Auf dieser Seite

ElementOperand QML Type

Der OPC-UA-Typ „ElementOperand“. Mehr...

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

Dieser Typ ist seit QtOpcUa 6.9 veraltet. Wir raten dringend davon ab, ihn in neuem Code zu verwenden.

Eigenschaften

Ausführliche Beschreibung

Der ElementOperand ist in OPC UA 1.05 Teil 4, 7.7.4.2 definiert. Er dient dazu, ein anderes Element im Filter anhand seines Index zu identifizieren (das erste Element hat den Index 0).

Dies ist erforderlich, um komplexe Filter zu erstellen, beispielsweise um auf die beiden Operanden der UND-Operation in ((Severity > 500) AND (Message == „TestString“)) zu verweisen. Der erste Schritt besteht darin, Inhaltsfilterelemente für die beiden Bedingungen (Severity > 500) und (Message == „TestString“) zu erstellen. Ein drittes Inhaltsfilterelement ist erforderlich, um eine UND-Kombination der beiden Bedingungen zu erstellen. Es besteht aus dem UND-Operator 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
            }
        }
    ]
}

Dokumentation zu den Eigenschaften

index : int

Index des Filterelements, das als Operand verwendet werden soll.

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