Subrack Device

@startuml

class MccsSubrack {
  +SubrackIp
  +SubrackPort
  +TileFQDNs
  -_are_tpms_on
  -_health_state
  +hardware_manager
  +IsTpmOn()
  +PowerDownTpms()
  +PowerOffTpm()
  +PowerOnTpm()
  +PowerUpTpms()
  +SetPowerSupplyFanSpeed()
  +SetSubrackFanMode()
  +SetSubrackFanSpeed()
  -_update_health_state()
  +always_executed_hook()
  +areTpmsOn()
  +are_tpms_on_changed()
  +backplaneTemperatures()
  +boardCurrent()
  +boardTemperatures()
  +cpldPllLocked()
  +delete_device()
  +health_changed()
  +init_command_objects()
  +init_device()
  +is_IsTpmOn_allowed()
  +is_PowerDownTpms_allowed()
  +is_PowerOffTpm_allowed()
  +is_PowerOnTpm_allowed()
  +is_PowerUpTpms_allowed()
  +powerSupplyCurrents()
  +powerSupplyFanSpeeds()
  +powerSupplyPowers()
  +powerSupplyVoltages()
  +simulationMode()
  +subrackFanMode()
  +subrackFanSpeeds()
  +subrackFanSpeedsPercent()
  +subrackPllLocked()
  +subrackTimestamp()
  +tpmCount()
  +tpmCurrents()
  +tpmPowers()
  +tpmPresent()
  +tpmSupplyFault()
  +tpmTemperatures()
  +tpmVoltages()
}

class SKABaseDevice {


}

class SubrackHardwareManager {
  -_are_tpms_on
  -_are_tpms_on_change_callback
  +backplane_temperatures
  +bay_count
  +board_current
  +board_temperatures
  +cpld_pll_locked
  +power_supply_currents
  +power_supply_fan_speeds
  +power_supply_powers
  +power_supply_voltages
  +subrack_fan_modes
  +subrack_fan_speeds
  +subrack_fan_speeds_percent
  +subrack_pll_locked
  +subrack_timestamp
  +tpm_count
  +tpm_currents
  +tpm_powers
  +tpm_present
  +tpm_supply_fault
  +tpm_temperatures
  +tpm_voltages
  +__init__()
  -_connect()
  -_update_are_tpms_on()
  +are_tpms_on()
  +connect()
  +is_tpm_on()
  +poll()
  +set_power_supply_fan_speed()
  +set_subrack_fan_modes()
  +set_subrack_fan_speed()
  +turn_off_tpm()
  +turn_off_tpms()
  +turn_on_tpm()
  +turn_on_tpms()
}

class SimulableHardwareManager {


}

class OnOffHardwareManager {


}

class SubrackHardwareFactory {
  -_logger
  -_subrack_ip
  -_subrack_port
  -_tpm_count
  +__init__()
  -_create_driver()
  -_create_static_simulator()
}

class SimulableHardwareFactory {


}
SKABaseDevice <|-- MccsSubrack
SimulableHardwareManager <|-- SubrackHardwareManager
OnOffHardwareManager <|-- SubrackHardwareManager
SimulableHardwareFactory <|-- SubrackHardwareFactory

@enduml

This module provides a Tango device for an SPS subrack.

class MccsSubrack(*args, **kwargs)

A Tango device for monitor and control of an SPS subrack.

PowerDownTpms()

Power down all TPMs.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purposes only.

PowerOffTpm(tpm_number)

Power down a TPM.

Parameters:

tpm_number (int) – the logical id of the TPM to power down

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purposes only.

PowerOnTpm(tpm_number)

Power up a TPM.

Parameters:

tpm_number (int) – the logical id of the TPM to power up

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purposes only.

PowerPduPortOff(port_number)

Turn the selected pdu port off.

Parameters:

port_number (int) – pdu port number

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

PowerPduPortOn(port_number)

Turn the selected pdu port on.

Parameters:

port_number (int) – pdu port number

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

PowerUpTpms()

Power up all TPMs.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purposes only.

ScheduleOff()

Turn self off.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

ScheduleOn()

Turn self on.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

SetPowerSupplyFanSpeed(power_supply_fan_id, speed_percent)

Set the selected power supply fan speed.

A json dictionary with mandatory keywords

Parameters:
  • power_supply_fan_id (int) – (int) power supply fan id from 1 to 2

  • speed_percent (int) – (int) fan speed in percent

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

SetSubrackFanMode(fan_id, mode)

Set the selected subrack backplane fan mode.

A json dictionary with mandatory keywords

