.NET Based OPC UA Client/Server SDK  3.3.0.530
UnifiedAutomation.UaServer.ShelvedStateMachineModel Class Reference

Defines a substate machine that represents an advanced Alarm filtering model. More...

Inherits UnifiedAutomation.UaServer.FiniteStateMachineModel, and UnifiedAutomation.UaServer.IMethodDispatcher.

Public Types

enum  State : uint { State.Unshelved = 1, State.TimedShelved = 2, State.OneShotShelved = 3 }
 The enumeration representing the possible states of the state machine. More...
 
enum  Transition : uint {
  Transition.OneShotShelvedToTimedShelved = 32, Transition.OneShotShelvedToUnshelved = 31, Transition.TimedShelvedToOneShotShelved = 23, Transition.TimedShelvedToUnshelved = 21,
  Transition.UnshelvedToOneShotShelved = 13, Transition.UnshelvedToTimedShelved = 12
}
 The enumeration representing the possible transitions of the state machine. More...
 

Public Member Functions

 ShelvedStateMachineModel ()
 Initializes a new instance of the ShelvedStateMachineModel class. More...
 
 ShelvedStateMachineModel (ShelvedStateMachineModel template, DummyArgument dummy=null)
 Initializes a new instance of the ShelvedStateMachineModel class. More...
 
void RaiseSwitchedEvent (State?oldState, State?state, Transition?transition)
 Raises the Switched event. More...
 
virtual void SwitchToState (State?state, Transition?transition=null)
 Switch to the given state. More...
 
virtual CallMethodEventHandler GetMethodDispatcher (RequestContext context, NodeId objectId, NodeId methodId)
 Gets the method dispatcher. More...
 
virtual StatusCode DispatchMethod (RequestContext context, MethodHandle methodHandle, IList< Variant > inputArguments, List< StatusCode > inputArgumentResults, List< Variant > outputArguments)
 Dispatches the method. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaServer.FiniteStateMachineModel
 FiniteStateMachineModel ()
 Initializes a new instance of the FiniteStateMachineModel class. More...
 
 FiniteStateMachineModel (FiniteStateMachineModel template, DummyArgument dummy=null)
 Initializes a new instance of the FiniteStateMachineModel class. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaServer.StateMachineModel
 StateMachineModel ()
 Initializes a new instance of the StateMachineModel class. More...
 
 StateMachineModel (StateMachineModel template, DummyArgument dummy=null)
 Initializes a new instance of the StateMachineModel class. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaServer.BaseObjectModel
 BaseObjectModel ()
 Initializes a new instance of the BaseObjectModel class. More...
 
 BaseObjectModel (BaseObjectModel template, DummyArgument dummy=null)
 Initializes a new instance of the BaseObjectModel class. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaServer.ModelControllerBase
virtual ModelHandle GetModelHandle (StringTable namespaceUris, object instance)
 Gets the metadata handle. More...
 
virtual DataValue GetValue (IMapperContext context, ModelMapping mapping)
 Gets the value associated with the mapping. More...
 
virtual bool SetValue (IMapperContext context, ModelMapping mapping, DataValue value)
 Sets the value associated with the mapping. More...
 
StatusCode GetStatusCode (string propertyName)
 Retrieve the status code for the given property. If no status code was explicitly set, StatusCodes.Good will be returned.
Parameters
propertyNameThe property name.
Returns
The status code of the property.

 
void SetStatusCode (string propertyName, StatusCode statusCode)
 Sets the status code of the given property. More...
 

Static Public Member Functions

static IEnumerable< TransitionGetTransitions (State oldState, State newState)
 A sequence of all possible transition for the given states. More...
 
static LocalizedText GetLocalizedText (State state)
 Retrieves a LocalizedText for the given state value. More...
 
static QualifiedName GetName (State state)
 Retrieves a QualifiedName for the given state value. More...
 
static NodeId GetNodeId (State state)
 Retrieves the NodeId for the given state value. More...
 
static LocalizedText GetLocalizedText (Transition transition)
 Retrieves a LocalizedText for the given transition value. More...
 
static QualifiedName GetName (Transition transition)
 Retrieves a QualifiedName for the given transition value. More...
 
static NodeId GetNodeId (Transition transition)
 Retrieves the NodeId for the given transition value. More...
 

