IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

EventFilter QML Type

Defines an EventFilter for a monitored item.

This type was introduced in QtOpcUa 5.13.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

EventFilter QML Type

  • Import Statement: import QtOpcUa

  • Since:: QtOpcUa 5.13

Detailed Description

An event filter is required for monitoring events on the server. It consists of select clauses and a where clause.

The select clauses are used to specify the data the user wants to receive when an event occurs. It consists of SimpleAttributeOperand simple attribute operands which select attributes of child nodes of an event type, for example the value attribute of the "Message" property of BaseEventType.

The where clause is used to restrict the reported events by matching against certain criteria. Several operators and four different operand types allow filtering based on the values of the attributes of the child nodes of an event type.

The select clause consists of an array of SimpleAttributeOperand. The where clause consists of an array of SimpleAttributeOperand, LiteralOperand, ElementOperand or AttributeOperand.

The following EventFilter tells the server to report the value of the "Message" field for events that have a "Severity" field with value >= 500:

 
Sélectionnez
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
                 }
            }
        ]
    }
}

For a more complex example with two conditions, see QOpcUaElementOperand.

See Also

See also FilterElement

Property Documentation

 

select : list<SimpleAttributeOperand>

Selected event fields that shall be included when a new event is reported.

where : list<FilterElement>

Content filter used to restrict the reported events to events matching certain criteria.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+