Parameters:
  • fan_id (int) – (int) fan id from 1 to 4

  • mode (FanMode) – (int) mode: 0=MANUAL, 1=AUTO

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

SetSubrackFanSpeed(subrack_fan_id, speed_percent)

Set the selected subrack backplane fan speed.

A json dictionary with mandatory keywords

Parameters:
  • subrack_fan_id (int) – (int) fan id from 1 to 4

  • speed_percent (int) – (int) fan speed in percent

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

UpdateHealthAttributes()

Request the subrack driver to poll the health status attributes.

Return type:

TaskFunctionType

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purposes only.

property UseAttributesForHealth

Use the attribute quality factor in health. ADR-115.

__init__(*args, **kwargs)

Initialise this device object.

Parameters:
  • args (Any) – positional args to the init

  • kwargs (Any) – keyword args to the init

backplaneTemperatures()

Handle a Tango attribute read of the subrack backplane temperature.

Two values are returned, respectively for the first (bays 1-4) and second (bays 5-8) halves of the backplane.

Return type:

Optional[list[float]]

Returns:

the backplane temperatures. When communication with the subrack is not established, this returns none.

boardCurrent()

Handle a Tango attribute read of subrack management board current.

Total current provided by the two power supplies.

Return type:

Optional[list[float]]

Returns:

total board current, in a list of length 1. When communication with the subrack is not established, this returns none.

boardTemperatures()

Handle a Tango attribute read of the subrack board temperature.

Two values are returned.

Return type:

Optional[list[float]]

Returns:

the board temperatures. When communication with the subrack is not established, this returns none.

cpldPllLocked()

Handle a Tango attribute read of the subrack CPLD PLL locked attribute.

Return type:

Optional[bool]

Returns:

whether the CPLD PLL is locked.

create_component_manager()

Create and return a component manager for this device.

Return type:

SubrackComponentManager

Returns:

a component manager for this device.

delete_device()

Delete the device.

Return type:

None

healthModelParams(argin)

Set the params for health transition rules.

Parameters:

argin (str) – JSON-string of dictionary of health states

Return type:

None

healthReport()

Get the health report.

Return type:

str

Returns:

the health report.

healthStatus()

Handle a dictionary of all available monitoring points.

Return type:

Optional[str]

Returns:

A dictionary containing all the monitoring points

init_device()

Initialise the device.

This is overridden here to change the Tango serialisation model.

Return type:

None

property internalVoltages1V1: float

Subrack internal 1V1 supply voltage in Volts.

Unit:

Volt

property internalVoltages1V5: float

Subrack internal 1V5 supply voltage in Volts.

Unit:

Volt

property internalVoltages2V5: float

Subrack internal 2V5 supply voltage in Volts.

Unit:

Volt

property internalVoltages2V8: float

Subrack internal 2V8 supply voltage in Volts.

Unit:

Volt

property internalVoltages3V: float

Subrack internal 3V supply voltage in Volts.

Unit:

Volt

property internalVoltages3V3: float

Subrack internal 3V3 supply voltage in Volts.

Unit:

Volt

property internalVoltages5V: float

Subrack internal 5V supply voltage in Volts.

Unit:

Volt

property internalVoltagesARM: float

Subrack internal ARM supply voltage in Volts.

Unit:

Volt

property internalVoltagesCORE: float

Subrack internal CORE supply voltage in Volts.

Unit:

Volt

property internalVoltagesDDR: float

Subrack internal DDR supply voltage in Volts.

Unit:

Volt

property internalVoltagesPOWERIN: float

Subrack power input voltage in Volts.

Unit:

Volt

property internalVoltagesSOC: float

Subrack internal SOC supply voltage in Volts.

Unit:

Volt

pduHealth()

Handle a Tango attribute read of the pdu health.

Return type:

Optional[str]

Returns:

the pdu health

pduModel()

Handle a Tango attribute read of the pdu model type.

Return type:

Optional[str]

Returns:

the pdu model type

pduNumberPorts()

Handle a Tango attribute read of thenumber of pdu ports.

Return type:

Optional[int]

Returns:

the number of pdu ports

pduPortCurrents()

Handle a Tango attribute read of the current of pdu port.

Return type:

Optional[list[float]]

Returns:

the state of the port.

pduPortStates()

Handle a Tango attribute read of the state of pdu port.

Return type:

Optional[list[int]]

Returns:

the state of the port.

pduPortVoltages()

Handle a Tango attribute read of the current of pdu port.

Return type:

Optional[list[float]]

Returns:

the state of the port.

powerSupplyCurrents()

Handle a Tango attribute read of the power supply currents.

Return type:

