Decision

class ska_csp_lmc_common.observation.consistency_policy.Decision(final_state: ska_control_model.ObsState, fault_msg: str | None = None, hard_fault: bool = False, immediate_publish: bool = False, severity: Severity | None = None)

Bases: object

Represents the result of a policy evaluation.

Parameters:
  • final_state – The target observation state for the resource.

  • fault_msg – Optional message describing the cause of a fault.

  • hard_fault – If True, triggers a component fault in the model.

  • immediate_publish – If True, bypasses the debounce mechanism.

Policy Protocol

class ska_csp_lmc_common.observation.consistency_policy.ScanConsistencyPolicy(*args, **kwargs)

Bases: Protocol

Protocol for evaluating the consistency of subsystem observation states.

Implementations define the logic to determine if the collective state of subsystems warrants a state transition or a fault declaration.

evaluate(aggregated: ska_control_model.ObsState, obs_modes: List[ska_control_model.ObsMode], subsystems: Dict[str, ska_control_model.ObsState], previous_state: ska_control_model.ObsState | None = None) Decision

Evaluate current subsystem states to reach a decision.

Parameters:
  • aggregated – The current overall observation state.

  • obs_modes – List of active observation modes.

  • subsystems – Mapping of subsystem names to their ObsState.

  • previous_state – The previously published aggregated ObsState.

Returns:

A Decision object containing the evaluation outcome.

_abc_impl = <_abc._abc_data object>
_is_protocol = True
_is_runtime_protocol = True