PST Observation State Model

This module provides the PST overrides of the ObsStateModel.

There is known tech debt in PST in regards to the fact that it was initially developed using a sub-array model and not an obs device. While the BEAM.MGMT uses a CspSubElementObsStateModel and CspSubElementObsStateMachine this does not work for the sub-devices like SMRB.MGMT, RECV.MGMT, and DSP.MGMT which still have a resourcing step and a configuring step. To simplify the resetting as part of AT3-425 the default ObsStateMachine needs to be overriden to allow for the “unresourced” (sic - SKA term) state.

class ska_pst_lmc.component.obs_state_model.PstObsStateMachine(callback: Optional[Callable] = None, **extra_kwargs: Any)[source]

State machine for observation state.

This class to be used in place of the ska_control_model._ObsStateMachine state machine to allow for the specifics of the state machine needed for the PST Process sub-devices (i.e. SMRB.MGMT, DSP.MGMT, RECV.MGMT, etc)

This is based off the SKA ObsStateModel

The full list of supported states are:

  • EMPTY: the PST subdevice has no configuration

  • RESOURCING_EMPTY: the PST subdevice is unresourced, but performing a configure beam operation

  • RESOURCING_IDLE: the PST subdevice is beam configured, and is currently finishing the configure beam operation

  • IDLE: the PST subdevice is beam configured but not scan configured

  • CONFIGURING_IDLE: the PST subdevice is beam configured but not scan configured; it is currently performing a configure scan operation

  • CONFIGURING_READY: the PST subdevice is scan configured; and is currently finishing the configure scan operation

  • READY: the PST subdevice is scan configured and waiting for a start scan request

  • SCANNING: the PST subdevice is scanning

  • ABORTING: the PST subdevice is aborting

  • ABORTED: the PST subdevice has aborted

  • RESETTING: the PST subdevice is resetting from an ABORTED or FAULT state back to IDLE

  • FAULT: the PST subdevice has encountered an observation fault.

A diagram of the state machine is shown below. Reflexive transitions and transitions to FAULT obs state are omitted to simplify the diagram.

@startuml PST Subdevice State Machine
EMPTY: The PST subdevice has no configuration
RESOURCING: The PST subdevice is performing a configure beam operation
IDLE: The PST subdevice is beam configured but has no scan configuration
CONFIGURING: The PST subdevice is performing a configure scan operation
READY: The PST subdevice is configured for a scan
SCANNING: The PST subdevice is scanning
ABORTING: The PST subdevice is aborting
ABORTED: The PST subdevice has aborted
RESETTING: The PST subdevice is resetting to EMPTY\nfrom FAULT or ABORTED state
FAULT: The PST subdevice has faulted

EMPTY -down-> RESOURCING: assign_invoked
RESOURCING -up-> EMPTY: assign_completed
RESOURCING -up-> EMPTY: release_completed
RESOURCING -down-> IDLE: assign_completed
RESOURCING -down-> IDLE: release_completed
IDLE -up-> RESOURCING: assign_invoked
IDLE -up-> RESOURCING: release_invoked
IDLE -down-> CONFIGURING: configure_invoked
IDLE -left-> ABORTING: abort_invoked
CONFIGURING -up-> IDLE: configure_completed
CONFIGURING -left-> ABORTING: abort_invoked
CONFIGURING -down-> READY: configure_completed
CONFIGURING -left-> ABORTING: abort_invoked
READY -up-> CONFIGURING: configure_invoked
READY -up-> IDLE: component_unconfigured
READY -down-> SCANNING: component_scanning
READY -left-> ABORTING: abort_invoked
SCANNING -up-> READY: component_not_scanning
SCANNING -left-> ABORTING: abort_invoked
ABORTING -up-> ABORTED: abort_completed
ABORTED -up-> RESETTING: obsreset_invoked
RESETTING -down-> ABORTING: abort_invoked
RESETTING -right-> EMPTY: obsreset_completed
[*] -up-> FAULT: component_obsfault\n(from any state)
FAULT -up-> RESETTING: obsreset_invoked
@enduml

Diagram of the PST subdevice state machine

Initialise the model.

Parameters
  • callback (callable) – A callback to be called when the state changes

  • extra_kwargs – Additional keywords arguments to pass to super class initialiser (useful for graphing)