Class implementing the UaObject interface for the ConditionType. More...
#include <opcua_conditiontype.h>
Public Member Functions | |
ConditionType (const UaNodeId &nodeId, UaObject *pInstanceDeclarationObject, NodeManagerConfig *pNodeConfig, const UaNodeId &sourceNode, const UaString &sourceName, UaMutexRefCounted *pSharedMutex=NULL) | |
ConditionType (const UaNodeId &nodeId, const UaString &name, OpcUa_UInt16 browseNameNameSpaceIndex, NodeManagerConfig *pNodeConfig, const UaNodeId &sourceNode, const UaString &sourceName, UaMutexRefCounted *pSharedMutex=NULL) | |
void | addEnabledStateLocale (const UaLocalizedText &falseName, const UaLocalizedText &trueName) |
virtual UaNodeId | getConditionNodeId () |
virtual UaNodeId | getConditionBranchNodeId () |
virtual OpcUa_Boolean | getConditionRetain () |
OpcUa_UInt32 | getBranchCount () |
ConditionTypeData * | getBranch (const UaNodeId &branchNodeId) |
ConditionTypeData * | getBranchByEventId (const UaByteString &eventId, UaByteString &userEventId) |
void | getAllBranches (UaPointerArray< ConditionTypeData > &branchArray) |
OpcUa_StatusCode | deleteBranch (const UaNodeId &branchNodeId) |
UaStatus | triggerBranchEvent (ConditionTypeData *pConditionTypeData, const UaDateTime &time, const UaDateTime &receiveTime, const UaByteString &eventId) |
Static Public Member Functions | |
static void | createTypes () |
static void | clearStaticMembers () |
Protected Member Functions | |
virtual | ~ConditionType () |
Class implementing the UaObject interface for the ConditionType.
OPC UA Objects are used to represent systems, system components, real-world objects and software objects. They have the NodeClass Object. The detailed description of Objects and their attributes can be found in the general description of the Object node class.
OpcUa::ConditionType::~ConditionType | ( | ) | [protected, virtual] |
Destruction
OpcUa::ConditionType::ConditionType | ( | const UaNodeId & | nodeId, |
UaObject * | pInstanceDeclarationObject, | ||
NodeManagerConfig * | pNodeConfig, | ||
const UaNodeId & | sourceNode, | ||
const UaString & | sourceName, | ||
UaMutexRefCounted * | pSharedMutex = NULL |
||
) |
Construction of the class ConditionType. This constructor is used if the object is created based on an instance declaration of an object type. Since the only difference between the instance declaration object and the instance object are the node id, the pointer to the instance declaration node is used to get the attribute values other than NodeId from the instance declaration node.
The object is reference counted and can not be deleted directly. The reference counter is set to one after the object is created. If the object was successfully added to a NodeManager using the methods NodeManagerConfig::addUaNode or NodeManagerConfig::addNodeAndReference the NodeManager will release this reference during shut down. If the object was not added to a NodeManager, it must be deleted using the releaseReference method. If the interface pointer is used in other places, the availablity of the object must be ensured by incrementing the reference counter with addReference when the pointer is stored somewhere and decremented with releaseReference if the interface pointer is not longer needed.
[in] | nodeId | NodeId of the new object |
[in] | pInstanceDeclarationObject | UaObject interface of the instance declaration node used to provide attribute values other than NodeId |
[in] | pNodeConfig | Interface pointer to the NodeManagerConfig interface used to add and delete node and references in the address space |
[in] | sourceNode | NodeId of the source node used for this condition object. Can be null if the source is not a node in the address space |
[in] | sourceName | Name of the source used for this condition object |
[in] | pSharedMutex | Shared mutex object used to synchronize access to the object. Can be NULL if no shared mutex is provided |
OpcUa::ConditionType::ConditionType | ( | const UaNodeId & | nodeId, |
const UaString & | name, | ||
OpcUa_UInt16 | browseNameNameSpaceIndex, | ||
NodeManagerConfig * | pNodeConfig, | ||
const UaNodeId & | sourceNode, | ||
const UaString & | sourceName, | ||
UaMutexRefCounted * | pSharedMutex = NULL |
||
) |
Construction of the class ConditionType. This constructor is used if the object is not created based on an instance declaration. It defines the name and node id of the object. Additional language specific names and other attribute values can be set with set methods provided by the class. The object is reference counted and can not be deleted directly. The reference counter is set to one after the object is created. If the object was successfully added to a NodeManager using the methods NodeManagerConfig::addUaNode or NodeManagerConfig::addNodeAndReference the NodeManager will release this reference during shut down. If the object was not added to a NodeManager, it must be deleted using the releaseReference method. If the interface pointer is used in other places, the availablity of the object must be ensured by incrementing the reference counter with addReference when the pointer is stored somewhere and decremented with releaseReference if the interface pointer is not longer needed.
[in] | nodeId | NodeId of the new object |
[in] | name | Name of the new object. Used as browse name and also as display name if no additional language specific names are set. |
[in] | browseNameNameSpaceIndex | Namespace index used for the browse name |
[in] | pNodeConfig | Interface pointer to the NodeManagerConfig interface used to add and delete node and references in the address space |
[in] | sourceNode | NodeId of the source node used for this condition object. Can be null if the source is not a node in the address space |
[in] | sourceName | Name of the source used for this condition object |
[in] | pSharedMutex | Shared mutex object used to synchronize access to the object. Can be NULL if no shared mutex is provided |
void OpcUa::ConditionType::addEnabledStateLocale | ( | const UaLocalizedText & | falseName, |
const UaLocalizedText & | trueName | ||
) |
Add Enabled state strings for additional locale
void OpcUa::ConditionType::clearStaticMembers | ( | ) | [static] |
Internal SDK method used to clear the static members of this class.
Reimplemented from OpcUa::ConditionTypeBase.
Reimplemented in OpcUa::AcknowledgeableConditionType, OpcUa::AcknowledgeableConditionTypeBase, OpcUa::AlarmConditionType, OpcUa::AlarmConditionTypeBase, OpcUa::DialogConditionType, OpcUa::DialogConditionTypeBase, OpcUa::DiscreteAlarmType, OpcUa::DiscreteAlarmTypeBase, OpcUa::ExclusiveDeviationAlarmType, OpcUa::ExclusiveDeviationAlarmTypeBase, OpcUa::ExclusiveLevelAlarmType, OpcUa::ExclusiveLevelAlarmTypeBase, OpcUa::ExclusiveLimitAlarmType, OpcUa::ExclusiveLimitAlarmTypeBase, OpcUa::ExclusiveRateOfChangeAlarmType, OpcUa::ExclusiveRateOfChangeAlarmTypeBase, OpcUa::LimitAlarmType, OpcUa::LimitAlarmTypeBase, OpcUa::NonExclusiveDeviationAlarmType, OpcUa::NonExclusiveDeviationAlarmTypeBase, OpcUa::NonExclusiveLevelAlarmType, OpcUa::NonExclusiveLevelAlarmTypeBase, OpcUa::NonExclusiveLimitAlarmType, OpcUa::NonExclusiveLimitAlarmTypeBase, OpcUa::NonExclusiveRateOfChangeAlarmType, OpcUa::NonExclusiveRateOfChangeAlarmTypeBase, OpcUa::OffNormalAlarmType, OpcUa::OffNormalAlarmTypeBase, OpcUa::TripAlarmType, and OpcUa::TripAlarmTypeBase.
void OpcUa::ConditionType::createTypes | ( | ) | [static] |
Create the related type nodes for condition classes
Reimplemented from OpcUa::ConditionTypeBase.
Reimplemented in OpcUa::AcknowledgeableConditionType, OpcUa::AcknowledgeableConditionTypeBase, OpcUa::AlarmConditionType, OpcUa::AlarmConditionTypeBase, OpcUa::DialogConditionType, OpcUa::DialogConditionTypeBase, OpcUa::DiscreteAlarmType, OpcUa::DiscreteAlarmTypeBase, OpcUa::ExclusiveDeviationAlarmType, OpcUa::ExclusiveDeviationAlarmTypeBase, OpcUa::ExclusiveLevelAlarmType, OpcUa::ExclusiveLevelAlarmTypeBase, OpcUa::ExclusiveLimitAlarmType, OpcUa::ExclusiveLimitAlarmTypeBase, OpcUa::ExclusiveRateOfChangeAlarmType, OpcUa::ExclusiveRateOfChangeAlarmTypeBase, OpcUa::LimitAlarmType, OpcUa::LimitAlarmTypeBase, OpcUa::NonExclusiveDeviationAlarmType, OpcUa::NonExclusiveDeviationAlarmTypeBase, OpcUa::NonExclusiveLevelAlarmType, OpcUa::NonExclusiveLevelAlarmTypeBase, OpcUa::NonExclusiveLimitAlarmType, OpcUa::NonExclusiveLimitAlarmTypeBase, OpcUa::NonExclusiveRateOfChangeAlarmType, OpcUa::NonExclusiveRateOfChangeAlarmTypeBase, OpcUa::OffNormalAlarmType, OpcUa::OffNormalAlarmTypeBase, OpcUa::TripAlarmType, and OpcUa::TripAlarmTypeBase.
OpcUa_StatusCode OpcUa::ConditionType::deleteBranch | ( | const UaNodeId & | branchNodeId ) |
Deletes the branch identified by the branch NodeId
[in] | branchNodeId | NodeId of the branch to delete. |
void OpcUa::ConditionType::getAllBranches | ( | UaPointerArray< ConditionTypeData > & | branchArray ) |
Returns an array of the available branches.
[out] | branchArray | Array of branches represented by an array of event data pointers. |
ConditionTypeData * OpcUa::ConditionType::getBranch | ( | const UaNodeId & | branchNodeId ) |
Returns a pointer to the branch event data based on the passe branch NodeId
[in] | branchNodeId | NodeId of the branch to return. |
ConditionTypeData * OpcUa::ConditionType::getBranchByEventId | ( | const UaByteString & | eventId, |
UaByteString & | userEventId | ||
) |
Returns a pointer to the branch event data based on the passe EventId. The function extracts also the user eventId provided in ConditionType::triggerBranchEvent().
[in] | eventId | EventId provided by the client in an Acknowledge, AddComment or Confirm call. |
[out] | userEventId | Extracted user event data provided in ConditionType::triggerBranchEvent(). |
OpcUa_UInt32 OpcUa::ConditionType::getBranchCount | ( | ) |
Returns the number of active branches
UaNodeId OpcUa::ConditionType::getConditionBranchNodeId | ( | ) | [virtual] |
Returns the condition branch NodeId for the condition object. This is used by the SDK to detect if the condition event data is from a branch.
Reimplemented from UaEventData.
UaNodeId OpcUa::ConditionType::getConditionNodeId | ( | ) | [virtual] |
Returns the condition NodeId for the condition object. This is used by the SDK to detect if the event data is from a condition event.
Reimplemented from UaEventData.
OpcUa_Boolean OpcUa::ConditionType::getConditionRetain | ( | ) | [virtual] |
Returns the Retain flag for the condition object. This is used by the SDK to detect if the condition event data indicates an interesting state.
Reimplemented from UaEventData.
UaStatus OpcUa::ConditionType::triggerBranchEvent | ( | ConditionTypeData * | pConditionTypeData, |
const UaDateTime & | time, | ||
const UaDateTime & | receiveTime, | ||
const UaByteString & | userEventId | ||
) |
Send event with event field data of the passed condition branch to the subscribed clients After setting the changed states of the condition branch this method is used to trigger the event notification that contains the snapshot of the new state of the condition branch.
[in] | pConditionTypeData | Event data of the condition branch to send a snapshot of the branch to the client(s). |
[in] | time | Time provides the time the Event occurred. This value is set as close to the event generator as possible. It often comes from the underlying system or device. |
[in] | receiveTime | ReceiveTime provides the time the OPC UA Server received the Event from the underlying device or another Server. |
[in] | userEventId | The server is responsible for generating a unique EventId for every event sent to the client. The SDK uses this parameter userEventId as part of the EventId but adds a unique part and the BranchId. The EventId is provided by the client in calls back to the server like in an alarm acknowledgement. The user specific part can be extracted from the EventId provided by the client by using ConditionType::getBranchByEventId() |