ElementOperand QML Type
OPC UA 元素操作符类型。更多
Import Statement: | import QtOpcUa |
Since: | QtOpcUa 5.13 |
Status: | Deprecated since 6.9 |
自 QtOpcUa 6.9 起,该类型已被弃用。我们强烈建议不要在新代码中使用它。
属性
- index : int
详细说明
ElementOperand 定义于 OPC UA 1.05 第 4 部分 7.7.4.2。它通过索引(第一个元素的索引为 0)来识别过滤器中的另一个元素。
创建复杂过滤器时需要使用该索引,例如在((Severity > 500)AND(Message == "TestString"))中引用 AND 运算的两个操作数。第一步是为两个条件(Severity > 500)和(Message == "TestString")创建内容过滤元素。需要第三个内容过滤元素来创建两个条件的 AND 组合。它由 AND 运算符和两个元素操作数组成,其中两个元素操作数是之前创建的两个条件的索引:
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 } } ] }
属性文档
index : int |
将用作操作数的过滤元素的索引。
© 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.