OpcUaCanOpen
CANopen OPC-UA server
AddressSpace::UaControlVariable Class Reference

Generic class has a signal attribute to send signal when value is changed All variable in OpcUaCanopen Server inherits this class. More...

#include <UaControlDeviceItem.h>

Inherits BaseDataVariableType, and BaseDataVariableType.

Inherited by AddressSpace::UaCalcItem, AddressSpace::UaCalcItem, AddressSpace::UaControlDeviceItem, AddressSpace::UaControlDeviceItem, AddressSpace::UaProgramStartVariable, and AddressSpace::UaProgramStartVariable.

Public Member Functions

 UaControlVariable (UaNode *cur, NmBuildingAutomation *pNodeManager, UaVariable *instance, UaMutexRefCounted *pSharedMutex)
 Constructor. More...
 
 UaControlVariable (const UaString &name, const UaNodeId &newNodeId, NmBuildingAutomation *pNodeManager, UaVariant &dv, UaMutexRefCounted *pSharedMutex)
 
virtual ~UaControlVariable ()
 
virtual UaStatus write (UaDataValue &udv)
 
virtual UaStatus read ()
 
virtual UaStatus setValue (Session *pSession, const UaDataValue &dataValue, OpcUa_Boolean checkAccessLevel)
 Redefine setValue function to sent data change signal;. More...
 
virtual UaStatus setValueOnChange (Session *pSession, const UaDataValue &dataValue, OpcUa_Boolean checkAccessLevel)
 Redefine setValue function to sent data change signal;. More...
 
virtual void connectItem (UaControlVariable *item)
 
virtual UaNodeId typeDefinitionId () const
 
virtual void setTypeDefinition (UaNodeId uni)
 set node id of type of variable More...
 
void convertToDouble (const UaDataValue &dataValue)
 Signal. More...
 
 UaControlVariable (UaNode *cur, NmBuildingAutomation *pNodeManager, UaVariable *instance, UaMutexRefCounted *pSharedMutex)
 Constructor. More...
 
 UaControlVariable (const UaString &name, const UaNodeId &newNodeId, NmBuildingAutomation *pNodeManager, UaVariant &dv, UaMutexRefCounted *pSharedMutex)
 
virtual ~UaControlVariable ()
 
virtual UaStatus write (UaDataValue &udv)
 
virtual UaStatus read ()
 
virtual UaStatus setValue (Session *pSession, const UaDataValue &dataValue, OpcUa_Boolean checkAccessLevel)
 Redefine setValue function to sent data change signal;. More...
 
virtual UaStatus setValueOnChange (Session *pSession, const UaDataValue &dataValue, OpcUa_Boolean checkAccessLevel)
 Redefine setValue function to sent data change signal;. More...
 
virtual void connectItem (UaControlVariable *item)
 
virtual UaNodeId typeDefinitionId () const
 
virtual void setTypeDefinition (UaNodeId uni)
 set node id of type of variable More...
 
void convertToDouble (const UaDataValue &dataValue)
 Signal. More...
 

Public Attributes

boost::signals2::signal< void(Session *pSession, const UaDataValue &dataValue, OpcUa_Boolean checkAccessLevel) > valueChange
 write date to hardware More...
 
OpcUa_Double curValue
 

Private Member Functions

 UA_DISABLE_COPY (UaControlVariable)
 
 UA_DISABLE_COPY (UaControlVariable)
 

Private Attributes

UaNodeId m_TypeDefinition
 

Detailed Description

Generic class has a signal attribute to send signal when value is changed All variable in OpcUaCanopen Server inherits this class.

Definition at line 24 of file UaControlDeviceItem.h.

Constructor & Destructor Documentation

◆ UaControlVariable() [1/4]

AddressSpace::UaControlVariable::UaControlVariable ( UaNode *  cur,
NmBuildingAutomation pNodeManager,
UaVariable *  instance,
UaMutexRefCounted *  pSharedMutex 
)

