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 devicessubarray_beam_trls (
Iterable
[str
]) – TRLS of all subarray beam devicesstation_beam_trls (
Iterable
[str
]) – TRLS of all station beam deviceslogger (
Logger
) – the logger to be used by this object.max_workers (
int
) – nos. of worker threadscommunication_state_callback (
Callable
[[CommunicationStatus
],None
]) – callback to be called when the status of the communications channel between the component manager and its component changescomponent_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:
- 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:
- 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.
- off(task_callback=None)
Turn off the MCCS subsystem.
- on(task_callback=None)
Turn on the MCCS subsystem.
- 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:
- Returns:
a result code and message
- release_all()
Release all subarrays resources.
- Return type:
- Returns:
a result code and message
- restart_subarray(subarray_id, task_callback=None)
Restart an MCCS subarray.