QOpcUaWriteResult Class
该类存储写操作的结果。更多
头文件: | #include <QOpcUaWriteResult> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget PRIVATE Qt6::OpcUa) |
qmake: | QT += opcua |
公共函数
QOpcUaWriteResult() | |
QOpcUaWriteResult(const QOpcUaWriteResult &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) |
void | setStatusCode(QOpcUa::UaStatusCode statusCode) |
QOpcUa::UaStatusCode | statusCode() const |
QOpcUaWriteResult & | operator=(const QOpcUaWriteResult &rhs) |
详细说明
OPC UA 服务器上的写入操作会返回一个状态代码,说明是否能写入值,如果不能,写入失败的原因是什么。
除了服务器返回的状态代码外,该类还包含节点 ID、属性和请求中的索引范围,以便客户端将结果与请求相匹配。
该类对象在QOpcUaClient::writeNodeAttributesFinished() 信号中返回,并包含作为QOpcUaClient::writeNodeAttributes() 请求一部分的写操作的结果。
另请参阅 QOpcUaClient::writeNodeAttributes()、QOpcUaClient::writeNodeAttributesFinished() 和QOpcUaWriteItem 。
成员函数文档
QOpcUaWriteResult::QOpcUaWriteResult()
默认情况下构建一个未设置参数的写入结果。
QOpcUaWriteResult::QOpcUaWriteResult(const QOpcUaWriteResult &other)
从other 构建写入结果。
QOpcUa::NodeAttribute QOpcUaWriteResult::attribute() const
返回写入结果的属性。
另请参阅 setAttribute()。
QString QOpcUaWriteResult::indexRange() const
返回写入结果的索引范围。
另请参阅 setIndexRange()。
QString QOpcUaWriteResult::nodeId() const
返回写入结果的节点 ID。
另请参阅 setNodeId()。
void QOpcUaWriteResult::setAttribute(QOpcUa::NodeAttribute attribute)
将写入结果的属性设置为attribute 。
另请参阅 attribute() 。
void QOpcUaWriteResult::setIndexRange(const QString &indexRange)
将写入结果的索引范围设置为indexRange 。
另请参阅 indexRange() 。
void QOpcUaWriteResult::setNodeId(const QString &nodeId)
将写入结果的节点 ID 设置为nodeId 。
另请参阅 nodeId() 。
void QOpcUaWriteResult::setStatusCode(QOpcUa::UaStatusCode statusCode)
将写入结果的状态代码设为statusCode 。
另请参阅 statusCode() 。
QOpcUa::UaStatusCode QOpcUaWriteResult::statusCode() const
返回写入结果的状态代码。
另请参阅 setStatusCode()。
QOpcUaWriteResult &QOpcUaWriteResult::operator=(const QOpcUaWriteResult &rhs)
在写入结果中设置rhs 中的值。
© 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.