Event Manager

class ska_csp_lmc_common.event.EventManager(device_type: str, task_callback: Callable, health_model: HealthStateModel, op_state_model: OpStateModel, obs_state_supervisor: CspObservationSupervisor, health_supervisor, max_queue_size: int | None = 100, logger: Logger | None = None)

Bases: BaseEventManager

Aggregator class to manage the event subscriptions.

__init__(device_type: str, task_callback: Callable, health_model: HealthStateModel, op_state_model: OpStateModel, obs_state_supervisor: CspObservationSupervisor, health_supervisor, max_queue_size: int | None = 100, logger: Logger | None = None)

Initialize the EventManager for the current device.

Handles the subscription and un-subscription of attributes on the CSP sub-system components. It also performs the aggregation of tha main attributes (State, healthState and obsState) of the CSP subordinate sub-systems to evaluate the state of the CSP as a whole.

Parameters:

logger – The device or python logger if default is None.

_process_event(evt: CspEvent) None

Handle the event fetched from the queue.

Parameters:

evt – an object with the event data

_evaluate_csp_state(evt: CspEvent) None

Evaluate the CSP Device State as aggregation of the state of the subordinate components.

It also re-evaluates the CSP Device healthState that can be affected by the change in the state of one or more CSP sub-system components.

This method relies on the device OpStateModel to perform the aggregation of the CSP sub-systems operational states.

Parameters:

evt – an object containing the event data.

_evaluate_csp_obsstate(evt: CspEvent) None

Evaluate the CSP Device observing state as aggregation of the observing state of the CSP subordinate sub-systems.

This method relies on the device ObsStateModel to perform the aggregation of the CSP sub-systems observing states.

Parameters:

evt – the CspEvent received from a subordinate component

_evaluate_csp_adminmode(evt: CspEvent) None

Evaluate CSP admin mode updates from subordinate components.

_evaluate_csp_healthstate(evt: CspEvent) None

Evaluate the CSP Device health state as aggregation of the health state of the CSP subordinate sub-systems.

This method relies on the health supervisor to merge forwarded subsystem healthInfo into the CSP device healthInfo.

Parameters:

evt – the CspEvent received from a subordinate component

_evaluate_csp_healthinfo(evt: CspEvent) None

Evaluate the CSP Device health state info as aggregation of subordinate subsystem health state info.

This method relies on the device HealthStateModel to perform the aggregation of the CSP sub-systems health values.

Parameters:

evt – the CspEvent received from a subordinate component

_update_subsystem_attribute(evt: CspEvent)

After an event on a subsystem, update the corresponding attribute on the device

Parameters:

evt – the CspEvent received from a subordinate component