PowerSwitchSimulator

class ska_mid_cbf_mcs.power_switch.power_switch_simulator.PowerSwitchSimulator(model: str, logger: Logger)[source]

Bases: object

A simulator for the power switch.

Parameters:
  • model – Name of the power switch model

  • logger – a logger for this object to use

property num_outlets: int

Get number of outlets present in this power switch.

Returns:

number of outlets

property is_communicating: bool

Returns whether or not the power switch can be communicated with.

Returns:

simulator always returns True

get_outlet_power_state(outlet: str) PowerState[source]

Get the power state of a specific outlet.

Parameters:

outlet – outlet ID

Returns:

power state of the outlet

Raises:

AssertionError – if outlet ID is out of bounds

turn_on_outlet(outlet: str) tuple[ska_control_model.result_code.ResultCode, str][source]

Turn on a specific outlet.

Parameters:

outlet – outlet ID to turn on

Returns:

a tuple containing a return code and a string message indicating status

Raises:

AssertionError – if outlet ID is out of bounds

turn_off_outlet(outlet: str) tuple[ska_control_model.result_code.ResultCode, str][source]

Turn off a specific outlet.

Parameters:

outlet – outlet ID to turn off

Returns:

a tuple containing a return code and a string message indicating status

Raises:

AssertionError – if outlet ID is out of bounds

get_outlet_list() list[ska_mid_cbf_mcs.power_switch.pdu_common.Outlet][source]

Returns a list of 8 outlets, containing their name and current state. The current state is always set to OFF.

Returns:

list of all the outlets available in this power switch