このページでは

ElementOperand QML Type

OPC UA の ElementOperand 型。詳細...

Import Statement: import QtOpcUa
Since: QtOpcUa 5.13
Status: Deprecated since 6.9

この型は QtOpcUa 6.9 以降、非推奨となっています。新しいコードでの使用は強く推奨しません。

プロパティ

詳細な説明

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

これは、例えば ((Severity > 500) AND (Message == "TestString")) における AND 演算の 2 つのオペランドを参照するなど、複雑なフィルターを作成するために必要です。 まず、2つの条件(Severity > 500)および(Message == "TestString")に対するコンテンツフィルター要素を作成します。これら2つの条件をANDで結合するには、3つ目のコンテンツフィルター要素が必要です。これは、AND演算子と、前述の2つの条件のインデックスを持つ2つの要素オペランドで構成されます。

import QtOpcUa as QtOpcUa

QtOpcUa.EventFilter {
    select : [ ... ]
    where: [
        QtOpcUa.FilterElement {
            operator: QtOpcUa.FilterElement.GreaterThan
            firstOperand: QtOpcUa.SimpleAttributeOperand {
                browsePath: [
                    QtOpcUa.NodeId {
                        identifier: "Severity"
                        ns: "http://opcfoundation.org/UA/"
                    }
                ]
            }
            secondOperand: QtOpcUa.LiteralOperand {
                value: 500
                type: QtOpcUa.Constants.UInt16
            }
        }
        QtOpcUa.FilterElement {
            operator: QtOpcUa.FilterElement.Equals
            firstOperand: QtOpcUa.SimpleAttributeOperand {
                browsePath: [
                    QtOpcUa.NodeId {
                        identifier: "Message"
                        ns: "http://opcfoundation.org/UA/"
                    }
                ]
            }
            secondOperand: QtOpcUa.LiteralOperand {
                value: "TestString"
                type: QtOpcUa.Constants.String
            }
        }
        QtOpcUa.FilterElement {
            operator: QtOpcUa.FilterElement.And
            firstOperand: QtOpcUa.ElementOperand {
                index: 0
            }
            secondOperand: QtOpcUa.ElementOperand {
                index: 1
            }
        }
    ]
}

プロパティのドキュメント

index : int

オペランドとして使用されるフィルターエレメントのインデックス。

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