Subarray Operational State Model

class ska_csp_lmc_common.subarray.model.op_state_model_subarray.SubarrayOpStateModel(op_state_init, op_state_changed_callback: Callable[[tango.DevState], None], logger=None)

Bases: OpStateModel

A simple operational state model that supports.

  • DevState.ON – when the component is powered on.

  • DevState.OFF – when the component is powered off.

  • DevState.STANDBY – when the component is low-power mode.

  • DevState.DISABLE – when the component is in OFFLINE administrative mode.

  • DevState.UNKNWON – when communication with the component is not established.

  • DevState.FAILED – when the component has failed

property op_state: tango.DevState

Return the operational state.

Returns:

the operational state state.

Return type:

DevState

evaluate_op_state() tango.DevState

Compute overall operational state of the CSP subarray device based on the fault and communication status of the subarray overall, together with the aggregation of the operational states of the subordinate sub- systems components.

Returns:

an overall operational state of the subarray.

Return type:

DevState

component_op_state_changed(component: Component, op_state: DevState | None) None

Handle change in the operational state of a CSP sub-system subarray/beam.

This is a callback hook, called by the EventManager when the operational state of a CSP sub-system subarray/beam changes.

Parameters:
  • component (Component) – the sub-system component whose operational state has changed

  • op_state (DevState) – the new operational state of the sub-system subarray/beam.

Subarray Health State Model

class ska_csp_lmc_common.subarray.model.health_state_model_subarray.SubarrayHealthModel(device_fqdn: str, init_state: ska_control_model.HealthState, health_state_callback: Callable[[ska_control_model.HealthState], None], callback: Callable[[str, Any], None], logger: Logger | None = None)

Bases: HealthStateModel

Health aggregation model for CSP subarray devices.

evaluate_from_snapshot(snap: Dict[str, ComponentSnapshot], *, now: float | None = None) ska_control_model.HealthState

Compute aggregated HealthState from snapshot.

Parameters:
  • snap – Snapshot of subsystem states.

  • now – Optional timestamp.

Returns:

Aggregated HealthState.

Subarray Observing State Model

class ska_csp_lmc_common.subarray.model.obs_state_model_subarray.SubarrayObsStateModel(obs_state_init: ska_control_model.ObsState, publish_callback: Callable[[ska_control_model.ObsState], None], logger: Logger | None = None, *, signal_callback: Callable[[ska_control_model.ObsState], None] | None = None)

Bases: ObsStateModel

ObsState model for CSP subarrays.

This model aggregates subsystem ObsStates and manages command- driven transitional states.

evaluate_states(component_states: dict) ska_control_model.ObsState

Aggregate component ObsStates and update the model state.

Parameters:

component_states – Mapping of components to ObsState.

Returns:

Current subarray ObsState.

perform_action(action: str) None

Handle command-driven ObsState transitions.

Actions follow the format ‘<command>_invoked’ or ‘<command>_completed’.

Parameters:

action – Action identifier string. action format: ‘<command>_invoked’ or ‘<command>_completed’

get_expected_obsstate(task_name: str) ska_control_model.ObsState

Retrieve the expected final obsstate after a correct command completion.