EventFilter QML Type

모니터링되는 항목에 대한 이벤트 필터를 정의합니다. 더 보기...

Import Statement: import QtOpcUa
Since: QtOpcUa 5.13

속성

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

상세 설명

서버의 이벤트를 모니터링하려면 이벤트 필터가 필요합니다. select 절과 where 절로 구성됩니다.

select 절은 이벤트 발생 시 사용자가 수신하고자 하는 데이터를 지정하는 데 사용됩니다. SimpleAttributeOperand 단순 속성 피연산자는 이벤트 유형의 하위 노드의 속성(예: BaseEventType의 "Message" 속성의 값 속성)을 선택하는 것으로 구성됩니다.

where 절은 특정 기준과 일치하여 보고된 이벤트를 제한하는 데 사용됩니다. 여러 연산자와 네 가지 피연산자 유형을 사용하여 이벤트 유형의 하위 노드 속성 값을 기준으로 필터링할 수 있습니다.

select 절은 SimpleAttributeOperand 의 배열로 구성되며, where 절은 SimpleAttributeOperand, LiteralOperand, ElementOperand 또는 AttributeOperand 의 배열로 구성됩니다.

다음 이벤트 필터는 값이 >= 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
                 }
            }
        ]
    }
}

두 가지 조건이 있는 더 복잡한 예제는 QOpcUaElementOperand 을 참조하십시오.

FilterElement참조하세요 .

속성 문서

새 이벤트가 신고될 때 포함될 선택된 이벤트 필드입니다.


where : list<FilterElement>

특정 조건과 일치하는 이벤트로 보고된 이벤트를 제한하는 데 사용되는 콘텐츠 필터입니다.


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