QOpcUaWriteItem Class

This class stores the options for a write operation. 更多...

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

公共函数

  QOpcUaWriteItem (const QString & nodeId , QOpcUa::NodeAttribute 属性 , const QVariant & value , QOpcUa::Types type = QOpcUa::Types::Undefined, const QString & indexRange = QString())
  QOpcUaWriteItem (const QOpcUaWriteItem & other )
QOpcUaWriteItem & operator= (const QOpcUaWriteItem & rhs )
QOpcUa::NodeAttribute 属性 () const
bool hasStatusCode () const
QString indexRange () const
QString nodeId () const
QDateTime serverTimestamp () const
void setAttribute (QOpcUa::NodeAttribute 属性 )
void setIndexRange (const QString & indexRange )
void setNodeId (const QString & nodeId )
void setServerTimestamp (const QDateTime & serverTimestamp )
void setSourceTimestamp (const QDateTime & sourceTimestamp )
void setStatusCode (QOpcUa::UaStatusCode statusCode )
void setType (QOpcUa::Types type )
void setValue (const QVariant & value )
void setValue (const QVariant & value , QOpcUa::Types type )
QDateTime sourceTimestamp () const
QOpcUa::UaStatusCode statusCode () const
QOpcUa::Types type () const
QVariant value () const

详细描述

A write operation on an OPC UA server overwrites the entire value or a certain index range of the value of an attribute of a node on the server. This class contains the necessary information for the backend to make a write request to the server.

One or multiple objects of this class make up the request of a QOpcUaClient::writeNodeAttributes () operation.

另请参阅 QOpcUaClient::writeNodeAttributes () 和 QOpcUaWriteResult .

成员函数文档编制

QOpcUaWriteItem:: QOpcUaWriteItem (const QString & nodeId , QOpcUa::NodeAttribute 属性 , const QVariant & value , QOpcUa::Types type = QOpcUa::Types::Undefined, const QString & indexRange = QString())

Creates a write item for the attribute 属性 from node nodeId 。值 value 类型 type will be written at position indexRange of 属性 .

QOpcUaWriteItem:: QOpcUaWriteItem (const QOpcUaWriteItem & other )

Creates a new write item from other .

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

设置值从 rhs in this write item.

QOpcUa::NodeAttribute QOpcUaWriteItem:: 属性 () const

Returns the attribute of the write item.

另请参阅 setAttribute ().

bool QOpcUaWriteItem:: hasStatusCode () const

Returns true if a status code for the value to write has been set.

QString QOpcUaWriteItem:: indexRange () const

Returns the index range of the write item.

另请参阅 setIndexRange ().

QString QOpcUaWriteItem:: nodeId () const

Returns the node id of the write item.

另请参阅 setNodeId ().

QDateTime QOpcUaWriteItem:: serverTimestamp () const

Returns the server timestamp for the value to write.

另请参阅 setServerTimestamp ().

void QOpcUaWriteItem:: setAttribute ( QOpcUa::NodeAttribute 属性 )

Sets the attribute of the write item to 属性 .

另请参阅 属性 ().

void QOpcUaWriteItem:: setIndexRange (const QString & indexRange )

Sets the index range of the write item to indexRange .

另请参阅 indexRange ().

void QOpcUaWriteItem:: setNodeId (const QString & nodeId )

Sets the node id of the write item to nodeId .

另请参阅 nodeId ().

void QOpcUaWriteItem:: setServerTimestamp (const QDateTime & serverTimestamp )

Sets the server timestamp for the value to write to serverTimestamp . If the server timestamp is invalid, it is ignored by the client and not sent to the server. If the server doesn't support writing timestamps, the write operation for this item will fail with status code BadWriteNotSupported .

另请参阅 serverTimestamp ().

void QOpcUaWriteItem:: setSourceTimestamp (const QDateTime & sourceTimestamp )

Sets the source timestamp for the value to write to sourceTimestamp . If the source timestamp is invalid, it is ignored by the client and not sent to the server. If the server doesn't support writing timestamps, the write operation for this item will fail with status code BadWriteNotSupported .

另请参阅 sourceTimestamp ().

void QOpcUaWriteItem:: setStatusCode ( QOpcUa::UaStatusCode statusCode )

Sets the status code for the value to write to statusCode . If no status code is set, no status code is sent to the server.

另请参阅 statusCode ().

void QOpcUaWriteItem:: setType ( QOpcUa::Types type )

Sets the type of the value of the write item to type .

另请参阅 type ().

void QOpcUaWriteItem:: setValue (const QVariant & value )

Sets the value of the write item to value . If given, the type information from setType () will be used in converting the value to a SDK specific data type.

另请参阅 value () 和 setType ().

void QOpcUaWriteItem:: setValue (const QVariant & value , QOpcUa::Types type )

Sets the value of the write item to

常量 描述
and the type of the value to type .

QDateTime QOpcUaWriteItem:: sourceTimestamp () const

Returns the source timestamp for the value to write.

另请参阅 setSourceTimestamp ().

QOpcUa::UaStatusCode QOpcUaWriteItem:: statusCode () const

Returns the status code for the value to write.

另请参阅 setStatusCode ().

QOpcUa::Types QOpcUaWriteItem:: type () const

Returns the type of the value of the write item.

另请参阅 setType ().

QVariant QOpcUaWriteItem:: value () const

Returns the value of the write item.

另请参阅 setValue ().