CspController
- class ska_csp_lmc_common.controller_device.CspController(*args: Any, **kwargs: Any)
Bases:
SKAController
CSP Controller functionality is modeled via a Common Class for the CSP Controller TANGO Devices (Mid and Low).
Device Properties:
- ConnectionTimeout
The maximum time to wait for the connection with a sub-system
Type:’DevUShort’
Default Value: 60
- PingConnectionTime
The time to wait between connection attempts
Type:’DevUShort’
Default Value: 5
- DefaultCommandTimeout
Deafult timeout for LRC execution
Type:’DevUShort’
Default Value: 5
- CspCbf
FQDN of the CBF Controller
Type:’DevString’
- CspPss
TANGO FQDN of the PSS Controller
Type:’DevString’
- CspPstBeams
TANGO FQDNs of the deployed PST Beams
Type:’DevVarStringArray’.
- CspSubarrays
TANGO FQDN of the CSP.LMC Subarrays
Type:’DevVarStringArray’
- init_device() None
Override the Base Classes init_device method to change the asynchronous callback sub-model from pull to push sub-model.
- _init_state_model() None
Override the health and operational State models:
current CSP.LMC implementation does no longer rely on the SKA State models and associated State Machine library.
- delete_device() None
Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the init_device method to be released. This method is called by the device destructor and by the device Init command.
- set_component_manager(cm_configuration: ComponentManagerConfiguration) CSPControllerComponentManager
Configure the ComponentManager for the CSP Controller device. This method has to be specialized in Mid.CSP and Low.CSP.
- Parameters:
cm_configuration – A class with all the device properties accessible as attributes
- Returns:
The CSP Controller ComponentManager
- create_component_manager() CSPControllerComponentManager
Override the base method.
- Returns:
The CSP ControllerComponentManager
- update_ctrl_state(value: tango.DevState) None
Update the CSP Controller state to the value returned by the Operational State Model.
- Parameters:
value – the CSP Controller state calculated as an aggregation of the CSP Controller sub-systems states.
- update_ctrl_health_state(value: ska_control_model.HealthState) None
Update the CSP Controller healthState as aggregation of the CSP sub- systems’ health states.
- Parameters:
value – the updated health state value
- update_property(property_name: str, property_value: Any) None
General method invoked by the ComponentManager to push an event on a device attribute properly configured to push events from the device. In the case of PstBeams only, entry to be updated has to be inserted as a list of [key, value].
- Parameters:
property_name – the TANGO attribute name
property_value – the attribute value
- _update_csp_command_result(command_id: str, command_result: tuple[ska_tango_base.commands.ResultCode, str]) None
Method to update the result code returned from a task execution. On updating, the device pushes archive and change events.
- Parameters:
command_id – the ID of the CSP task as returned from the CommandTracker.
command_result – the tuple with result code and message returned when the task completes.
- _update_command_result(command_id: str, command_result: tuple[ska_tango_base.commands.ResultCode, str]) None
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommand
Class to handle the CSP.LMC Controller Init command.
- do()
Invoke the init command on the Controller ComponentManager.
- Returns:
a tuple with the command result code and an informative message.
- is_On_allowed() bool
Return whether the On command may be called in the current device state.
- Returns:
whether the command may be called in the current device state
- Raise:
DevFailed exception if the device is not in one of the following states: ON, STANDBY,OFF
- is_Off_allowed() bool
Return whether the Off command may be called in the current device state.
- Returns:
whether the command may be called in the current device state
- Raise:
DevFailed exception if the device is not in one of the following states: ON, STANDBY,OFF
- is_Standby_allowed() bool
Return whether the Standby command may be called in the current device state.
- Returns:
whether the command may be called in the current device state
- Raise:
DevFailed exception if the device is not in one of the following states: ON, STANDBY,OFF
- is_Reset_allowed() bool
- Return whether the Reset command may be called in the current device
state.
- Returns:
whether the command may be called in the current device state
- buildState() str
Read the Build State of the device.
- Returns:
the build state of the device
- versionId() str
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
- cbfVersion() str
Return the SW version of the CBF Controller.
- Returns:
the CBFVersion attribute.
- pssVersion() str
Return the SW version of the PSS Controller.
- Returns:
the PSSVersion attribute.
- jsonComponentVersions() str
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.
- testAlarm(argin: bool) None
Enable/Disable the testAlarm flag.Used to test the CSP.LMC AlarmHandler when deployed.
- Parameters:
argin – True/False
- read_adminMode() ska_control_model.AdminMode
Return the admin Mode of the CSP sub-system.
- Returns:
admin Mode of the device
- write_adminMode(value: ska_control_model.AdminMode) None
Set the administration mode for the whole CSP sub-system.
- Parameters:
value – one of the administration mode value (ON-LINE, OFF-LINE, MAINTENANCE, NOT-FITTED, RESERVED).
- read_commandTimeout() int
Return the commandTimeout attribute.
- Returns:
The duration of the command timeout in sec..
- write_commandTimeout(value)
Set the value of the command timeout in sec.
Configure the timeout applied to each command. The specified value shall be > 0.
Negative values raise a TypeError exception. This is the expected behavior because the attribute has been defined as DevUShort. A zero value raises a ValueError exception.
- Raises:
TypeError or tango.DevFailed depending on whether the specified value is negative or zero if a negative value.
- read_cspCbfState() tango.DevState
Return the state value of the CBF Controller.
- read_cspPssState() tango.DevState
Return the the state value of the PSS Controller..
- read_cspPstBeamsState() str
Return the state of the deployed PST beams.
- read_cspCbfHealthState() tango.DevState
Return the health state value of the CBF Controller.
- read_cspPssHealthState() tango.DevState
Return the health state value of the PSS Controller.
- read_cspPstBeamsHealthState() tango.DevState
Return the health state of the deployed PST beams.
- read_cbfControllerAddress() str
Return the FQDN of the CBF Controller
- read_pssControllerAddress() str
Return the FQDN of the PSS Controller.
- read_cspCbfAdminMode() ska_control_model.AdminMode
Return the admin mode of the CBF Controller.
- write_cspCbfAdminMode(value) ska_control_model.AdminMode
Set the admin mode pf the CBF Controller.
Set the CBF sub-element adminMode attribute value.
- Parameters:
value – one of the administration mode value (ON-LINE, OFF-LINE, MAINTENANCE, NOT-FITTED, RESERVED).
- Returns:
None
- Raises:
tango.DevFailed when there is no DeviceProxy providing interface to the CBF sub-element Master, or an exception is caught in command execution.
- read_cspPssAdminMode() ska_control_model.AdminMode
Return the admin mode of the PSS Controller.
- write_cspPssAdminMode(value) ska_control_model.AdminMode
Set the admin mode pf the PSS Controller
NOTE: not implemented
- read_cspPstBeamsAdminMode() str
Return the admin mode of the deployed PST beams.
- read_numOfDevCompletedTask()
Return the numOfDevCompletedTask attribute.
NOTE: not implemented
- read_cspSubarrayAddresses() List[str]
Return the list with the CspSubarrays’ addresses (FQDNs). The list is defined as a Device Property If the Device Property is not defined, it returns an empty list
- read_listOfDevCompletedTask()
Return the list of the devices (FQDNs) that have completed the last required task.
NOTE: not implemented
- read_commandResult() Tuple[str, ska_tango_base.commands.ResultCode]
Return the commandResult value. Implemented as a list of 2 strings:
element 0: CSP task name
element 1: ResultCode value
This attribute is used to signal the client the completion of the execution of a non-blocking task.
- read_isCommunicating() bool
Whether the TANGO device is communicating with the controlled component.
- cbfSimulationMode(value: cbfSimulationMode) None
Set the Simulation Mode of the CBF subsystem.
- Parameters:
value – desired Simulation Mode of the device.