QOpcUaHistoryData Class

该类存储节点的历史数据值。更多

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

公共函数

QOpcUaHistoryData()
QOpcUaHistoryData(const QString &nodeId)
QOpcUaHistoryData(const QOpcUaHistoryData &other)
~QOpcUaHistoryData()
void addValue(const QOpcUaDataValue &value)
int count() const
QString nodeId() const
QList<QOpcUaDataValue> result() const
void setNodeId(const QString &nodeId)
void setStatusCode(QOpcUa::UaStatusCode statusCode)
QOpcUa::UaStatusCode statusCode() const
void swap(QOpcUaHistoryData &other)
QOpcUaHistoryData &operator=(const QOpcUaHistoryData &other)

详细描述

在处理读取历史数据的请求时,该类的实例用于存储有关已读取的节点、其值和状态代码的信息。历史读取请求的完成信号将返回一个 QOpcUaHistoryData 对象列表,可对其进行解析以查看请求结果。

成员函数文档

QOpcUaHistoryData::QOpcUaHistoryData()

构造一个无效的历史数据项。

[explicit] QOpcUaHistoryData::QOpcUaHistoryData(const QString &nodeId)

构造一个历史数据项,并存储其对应的节点。

QOpcUaHistoryData::QOpcUaHistoryData(const QOpcUaHistoryData &other)

other 中构造一个历史数据项。

[noexcept] QOpcUaHistoryData::~QOpcUaHistoryData()

销毁历史数据项。

void QOpcUaHistoryData::addValue(const QOpcUaDataValue &value)

添加value 给定的数据值对象。

int QOpcUaHistoryData::count() const

返回可用数据值对象的数量。

QString QOpcUaHistoryData::nodeId() const

返回已存储数据的节点的 nodeId。

另请参阅 setNodeId()。

QList<QOpcUaDataValue> QOpcUaHistoryData::result() const

返回包含历史读取请求结果的数据值对象列表。

void QOpcUaHistoryData::setNodeId(const QString &nodeId)

nodeId 设置为nodeId

另请参阅 nodeId() 。

void QOpcUaHistoryData::setStatusCode(QOpcUa::UaStatusCode statusCode)

将状态代码设为statusCode

另请参阅 statusCode() 。

QOpcUa::UaStatusCode QOpcUaHistoryData::statusCode() const

返回状态代码,表示在获取历史数据时是否发生错误。

另请参阅 setStatusCode()。

[noexcept] void QOpcUaHistoryData::swap(QOpcUaHistoryData &other)

将此数据值实例与other 互换。该函数运行速度非常快,从未出现过故障。

QOpcUaHistoryData &QOpcUaHistoryData::operator=(const QOpcUaHistoryData &other)

设置该历史数据项目中other 的值。

© 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.