QOpcUaElementOperand Class

OPC UAElementOperand タイプ。詳細...

ヘッダー #include <QOpcUaElementOperand>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua

パブリック関数

QOpcUaElementOperand()
QOpcUaElementOperand(quint32 index)
QOpcUaElementOperand(const QOpcUaElementOperand &rhs)
quint32 index() const
void setIndex(quint32 index)
QVariant operator QVariant() const
QOpcUaElementOperand &operator=(const QOpcUaElementOperand &rhs)
(since 6.7) bool operator!=(const QOpcUaElementOperand &lhs, const QOpcUaElementOperand &rhs)
(since 6.7) bool operator==(const QOpcUaElementOperand &lhs, const QOpcUaElementOperand &rhs)

詳細説明

ElementOperand は、OPC UA 1.05 part 4の7.7.4.2で定義されています。これは、フィルター内の別の要素をインデックスで識別するために使用されます(最初の要素のインデックスは0です)。

例えば、((Severity > 500) AND (Message == "TestString"))のAND演算の2つのオペランドを参照するなど、複雑なフィルタを作成する際に必要となります。最初のステップは、(Severity > 500) と (Message == "TestString") の 2 つの条件に対するコンテンツ・フィルタ要素を作成することです。2 つの条件の AND の組み合わせを作成するには、3 番目のコンテンツ・フィルタ要素が必要です。これは、AND 演算子と、前に作成した 2 つの条件のインデックスを持つ 2 つの要素オペランドで構成されます:

QOpcUaMonitoringParameters::EventFilter filter;
...
// setup select clauses
...
QOpcUaContentFilterElement condition1;
QOpcUaContentFilterElement condition2;
QOpcUaContentFilterElement condition3;
condition1 << QOpcUaContentFilterElement::FilterOperator::GreaterThan << QOpcUaSimpleAttributeOperand("Severity") <<
                QOpcUaLiteralOperand(quint16(500), QOpcUa::Types::UInt16);
condition2 << QOpcUaContentFilterElement::FilterOperator::Equals << QOpcUaSimpleAttributeOperand("Message") <<
                QOpcUaLiteralOperand("TestString", QOpcUa::Types::String);
condition3 << QOpcUaContentFilterElement::FilterOperator::And << QOpcUaElementOperand(0) << QOpcUaElementOperand(1);
filter << condition1 << condition2 << condition3;

メンバ関数ドキュメント

QOpcUaElementOperand::QOpcUaElementOperand()

Default は、パラメータを設定せずに要素オペランドを構築します。

QOpcUaElementOperand::QOpcUaElementOperand(quint32 index)

インデックスindex を持つ要素オペランドを構築します。

QOpcUaElementOperand::QOpcUaElementOperand(const QOpcUaElementOperand &rhs)

rhs から要素オペランドを構築します。

quint32 QOpcUaElementOperand::index() const

オペランドとして使用するフィルタ要素のインデックスを返します。

setIndex()も参照ください

void QOpcUaElementOperand::setIndex(quint32 index)

オペランドとして使われるフィルター要素のインデックスをindex に設定します。

index()も参照のこと

QVariant QOpcUaElementOperand::operator QVariant() const

この要素オペランドをQVariant に変換する。

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

この要素オペランドにrhs の値を設定します。

関連する非会員

[noexcept, since 6.7] bool operator!=(const QOpcUaElementOperand &lhs, const QOpcUaElementOperand &rhs)

lhsrhs と異なる値の場合、true を返します。

この関数は Qt 6.7 で導入されました。

[noexcept, since 6.7] bool operator==(const QOpcUaElementOperand &lhs, const QOpcUaElementOperand &rhs)

lhsrhs と同じ値の場合、true を返します。

この関数は Qt 6.7 で導入されました。

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