QOpcUaReadResult Class

This class stores the result of a read operation. 更多...

头: #include <QOpcUaReadResult>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua

公共函数

QOpcUaReadResult ()
QOpcUaReadResult (const QOpcUaReadResult & other )
QOpcUa::NodeAttribute 属性 () const
QString indexRange () const
QString nodeId () const
QDateTime serverTimestamp () const
void setAttribute (QOpcUa::NodeAttribute 属性 )
void setIndexRange (const QString & indexRange )
void setNodeId (const QString & nodeId )
void setServerTimestamp (const QDateTime & serverTimestamp )
void setSourceTimestamp (const QDateTime & sourceTimestamp )
void setStatusCode (QOpcUa::UaStatusCode statusCode )
void setValue (const QVariant & value )
QDateTime sourceTimestamp () const
QOpcUa::UaStatusCode statusCode () const
QVariant value () const
QOpcUaReadResult & operator= (const QOpcUaReadResult & rhs )

详细描述

A read operation on an OPC UA server returns the value and timestamps which describe when a value was generated by the source and when the server obtained it. It also returns a status code which describes if the value could be read and if not, for what reason the read has failed.

In addition to the data returned by the server, this class also contains the node id, the attribute and the index range from the request to enable a client to match the result with a request.

Objects of this class are returned in the QOpcUaClient::readNodeAttributesFinished () signal and contain the result of a read operation that was part of a QOpcUaClient::readNodeAttributes () request.

另请参阅 QOpcUaClient::readNodeAttributes (), QOpcUaClient::readNodeAttributesFinished (),和 QOpcUaReadItem .

成员函数文档编制

QOpcUaReadResult:: QOpcUaReadResult ()

Default constructs a read result with no parameters set.

QOpcUaReadResult:: QOpcUaReadResult (const QOpcUaReadResult & other )

Constructs a read result from other .

QOpcUa::NodeAttribute QOpcUaReadResult:: 属性 () const

Returns the attribute id.

另请参阅 setAttribute ().

QString QOpcUaReadResult:: indexRange () const

Returns the index range.

另请参阅 setIndexRange ().

QString QOpcUaReadResult:: nodeId () const

Returns the node id.

另请参阅 setNodeId ().

QDateTime QOpcUaReadResult:: serverTimestamp () const

Returns the server timestamp for value ().

另请参阅 setServerTimestamp ().

void QOpcUaReadResult:: setAttribute ( QOpcUa::NodeAttribute 属性 )

Sets the attribute id to 属性 .

另请参阅 属性 ().

void QOpcUaReadResult:: setIndexRange (const QString & indexRange )

Sets the index range to indexRange .

另请参阅 indexRange ().

void QOpcUaReadResult:: setNodeId (const QString & nodeId )

Sets the node id to nodeId .

另请参阅 nodeId ().

void QOpcUaReadResult:: setServerTimestamp (const QDateTime & serverTimestamp )

Sets the server timestamp to serverTimestamp .

另请参阅 serverTimestamp ().

void QOpcUaReadResult:: setSourceTimestamp (const QDateTime & sourceTimestamp )

Sets the source timestamp to sourceTimestamp .

另请参阅 sourceTimestamp ().

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

Sets the status code to statusCode .

另请参阅 statusCode ().

void QOpcUaReadResult:: setValue (const QVariant & value )

Sets the value to value .

另请参阅 value ().

QDateTime QOpcUaReadResult:: sourceTimestamp () const

Returns the source timestamp for value ().

另请参阅 setSourceTimestamp ().

QOpcUa::UaStatusCode QOpcUaReadResult:: statusCode () const

Returns the status code for this element. If the status code is not Good , the value and the timestamps are invalid.

另请参阅 setStatusCode ().

QVariant QOpcUaReadResult:: value () const

Returns the value.

另请参阅 setValue ().

QOpcUaReadResult &QOpcUaReadResult:: operator= (const QOpcUaReadResult & rhs )

设置值从 rhs in this read result.