Constructor.

Parameters
namethe name of ua node
newNodeIditem ua node id
pNodeManagerpointer to node manager
dvinitial value of item (usually empty)
pSharedMutexpointer to shared mutex (using toolkit)

Definition at line 21 of file UaControlDeviceItem.cpp.

◆ UaControlVariable() [2/4]

AddressSpace::UaControlVariable::UaControlVariable ( const UaString &  name,
const UaNodeId &  newNodeId,
NmBuildingAutomation pNodeManager,
UaVariant &  dv,
UaMutexRefCounted *  pSharedMutex 
)

Definition at line 11 of file UaControlDeviceItem.cpp.

◆ ~UaControlVariable() [1/2]

virtual AddressSpace::UaControlVariable::~UaControlVariable ( )
inlinevirtual

Definition at line 52 of file UaControlDeviceItem.h.

◆ UaControlVariable() [3/4]

AddressSpace::UaControlVariable::UaControlVariable ( UaNode *  cur,
NmBuildingAutomation pNodeManager,
UaVariable *  instance,
UaMutexRefCounted *  pSharedMutex 
)

Constructor.

Parameters
namethe name of ua node
newNodeIditem ua node id
pNodeManagerpointer to node manager
dvinitial value of item (usually empty)
pSharedMutexpointer to shared mutex (using toolkit)

◆ UaControlVariable() [4/4]

AddressSpace::UaControlVariable::UaControlVariable ( const UaString &  name,
const UaNodeId &  newNodeId,
NmBuildingAutomation pNodeManager,
UaVariant &  dv,
UaMutexRefCounted *  pSharedMutex 
)

◆ ~UaControlVariable() [2/2]

virtual AddressSpace::UaControlVariable::~UaControlVariable ( )
inlinevirtual

Definition at line 52 of file UaControlDeviceItem.hpp.

Member Function Documentation

◆ connectItem() [1/2]

virtual void AddressSpace::UaControlVariable::connectItem ( UaControlVariable item)
inlinevirtual

Definition at line 111 of file UaControlDeviceItem.h.

◆ connectItem() [2/2]

virtual void AddressSpace::UaControlVariable::connectItem ( UaControlVariable item)
inlinevirtual

Definition at line 111 of file UaControlDeviceItem.hpp.

◆ convertToDouble() [1/2]

void AddressSpace::UaControlVariable::convertToDouble ( const UaDataValue &  dataValue)
inline

Signal.

Definition at line 134 of file UaControlDeviceItem.hpp.

◆ convertToDouble() [2/2]

void AddressSpace::UaControlVariable::convertToDouble ( const UaDataValue &  dataValue)
inline

Signal.

Definition at line 135 of file UaControlDeviceItem.h.

◆ read() [1/2]

virtual UaStatus AddressSpace::UaControlVariable::read ( )
inlinevirtual

◆ read() [2/2]

virtual UaStatus AddressSpace::UaControlVariable::read ( )
inlinevirtual

◆ setTypeDefinition() [1/2]

virtual void AddressSpace::UaControlVariable::setTypeDefinition ( UaNodeId  uni)
inlinevirtual

set node id of type of variable

Parameters
uniua node id of type

Definition at line 127 of file UaControlDeviceItem.hpp.

◆ setTypeDefinition() [2/2]

virtual void AddressSpace::UaControlVariable::setTypeDefinition ( UaNodeId  uni)
inlinevirtual

set node id of type of variable

Parameters
uniua node id of type

Definition at line 128 of file UaControlDeviceItem.h.

◆ setValue() [1/2]

virtual UaStatus AddressSpace::UaControlVariable::setValue ( Session *  pSession,
const UaDataValue &  dataValue,
OpcUa_Boolean  checkAccessLevel 
)
inlinevirtual

Redefine setValue function to sent data change signal;.

