class UaFiniteStateMachine:
Constructor: UaFiniteStateMachine(name, states, initial, write_func, ...)
Base class for all finite state machine OPC-UA representations based on transitions library.
| Method | __init__ |
Undocumented |
| Method | add |
Add the given transition to the internal state machine. |
| Async Method | init |
Asynchronous initialization of the instance. |
| Async Method | try |
Try to trigger an event in the internal state machine. |
| Class Variable | ua |
Undocumented |
| Instance Variable | before |
Undocumented |
| Instance Variable | exclude |
Undocumented |
| Instance Variable | logger |
Undocumented |
| Instance Variable | name |
Undocumented |
| Instance Variable | represent |
Undocumented |
| Instance Variable | represent |
Undocumented |
| Instance Variable | state |
Undocumented |
| Instance Variable | transition |
Undocumented |
| Instance Variable | ua |
Maps the state name to an OPC UA node ID representing the state in the OPC UA address space. |
| Instance Variable | ua |
Maps the transition name to an OPC UA node ID representing the transition in the OPC UA address space. |
| Instance Variable | ua |
OPC UA node 'StateMachine' representing this instance. |
| Instance Variable | ua |
OPC UA node 'AvailableStates'. |
| Instance Variable | ua |
OPC UA node 'AvailableTransitions'. |
| Instance Variable | ua |
Undocumented |
| Instance Variable | ua |
OPC UA node 'Id' property of the 'CurrentState' node. |
| Instance Variable | ua |
OPC UA node 'CurrentState' of the state machine. |
| Property | current |
Undocumented |
| Async Method | _add |
Undocumented |
| Async Method | _after |
Handle callback from state machine after a state changes. Used to update the OPC-UA representation. |
| Async Method | _init |
Add ua_node_id attribute to given state. |
| Async Method | _init |
Undocumented |
| Async Method | _init |
Add all states to OPC-UA state machine representation and sets the initial state of the FSM. |
| Async Method | _init |
Add all transitions to OPC-UA state machine representation. |
| Instance Variable | _internal |
Undocumented |
| Instance Variable | _write |
Undocumented |
str, states: Sequence[ Enum], initial: AsyncState | Enum, write_func: Callable[ [ Enum], Awaitable[ None]], represent_transitions: bool = False, represent_states: bool = False, exclude_states: Sequence[ Enum] | None = None):
¶
Undocumented
Add the given transition to the internal state machine.
For documentation of available keyword arguments, please look into transitions.Machine.add_transition().
Asynchronous initialization of the instance.
Adds a new OPC-UA object to the given parent node of some OPC-UA StateMachineType. Adds sub OPC-UA nodes representing all states of the internal state machine.
| Parameters | |
stateNode | OPC-UA node of the state machine (instantiated from respective types). |
stateNode | None | #TODO OPC UA node of the state machine type definition; normally not needed since node has method 'read_type_definition()', parameter used as workaround if reason is expected, None is used as default cause lock is no opc ua state machine |
Try to trigger an event in the internal state machine.
Handles expected exceptions due to wrong state and UaStatusCodeError exceptions due to unsatisfied conditions.
| Parameters | |
user:UserProtocol | None | User which triggers the event. |
triggerstr | Name of the trigger function. |
| Returns | |
ua.StatusCode | Returns either an OPC-UA status code or what the provided success_func returns. |
Maps the transition name to an OPC UA node ID representing the transition in the OPC UA address space.
Add ua_node_id attribute to given state.
This is achieved by adding a OPC-UA node representing the given state to the OPC-UA representation of the state machine.