W3cubDocs

/Qt

ElementOperand QML Type

The OPC UA ElementOperand type. More...

Import Statement: import QtOpcUa
Since: QtOpcUa 5.13

Properties

Detailed Description

The ElementOperand is defined in OPC-UA part 4, 7.4.4.2. It is used to identify another element in the filter by its index (the first element has the index 0).

This is required to create complex filters, for example to reference the two operands of the AND operation in ((Severity > 500) AND (Message == "TestString")). The first step is to create content filter elements for the two conditions (Severity > 500) and (Message == "TestString"). A third content filter element is required to create an AND combination of the two conditions. It consists of the AND operator and two element operands with the indices of the two conditions created before:

import QtOpcUa 5.13 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
            }
        }
    ]
}

Property Documentation

index : int

Index of the filter element that is going to be used as operand.

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.2/qml-qtopcua-elementoperand.html