Nesta página

ElementOperand QML Type

O tipo ElementOperand do OPC UA. Mais...

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

Este tipo está obsoleto desde o QtOpcUa 6.9. Recomendamos enfaticamente que não seja utilizado em código novo.

Propriedades

Descrição detalhada

O ElementOperand é definido na norma OPC UA 1.05, parte 4, seção 7.7.4.2. Ele é utilizado para identificar outro elemento no filtro por meio de seu índice (o primeiro elemento tem o índice 0).

Isso é necessário para criar filtros complexos, por exemplo, para referenciar os dois operandos da operação AND em ((Severity > 500) AND (Message == "TestString")). O primeiro passo é criar elementos de filtro de conteúdo para as duas condições (Severity > 500) e (Message == "TestString"). É necessário um terceiro elemento de filtro de conteúdo para criar uma combinação AND das duas condições. Ele consiste no operador AND e em dois operandos de elemento com os índices das duas condições criadas anteriormente:

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

Documentação da Propriedade

index : int

Índice do elemento de filtro que será utilizado como operando.

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