本页内容

ElementOperand QML Type

OPC UA 的 ElementOperand 类型。更多内容...

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

自 QtOpcUa 6.9 起,此类型已被废弃。我们强烈建议不要在新代码中使用它。

属性

详细说明

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

将用作操作数的滤芯索引。

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