Controller Component Manager

This module implements component management for the MCCS controller.

class ControllerComponentManager(subarray_trls, station_trls, subarray_beam_trls, station_beam_trls, logger, max_workers, communication_state_callback, component_state_callback)

A component manager for an MCCS controller.

This component manager has three jobs:

  • Monitoring of the devices in the MCCS subsystem

  • Powering the MCCS subsystem off and on

  • Allocating resources to subarrays

__init__(subarray_trls, station_trls, subarray_beam_trls, station_beam_trls, logger, max_workers, communication_state_callback, component_state_callback)

Initialise a new instance.

Parameters:
  • subarray_trls (Iterable[str]) – TRLS of all subarray devices

  • station_trls (Iterable[str]) – TRLS of all station devices

  • subarray_beam_trls (Iterable[str]) – TRLS of all subarray beam devices

  • station_beam_trls (Iterable[str]) – TRLS of all station beam devices

  • logger (Logger) – the logger to be used by this object.

  • max_workers (int) – nos. of worker threads

  • communication_state_callback (Callable[[CommunicationStatus], None]) – callback to be called when the status of the communications channel between the component manager and its component changes

  • component_state_callback (Callable[..., None]) – callback to be called when the component state changes

allocate(task_callback=None, *, interface=None, subarray_id, subarray_beams)

Allocate and distribute a set of unallocated MCCS resources to a subarray.

The kwargs argument specifies the overall sub-array composition in terms of which stations should be allocated to the specified subarray_beam. It contains: :type interface: Optional[str] :param interface: the schema version this is running against. :type subarray_id: int :param subarray_id: int, ID of the subarray which requires allocation :type subarray_beams: list[dict] :param subarray_beams: list of dictionaries, each sepcifying a beam allocation :type task_callback: Optional[Callable] :param task_callback: callback to signal end of command :rtype: tuple[TaskStatus, str] :return: A tuple containing a task status and a unique id

get_health_trl(trl)

Return the health of a subdevice with given TRL.

Parameters:

trl (str) – TRL of device to return health of

Return type:

Optional[HealthState]

Returns:

health of device given by TRL

Raises:

ValueError – if TRL is for an invalid device

get_healths(device_type='all')

Return subdevice healths.

Parameters:

device_type (str) – the type of device to return the health state of its instances.

Return type:

dict[str, dict[str, Optional[str]]]

Returns:

dictionary of [device_type: [TRL : HealthState]] for each device of that device type, or all devices if called without an argument.

Raises:

ValueError – if device_type is not a valid device type.

get_resources(subarray_id)

Return a dictionary of the resources assigned to a given subarray.

Parameters:

subarray_id (int) – The subarray ID of the resources

Return type:

str

Returns:

json formatted dictionary

off(task_callback=None)

Turn off the MCCS subsystem.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a TaskStatus and message

on(task_callback=None)

Turn on the MCCS subsystem.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

task status and message

property power_state: ska_control_model.PowerState | None

Return my power state.

Returns:

my power state

release(subarray_id)

Release a subarray’s resources.

Parameters:

subarray_id (int) – ID of the subarray which requires release

Return type:

tuple[ResultCode, str]

Returns:

a result code and message

release_all()

Release all subarrays resources.

Return type:

tuple[ResultCode, str]

Returns:

a result code and message

restart_subarray(subarray_id, task_callback=None)

Restart an MCCS subarray.

Parameters:
  • subarray_id (int) – an integer subarray_id.

  • task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and a message

standby(task_callback=None)

Put the MCCS subsystem in standby mode.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

task status and message

start_communicating()

Establish communication with the station components.

Return type:

None

stop_communicating()

Break off communication with the station components.

Return type:

None