QOpcUaReadItem Class

该类存储读取操作的选项。更多

Header: #include <QOpcUaReadItem>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua

公共函数

QOpcUaReadItem()
QOpcUaReadItem(const QString &nodeId, QOpcUa::NodeAttribute attr = QOpcUa::NodeAttribute::Value, const QString &indexRange = QString())
QOpcUaReadItem(const QOpcUaReadItem &other)
QOpcUa::NodeAttribute attribute() const
QString indexRange() const
QString nodeId() const
void setAttribute(QOpcUa::NodeAttribute attribute)
void setIndexRange(const QString &indexRange)
void setNodeId(const QString &nodeId)
QOpcUaReadItem &operator=(const QOpcUaReadItem &rhs)
bool operator!=(const QOpcUaReadItem &lhs, const QOpcUaReadItem &rhs)
bool operator==(const QOpcUaReadItem &lhs, const QOpcUaReadItem &rhs)

详细说明

OPC UA 服务器上的读操作会返回服务器上节点属性值的整个值或某个索引范围。该类包含后台向服务器发出读取请求的必要信息。

一个或多个该类对象构成了QOpcUaClient::readNodeAttributes() 操作的请求。

另请参阅 QOpcUaClient::readNodeAttributes() 和QOpcUaReadResult

成员函数文档

QOpcUaReadItem::QOpcUaReadItem()

默认构建一个未设置参数的读取项目。

QOpcUaReadItem::QOpcUaReadItem(const QString &nodeId, QOpcUa::NodeAttribute attr = QOpcUa::NodeAttribute::Value, const QString &indexRange = QString())

为节点nodeId 的属性attr 的索引范围indexRange 构建一个读取项。

QOpcUaReadItem::QOpcUaReadItem(const QOpcUaReadItem &other)

other 构建一个读取项。

QOpcUa::NodeAttribute QOpcUaReadItem::attribute() const

返回节点属性 ID。

另请参阅 setAttribute()。

QString QOpcUaReadItem::indexRange() const

返回索引范围。

另请参见 setIndexRange()。

QString QOpcUaReadItem::nodeId() const

返回节点 ID。

另请参见 setNodeId()。

void QOpcUaReadItem::setAttribute(QOpcUa::NodeAttribute attribute)

将节点属性 id 设为attribute

另请参阅 attribute() 。

void QOpcUaReadItem::setIndexRange(const QString &indexRange)

将索引范围设置为indexRange

另请参阅 indexRange() 。

void QOpcUaReadItem::setNodeId(const QString &nodeId)

将节点 id 设为nodeId

另请参阅 nodeId() 。

QOpcUaReadItem &QOpcUaReadItem::operator=(const QOpcUaReadItem &rhs)

在此读取项目中设置rhs 的值。

相关非会员

[noexcept] bool operator!=(const QOpcUaReadItem &lhs, const QOpcUaReadItem &rhs)

如果lhs 不等于rhs ,则返回true ;否则返回false

如果nodeIdattributeindexRange 不相等,则认为两个读取项不相等。

[noexcept] bool operator==(const QOpcUaReadItem &lhs, const QOpcUaReadItem &rhs)

如果lhs 等于rhs ,则返回true ;否则返回false

如果nodeIdattributeindexRange 相等,则认为两个读取项相等。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.