Protected Attributes

State m_state
 The current state of the state machine. More...
 
Transition m_transition
 The last transition of the state machine. More...
 

Properties

AlarmConditionModel ParentAlarm [get, set]
 The containing alarm. More...
 
double UnshelveTime [get, set]
 Specifies the remaining time in milliseconds until the Alarm automatically transitions into the Unshelved state. More...
 
State InternalState [get, protected set]
 The FiniteStateMachineModel.CurrentState as the enumeration value. More...
 
Transition InternalTransition [get, protected set]
 The FiniteStateMachineModel.LastTransition as the enumeration value. More...
 
IShelvedStateMachineMethods ShelvedStateMachineMethods [get, set]
 Gets or sets the ShelvedStateMachine methods. More...
 
- Properties inherited from UnifiedAutomation.UaServer.FiniteStateMachineModel
NodeId[] AvailableStates [get, set]
 Gets or sets the AvailableStates More...
 
NodeId[] AvailableTransitions [get, set]
 Gets or sets the AvailableTransitions More...
 
new FiniteStateVariableModel CurrentState [get, set]
 Stores the current state of an instance of the FiniteStateMachineType. More...
 
new FiniteTransitionVariableModel LastTransition [get, set]
 Stores the last transition which occurred in an instance of the FiniteStateMachineType. More...
 
- Properties inherited from UnifiedAutomation.UaServer.StateMachineModel
StateVariableModel CurrentState [get, set]
 Stores the current state of an instance of the StateMachineType. More...
 
TransitionVariableModel LastTransition [get, set]
 Stores the last transition which occurred in an instance of the StateMachineType. More...
 
- Properties inherited from UnifiedAutomation.UaServer.ModelControllerBase
ModelHandle ModelHandle [get, set]
 Gets or sets the metadata handle. More...
 
object UserData [get, set]
 Gets or sets the user data. More...
 
- Properties inherited from UnifiedAutomation.UaServer.INotifyStatusCodeInfo
bool HasStatusCodes [get]
 true if no property has an explicit set status code. Hence when all status codes are implicit StatusCodes.Good. More...
 

Events

EventHandler
< StateMachineEventArgs< State?,
Transition?> > 
Switched
 Occurs when the SwitchToState method was called. More...
 
- Events inherited from UnifiedAutomation.UaServer.ModelControllerBase
PropertyChangedEventHandler PropertyChanged
 Occurs when a property value changes. More...
 
EventHandler
< PropertyChangeRequestedEventArgs
PropertyChangeRequested
 The event is emitted just before the value will be changed, and gives the observer the opportunity to reject or adjust (e.g. clamp) the property change by setting the PropertyChangeRequestedEventArgs.StatusCode and PropertyChangeRequestedEventArgs.Value properties. More...
 
EventHandler
< StatusCodeChangedEventArgs
StatusCodeChanged
 
- Events inherited from UnifiedAutomation.UaServer.INotifyPropertyChangeRequested
EventHandler
< PropertyChangeRequestedEventArgs
PropertyChangeRequested
 The property change request event. More...
 
- Events inherited from UnifiedAutomation.UaServer.INotifyStatusCodeInfo
EventHandler
< StatusCodeChangedEventArgs
StatusCodeChanged
 Occurs if the status code of a property was changed. More...
 

Additional Inherited Members

- Public Attributes inherited from UnifiedAutomation.UaServer.ModelControllerBase
bool HasStatusCodes => m_statusCodes != null && m_statusCodes.Count > 0
 
- Protected Member Functions inherited from UnifiedAutomation.UaServer.ModelControllerBase
void RaisePropertyChangedEvent ([CallerMemberName] string propertyName=null)
 Raises an property change event. More...
 
void RaisePropertyChangeRequestedEvent< T > (T value, [CallerMemberName] string propertyName=null)
 Called when the value of a property is supposed to be changed. More...
 
bool SetField< T > (ref T field, T value, [CallerMemberName] string propertyName=null)
 Sets the backing field to the new value, and triggers a property change event, if the value has changed. More...
 

Detailed Description

Defines a substate machine that represents an advanced Alarm filtering model.

