PySide6.QtOpcUa.QOpcUaElementOperand¶
- class QOpcUaElementOperand¶
The OPC UA ElementOperand type. More…
Synopsis¶
Methods¶
def
__init__()
def
index()
def
__ne__()
def
__eq__()
def
setIndex()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
The ElementOperand is defined in OPC UA 1.05 part 4, 7.7.4.2. It is used to identify another element in the filter by its index (the first element has the index 0).
This is required to create complex filters, for example to reference the two operands of the AND operation in ((Severity > 500) AND (Message == “TestString”)). The first step is to create content filter elements for the two conditions (Severity > 500) and (Message == “TestString”). A third content filter element is required to create an AND combination of the two conditions. It consists of the AND operator and two element operands with the indices of the two conditions created before:
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__()¶
Default constructs an element operand with no parameters set.
- __init__(arg__1)
- Parameters:
arg__1 –
QOpcUaElementOperand
Constructs an element operand from
rhs
.- __init__(index)
- Parameters:
index – int
Constructs an element operand with index
index
.- index()¶
- Return type:
int
Returns the index of the filter element that is going to be used as operand.
See also
- __ne__(rhs)¶
- Parameters:
rhs –
QOpcUaElementOperand
- Return type:
bool
Returns
true
iflhs
a different value thanrhs
.- __eq__(rhs)¶
- Parameters:
rhs –
QOpcUaElementOperand
- Return type:
bool
Returns
true
iflhs
has the same value asrhs
.- setIndex(index)¶
- Parameters:
index – int
Sets the index of the filter element that is going to be used as operand to
index
.See also