PySide6.QtOpcUa.QOpcUaElementOperand

class QOpcUaElementOperand

OPC UA ElementOperand 类型。更多

概要

方法

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

ElementOperand 在 OPC UA 1.05 第4部分的7.7.4.2中定义。它用于通过索引(第一个元素的索引为0)来识别过滤器中的另一个元素。

这是创建复杂过滤器所必需的,例如引用AND操作的两个操作数在((Severity > 500) AND (Message == “TestString”))中。第一步是为两个条件(Severity > 500)和(Message == “TestString”)创建内容过滤器元素。需要第三个内容过滤器元素来创建这两个条件的AND组合。它由AND运算符和两个元素操作数组成,这两个操作数是之前创建的两个条件的索引:

QOpcUaMonitoringParameters::EventFilter filter;
...
// setup select clauses
...
QOpcUaContentFilterElement condition1;
QOpcUaContentFilterElement condition2;
QOpcUaContentFilterElement condition3;
condition1 << QOpcUaContentFilterElement::FilterOperator::GreaterThan << QOpcUaSimpleAttributeOperand("Severity") <<
                QOpcUaLiteralOperand(quint16(500), QOpcUa::Types::UInt16);
condition2 << QOpcUaContentFilterElement::FilterOperator::Equals << QOpcUaSimpleAttributeOperand("Message") <<
                QOpcUaLiteralOperand("TestString", QOpcUa::Types::String);
condition3 << QOpcUaContentFilterElement::FilterOperator::And << QOpcUaElementOperand(0) << QOpcUaElementOperand(1);
filter << condition1 << condition2 << condition3;
__init__()

默认构造一个没有设置参数的元素操作数。

__init__(rhs)
Parameters:

rhsQOpcUaElementOperand

rhs构造一个元素操作数。

__init__(index)
Parameters:

索引 – int

构造一个索引为 index 的元素操作数。

index()
Return type:

整数

返回将用作操作数的过滤器元素的索引。

另请参阅

setIndex()

__ne__(rhs)
Parameters:

rhsQOpcUaElementOperand

Return type:

布尔

如果 lhs 的值与 rhs 不同,则返回 true

__eq__(rhs)
Parameters:

rhsQOpcUaElementOperand

Return type:

布尔

如果 lhs 的值与 rhs 相同,则返回 true

setIndex(index)
Parameters:

索引 – int

设置将用作操作数的过滤器元素的索引为index

另请参阅

index()