In questa pagina

ElementOperand QML Type

Il tipo ElementOperand di OPC UA. Maggiori informazioni...

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

Questo tipo è deprecato a partire da QtOpcUa 6.9. Si sconsiglia vivamente di utilizzarlo nel nuovo codice.

Proprietà

Descrizione dettagliata

L'ElementOperand è definito nella specifica OPC UA 1.05, parte 4, sezione 7.7.4.2. Viene utilizzato per identificare un altro elemento nel filtro tramite il suo indice (il primo elemento ha indice 0).

Ciò è necessario per creare filtri complessi, ad esempio per fare riferimento ai due operandi dell’operazione AND in ((Severity > 500) AND (Message == "TestString")). Il primo passo consiste nel creare elementi di filtro di contenuto per le due condizioni (Severity > 500) e (Message == "TestString"). È necessario un terzo elemento di filtro di contenuto per creare una combinazione AND delle due condizioni. Esso è costituito dall’operatore AND e da due operandi di elemento con gli indici delle due condizioni create in precedenza:

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

Documentazione delle proprietà

index : int

Indice dell'elemento filtrante che verrà utilizzato come 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.