SMART Box device
This module implements the MCCS SmartBox device.
- class MccsSmartBox(*args, **kwargs)
An implementation of the SmartBox device for MCCS.
- ClearThresholdCache()
Clear the threshold caches.
- PowerOffAntenna(antenna_name)
Power off an antenna.
- Parameters:
antenna_name (
str) – the antenna 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.
- PowerOffPort(port_number)
Power down a port.
This may or may not have a Antenna attached.
- Parameters:
port_number (
int) – the smartbox port 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.
- PowerOnAntenna(antenna_name)
Power up an antenna.
- Parameters:
antenna_name (
str) – the antenna 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.
- PowerOnPort(port_number)
Power up a port.
This may or may not have a Antenna attached.
- Parameters:
port_number (
int) – the smartbox port 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.
- ReadableName()
Return the name of the smartbox in a readable format.
- Return type:
- Returns:
the name of the smartbox
- SetAntennaMasking(argin)
Set the masking status for antennas on this smartbox.
Antennas absent from the dict are left unchanged. The local port mask cache is updated immediately so no Init() is required.
Returns
REJECTEDif none of the supplied antenna names are known to this smartbox (e.g. all names are unrecognised or the dict is empty).- Parameters:
argin (
str) – JSON string mapping antenna names to masked status, e.g.{"sb01-01": true, "sb01-03": false}.truemeans masked (port will not be powered on);falsemeans unmasked.- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purposes only. Returns
REJECTEDif no antennas would be masked.
- SetPortPowers(json_argument)
Set port powers.
These ports may not have an antenna attached.
- Parameters:
json_argument (
str) – desired port powers of unmasked ports with smartboxes attached in json form.- Return type:
TaskFunctionType- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purposes only.
- UpdateThresholdCache()
Update the threshold caches.
- __init__(*args, **kwargs)
Initialise this device object.
- antennaNames()
Get the names of antennas on this smartbox.
- Return type:
- Returns:
the names of antennas on this smartbox.
- create_component_manager()
Create and return a component manager for this device.
- Return type:
- Returns:
a component manager for this device.
- execute_Off()
Execute the Off command.
- Return type:
TaskFunctionType- Returns:
the callable function.
- execute_On()
Execute the On command.
- Return type:
TaskFunctionType- Returns:
the callable function.
- execute_Standby()
Execute the Standby command.
- Return type:
TaskFunctionType- Returns:
the callable function.
- fndhPort()
Return the fndh port the smartbox is attached to.
- Return type:
- Returns:
the fndh port that the smartbox is attached to.
- healthModelParams(argin)
Set the params for health transition rules.
- init_device()
Initialise the device.
This is overridden here to change the Tango serialisation model.
- Return type:
- is_engineering()
Return a flag representing whether we are in Engineering mode.
- Return type:
- Returns:
True if Smartbox is in Engineering Mode.
- is_firmware_threshold_allowed(req_type)
Return a flag representing whether we are allowed to access the attribute.
- Parameters:
req_type (
AttReqType) – the request type- Return type:
- Returns:
True if access is allowed.
- numberOfPortBreakersTripped()
Return the total number of breakers which have tripped.
This is used for alarm configuration.
- portMask(port_mask)
Set the port mask for this smartbox’s ports.
- Parameters:
port_mask (
list[bool]) – the port mask, it must be the correct length (12).- Raises:
ValueError – if the length of supplied port mask is incorrect.
- Return type:
- thresholdDifferences()
Return the differences between threshold values.
- Return type:
- Returns:
Return the differences between threshold values.