Subrack Component Manager

This module implements component management for subracks.

class SubrackComponentManager(subrack_ip, subrack_port, logger, communication_state_changed_callback, component_state_changed_callback, update_rate=5.0, _driver=None, _initial_power_state=ska_control_model.PowerState.ON, _initial_fail=False)

A component manager for an subrack (simulator or driver) and its power supply.

__init__(subrack_ip, subrack_port, logger, communication_state_changed_callback, component_state_changed_callback, update_rate=5.0, _driver=None, _initial_power_state=ska_control_model.PowerState.ON, _initial_fail=False)

Initialise a new instance.

Parameters:
  • subrack_ip (str) – the IP address of the subrack

  • subrack_port (int) – the subrack port

  • logger (Logger) – a logger for this object to use

  • communication_state_changed_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_changed_callback (Callable[..., None]) – callback to be called when the component state changes

  • update_rate (float) – how often updates to attribute values should be provided. This is not necessarily the same as the rate at which the instrument is polled. For example, the instrument may be polled every 0.1 seconds, thus ensuring that any invoked commands or writes will be executed promptly. However, if the update_rate is 5.0, then routine reads of instrument values will only occur every 50th poll (i.e. every 5 seconds).

  • _driver (Optional[SubrackDriver]) – for testing only, we can inject a driver rather then letting the component manager create its own. If provided, this overrides driver-specific arguments such as the IP and port.

  • _initial_power_state (PowerState) – for testing only, we can set the initial power state of the simulated subrack power supply. If not provided, the default is ON, since all our current facilities with a real hardware subrack do not yet allow it to be powered on and off.

  • _initial_fail (bool) – for testing only, we can set the simulated subrack power supply to fail.

set_power_supply_fan_speed(fan_number, speed, task_callback=None)

Set the target speed of a power supply fan.

Parameters:
  • fan_number (int) – one-based number of the fan to be set.

  • speed (float) – speed setting for the fan.

  • task_callback (Optional[Callable]) – callback to be called when the status of the command changes

Return type:

tuple[TaskStatus, str]

Returns:

the task status and a human-readable status message

set_subrack_fan_mode(fan_number, mode, task_callback=None)

Set the target speed mode of a subrack fan.

Parameters:
  • fan_number (int) – one-based number of the fan to be set.

  • mode (FanMode) – speed mode setting for the fan.

  • task_callback (Optional[Callable]) – callback to be called when the status of the command changes

Return type:

tuple[TaskStatus, str]

Returns:

the task status and a human-readable status message

set_subrack_fan_speed(fan_number, speed, task_callback=None)

Set the target speed of a subrack fan.

Parameters:
  • fan_number (int) – one-based number of the fan to be set.

  • speed (float) – speed setting for the fan.

  • task_callback (Optional[Callable]) – callback to be called when the status of the command changes

Return type:

tuple[TaskStatus, str]

Returns:

the task status and a human-readable status message

turn_off_tpm(tpm_number, task_callback=None)

Turn a TPM off.

Parameters:
  • tpm_number (int) – (one-based) number of the TPM to turn off.

  • task_callback (Optional[Callable]) – callback to be called when the status of the command changes

Return type:

tuple[TaskStatus, str]

Returns:

the task status and a human-readable status message

turn_off_tpms(task_callback=None)

Turn all TPMs off.

Parameters:

task_callback (Optional[Callable]) – callback to be called when the status of the command changes

Return type:

tuple[TaskStatus, str]

Returns:

the task status and a human-readable status message

turn_on_tpm(tpm_number, task_callback=None)

Turn a TPM on.

Parameters:
  • tpm_number (int) – (one-based) number of the TPM to turn on.

  • task_callback (Optional[Callable]) – callback to be called when the status of the command changes

Return type:

tuple[TaskStatus, str]

Returns:

the task status and a human-readable status message

turn_on_tpms(task_callback=None)

Turn all TPMs on.

Parameters:

task_callback (Optional[Callable]) – callback to be called when the status of the command changes

Return type:

tuple[TaskStatus, str]

Returns:

the task status and a human-readable status message