このページでは

QOpcUaReadResult Class

このクラスは、読み取り操作の結果を格納します。詳細...

ヘッダー: #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 attribute() const
QString indexRange() const
QString nodeId() const
QDateTime serverTimestamp() const
void setAttribute(QOpcUa::NodeAttribute attribute)
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)

詳細な説明

OPC UA サーバーに対する読み取り操作では、値と、その値がソースによって生成された時刻およびサーバーがそれを取得した時刻を表すタイムスタンプが返されます。また、値の読み取りが可能であったか、あるいは読み取りに失敗した場合はその理由を示すステータスコードも返されます。

サーバーから返されたデータに加え、このクラスには、クライアントが結果をリクエストと照合できるように、リクエストからのノードID、属性、およびインデックス範囲も含まれています。

このクラスのオブジェクトは、QOpcUaClient::readNodeAttributesFinished() シグナルで返され、QOpcUaClient::readNodeAttributes() リクエストの一部であった読み取り操作の結果を含んでいます。

QOpcUaClient::readNodeAttributes()、QOpcUaClient::readNodeAttributesFinished()、およびQOpcUaReadItemも参照してください 。

メンバ関数のドキュメント

QOpcUaReadResult::QOpcUaReadResult()

default は、パラメータが設定されていない読み取り結果を生成します。

QOpcUaReadResult::QOpcUaReadResult(const QOpcUaReadResult &other)

other から読み取り結果を生成します。

QOpcUa::NodeAttribute QOpcUaReadResult::attribute() const

属性のIDを返します。

setAttribute()も参照してください 。

QString QOpcUaReadResult::indexRange() const

インデックスの範囲を返します。

setIndexRange()も参照してください 。

QString QOpcUaReadResult::nodeId() const

ノード ID を返します。

setNodeId()も参照してください 。

QDateTime QOpcUaReadResult::serverTimestamp() const

value() のサーバータイムスタンプを返します。

setServerTimestamp()も参照してください 。

void QOpcUaReadResult::setAttribute(QOpcUa::NodeAttribute attribute)

属性 id を「attribute 」に設定します。

attribute()も参照してください 。

void QOpcUaReadResult::setIndexRange(const QString &indexRange)

インデックスの範囲をindexRange に設定します。

indexRange()も参照してください 。

void QOpcUaReadResult::setNodeId(const QString &nodeId)

ノード ID をnodeId に設定します。

nodeId()も参照してください 。

void QOpcUaReadResult::setServerTimestamp(const QDateTime &serverTimestamp)

サーバーのタイムスタンプをserverTimestamp に設定します。

serverTimestamp()も参照してください 。

void QOpcUaReadResult::setSourceTimestamp(const QDateTime &sourceTimestamp)

ソースのタイムスタンプをsourceTimestamp に設定します。

sourceTimestamp()も参照してください 。

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

ステータスコードをstatusCode に設定します。

statusCode()も参照してください 。

void QOpcUaReadResult::setValue(const QVariant &value)

値を `value` に設定します。

value()も参照してください 。

QDateTime QOpcUaReadResult::sourceTimestamp() const

value() のソースタイムスタンプを返します。

setSourceTimestamp()も参照してください 。

QOpcUa::UaStatusCode QOpcUaReadResult::statusCode() const

この要素のステータスコードを返します。ステータスコードがGood でない場合、値とタイムスタンプは無効です。

setStatusCode()も参照してください 。

QVariant QOpcUaReadResult::value() const

値を返します。

setValue()も参照してください 。

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

この読み取り結果に、rhs の値を設定します。

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