QOpcUaHistoryReadRawRequest Class

该类存储从服务器请求历史数据的必要信息。更多

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

公共函数

QOpcUaHistoryReadRawRequest()
(since 6.7) QOpcUaHistoryReadRawRequest(const QList<QOpcUaReadItem> &nodesToRead, const QDateTime &startTimestamp, const QDateTime &endTimestamp, QOpcUa::TimestampsToReturn timestampsToReturn)
QOpcUaHistoryReadRawRequest(const QList<QOpcUaReadItem> &nodesToRead, const QDateTime &startTimestamp, const QDateTime &endTimestamp, quint32 numValuesPerNode = 0, bool returnBounds = false)
QOpcUaHistoryReadRawRequest(const QOpcUaHistoryReadRawRequest &other)
~QOpcUaHistoryReadRawRequest()
void addNodeToRead(const QOpcUaReadItem &nodeToRead)
QDateTime endTimestamp() const
QList<QOpcUaReadItem> nodesToRead() const
quint32 numValuesPerNode() const
bool returnBounds() const
void setEndTimestamp(const QDateTime &endTimestamp)
void setNodesToRead(const QList<QOpcUaReadItem> &nodesToRead)
void setNumValuesPerNode(quint32 numValuesPerNode)
void setReturnBounds(bool returnBounds)
void setStartTimestamp(const QDateTime &startTimestamp)
(since 6.7) void setTimestampsToReturn(QOpcUa::TimestampsToReturn timestampsToReturn)
QDateTime startTimestamp() const
void swap(QOpcUaHistoryReadRawRequest &other)
(since 6.7) QOpcUa::TimestampsToReturn timestampsToReturn() const
QOpcUaHistoryReadRawRequest &operator=(const QOpcUaHistoryReadRawRequest &other)
bool operator!=(const QOpcUaHistoryReadRawRequest &lhs, const QOpcUaHistoryReadRawRequest &rhs)
bool operator==(const QOpcUaHistoryReadRawRequest &lhs, const QOpcUaHistoryReadRawRequest &rhs)

详细描述

Qt OPC UA 表示 OPC UA ReadRawModifiedDetails,用于读取OPC UA 1.04 第 11 部分 6.4.3 中定义的历史数据。

从服务器请求历史数据时,需要向服务器提供几个值,以便知道要收集哪些数据。QOpcUaHistoryReadRawRequest 类提供了所需的值。startTimestampendTimestamp 定义了应从何处收集历史数据的时间范围。nodesToRead 定义了应从哪些节点收集历史数据。numValuesPerNode 定义了每个节点应返回的数据值的最大数量。returnBounds 定义了结果中是否应包含边界值。

成员函数文档

QOpcUaHistoryReadRawRequest::QOpcUaHistoryReadRawRequest()

构造一个无效的 QOpcUaHistoryReadRawRequest。

[explicit, since 6.7] QOpcUaHistoryReadRawRequest::QOpcUaHistoryReadRawRequest(const QList<QOpcUaReadItem> &nodesToRead, const QDateTime &startTimestamp, const QDateTime &endTimestamp, QOpcUa::TimestampsToReturn timestampsToReturn)

用给定的值构建 QOpcUaHistoryReadRawRequest 项目。timestampsToReturn 参数决定返回每个值的时间戳。

此函数在 Qt 6.7 中引入。

[explicit] QOpcUaHistoryReadRawRequest::QOpcUaHistoryReadRawRequest(const QList<QOpcUaReadItem> &nodesToRead, const QDateTime &startTimestamp, const QDateTime &endTimestamp, quint32 numValuesPerNode = 0, bool returnBounds = false)

使用给定值构建 QOpcUaHistoryReadRawRequest 项目。

QOpcUaHistoryReadRawRequest::QOpcUaHistoryReadRawRequest(const QOpcUaHistoryReadRawRequest &other)

other 构造一个 QOpcUaHistoryReadRawRequest 项目。

[noexcept] QOpcUaHistoryReadRawRequest::~QOpcUaHistoryReadRawRequest()

销毁请求对象。

void QOpcUaHistoryReadRawRequest::addNodeToRead(const QOpcUaReadItem &nodeToRead)

将节点添加到nodeToRead 列表中。

QDateTime QOpcUaHistoryReadRawRequest::endTimestamp() const

返回结束时间戳。

另请参阅 setEndTimestamp().

QList<QOpcUaReadItem> QOpcUaHistoryReadRawRequest::nodesToRead() const

返回要读取的节点列表。

另请参阅 setNodesToRead()。

quint32 QOpcUaHistoryReadRawRequest::numValuesPerNode() const

返回每个节点的数值个数。

另请参见 setNumValuesPerNode()。

bool QOpcUaHistoryReadRawRequest::returnBounds() const

返回是否请求返回边界。

另请参见 setReturnBounds()。

void QOpcUaHistoryReadRawRequest::setEndTimestamp(const QDateTime &endTimestamp)

为要获取的历史数据设置endTimestamp

另请参阅 endTimestamp().

void QOpcUaHistoryReadRawRequest::setNodesToRead(const QList<QOpcUaReadItem> &nodesToRead)

设置nodesToRead 列表。

另请参阅 nodesToRead().

void QOpcUaHistoryReadRawRequest::setNumValuesPerNode(quint32 numValuesPerNode)

设置numValuesPerNode ,表示每个节点要获取的值的个数。

另请参阅 numValuesPerNode().

void QOpcUaHistoryReadRawRequest::setReturnBounds(bool returnBounds)

设置returnBounds 以指示是否应请求返回边界。

另请参阅 returnBounds().

void QOpcUaHistoryReadRawRequest::setStartTimestamp(const QDateTime &startTimestamp)

为要获取的历史数据设置startTimestamp

另请参阅 startTimestamp().

[since 6.7] void QOpcUaHistoryReadRawRequest::setTimestampsToReturn(QOpcUa::TimestampsToReturn timestampsToReturn)

将每个值返回的选定时间戳设置为timestampsToReturn

此函数在 Qt 6.7 中引入。

另请参阅 timestampsToReturn() 。

QDateTime QOpcUaHistoryReadRawRequest::startTimestamp() const

返回起始时间戳。

另请参阅 setStartTimestamp().

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

将此请求实例与other 互换。该功能运行速度非常快,从未出现过故障。

[since 6.7] QOpcUa::TimestampsToReturn QOpcUaHistoryReadRawRequest::timestampsToReturn() const

返回为每个值选择的时间戳。

此函数在 Qt 6.7 中引入。

另请参阅 setTimestampsToReturn()。

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

QOpcUaHistoryReadRawRequest 项目中设置other 的值。

相关非会员

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

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

如果两个QOpcUaHistoryReadRawRequest 项目的startTimestamp,endTimestamp,numValuesPerNode,returnBoundsnodesToRead 不相等,则视为不相等。

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

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

如果startTimestamp,endTimestamp,numValuesPerNode,returnBoundsnodesToRead 相等,则认为两个QOpcUaHistoryReadRawRequest 项目相等。

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