En esta página

EventFilter QML Type

Define un EventFilter para un elemento supervisado. Más información...

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

Este tipo está obsoleto desde QtOpcUa 6.9. Recomendamos encarecidamente no utilizarlo en código nuevo.

Propiedades

  • select : list<SimpleAttributeOperand>
  • where : list<FilterElement>

Descripción detallada

Se requiere un filtro de eventos para supervisar los eventos en el servidor. Consta de cláusul select y de una cláusula where.

Las cláusulas « select » se utilizan para especificar los datos que el usuario desea recibir cuando se produce un evento. Consisten en operandos de atributo simples « SimpleAttributeOperand » que seleccionan atributos de nodos hijos de un tipo de evento; por ejemplo, el atributo «value» de la propiedad «Message» de BaseEventType.

La cláusula « where » se utiliza para restringir los eventos notificados mediante la coincidencia con determinados criterios. Varios operadores y cuatro tipos diferentes de operandos permiten filtrar en función de los valores de los atributos de los nodos hijos de un tipo de evento.

La cláusula «select» consta de una matriz de « SimpleAttributeOperand ». La cláusula «where» consta de una matriz de « SimpleAttributeOperand », « LiteralOperand », « ElementOperand » o « AttributeOperand ».

El siguiente EventFilter indica al servidor que informe del valor del campo «Message» para los eventos cuyo campo «Severity» tenga un valor >= 500:

import QtOpcUa as QtOpcUa
QtOpcUa.Node {
    ...

    eventFilter: QtOpcUa.EventFilter {
        select: [
                  QtOpcUa.SimpleAttributeOperand {
                    browsePath: [
                                  QtOpcUa.NodeId {
                                      identifier: "Severity"
                                      ns: "http://opcfoundation.org/UA/"
                                  }
                                ]
                  },
                  QtOpcUa.SimpleAttributeOperand {
                    browsePath: [
                                  QtOpcUa.NodeId {
                                      identifier: "Message"
                                      ns: "http://opcfoundation.org/UA/"
                                  }
                                ]
                  }
        ]

        where: [
            QtOpcUa.FilterElement {
                operator: QtOpcUa.FilterElement.GreaterThanOrEqual
                firstOperand: QtOpcUa.SimpleAttributeOperand {
                    browsePath: [
                                  QtOpcUa.NodeId {
                                      identifier: "Severity"
                                      ns: "http://opcfoundation.org/UA/"
                                  }
                                ]
                }
                secondOperand: QtOpcUa.LiteralOperand {
                                value: 700
                                type: QtOpcUa.Constants.UInt16
                 }
            }
        ]
    }
}

Para ver un ejemplo más complejo con dos condiciones, consulta QOpcUaElementOperand.

Véase también FilterElement.

Documentación de propiedades

select : list<SimpleAttributeOperand>

Campos seleccionados del evento que deben incluirse al notificar un nuevo evento.

where : list<FilterElement>

Filtro de contenido utilizado para limitar los eventos notificados a aquellos que cumplen determinados criterios.

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