The state model supports two types of Shelving: OneShotShelving and TimedShelving.The illustration includes the allowed transitions between the various substates. Shelving is an Operator initiated activity.

In OneShotShelving, a user requests that an Alarm be Shelved for its current Active state. This type of Shelving is typically used when an Alarm is continually occurring on a boundary (i.e. a Condition is jumping between High Alarm and HighHigh Alarm, always in the Active state). The One Shot Shelving will automatically clear when an Alarm returns to an inactive state. Another use for this type of Shelving is for a plant area that is shut down i.e. a long running Alarm such as a low level Alarm for a tank that is not in use. When the tank starts operation again the Shelving state will automatically clear.

In TimedShelving, a user specifies that an Alarm be shelved for a fixed time period. This type of Shelving is quite often used to block nuisance Alarms. For example, an Alarm that occurs more than ten times in a minute may get shelved for a few minutes.

In all states, the Unshelve can be called to cause a transition to the Unshelve state; this includes Un-shelving an Alarm that is in the TimedShelve state before the time has expired and the OneShotShelve state without a transition to an inactive state.

The “Time Expired” transition is simply a system generated transition that occurs when the time value defined as part of the “Timed Shelved Call” has expired. The “Any Transition Occurs” transition is also a system generated transition; this transition is generated when the Condition goes to an inactive state.

The ShelvedStateMachine includes a hierarchy of substates. It supports all transitions between Unshelved, OneShotShelved and TimedShelved.

This FiniteStateMachine supports three Active states; Unshelved, TimedShelved and OneShotShelved. It also supports six transitions.This FiniteStateMachine also supports three methods: UnifiedAutomation.UaServer.IShelvedStateMachineMethods.TimedShelve , UnifiedAutomation.UaServer.IShelvedStateMachineMethods.OneShotShelve and UnifiedAutomation.UaServer.IShelvedStateMachineMethods.Unshelve.

Member Enumeration Documentation

The enumeration representing the possible states of the state machine.

Enumerator
Unshelved 

The Unshelved state.

TimedShelved 

The TimedShelved state.

OneShotShelved 

The OneShotShelved state.

The enumeration representing the possible transitions of the state machine.

Enumerator
OneShotShelvedToTimedShelved 

Transition from State.OneShotShelved to State.TimedShelved.

OneShotShelvedToUnshelved 

Transition from State.OneShotShelved to State.Unshelved.

TimedShelvedToOneShotShelved 

Transition from State.TimedShelved to State.OneShotShelved.

TimedShelvedToUnshelved 

Transition from State.TimedShelved to State.Unshelved.

UnshelvedToOneShotShelved 

Transition from State.Unshelved to State.OneShotShelved.

UnshelvedToTimedShelved 

Transition from State.Unshelved to State.TimedShelved.

Constructor & Destructor Documentation

UnifiedAutomation.UaServer.ShelvedStateMachineModel.ShelvedStateMachineModel ( )

Initializes a new instance of the ShelvedStateMachineModel class.

UnifiedAutomation.UaServer.ShelvedStateMachineModel.ShelvedStateMachineModel ( ShelvedStateMachineModel  template,
DummyArgument  dummy = null 
)

Initializes a new instance of the ShelvedStateMachineModel class.

Parameters
templateThe template.
dummyDummy argument to enable writing own constructors that are called by the generated code.

Member Function Documentation

virtual StatusCode UnifiedAutomation.UaServer.ShelvedStateMachineModel.DispatchMethod ( RequestContext  context,
MethodHandle  methodHandle,
IList< Variant inputArguments,
List< StatusCode inputArgumentResults,
List< Variant outputArguments 
)
virtual

Dispatches the method.

Parameters
contextThe context.
methodHandleThe method handle.
inputArgumentsThe input arguments.
inputArgumentResultsThe input argument results.
outputArgumentsThe output arguments.
Returns
static LocalizedText UnifiedAutomation.UaServer.ShelvedStateMachineModel.GetLocalizedText ( State  state)
static

Retrieves a LocalizedText for the given state value.

Parameters
stateThe state to get the text.
Returns
The text.
static LocalizedText UnifiedAutomation.UaServer.ShelvedStateMachineModel.GetLocalizedText ( Transition  transition)
static

Retrieves a LocalizedText for the given transition value.

