ElementOperand QML Type

Der OPC UA ElementOperand Typ. Mehr...

Import Statement: import QtOpcUa
Since: QtOpcUa 5.13

Eigenschaften

Detaillierte Beschreibung

Der ElementOperand ist in OPC UA 1.05 Teil 4, 7.7.4.2 definiert. Er wird verwendet, um ein anderes Element im Filter durch seinen Index zu identifizieren (das erste Element hat den Index 0).

Dies ist erforderlich, um komplexe Filter zu erstellen, z. B. um die beiden Operanden der UND-Verknüpfung in ((Severity > 500) AND (Message == "TestString")) zu referenzieren. Der erste Schritt besteht darin, Inhaltsfilterelemente für die beiden Bedingungen (Schweregrad > 500) und (Nachricht == "TestString") zu erstellen. Ein drittes Inhaltsfilterelement ist erforderlich, um eine UND-Verknüpfung der beiden Bedingungen zu erstellen. Es besteht aus dem Operator AND und zwei Elementoperanden mit den Indizes der beiden zuvor erstellten Bedingungen:

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
            }
        }
    ]
}

Eigenschaft Dokumentation

index : int

Index des Filterelements, das als Operand verwendet werden soll.


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