本页内容

QOpcUaHistoryData Class

该类用于存储来自某个节点的历史数据值。更多内容...

头文件: #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)

详细说明

在处理读取历史记录数据的请求时,本类的实例用于存储已读取的节点、其值以及状态码的相关信息。历史记录读取请求的 finished 信号将返回一个 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 中的值设置为此历史数据项的值。

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