Controller Component Manager
This module implements component management for the MCCS controller.
- class ControllerComponentManager(*args: Any, **kwargs: Any)[source]
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: Iterable[str], station_trls: Iterable[str], subarray_beam_trls: Iterable[str], station_beam_trls: Iterable[str], logger: Logger, obs_command_timeout: int, communication_state_callback: Callable[[ska_control_model.CommunicationStatus], None], component_state_callback: Callable[[...], None]) None[source]
Initialise a new instance.
- Parameters:
subarray_trls – TRLS of all subarray devices
station_trls – TRLS of all station devices
subarray_beam_trls – TRLS of all subarray beam devices
station_beam_trls – TRLS of all station beam devices
obs_command_timeout – the default timeout for obs commands in seconds.
logger – the logger to be used by this object.
communication_state_callback – callback to be called when the status of the communications channel between the component manager and its component changes
component_state_callback – callback to be called when the component state changes
- allocate(task_callback: Callable | None = None, *, interface: str | None = None, subarray_id: int, subarray_beams: list[dict]) tuple[ska_control_model.TaskStatus, str][source]
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: :param interface: the schema version this is running against. :param subarray_id: int, ID of the subarray which requires allocation :param subarray_beams: list of dictionaries, each sepcifying a beam allocation :param task_callback: callback to signal end of command :return: A tuple containing a task status and a unique id
- get_health_trl(trl: str) ska_control_model.HealthState | None[source]
Return the health of a subdevice with given TRL.
- Parameters:
trl – TRL of device to return health of
- Returns:
health of device given by TRL
- Raises:
ValueError – if TRL is for an invalid device
- get_healths(device_type: str = 'all') dict[str, dict[str, Optional[str]]][source]
Return subdevice healths.
- Parameters:
device_type – the type of device to return the health state of its instances.
- 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: int) str[source]
Return a dictionary of the resources assigned to a given subarray.
- Parameters:
subarray_id – The subarray ID of the resources
- Returns:
json formatted dictionary
- off(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Turn off the MCCS subsystem.
- Parameters:
task_callback – Update task state, defaults to None
- Returns:
a TaskStatus and message
- on(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Turn on the MCCS subsystem.
- Parameters:
task_callback – Update task state, defaults to None
- Returns:
task status and message
- property power_state: ska_control_model.PowerState | None
Return my power state.
- Returns:
my power state
- release(subarray_id: int) tuple[ska_control_model.ResultCode, str][source]
Release a subarray’s resources.
- Parameters:
subarray_id – ID of the subarray which requires release
- Returns:
a result code and message
- release_all() tuple[ska_control_model.ResultCode, str][source]
Release all subarrays resources.
- Returns:
a result code and message
- restart_subarray(subarray_id: int, task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Restart an MCCS subarray.
- Parameters:
subarray_id – an integer subarray_id.
task_callback – Update task state, defaults to None
- Returns:
a task status and a message