Optional[list[float]]

Returns:

the power supply currents. When communication with the subrack is not established, this returns none.

powerSupplyFanSpeeds()

Handle a Tango attribute read of the power supply fan speeds.

Values expressed in percent of maximum.

Return type:

Optional[list[float]]

Returns:

the power supply fan speeds. When communication with the subrack is not established, this returns none.

powerSupplyPowers()

Handle a Tango attribute read of the power supply powers.

Return type:

Optional[list[float]]

Returns:

the power supply powers. When communication with the subrack is not established, this returns none.

powerSupplyVoltages()

Handle a Tango attribute read of the power supply voltages.

Return type:

Optional[list[float]]

Returns:

the power supply voltages. When communication with the subrack is not established, this returns none.

subrackBoardInfo()

Handle a Tango attribute read of the Subrack board info.

Return type:

Optional[str]

Returns:

the subrack board info as a dict

subrackFanModes()

Handle a Tango attribute read of the subrack fan modes.

Return type:

Optional[list[int]]

Returns:

the subrack fan modes. When communication with the subrack is not established, this returns none.

subrackFanSpeeds()

Handle a Tango attribute read of the subrack fan speeds, in RPM.

Return type:

Optional[list[float]]

Returns:

the subrack fan speeds. When communication with the subrack is not established, this returns none.

subrackFanSpeedsPercent()

Handle a Tango attribute read of the subrack fan speeds, in percent.

This is the commanded setpoint; the relation between this level and the actual RPMs is not linear. Subrack speed is managed automatically by the controller, by default (see subrack_fan_mode).

Commanded speed is the same for fans 1-2 and 3-4.

Return type:

Optional[list[float]]

Returns:

the subrack fan speed setpoints in percent. When communication with the subrack is not established, this returns none.

subrackPllLocked()

Handle a Tango attribute read of the subrack PLL locked attribute.

Return type:

Optional[bool]

Returns:

whether the subrack PLL is locked.

subrackTimestamp()

Handle a Tango attribute read of the subrack timestamp attribute.

Return type:

Optional[int]

Returns:

the subrack timestamp

tpm1PowerState()

Handle a Tango attribute read of the power state of TPM 1.

Return type:

PowerState

Returns:

the power state of TPM 1.

tpm2PowerState()

Handle a Tango attribute read of the power state of TPM 2.

Return type:

PowerState

Returns:

the power state of TPM 2.

tpm3PowerState()

Handle a Tango attribute read of the power state of TPM 3.

Return type:

PowerState

Returns:

the power state of TPM 3.

tpm4PowerState()

Handle a Tango attribute read of the power state of TPM 4.

Return type:

PowerState

Returns:

the power state of TPM 4.

tpm5PowerState()

Handle a Tango attribute read of the power state of TPM 5.

Return type:

PowerState

Returns:

the power state of TPM 5.

tpm6PowerState()

Handle a Tango attribute read of the power state of TPM 6.

Return type:

PowerState

Returns:

the power state of TPM 6.

tpm7PowerState()

Handle a Tango attribute read of the power state of TPM 7.

Return type:

PowerState

Returns:

the power state of TPM 7.

tpm8PowerState()

Handle a Tango attribute read of the power state of TPM 8.

Return type:

PowerState

Returns:

the power state of TPM 8.

tpmCount()

Handle a Tango attribute read of TPM count.

Return type:

int

Returns:

the number of TPMs present in the subrack. When communication with the subrack is not established, this returns 0.

tpmCurrents()

Handle a Tango attribute read of the TPM currents.

Return type:

Optional[list[float]]

Returns:

the TPM currents. When communication with the subrack is not established, this returns none.

tpmPowers()

Handle a Tango attribute read of the TPM powers.

Return type:

Optional[list[float]]

Returns:

the TPM powers. When communication with the subrack is not established, this returns none.

tpmPresent()

Handle a Tango attribute read of which TPMs are present in the subrack.

Return type:

list[bool]

Returns:

whether a TPM is present in each bay. When communication with the subrack is not established, this returns an empty list.

tpmVoltages()

Handle a Tango attribute read of the TPM voltages.

Return type:

Optional[list[float]]

Returns:

the TPM voltages

useAttributesForHealth()

Return if adr115 is in use.

Return type:

bool

Returns:

True if attributes quality is being evaluated in health.

main(*args, **kwargs)

Launch an MccsSubrack Tango device server instance.

Parameters:
  • args (str) – positional arguments, passed to the Tango device

  • kwargs (str) – keyword arguments, passed to the sever

Return type:

int

Returns:

the Tango server exit code