EventFilter QML Type
为受监控项目定义事件过滤器。更多
Import Statement: | import QtOpcUa |
Since: | QtOpcUa 5.13 |
Status: | Deprecated since 6.9 |
自 QtOpcUa 6.9 起,该类型已被弃用。我们强烈建议不要在新代码中使用它。
属性
详细说明
事件过滤器用于监控服务器上的事件。它由select
子句和where
子句组成。
select
子句用于指定用户希望在事件发生时接收的数据。它包括SimpleAttributeOperand 简单属性操作数,用于选择事件类型子节点的属性,例如 BaseEventType 的 "Message "属性的值属性。
where
子句用于通过与特定条件匹配来限制报告的事件。通过几个运算符和四种不同的操作符类型,可以根据事件类型子节点的属性值进行筛选。
select 子句由SimpleAttributeOperand 数组组成。where 子句由SimpleAttributeOperand 、LiteralOperand 、ElementOperand 或AttributeOperand 数组组成。
下面的 EventFilter 告诉服务器,如果事件的 "严重性 "字段的值大于等于 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 。
属性文档
select : list<SimpleAttributeOperand> |
报告新事件时应包含的选定事件字段。
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.