Obs State Model
This module specifies CSP SubElement Observing state machine.
It comprises:
an underlying state machine:
CspSubElementObsStateMachinea
CspSubElementObsStateModelthat maps the underlying state machine state to a value of theska_control_model.ObsStateenum.
- class CspSubElementObsStateMachine(callback: Callable | None = None, **extra_kwargs: Any)
The observation state machine used by a generic CSP sub-element ObsDevice.
Compared to the SKA Observation State Machine, it implements a smaller number of states, number that can be further decreased depending on the necessities of the different sub-elements.
The implemented states are:
IDLE: the device is unconfigured.
CONFIGURING_IDLE: the device in unconfigured, but configuration is in progress.
CONFIGURING_READY: the device in configured, and configuration is in progress.
READY: the device is configured and is ready to perform observations
SCANNING: the device is performing the observation.
ABORTING: the device is processing an abort.
TODO: Need to understand if this state is really required by the observing devices of any CSP sub-element.
ABORTED: the device has completed the abort request.
FAULT: the device component has experienced an error from which it can be recovered only via manual intervention invoking a reset command that force the device to the base state (IDLE).
The actions supported divide into command-oriented actions and component monitoring actions.
The command-oriented actions are:
configure_invoked and configure_completed: bookending the Configure() command, and hence the CONFIGURING state
abort_invoked and abort_completed: bookending the Abort() command, and hence the ABORTING state
obsreset_invoked and obsreset_completed: bookending the ObsReset() command, and hence the OBSRESETTING state
end_invoked, scan_invoked, end_scan_invoked: these result in reflexive transitions, and are purely there to indicate states in which the End(), Scan() and EndScan() commands are permitted to be run
The component-oriented actions are:
component_obsfault: the monitored component has experienced an observation fault
component_unconfigured: the monitored component has become unconfigured
component_configured: the monitored component has become configured
component_scanning: the monitored component has started scanning
component_not_scanning: the monitored component has stopped scanning
A diagram of the state machine is shown below. Reflexive transitions and transitions to FAULT obs state are omitted to simplify the diagram.
Diagram of the CSP subelement obs state machine
Initialise the model.
- Parameters:
callback – A callback to be called when the state changes
extra_kwargs – Additional keywords arguments to pass to super class initialiser (useful for graphing)
- class CspSubElementObsStateModel(*args: Any, **kwargs: Any)
Implements the observation state model for a generic CSP sub-element ObsDevice.
Compared to the SKA observation state model, it implements a smaller number of states, number that can be further decreased depending on the necessities of the different sub-elements.
The implemented states are:
IDLE: the device is unconfigured.
CONFIGURING: transitional state to report device configuration is in progress.
TODO: Need to understand if this state is really required by the observing devices of any CSP sub-element.
READY: the device is configured and is ready to perform observations
SCANNING: the device is performing the observation.
ABORTING: the device is processing an abort.
TODO: Need to understand if this state is really required by the observing devices of any CSP sub-element.
ABORTED: the device has completed the abort request.
RESETTING: the device is resetting from an ABORTED or FAULT state back to IDLE
FAULT: the device component has experienced an error from which it can be recovered only via manual intervention invoking a reset command that force the device to the base state (IDLE).
Initialise the model.
- Parameters:
logger – the logger to be used by this state model.
callback – A callback to be called when a transition causes a change to device obs_state