Sur cette page

ElementOperand QML Type

Le type d'élément OPC UA ElementOperand. Plus...

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

Ce type est obsolète depuis QtOpcUa 6.9. Il est fortement déconseillé de l'utiliser dans un nouveau code.

Propriétés

Description détaillée

La commande ElementOperand est définie dans OPC UA 1.05, partie 4, 7.7.4.2. Elle est utilisée pour identifier un autre élément du filtre par son index (le premier élément a l'index 0).

Cela est nécessaire pour créer des filtres complexes, par exemple pour référencer les deux opérandes de l'opération AND dans ((Severity > 500) AND (Message == "TestString")). La première étape consiste à créer des éléments de filtre de contenu pour les deux conditions (Severity > 500) et (Message == "TestString"). Un troisième élément de filtre de contenu est nécessaire pour créer une combinaison ET des deux conditions. Il se compose de l'opérateur AND et de deux opérandes d'éléments avec les indices des deux conditions créées précédemment :

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

Documentation sur les propriétés

index : int

Index de l'élément filtrant qui sera utilisé comme opérande.

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