CbfComponentManager Class

class ska_mid_cbf_mcs.base.component_manager.CbfComponentManager(*args: Any, **kwargs: Any)[source]

Bases: TaskExecutorComponentManager

A base component manager for SKA Mid.CBF MCS

This class exists to modify the interface of the ska_tango_base.executor.executor_component_manager.TaskExecutorComponentManager. The TaskExecutorComponentManager accepts max_queue_size keyword argument to determine limits on worker queue length, for the management of LRC threads.

Additionally, this provides optional arguments for attribute change event and HealthState updates, for a device to pass in its callbacks for push change events.

Finally, the TaskExecutorComponentManager inherits from BaseComponentManager, which accepts the keyword arguments communication_state_callback and component_state_callback, each with an analogous callback method in the SKABaseDevice (namely _communication_state_changed and _component_state_changed) used to drive the operational state (opState) model from the component manager.

start_communicating(*args: Any, admin_mode: ska_control_model.AdminMode, **kwargs: Any) None[source]

Thread for start_communicating operation.

stop_communicating(*args: Any, admin_mode: ska_control_model.AdminMode, **kwargs: Any) None[source]

Thread for stop_communicating operation.

task_abort_event_is_set(command_name: str, task_callback: Callable, task_abort_event: Event) bool[source]

Helper method for checking task abort event during command thread.

Parameters:
  • command_name – name of command for result message

  • task_callback – command tracker update_command_info callback

  • task_abort_event – task executor abort event

Returns:

True if abort event is set, otherwise False

results_callback(event_data: tango.EventData | None) None[source]

Callback for LRC command result events. All subdevices that may block our LRC thread with their own LRC execution have their longRunningCommandResult attribute subscribed to with this method as the change event callback.

Parameters:

event_data – Tango attribute change event data

issue_group_command(command_name: str, proxies: Iterable[tango.DeviceProxy], command_args: Any | Iterable[Any] | None = None, is_lrc: bool | None = True, partial_success: bool | None = False, check_on_fail: dict[str, callable] | None = None) dict[str, ska_control_model.ResultCode][source]

Helper function to issue commands to groups of devices. Important: all proxies provided must be able to execute the requested command.

Parameters:
  • command_name – name of command to be issued

  • proxies – iterable of device proxies

  • command_args – command argument to be supplied to all commands, or an iterable of separate command arguments for each command (defaults to None for commands with no arguments); requires separate arguments be provided for commands that take in array-like arguments, otherwise it will map a single iterable argument to multiple commands

  • is_lrc – True if command is long-running, otherwise False

  • partial_success – defaults to False, in which case an error will be logged if any command fails; set to True to only log a warning if any command fails but at least 1 succeeds

  • check_on_fail – dict containing attribute name(s) and evaluating function(s) to validate command success via attribute read should the command result fail initial validation

Returns:

dict of proxy command returns

update_device_health_state(health_state: ska_control_model.HealthState) None[source]

Handle a health state change. This is a helper method for use by subclasses.

Parameters:

health_state – the new health state of the component manager.

op_state_callback(event_data: tango.EventData | None) None[source]

Callback for state attribute events.

Parameters:

event_data – Tango attribute change event data

wait_for_blocking_states(target_state: tango.DevState, task_abort_event: Event | None = None) bool[source]

Wait for the number of anticipated state changes to be pushed by subordinate devices.

Parameters:
  • target_state – target state to wait for in all monitored op states

  • task_abort_event – Check for abort, defaults to None

Returns:

True if all state changes were successfully recorded, otherwise False

property is_communicating: bool

Return whether communication with the component is established.

SKA Mid.CBF MCS uses the more expressive communication_status for this, but this is still needed as a base classes hook.

Returns:

True if communication with the component is established, else False.

property is_communicating_disabled: bool

Return whether communication with the component is disabled.

SKA Mid.CBF MCS uses the more expressive communication_status for this, but this is still needed as a base classes hook.

Returns:

True if communication with the component is established, else False.

property power_state: ska_control_model.PowerState | None

Return the power state of this component manager.

Returns:

the power state of this component manager, if known.

property faulty: bool | None

Return whether this component manager is currently experiencing a fault.

Returns:

True if this component manager is currently experiencing a fault, else False.