Parameters
pSessionpointer to current session
dataValuenew value of item
checkAccessLevelwhether check access
Returns
status

Reimplemented in AddressSpace::UaProgramStartVariable, and AddressSpace::UaProgramStartVariable.

Definition at line 82 of file UaControlDeviceItem.h.

◆ setValue() [2/2]

virtual UaStatus AddressSpace::UaControlVariable::setValue ( Session *  pSession,
const UaDataValue &  dataValue,
OpcUa_Boolean  checkAccessLevel 
)
inlinevirtual

Redefine setValue function to sent data change signal;.

Parameters
pSessionpointer to current session
dataValuenew value of item
checkAccessLevelwhether check access
Returns
status

Reimplemented in AddressSpace::UaProgramStartVariable, and AddressSpace::UaProgramStartVariable.

Definition at line 82 of file UaControlDeviceItem.hpp.

◆ setValueOnChange() [1/2]

virtual UaStatus AddressSpace::UaControlVariable::setValueOnChange ( Session *  pSession,
const UaDataValue &  dataValue,
OpcUa_Boolean  checkAccessLevel 
)
inlinevirtual

Redefine setValue function to sent data change signal;.

Parameters
pSessionpointer to current session
dataValuenew value of item
checkAccessLevelwhether check access
Returns
status

Reimplemented in AddressSpace::UaProgramStartVariable, and AddressSpace::UaProgramStartVariable.

Definition at line 99 of file UaControlDeviceItem.h.

◆ setValueOnChange() [2/2]

virtual UaStatus AddressSpace::UaControlVariable::setValueOnChange ( Session *  pSession,
const UaDataValue &  dataValue,
OpcUa_Boolean  checkAccessLevel 
)
inlinevirtual

Redefine setValue function to sent data change signal;.

Parameters
pSessionpointer to current session
dataValuenew value of item
checkAccessLevelwhether check access
Returns
status

Reimplemented in AddressSpace::UaProgramStartVariable, and AddressSpace::UaProgramStartVariable.

Definition at line 99 of file UaControlDeviceItem.hpp.

◆ typeDefinitionId() [1/2]

virtual UaNodeId AddressSpace::UaControlVariable::typeDefinitionId ( ) const
inlinevirtual
Returns
node id of type of variable

Definition at line 122 of file UaControlDeviceItem.hpp.

◆ typeDefinitionId() [2/2]

virtual UaNodeId AddressSpace::UaControlVariable::typeDefinitionId ( ) const
inlinevirtual
Returns
node id of type of variable

Definition at line 123 of file UaControlDeviceItem.h.

◆ UA_DISABLE_COPY() [1/2]

AddressSpace::UaControlVariable::UA_DISABLE_COPY ( UaControlVariable  )
private

◆ UA_DISABLE_COPY() [2/2]

AddressSpace::UaControlVariable::UA_DISABLE_COPY ( UaControlVariable  )
private

◆ write() [1/2]

virtual UaStatus AddressSpace::UaControlVariable::write ( UaDataValue &  udv)
inlinevirtual

◆ write() [2/2]

virtual UaStatus AddressSpace::UaControlVariable::write ( UaDataValue &  udv)
inlinevirtual

Member Data Documentation

◆ curValue

OpcUa_Double AddressSpace::UaControlVariable::curValue

Definition at line 181 of file UaControlDeviceItem.h.

◆ m_TypeDefinition

UaNodeId AddressSpace::UaControlVariable::m_TypeDefinition
private

Definition at line 184 of file UaControlDeviceItem.h.

◆ valueChange

boost::signals2::signal< void(Session *pSession, const UaDataValue &dataValue, OpcUa_Boolean checkAccessLevel) > AddressSpace::UaControlVariable::valueChange

write date to hardware

Parameters
udvvalue of variable

Definition at line 133 of file UaControlDeviceItem.h.


The documentation for this class was generated from the following files: