Sur cette page

ElementOperand QML Type

Le type ElementOperand d'OPC UA. En savoir plus...

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

Ce type est obsolète depuis QtOpcUa 6.9. Nous déconseillons fortement de l'utiliser dans du nouveau code.

Propriétés

Description détaillée

L'ElementOperand est défini dans la norme OPC UA 1.05, partie 4, section 7.7.4.2. Il sert à identifier un autre élément du filtre par son index (le premier élément ayant l'index 0).

Ceci est nécessaire pour créer des filtres complexes, par exemple pour référencer les deux opérandes de l’opération ET dans ((Severity > 500) ET (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 « AND » des deux conditions. Il se compose de l’opérateur « AND » et de deux opérandes d’élément portant 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 de filtre 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.