Mid CSP.LMC Controller
- class ska_csp_lmc_mid.controller.mid_controller_device.MidCspController(*args: Any, **kwargs: Any)
Bases:
CspControllerThe base class for MID CspMAster. Functionality to monitor CSP.LMC Capabilities are implemented in separate TANGO Devices.
Device Properties:
- CspVccCapability
TANGO Device to monitor the Mid.CSP VCCs Capabilities devices.
Type:’DevString’Properties
- CspFspCapability
TANGO Device to monitor the Mid.CSP FSPs Capabilities devices.
Type:’DevString’
- CspVccCapability
TANGO property
- CspFspCapability
TANGO property
- set_component_manager(cm_configuration: ComponentManagerConfiguration) MidCspControllerComponentManager
Set the Component Manager for the Mid CSP Controller device.
- Parameters:
cm_configuration – A class with all the device properties accessible as attributes
- Returns:
The Mid.Csp ControllerComponentManager
- init_command_objects() None
Set up the command objects.
- is_LoadDishCfg_allowed() bool
Return whether the LoadDishCfg command may be called in the current device state.
- Parameters:
raise_if_disallowed – whether to raise an error or simply return False if the command is disallowed. Currently not used.
- Returns:
whether the command may be called in the current device state
- LoadDishCfg(argin: str) tuple[list[ResultCode], list[str]]
Load DishID to VCC Mapping.
To modify behaviour for this command, modify the do() method of the command class.
- Parameters:
argin – mapping
- Returns:
A tuple containing a result code and a string message. If the result code indicates that the command was accepted, the message is the unique ID of the task that will execute the command. If the result code indicates that the command was not excepted, the message explains why.
- commandResultName
The first entry of commandResult attribute, i.e. the name of latest command executed. For Taranta visualization
- commandResultCode
The second entry of commandResult attribute, i.e. the resultCode of latest command executed. For Taranta visualization
- availableCapabilities
A list of available number of instances of each capability type, e.g.
CORRELATOR:512,PSS-BEAMS:4
- receptorsList
The list of all receptors
- receptorMembership
The receptors affiliation to MID CSP sub-arrays.
- unassignedReceptorIDs
The list of available receptors IDs.
- cspVccCapabilityAddress
The FQDN of the CSP VCC Capability
- cspFspCapabilityAddress
The FQDN of the CSP FSP Capability
- vccAddresses
The list of VCC Capabilities FQDNs
- fspAddresses
The list of FSP Capabilities FQDNs
- dishVccConfig
The Dish ID - VCC ID mapping in a json string
- sourceDishVccConfig
The source of Dish ID - VCC ID mapping in a json string
- read_commandResultName() str
Return the name of the last executed CSP task.
- Returns:
The name of the CSP task.
- read_commandResultCode() str
Return the ResultCode of the last executed CSP task.
- Returns:
The result code (see
ResultCode) of the last executed task.
- read_availableCapabilities() List[str]
Return the list of available capabilities.
- Returns:
For each Mid.CSP capability type, reports the number of available resources.
- read_receptorsList() List[str]
Return the list with all the (deployed) receptors IDs.
- Returns:
The list of receptors Ids.
- read_receptorMembership() List[int]
Return the information about the receptors/VCCs affiliation to Mid.CSP subarrays. The value stored in the (receptor_id -1) element corresponds to the subarray Id owing the VCC associated to the receptor. This value is in the range [0, 16]: 0 means the current resource is not assigned to any subarray.
On failure an empty list is returned (VERIFY!!!)
- Returns:
The subarray affiliation of the receptors.
- read_unassignedReceptorIDs() List[str]
Return the list of available receptors IDs. The list includes all the receptors that are not assigned to any subarray and, are “full working”. This means:
a valid link connection receptor-VCC
the connected VCC healthState OK
On failure an empty list is returned.
- Returns:
The list of the available receptors IDs.
- read_vccAddresses() List[str]
ReturnCspFspCapabilityVcc the list with the FQDNs of the VCCs TANGO devices.
- Returns:
the list of VCC Capabilities FQDNs
- read_fspAddresses() List[str]
Return the list with the FQDNs of the FSPs TANGO devices.
- Returns:
The list of FSP Capabilities FQDNs
- read_dishVccConfig() DevState
Return the dishVccConfig attribute.
- Returns:
The corresponding Cbf Controller sysParam attribute
- Raise:
ValueError exception if attribute reading from the device fails
- Raise:
KeyError exception.
- read_sourceDishVccConfig() DevState
Return the dishVccConfig attribute.
- Returns:
The corresponding Cbf Controller sysParam attribute
- Raise:
ValueError exception if attribute reading from the device fails
- Raise:
KeyError exception.
- alarmDishIdCfg
Alarm raised in case of failure of the command LoadDishCfg
- Abort() tuple[list[ResultCode], list[str]]
Abort any executing long running command(s) and empty the queue.
- Returns:
A tuple containing a result code and the unique ID of the command
- AbortCommands() tuple[list[ResultCode], list[str]]
Empty out long running commands in queue.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- CheckLongRunningCommandStatus(argin: str) str
Check the status of a long running command by ID.
- Parameters:
argin – the command id
- Returns:
command status
- ConnectionTimeout
TANGO property
- CspCbf
TANGO property
- CspPss
TANGO property
- CspPstBeams
TANGO property
- CspResourceManager
TANGO property
- CspSubarrays
TANGO property
- DebugDevice() int
Enable remote debugging of this device.
To modify behaviour for this command, modify the do() method of the command class:
DebugDeviceCommand.- Returns:
the port the debugger is listening on
- DefaultCommandTimeout
TANGO property
- ExecutePendingOperations() None
Execute any Tango operations that have been pushed on the queue.
The poll time is initially 5ms, to circumvent the problem of device initialisation, but is reset to 100ms after the first pass.
- GetVersionInfo() list[str]
Return the version information of the device.
To modify behaviour for this command, modify the do() method of the command class.
- Returns:
The result code and the command unique ID
- GroupDefinitions
Device property.
Each string in the list is a JSON serialised dict defining the
group_name,devicesandsubgroupsin the group. A Tango Group object is created for each item in the list, according to the hierarchy defined. This provides easy access to the managed devices in bulk, or individually.The general format of the list is as follows, with optional
devicesandsubgroupskeys:[ {"group_name": "<name>", "devices": ["<dev name>", ...]}, {"group_name": "<name>", "devices": ["<dev name>", "<dev name>", ...], "subgroups" : [{<nested group>}, {<nested group>}, ...]}, ... ]
For example, a hierarchy of racks, servers and switches:
[ {"group_name": "servers", "devices": ["elt/server/1", "elt/server/2", "elt/server/3", "elt/server/4"]}, {"group_name": "switches", "devices": ["elt/switch/A", "elt/switch/B"]}, {"group_name": "pdus", "devices": ["elt/pdu/rackA", "elt/pdu/rackB"]}, {"group_name": "racks", "subgroups": [ {"group_name": "rackA", "devices": ["elt/server/1", "elt/server/2", "elt/switch/A", "elt/pdu/rackA"]}, {"group_name": "rackB", "devices": ["elt/server/3", "elt/server/4", "elt/switch/B", "elt/pdu/rackB"], "subgroups": []} ]} ]
- IsCapabilityAchievable(argin: tuple[list[int], list[str]]) bool
Check if provided capabilities can be achieved by the resource(s).
To modify behaviour for this command, modify the do() method of the command class.
- Parameters:
argin –
An array consisting pair of
[nrInstances]: DevLong. Number of instances of the capability.
[Capability types]: DevString. Type of capability.
- Returns:
True or False
- LoggingLevelDefault
Device property.
Default logging level at device startup. See
LoggingLevel
- LoggingTargetsDefault
Device property.
Default logging targets at device startup. See the project readme for details.
- MaxCapabilities
TANGO property
- Off(argin: List[str]) Tuple[ResultCode, str]
Turn device off.
:param List of fqdn of controller’s subsystems to operate
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- On(argin: List[str]) Tuple[ResultCode, str]
Turn device on.
:param List of fqdn of controller’s subsystems to operate.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- PingConnectionTime
TANGO property
- Reset() tuple[list[ResultCode], list[str]]
Reset the device.
To modify behaviour for this command, modify the do() method of the command class.
For a device that directly monitors and controls hardware, this command should put that hardware into a known state, for example by clearing buffers and loading default values into registers, or if necessary even by power-cycling and re-initialising the hardware.
Logical devices should generally implement this command to perform a sensible reset of that logical device. For example, aborting any current activities and clearing internal state.
Reset generally should not change the power state of the device or its hardware:
If invoking Reset() from STANDBY state, the device would usually be expected to remain in STANDBY.
If invoking Reset() from ON state, the device would usually be expected to remain in ON.
If invoking Reset() from FAULT state, the device would usually be expected to transition to ON or remain in FAULT, depending on whether the reset was successful in clearing then fault.
Reset generally should not propagate to subservient devices. For example, a subsystem controller device should implement Reset to reset the subsystem as a whole, but that probably should not result in all of the subsystem’s hardware being power-cycled.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- SkaLevel
Device property.
Indication of importance of the device in the SKA hierarchy to support drill-down navigation: 1..6, with 1 highest.
- Standby(argin: List[str]) Tuple[ResultCode, str]
Turn device standby.
:param List of fqdn of controller’s subsystems to operate
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- TangoClassClass
alias of
MidCspControllerClass
- TangoClassName = 'MidCspController'
- adminMode
Return the admin Mode of the CSP sub-system.
- Returns:
admin Mode of the device
- buildState
Read the Build State of the device.
- Returns:
the build state of the device
- cbfControllerAddress
TANGO FQDN of the CBF sub-element Master
- cbfSimulationMode
Attribute used to enable/disable the CBF simulation mode
- cbfVersion
Return the SW version of the CBF Controller.
- Returns:
the CBFVersion attribute.
- commandResult
command_name, result_code Gives the name and the result_code of latest command execution
- commandTimeout
Report the set command timeout
- commandedState
Read the last commanded operating state of the device.
Initial string is “None”. Only other strings it can change to is “OFF”, “STANDBY” or “ON”, following the start of the Off(), Standby(), On() or Reset() long running commands.
- Returns:
commanded operating state string.
- controlMode
Read the Control Mode of the device.
The control mode of the device are REMOTE, LOCAL Tango Device accepts only from a ‘local’ client and ignores commands and queries received from TM or any other ‘remote’ clients. The Local clients has to release LOCAL control before REMOTE clients can take control again.
- Returns:
Control Mode of the device
- cspCbfAdminMode
The CBF sub-subsystem adminMode.
- cspCbfHealthState
The CBF sub-element healthState.
- cspCbfState
The CBF sub-element Device State. Allowed values are ON, STANDBY, OFF, DISABLE, ALARM, FAULT, UNKNOWN
- cspPssAdminMode
The PSS sub-system adminMode.
- cspPssHealthState
The PSS sub-element healthState
- cspPssState
The PSS sub-element Device State. Allowed values are ON, STANDBY, OFF, DISABLE, ALARM, FAULT, UNKNOWN
- cspPstBeamsAdminMode
Report the administration mode of the beams as JSON formatted string
- cspPstBeamsHealthState
Report the health state of the pst beams as a JSON formatted string
- cspPstBeamsObsState
Report the observing state of the PST beams as a JSON formatted string
- cspPstBeamsState
Report the state of the pst beams assigned as a JSON formatted string.
- cspResourceAdminMode
The ResourceManager adminMode.
- cspResourceHealthState
The ResourceManager sub-element healthState
- cspResourceState
The ResourceManager sub-element Device State. Allowed values are ON, STANDBY, OFF, DISABLE, ALARM, FAULT, UNKNOWN
- elementAlarmAddress
FQDN of Element Alarm Handlers
- elementDatabaseAddress
FQDN of Element Database device
- elementLoggerAddress
FQDN of Element Logger
- elementTelStateAddress
FQDN of Element TelState device
- healthInfo
Attribute used to specifies the cause for the healthdegradation or failure
- healthState
Read the Health State of the device.
It interprets the current device condition and condition of all managed devices to set this. Most possibly an aggregate attribute.
- Returns:
Health State of the device
- isCommunicating
Whether the device is communicating with the component under control
- jsonComponentVersions
Return a JSON formatted string with the SW of all the CSP Controller subordinate sub-systems.
Example:
‘{“mid_csp_cbf/sub_elt/controller”: “0.11.4”, “mid-csp/subarray/01”: “0.16.3”, “mid-csp/subarray/02”: “0.16.3”, “mid-csp/subarray/03”: “0.16.3”}’
- Returns:
JSON formatted string.
- loggingLevel
Read the logging level of the device.
Initialises to LoggingLevelDefault on startup. See
LoggingLevel- Returns:
Logging level of the device.
- loggingTargets
Read the additional logging targets of the device.
Note that this excludes the handlers provided by the ska_ser_logging library defaults - initialises to LoggingTargetsDefault on startup.
- Returns:
Logging level of the device.
- longRunningCommandResult
Read the result of the completed long running command.
Reports unique_id, json-encoded result. Clients can subscribe to on_change event and wait for the ID they are interested in.
- Returns:
ID, result.
- lrcFinished
Read info of the finished long running commands.
- Returns:
a list of info JSON blobs of the finished long running commands.
- lrcProtocolVersions
Return supported protocol versions.
- Returns:
A tuple containing the lower and upper bounds of supported long running command protocol versions.
- maxCapabilities
4’.
- Type:
Maximum number of instances of each capability type, e.g. ‘CORRELATOR
- Type:
512’, ‘PSS-BEAMS
- numOfDevCompletedTask
Number of devices that completed the task
- pssControllerAddress
TANGO FQDN of the PSS sub-element Master
- pssVersion
Return the SW version of the PSS Controller.
- Returns:
the PSSVersion attribute.
- pstBeamSubarrayMap
JSON-string representing the mapping between the PST Beam ids and the Subarray id.
- pstBeamsAddresses
TANGO FQDNs of the PST Beams
- pstBeamsAvailable
Return a list of string representing the PST Beam ids available. i.e [“1”, “2”]
- Returns:
list of pst beam id string.
- pstVersion
Return the SW version of the PST Beams.
- Returns:
the PSTVersion attribute.
- qualityAssuranceMetrics
Attribute used to aggregate quality metrics of the subsystemsin order to improve monitoring capabilities.
- simulationMode
Read the Simulation Mode of the device.
Some devices may implement both modes, while others will have simulators that set simulationMode to True while the real devices always set simulationMode to False.
- Returns:
Simulation Mode of the device.
- testAlarm
flag to test alarm
- testMode
Read the Test Mode of the device.
Either no test mode or an indication of the test mode.
- Returns:
Test Mode of the device
- versionId
Return the SW version of the current device.
The SW version is equal to the release number of the CSP Helm chart and also of the containerized image.
- Returns:
the version id of the device