QOpcUaElementOperand Class

OPC UA ElementOperand 类型。 更多...

头: #include <QOpcUaElementOperand>
qmake: QT += opcua

公共函数

QOpcUaElementOperand (quint32 index )
QOpcUaElementOperand (const QOpcUaElementOperand & rhs )
QOpcUaElementOperand & operator= (const QOpcUaElementOperand & rhs )
quint32 index () const
void setIndex (quint32 index )
QVariant operator QVariant () const

详细描述

The ElementOperand is defined in OPC-UA part 4, 7.4.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;
					

成员函数文档编制

QOpcUaElementOperand:: QOpcUaElementOperand ( quint32 index )

Constructs an element operand with index index .

QOpcUaElementOperand:: QOpcUaElementOperand (const QOpcUaElementOperand & rhs )

Constructs an element operand from rhs .

QOpcUaElementOperand &QOpcUaElementOperand:: operator= (const QOpcUaElementOperand & rhs )

设置值从 rhs in this element operand.

quint32 QOpcUaElementOperand:: index () const

Returns the index of the filter element that is going to be used as operand.

另请参阅 setIndex ().

void QOpcUaElementOperand:: setIndex ( quint32 index )

Sets the index of the filter element that is going to be used as operand to index .

另请参阅 index ().

QVariant QOpcUaElementOperand:: operator QVariant () const

Converts this element operand to QVariant .