Operating State
- class ska_control_model.OpStateModel(logger, callback=None, state_machine_factory=None)
This class implements the state model for operational state (“opState”).
The model supports the following states, represented as values of the
tango.DevState
enum.INIT: the control system is initialising.
DISABLE: the control system has been told not to monitor the system under control.
UNKNOWN: the control system is monitoring (or at least trying to monitor) the system under control, but is unable to determine its state.
OFF: the control system is monitoring the system under control, which is powered off.
STANDBY: the control system is monitoring the system under control, which is in low-power standby mode.
ON: the control system is monitoring the system under control, which is turned on.
FAULT: the control system is monitoring the system under control, which has failed or is in an inconsistent state.
The actions supported are:
init_invoked: the control system has started initialising.
init_completed: the control system has finished initialising.
component_disconnected: the control system his disconnected from the system under control (for example because admin mode was set to OFFLINE). Note, this action indicates a deliberate, control-system-initiated, disconnect; a lost connection would be indicated by a “component_unknown” action.
component_unknown: the control system is unable to determine the state of the system under control.
component_off: the system under control has been switched off
component_standby: the system under control has switched to low-power standby mode
component_on: the system under control has been switched on.
component_fault: the system under control has experienced a fault.
component_no_fault: the system under control has stopped experiencing a fault.
A diagram of the operational state model, as implemented, is shown below.
The following hierarchical diagram is more explanatory; however note that the implementation does not use a hierarchical state machine.
- __init__(logger, callback=None, state_machine_factory=None)
Initialise the operational state model.
- Parameters:
logger (
Logger
) – the logger to be used by this state model.callback (
Optional
[Callable
[[Optional
[DevState
]],None
]]) – A callback to be called when the state machine for op_state reports a change of statestate_machine_factory (
Optional
[Callable
[...
,LockedMachine
]]) – a callable that returns a state machine for this model to use
- __weakref__
list of weak references to the object (if defined)
- is_action_allowed(action, raise_if_disallowed=False)
Return whether a given action is allowed in the current state.
- Parameters:
- Raises:
StateModelError – if the action is unknown to the state machine
- Return type:
- Returns:
whether the action is allowed in the current state
- property op_state: tango.DevState
Return the op state.
- Returns:
the op state of this state model