QOpcUaHistoryReadEventRequest Class
该类存储了从服务器请求历史数据所需的必要信息。更多内容...
| 头文件: | #include <QOpcUaHistoryReadEventRequest> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget PRIVATE Qt6::OpcUa) |
| qmake: | QT += opcua |
| 自: | Qt 6.7 |
公共函数
| QOpcUaHistoryReadEventRequest() | |
| QOpcUaHistoryReadEventRequest(const QList<QOpcUaReadItem> &nodesToRead, const QDateTime &startTimestamp, const QDateTime &endTimestamp, const QOpcUaMonitoringParameters::EventFilter &filter) | |
| QOpcUaHistoryReadEventRequest(const QOpcUaHistoryReadEventRequest &other) | |
| QOpcUaHistoryReadEventRequest(QOpcUaHistoryReadEventRequest &&other) | |
| ~QOpcUaHistoryReadEventRequest() | |
| void | addNodeToRead(const QOpcUaReadItem &nodeToRead) |
| QDateTime | endTimestamp() const |
| QOpcUaMonitoringParameters::EventFilter | filter() const |
| QList<QOpcUaReadItem> | nodesToRead() const |
| quint32 | numValuesPerNode() const |
| void | setEndTimestamp(const QDateTime &endTimestamp) |
| void | setFilter(const QOpcUaMonitoringParameters::EventFilter &filter) |
| void | setNodesToRead(const QList<QOpcUaReadItem> &nodesToRead) |
| void | setNumValuesPerNode(quint32 numValuesPerNode) |
| void | setStartTimestamp(const QDateTime &startTimestamp) |
| QDateTime | startTimestamp() const |
| void | swap(QOpcUaHistoryReadEventRequest &other) |
| QOpcUaHistoryReadEventRequest & | operator=(QOpcUaHistoryReadEventRequest &&other) |
| QOpcUaHistoryReadEventRequest & | operator=(const QOpcUaHistoryReadEventRequest &other) |
相关的非成员
| bool | operator!=(const QOpcUaHistoryReadEventRequest &lhs, const QOpcUaHistoryReadEventRequest &rhs) |
| bool | operator==(const QOpcUaHistoryReadEventRequest &lhs, const QOpcUaHistoryReadEventRequest &rhs) |
详细说明
这是Qt OPC UA 对OPC-UA第11部分6.4.2中定义的用于读取历史数据的OPC UA ReadEventDetails的表示。
从服务器请求历史数据时,需要向服务器提供几个值,以便服务器知道要收集哪些数据。 QOpcUaHistoryReadEventRequest 类提供了所需的值。startTimestamp 和endTimestamp 定义了应从中收集历史事件的时间范围。nodesToRead 定义了应从哪些节点收集历史数据。numValuesPerNode 定义了每个节点应返回的最大事件数。filter 是用于确定应返回哪些事件及其哪些字段的事件过滤器。
成员函数文档
QOpcUaHistoryReadEventRequest::QOpcUaHistoryReadEventRequest()
构建了一个无效的 QOpcUaHistoryReadEventRequest。
[explicit] QOpcUaHistoryReadEventRequest::QOpcUaHistoryReadEventRequest(const QList<QOpcUaReadItem> &nodesToRead, const QDateTime &startTimestamp, const QDateTime &endTimestamp, const QOpcUaMonitoringParameters::EventFilter &filter)
根据给定的值构建一个 QOpcUaHistoryReadEventRequest 对象。
QOpcUaHistoryReadEventRequest::QOpcUaHistoryReadEventRequest(const QOpcUaHistoryReadEventRequest &other)
根据other 构建一个QOpcUaHistoryReadEventRequest对象。
[constexpr noexcept default] QOpcUaHistoryReadEventRequest::QOpcUaHistoryReadEventRequest(QOpcUaHistoryReadEventRequest &&other)
从 `other` 构建一个新的读取事件请求对象。
注意: 被移动的源对象 other 将处于部分形成状态,在此状态下,唯一有效的操作是销毁和赋值。
[noexcept] QOpcUaHistoryReadEventRequest::~QOpcUaHistoryReadEventRequest()
销毁请求对象。
void QOpcUaHistoryReadEventRequest::addNodeToRead(const QOpcUaReadItem &nodeToRead)
将一个节点添加到nodeToRead 列表中。
QDateTime QOpcUaHistoryReadEventRequest::endTimestamp() const
返回结束时间戳。
另请参阅 setEndTimestamp()。
QOpcUaMonitoringParameters::EventFilter QOpcUaHistoryReadEventRequest::filter() const
返回用于检索历史事件的事件过滤器。
另请参阅 setFilter()。
QList<QOpcUaReadItem> QOpcUaHistoryReadEventRequest::nodesToRead() const
返回待读取的节点列表。
另请参阅 setNodesToRead()。
quint32 QOpcUaHistoryReadEventRequest::numValuesPerNode() const
返回每个节点中的值个数。
另请参阅 setNumValuesPerNode()。
void QOpcUaHistoryReadEventRequest::setEndTimestamp(const QDateTime &endTimestamp)
将endTimestamp 设置为要获取的历史数据。
另请参阅 endTimestamp()。
void QOpcUaHistoryReadEventRequest::setFilter(const QOpcUaMonitoringParameters::EventFilter &filter)
将用于检索历史事件的事件过滤器设置为filter 。
另请参阅 filter()。
void QOpcUaHistoryReadEventRequest::setNodesToRead(const QList<QOpcUaReadItem> &nodesToRead)
设置nodesToRead 列表。
另请参阅 nodesToRead()。
void QOpcUaHistoryReadEventRequest::setNumValuesPerNode(quint32 numValuesPerNode)
将numValuesPerNode 设置为指定每个节点要获取的值个数。
另请参阅 numValuesPerNode()。
void QOpcUaHistoryReadEventRequest::setStartTimestamp(const QDateTime &startTimestamp)
将startTimestamp 设置为要获取的历史数据。
另请参阅 startTimestamp()。
QDateTime QOpcUaHistoryReadEventRequest::startTimestamp() const
返回开始时间戳。
另请参阅 setStartTimestamp()。
[noexcept] void QOpcUaHistoryReadEventRequest::swap(QOpcUaHistoryReadEventRequest &other)
Swaps 将读取事件请求对象other 与该读取事件请求对象进行交换。此操作速度极快,且绝不会失败。
[noexcept] QOpcUaHistoryReadEventRequest &QOpcUaHistoryReadEventRequest::operator=(QOpcUaHistoryReadEventRequest &&other)
将other 通过移动赋值操作赋值给此QOpcUaHistoryReadEventRequest 实例。
注意: 被移动的源对象 other 将处于部分初始化状态,在此状态下,唯一有效的操作是销毁和赋值。
QOpcUaHistoryReadEventRequest &QOpcUaHistoryReadEventRequest::operator=(const QOpcUaHistoryReadEventRequest &other)
将other 中的值设置到此QOpcUaHistoryReadEventRequest 项中。
相关非成员
[noexcept] bool operator!=(const QOpcUaHistoryReadEventRequest &lhs, const QOpcUaHistoryReadEventRequest &rhs)
如果lhs 不等于rhs ,则返回true ;否则返回false 。
如果两个 `QOpcUaHistoryReadEventRequest ` 项的 `startTimestamp`、`endTimestamp`、`numValuesPerNode`、`filter ` 或 `nodesToRead ` 不相等,则视为不相等。
[noexcept] bool operator==(const QOpcUaHistoryReadEventRequest &lhs, const QOpcUaHistoryReadEventRequest &rhs)
如果lhs 等于rhs ,则返回true ;否则返回false 。
若两个 `QOpcUaHistoryReadEventRequest ` 对象的 `startTimestamp`、`endTimestamp`、`numValuesPerNode`、`filter ` 和 `nodesToRead ` 均相等,则视为相等。
© 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.