Parameters
transitionThe transition to get the text.
Returns
The transition.
virtual CallMethodEventHandler UnifiedAutomation.UaServer.ShelvedStateMachineModel.GetMethodDispatcher ( RequestContext  context,
NodeId  objectId,
NodeId  methodId 
)
virtual

Gets the method dispatcher.

Parameters
contextThe context.
objectIdThe object id.
methodIdThe method id.
Returns

Implements UnifiedAutomation.UaServer.IMethodDispatcher.

static QualifiedName UnifiedAutomation.UaServer.ShelvedStateMachineModel.GetName ( State  state)
static

Retrieves a QualifiedName for the given state value.

Parameters
stateThe state to get the name.
Returns
The name.
static QualifiedName UnifiedAutomation.UaServer.ShelvedStateMachineModel.GetName ( Transition  transition)
static

Retrieves a QualifiedName for the given transition value.

Parameters
transitionThe transition to get the name.
Returns
The name.
static NodeId UnifiedAutomation.UaServer.ShelvedStateMachineModel.GetNodeId ( State  state)
static

Retrieves the NodeId for the given state value.

Parameters
stateThe state to get the NodeId.
Returns
The NodeId.
static NodeId UnifiedAutomation.UaServer.ShelvedStateMachineModel.GetNodeId ( Transition  transition)
static

Retrieves the NodeId for the given transition value.

Parameters
transitionThe transition to get the NodeId.
Returns
The NodeId.
static IEnumerable<Transition> UnifiedAutomation.UaServer.ShelvedStateMachineModel.GetTransitions ( State  oldState,
State  newState 
)
static

A sequence of all possible transition for the given states.

Parameters
oldStateThe From state.
newStateThe To state.
Returns
A sequence of all possible transition for the given states. The sequence can be empty, but it will never be null.
void UnifiedAutomation.UaServer.ShelvedStateMachineModel.RaiseSwitchedEvent ( State oldState,
State state,
Transition transition 
)

Raises the Switched event.

virtual void UnifiedAutomation.UaServer.ShelvedStateMachineModel.SwitchToState ( State state,
Transition transition = null 
)
virtual

Switch to the given state.

Parameters
stateThe state.
transitionThe transition.

If the transition value is null the method will take the first transition that is possible. If there is no possible transition or if a transition was passed that is not possible for the old and new state combination, null will be assigned to the InternalTransition and FiniteStateMachineModel.LastTransition properties. It is up to the caller to avoid such situations.

A null value for the state will be translated to the specification conform status code StatusCodes.BadStateNotActive.

Member Data Documentation

State UnifiedAutomation.UaServer.ShelvedStateMachineModel.m_state
protected

The current state of the state machine.

Transition UnifiedAutomation.UaServer.ShelvedStateMachineModel.m_transition
protected

The last transition of the state machine.

Property Documentation

State UnifiedAutomation.UaServer.ShelvedStateMachineModel.InternalState
getprotected set

The FiniteStateMachineModel.CurrentState as the enumeration value.

Transition UnifiedAutomation.UaServer.ShelvedStateMachineModel.InternalTransition
getprotected set

The FiniteStateMachineModel.LastTransition as the enumeration value.

AlarmConditionModel UnifiedAutomation.UaServer.ShelvedStateMachineModel.ParentAlarm
getset

The containing alarm.

IShelvedStateMachineMethods UnifiedAutomation.UaServer.ShelvedStateMachineModel.ShelvedStateMachineMethods
getset

Gets or sets the ShelvedStateMachine methods.

The ShelvedStateMachine methods.

double UnifiedAutomation.UaServer.ShelvedStateMachineModel.UnshelveTime
getset

Specifies the remaining time in milliseconds until the Alarm automatically transitions into the Unshelved state.

For the TimedShelved state this time is initialised with the ShelvingTime argument of the TimedShelve method call. For the OneShotShelved state the UnshelveTime will be a constant set to the maximum Duration except if a MaxTimeShelved Property is provided.

Event Documentation

EventHandler<StateMachineEventArgs<State?, Transition?> > UnifiedAutomation.UaServer.ShelvedStateMachineModel.Switched

Occurs when the SwitchToState method was called.

Note, the event is also emitted when the state stays the same.


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