TMC Common Tango Helper Devices
TMC uses helper devices instead of real devices to test component level functionality and also functionality of overall integrated TMC in TMC integration repository. These Devices are used by multiple TMC repositories so kept in common repository to have functionality readily available across TMC repositories.
Devices and their functionality
This page contains all the helper devices used by TMC to mock behavior of sub-systems,leaf nodes or subarray device. Each helper device exposes required API’s similar to real device.
Functionality
Few Functionality provided by the helper devices are as follows:
SetDirectObsState: used to set device obsState directly.
SetDirectState: Used to set device state directly.
commandCallInfo: Used to get information of arguments used to call the command
SetDelay: Used to produce delay in execution of commands to mimic real scenario.
resetDelay: Used to reset delay to default one.
Fault Injection: To make devices faulty to check error handling in tango devices.
- AddTransitions: This command will set duration for obs state such that whenrespective command for obs state is triggered then it change obs state
after provided duration.
Device List
1. Helper_CSP_Master
This module defines a helper device that acts as csp master in our testing.
- class ska_tmc_common.test_helpers.helper_csp_master_device.HelperCspMasterDevice(*args: Any, **kwargs: Any)
Bases:
HelperBaseDeviceA helper device class for Csp Controller device
- init_device() None
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperCspMasterDevice’s init_device() command.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialisation. :return: ResultCode and message
- create_component_manager() EmptyComponentManager
Creates an instance of EmptyComponentManager :return: component manager instance :rtype: EmptyComponentManager
- read_adminMode() ska_tango_base.control_model.AdminMode
This method reads the adminMode value of the device. :return: admin_mode value :rtype: AdminMode
- write_adminMode(value: ska_tango_base.control_model.AdminMode) None
This method writes the adminMode value of the device.
- read_sourceDishVccConfig() str
This method reads the sourceDishVccConfig value of the dish. :return: source_dish_vcc_config value :rtype:str
- read_dishVccConfig() str
This method reads the dishVccConfig value of the dish. :return: dish_vcc_config value :rtype:str
- is_On_allowed() bool
This method checks if the On command is allowed in current state. :return:
Trueif the command is allowed :rtype: bool
- On(argin: list) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes On command on CSP Master :return: ResultCode and message :rtype: Tuple
- is_Off_allowed() bool
This method checks if the Off command is allowed in current state. :return:
Trueif the command is allowed :rtype: bool
- Off(argin: list) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Off command on CSP Master :return: ResultCode and message :rtype: Tuple
- is_Standby_allowed() bool
This method checks if the Standby command is allowed in current state. :return:
Trueif the command is allowed :rtype: bool
- Standby(argin: list) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Standby command on CSP Master :return: ResultCode and message :rtype: Tuple
- ResetSysParams() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This Command Reset Sys Param and source sys param :return: ResultCode and message
- is_LoadDishCfg_allowed() bool
This method checks if the LoadDishCfg command is allowed in current state. :return:
Trueif the command is allowed :rtype: bool
- push_dish_vcc_config_and_source_dish_vcc_config()
Push sys param and source sys param event
- LoadDishCfg(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This command updates attribute sourceDishVccConfig and dishVccConfig
- Parameters:
argin – json with File URI.
- Dtype:
str
- Returns:
ResultCode and message
- Return type:
Tuple
Example argin: { “interface”: “https://schema.skao.int/ska-mid-cbf-initial-parameters/2.2”,
“tm_data_sources”: [tm_data_sources] #The data source that is used to store the data and is accessible through the Telescope Model
“tm_data_filepath”: “path/to/file.json” #The path to the json file containing the Mid.CBF initialization parameters within the data source
}
2. Helper_Dish_Device
This module implements the Helper Dish Device for testing an integrated TMC
- class ska_tmc_common.test_helpers.helper_dish_device.HelperDishDevice(*args: Any, **kwargs: Any)
Bases:
HelperDishLNDeviceA device exposing commands and attributes of the Dish device.
- init_device()
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperDishDevice’s init_device() command.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialisation. :return: ResultCode and message
- read_isAdminModeEnabled()
Raise an AttributeError indicating ‘isAdminModeEnabled’ is unavailable. :raises AttributeError: Always raised to block access to the attribute.
- write_isAdminModeEnabled(value: bool)
Raise an AttributeError indicating that ‘isAdminModeEnabled’ cannot be modified. :param value: The value attempted to set for isAdminModeEnabled. :raises AttributeError: Always raised to access to the attribute..
- read_band1PointingModelParams() List[float]
This method reads the band1PointingModelParams attribute of a dish. :rtype: List
- write_band1PointingModelParams(value)
This method writes band1PointingModelParams attribute of dish. :param value: _band1PointingModelParams as given is the json :value dtype: List :rtype: None
- read_band2PointingModelParams() List[float]
This method reads the band2PointingModelParams attribute of a dish. :rtype: List
- write_band2PointingModelParams(value)
This method writes band2PointingModelParams attribute of dish. :param value: _band2PointingModelParams as given is the json :value dtype: List :rtype: None
- read_band3PointingModelParams() List[float]
This method reads the band3PointingModelParams attribute of a dish. :rtype: List
- write_band3PointingModelParams(value)
This method writes band3PointingModelParams attribute of dish. :param value: _band3PointingModelParams as given is the json :value dtype: List :rtype: None
- read_band4PointingModelParams() List[float]
This method reads the band4PointingModelParams attribute of a dish. :rtype: List
- write_band4PointingModelParams(value)
This method writes band4PointingModelParams attribute of dish. :param value: _band4PointingModelParams as given is the json :value dtype: List :rtype: None
- read_band5aPointingModelParams() List[float]
This method reads the band5aPointingModelParams attribute of a dish. :rtype: List
- write_band5aPointingModelParams(value)
This method writes band5aPointingModelParams attribute of dish. :param value: _band5aPointingModelParams as given is the json :value dtype: List :rtype: None
- read_band5bPointingModelParams() List[float]
This method reads the band5bPointingModelParams attribute of a dish. :rtype: List
- write_band5bPointingModelParams(value)
This method writes band5bPointingModelParams attribute of dish. :param value: _band5bPointingModelParams as given is the json :value dtype: List :rtype: None
- property configured_band
- Gets the currently configured band.
This property returns the band that has been configured for instance.
- Returns:
Band: The currently configured band.
- read_scanID() str
This method reads the scanID attribute of a dish. :rtype: str
- write_scanID(value: str) None
This method writes scanID attribute of dish. :param value: scan_id as given is the json :value dtype: str :rtype: None
- trackTableLoadMode(value: TrackTableLoadMode) None
Set the trackTableLoadMode. :param value: TrackTableLoadMode (NEW or APPEND) :value dtype: TrackTableLoadMode :rtype: None
- kValue() int
This attribute is used for storing dish kvalue into tango DB.Made this attribute memorized so that when device restart then previous set kvalue will be used validation. :return: kValue
- is_SetKValue_allowed() bool
This method checks if the SetKValue Command is allowed in current State. :rtype: bool :return: boolean value if kValue is set or not
- SetKValue(kvalue: int) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This command invokes SetKValue command on Dish Master.
- Parameters:
kvalue – k value between range 1-2222.
- Returns:
ResultCode and meeage
- Kvalue dtype:
int
- Return type:
Tuple[List[ResultCode], List[str]]
- read_configuredBand() Band
This method reads the configuredBand of dish. :return: configure band for dishes :rtype: Band
- read_offset() str
This method reads the offset of dishes. :return: offset for dishes :rtype: str
- read_programTrackTable() list
This method reads the programTrackTable attribute of a dish. :return: programTrackTable for dishes :rtype: list
- write_programTrackTable(value: list) None
This method writes the programTrackTable attribute of dish. :param value: 50 entries of timestamp, azimuth and elevation values of the desired pointing of dishes. Example: programTrackTable = [ (timestamp1, azimuth1, elevation1), (timestamp2, azimuth2, elevation2), (timestamp3, azimuth3, elevation3),] :value dtype: list :rtype: None
- read_achievedPointing() numpy.ndarray
This method reads the achievedPointing of dishes. :return: achievedPointing of dishes :rtype: str
- SetDirectConfiguredBand(argin: Band) None
Trigger a ConfiguredBand change
- AddTransition(state_duration_info: str) None
This command will set duration for pointing state such that when respective command for pointing state is triggered then it change pointing state after provided duration
- ResetTransitions() None
This command will reset PointingState duration which is set
- set_configured_band(configured_band: Band) None
This method set the Configured Band
- update_command_info(command_name: str = '', command_input: str | bool | None = None) None
This method updates the commandCallInfo attribute, with the respective command information.
- Args:
command_name (str): command name command_input(str or bool): Input argin for command
- set_achieved_pointing() None
Sets the achieved pointing for dish.
- SetOperateMode() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes SetOperateMode command on Dish Master :return: ResultCode and message :rtype: tuple
- AbortCommands() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes AbortCommands command on Dish Master :return: ResultCode and message :rtype: tuple
- is_TrackLoadStaticOff_allowed() bool
This method checks if the TrackLoadStaticOff command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- TrackLoadStaticOff(argin: List[float]) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes TrackLoadStaticOff command on Dish Master.
- Parameters:
argin – A list containing scan_id/ time, cross elevation and elevation offsets.
- Argin dtype:
List(float)
- Returns:
ResultCode and message
- Return type:
Tuple[List[ResultCode], List[str]]
- is_ConfigureBand1_allowed() bool
This method checks if the ConfigureBand1 command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- ConfigureBand1(argin: bool) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes ConfigureBand1 command on Dish Master :param argin: The argin is a boolean value, if it is set true it invoke ConfigureBand1 command. :argin dtype: bool :return: ResultCode and message :rtype: tuple
- is_ConfigureBand2_allowed() bool
This method checks if the ConfigureBand2 Command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- ConfigureBand2(argin: bool) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes ConfigureBand2 command on Dish Master :param argin: The argin is a boolean value, if it is set true it invoke ConfigureBand2 command. :argin dtype: bool :return: ResultCode and message :rtype: tuple
- is_ConfigureBand3_allowed() bool
This method checks if the ConfigureBand3 Command is allowed in current State. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- ConfigureBand3(argin: bool) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes ConfigureBand3 command on Dish Master :return: ResultCode and message
- is_ConfigureBand4_allowed() bool
This method checks if the ConfigureBand4 Command is allowed in current State. :rtype: bool :return:
Trueif the command is allowed :raises CommandNotAllowed: command is not allowed
- ConfigureBand4(argin: bool) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes ConfigureBand4 command on Dish Master :return: ResultCode and message
- is_ConfigureBand5a_allowed() bool
This method checks if the ConfigureBand5a Command is allowed in current State. :rtype:bool :return:
Trueif the command is allowed :raises CommandNotAllowed: command is not allowed
- ConfigureBand5a(argin: bool) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes ConfigureBand5a command on Dish Master :return: ResultCode and message
- is_ConfigureBand5b_allowed() bool
This method checks if the ConfigureBand5b Command is allowed in current State. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- ConfigureBand5b(argin: bool) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes ConfigureBand5b command on Dish Master :return: ResultCode and message
- update_track_lrcr(command_name: str = '', command_id: str = '') None
Updates the longrunningcommandresult after a delay.
- Track() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Track command on Dish Master :return: ResultCode and message :rtype: tuple
- is_Scan_allowed() bool | CommandNotAllowed
This method checks if the Scan Command is allowed in current State. :return:
Trueif the command is allowed :rtype: Union[bool,CommandNotAllowed] :raises CommandNotAllowed: command is not allowed
- Scan(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method sets scanID attribute of Dish Master. :return: Tuple[List[ResultCode], List[str]]
- is_EndScan_allowed() bool | CommandNotAllowed
This method checks if the EndScan Command is allowed in current State. :rtype:bool :raises CommandNotAllowed: command is not allowed :rtype: Union[bool,CommandNotAllowed]
- EndScan() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method clears the scanID attribute of Dish Master :return: ResultCode and message :rtype: Tuple[List[ResultCode], List[str]]
- process_json_to_band_params(json_data: str) None
Processes the given JSON string, extracts ‘coefficients’ values in a specified order, and assigns them to an attribute based on the ‘band’ value. :raises CoefficientError: Not implemented error
- ApplyPointingModel(global_pointing_data: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method applies the received global pointing model data. Its a dummy command at present. Will be renamed, once Dish ICD gets updated.
- Parameters:
global_pointing_data (str) – Global pointing data
- Returns:
ResultCode and message
- Return type:
Tuple[List[ResultCode], List[str]]
- is_TrackStop_allowed() bool
This method checks if the TrackStop Command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- TrackStop() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes TrackStop command on Dish Master :return: ResultCode and message :rtype: tuple
3. Helper_SDP_Subarray
Helper device for SdpSubarray device
- class ska_tmc_common.test_helpers.helper_sdp_subarray.HelperSdpSubarray(*args: Any, **kwargs: Any)
Bases:
HelperSubArrayDeviceA helper SdpSubarray device for triggering state changes with a command. It can be used to mock SdpSubarray’s bahavior to test error propagation from SdpSubarray to SdpSubarrayLeafNode in case of command failure
- init_device()
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperSubarrayDevice’s init_device() “command”.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialisation. :return: ResultCode and message
- read_delay() int
This method is used to read the attribute value for delay. :return: delay
- SetDirectreceiveAddresses(argin: str) None
Set the receivedAddresses
- read_receiveAddresses()
Returns receive addresses. :return: receiveAddresses
- read_defective() str
Returns defective status of devices :return: defective parameters :rtype: str
- On()
This method simulates On command on SDP Subarray
- Off()
This method simulates OFF command on SDP Subarray
- AssignResources(argin)
This method simulates AssignResources command on SdpSubarray device. :raises throw_exception: when input json is wrong
- ReleaseResources()
This method invokes ReleaseResources command on SdpSubarray device.
- ReleaseAllResources()
This method invokes ReleaseAllResources command on SdpSubarray device.
- Configure(argin)
This method invokes Configure command on SdpSubarray device. :raises throw_exception: when input json is wrong
- Scan(argin)
This method invokes Scan command on SdpSubarray device. :raises throw_exception: when input json is wrong
- EndScan()
This method invokes EndScan command on SdpSubarray device.
- End()
This method invokes End command on SdpSubarray device.
- Abort()
This method invokes Abort command on SdpSubarray device.
- Restart()
This method invokes Restart command on SdpSubarray device.
- induce_fault()
Induces a fault into the device based on the given parameters.
Example:
defective_params = json.dumps({“enabled”: False, “fault_type”: FaultType.FAILED_RESULT, “error_message”: “Default exception.”, “result”: ResultCode.FAILED,}) proxy.SetDefective(defective_params)
Explanation:
This method induces various types of faults into a device to test its robustness and error-handling capabilities.
- FAILED_RESULT:
A fault type where an exception will be raised when command invoked with induce fault.
- Raises:
throw_exception – Raises error to mimic the real device behavior.
4. Helper_SDP_Subarray_Leaf_Device
This module implements the Helper devices for subarray leaf nodes for testing an integrated TMC
- class ska_tmc_common.test_helpers.helper_sdp_subarray_leaf_device.HelperSdpSubarrayLeafDevice(*args: Any, **kwargs: Any)
Bases:
HelperSubarrayLeafDeviceA device exposing commands and attributes of the SDP Subarray Leaf Nodes devices.
- init_device() None
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperSubarrayDevice’s init_device() “command”.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialisation. :return: ResultCode and message
- read_sdpSubarrayObsState()
Reads the current observation state of the SDP subarray :return: obsstate value
- read_sdpSubarrayAdminMode()
Reads the admin mode of the SDP subarray leaf node :return: admin mode
- SetSdpSubarrayLeafNodeObsState(argin: ska_tango_base.control_model.ObsState) None
Trigger a ObsState change
- SetSdpSubarrayLeafNodeAdminMode(argin: int) None
Trigger a admin mode change
- push_obs_state_event(obs_state: ska_tango_base.control_model.ObsState) None
Push Obs State Change Event
5. Helper_MCCS_Controller
This module implements the Helper MCCS controller devices for testing an integrated TMC
- class ska_tmc_common.test_helpers.helper_mccs_controller_device.HelperMCCSController(*args: Any, **kwargs: Any)
Bases:
HelperBaseDeviceA helper MCCS controller device for triggering state changes with a command
- init_device() None
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperMCCSController’s init_device() “command”.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialisation. :return: ResultCode, message :rtype:tuple
- read_isAdminModeEnabled()
Raise an AttributeError indicating ‘isAdminModeEnabled’ is unavailable. :raises AttributeError: Always raised to block access to the attribute.
- write_isAdminModeEnabled(value: bool)
Raise an AttributeError indicating that ‘isAdminModeEnabled’ cannot be modified. :param value: The value attempted to set for isAdminModeEnabled. :raises AttributeError: Always raised to access to the attribute..
- SetDefective(values: str) None
Trigger defective change :param: values :type: str
- is_Allocate_allowed() bool
Check if command Allocate is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- Allocate(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Allocate command on MCCS controller device
- Returns:
a tuple containing ResultCode and Message
- Return type:
Tuple
- is_Release_allowed() bool
Check if command Release is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- Release(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Release command on MCCS controller device
- Returns:
a tuple containing Resultcode and Message
- Return type:
Tuple
- is_RestartSubarray_allowed() bool
This method checks if the RestartSubarray command is allowed in the current device state. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- RestartSubarray(argin: int) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke RestartSubarray command. :param argin: an integer subarray_id. :return: ResultCode, command id :rtype: tuple
- induce_fault(command_name: str, command_id: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
Induces a fault into the device based on the given parameters.
- Parameters:
command_name (str) – The name of the command for which a fault is being induced.
command_id (str) – The command id over which the LRCR event is to be pushed.
Explanation: This method induces various types of faults into a device to test its robustness and error-handling capabilities. Overrided to fix time out issue on MCCS Master Leaf node.
- STUCK_IN_INTERMEDIATE_STATE:
This fault type makes it such that the device is stuck in the given Observation state.
6. Helper_Subarray_Device
This module implements the Helper devices for subarray nodes for testing an integrated TMC
- class ska_tmc_common.test_helpers.helper_subarray_device.HelperSubArrayDevice(*args: Any, **kwargs: Any)
Bases:
SKASubarrayA generic subarray device for triggering state changes with a command. It can be used as helper device for element subarray node
- init_device()
- read_isAdminModeEnabled()
Raise an AttributeError indicating ‘isAdminModeEnabled’ is unavailable. :raises AttributeError: Always raised to block access to the attribute.
- write_isAdminModeEnabled(value: bool)
Raise an AttributeError indicating that ‘isAdminModeEnabled’ cannot be modified. :param value: The value attempted to set for isAdminModeEnabled. :raises AttributeError: Always raised to access to the attribute..
- read_adminMode() ska_tango_base.control_model.AdminMode
This method reads the adminMode value of the device. :return: admin_mode value :rtype: AdminMode
- write_adminMode(value)
This method writes the adminMode value of the device.
- assignedResources() str
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperSubArrayDevice’s init_device() “command”.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialization. :return: ResultCode
- read_scanId() int
This method is used to read the attribute value for scanId. :return: scan_id
- read_obsStateTransitionDuration()
Read transition :return: state duration info
- read_isSubsystemAvailable() bool
Returns availability status for the leaf nodes devices :return: availability status for the leaf nodes devices :rtype: bool
- SetSubsystemAvailable(value: bool) None
Sets Availability of the device :rtype: bool
- AddTransition(state_duration_info: str) None
This command will set duration for obs state such that when respective command for obs state is triggered then it change obs state after provided duration
- ResetTransitions() None
This command will reset ObsState duration which is set
- read_commandCallInfo()
This method is used to read the attribute value for commandCallInfo. :return: attribute value for commandCallInfo
- read_commandDelayInfo()
This method is used to read the attribute value for delay. :return: attribute value for delay
- read_commandInProgress() str
This method is used to read, which command is in progress :return: command in progress :rtype: str
- read_defective() str
This method is used to read the value of the attribute defective :return: attribute value defective :rtype: str
- read_receiveAddresses() str
This method is used to read receiveAddresses attribute :return: attribute receiveAddresses :rtype: str
- push_obs_state_event(obs_state: ska_tango_base.control_model.ObsState) None
This Method pushes change event for subarray observation state Args: obs_state (ObsState): Observation state of subarray
- push_command_result(result_code: ska_tango_base.commands.ResultCode, command_name: str, message: str = 'Command Completed', command_id: str = '') None
Push long running command result event for given command.
- Parameters:
result_code (ResultCode) – The result code to be pushed as an event
command_name (str) – The command name for which event is being pushed
message (str) – The message associated with the command result
command_id (str) – The unique command id
- update_device_obsstate(value: ska_tango_base.control_model.ObsState, command_name: str = '') None
Updates the given data after a delay.
- update_command_info(command_name: str = '', command_input: str = '') None
This method updates the commandCallInfo attribute, with the respective command information.
- Args:
command_name (str): command name command_input (str): Input argin for command
- create_component_manager() EmptySubArrayComponentManager
This method is used to create an instance of EmptySubarrayComponentManager :return: component manager :rtype: EmptySubArrayComponentManager
- SetDelayInfo(command_delay_info: str) None
Update delay value
- ResetDelayInfo() None
Reset Delay to its default values
- ClearCommandCallInfo() None
Clears commandCallInfo to empty list
- SetDirectObsState(argin: ska_tango_base.control_model.ObsState) None
Trigger a ObsState change
- SetDirectState(argin: tango.DevState) None
- Trigger a DevState if self.dev_state() != argin:
- self.set_state(argin)
change
- SetDirectHealthState(argin: ska_tango_base.control_model.HealthState) None
Trigger a HealthState change
- SetDirectCommandInProgress(argin: str) None
Trigger a CommandInProgress change
- SetDirectassignedResources(argin: str) None
Triggers an assignedResources attribute change. Note: This method should be used only in case of low.
- is_On_allowed() bool
Check if command On is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- On() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes On command on Subarray Device :return: ResultCode :rtype: Tuple
- is_Off_allowed() bool
Check if command Off is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- Off() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Off command on Subarray Device :return: ResultCode and message :rtype: Tuple
- induce_fault(command_name: str, command_id: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
Induces a fault into the device based on the given parameters.
- Parameters:
command_name (str) – The name of the command for which a fault is being induced.
command_id (str) – The command id over which the LRCR event is to be pushed.
- Returns:
ResultCode and Unique_ID
- Return type:
Tuple[List[ResultCode], List[str]]
- Example:
defective_params = json.dumps({“enabled”: False,”fault_type”: FaultType.FAILED_RESULT,”error_message”: “Default exception.”, “result”: ResultCode.FAILED,}) proxy.SetDefective(defective_params)
Explanation: This method induces various types of faults into a device to test its robustness and error-handling capabilities.
- FAILED_RESULT:
A fault type that triggers a failed result code for the command. The device will return a result code of ‘FAILED’ along with a unique_id indicating that the command execution has failed.
- LONG_RUNNING_EXCEPTION:
A fault type where a failed result will be sent over the LongRunningCommandResult attribute in ‘delay’ amount of time.
- STUCK_IN_INTERMEDIATE_STATE:
This fault type makes it such that the device is stuck in the given Observation state.
- COMMAND_NOT_ALLOWED_AFTER_QUEUING:
This fault type sends a ResultCode.NOT_ALLOWED event through the LongRunningCommandResult attribute.
- COMMAND_NOT_ALLOWED_EXCEPTION_AFTER_QUEUING:
This fault type sends a ResultCode.REJECTED event through the LongRunningCommandResult attribute.
- STUCK_IN_OBS_STATE:
This fault type sets the device to given obsState and sends out an event on the LongRunningCommandResult attribute.
- SetDefective(values: str) None
Trigger defective change :param: values :type: str
- is_Standby_allowed() bool
Check if command Standby is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- Standby() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Standby command on subarray devices :return: ResultCode, message :rtype: tuple
- is_AssignResources_allowed() bool
Check if command AssignResources is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- AssignResources(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes AssignResources command on subarray devices :return: ResultCode and message
- is_ReleaseResources_allowed() bool
Check if command ReleaseResources is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- ReleaseResources(argin) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes ReleaseResources command on subarray device :return: ResultCode and message
- is_ReleaseAllResources_allowed() bool
Check if command ReleaseAllResources is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- ReleaseAllResources() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes ReleaseAllResources command on subarray device :return: ResultCode, message :rtype: tuple
- is_Configure_allowed() bool
Check if command Configure is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- Configure(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Configure command on subarray devices :return: ResultCode, message :rtype: tuple
- is_Scan_allowed() bool
Check if command Scan is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- Scan(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Scan command on subarray devices. :return: ResultCode, message :rtype: tuple
- is_EndScan_allowed() bool
Check if command EndScan is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- EndScan() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes EndScan command on subarray devices. :return: ResultCode, message :rtype: tuple
- is_End_allowed() bool
Check if command End is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- End() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes End command on subarray devices. :return: ResultCode, message :rtype: tuple
- is_GoToIdle_allowed() bool
Check if command GoToIdle is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- GoToIdle() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes GoToIdle command on subarray devices. :return: ResultCode, message :rtype: tuple
- is_ObsReset_allowed() bool
Check if command ObsReset is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- ObsReset() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
ObsReset Command :return: ResultCode and message
- is_Abort_allowed() bool
Check if command Abort is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- Abort() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Abort command on subarray devices. :return: ResultCode, message :rtype: tuple
- is_SetAdminMode_allowed() bool
This method checks if SetAdminMode command is allowed in the current device state. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- SetAdminMode(argin) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke SetAdminMode command. :return: ResultCode, message :rtype: tuple
- is_Restart_allowed() bool
Check if command Restart is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- Restart() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Restart command on subarray devices :return: ResultCode, message :rtype: tuple
7. Helper_Subarray_Leaf_Device
This module implements the Helper devices for subarray leaf nodes for testing an integrated TMC
- class ska_tmc_common.test_helpers.helper_subarray_leaf_device.HelperSubarrayLeafDevice(*args: Any, **kwargs: Any)
Bases:
HelperBaseDeviceA device exposing commands and attributes of the Subarray Leaf Nodes devices.
- init_device() None
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperSubarrayDevice’s init_device() “command”.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialisation. :return: ResultCode and message
- read_obsStateTransitionDuration()
Read transition :return: state duration info
- read_commandCallInfo()
This method is used to read the attribute value for commandCallInfo. :return: attribute value for commandCallInfo
- read_defective() str
Returns defective status of devices :return: attribute value defective :rtype: str
- read_obsState() ska_tango_base.control_model.ObsState
This method is used to read the attribute value for obsState. :return: attribute value for obsstate
- update_command_info(command_name: str = '', command_input: str = '') None
This method updates the commandCallInfo attribute, with the respective command information.
- Args:
command_name (str): command name command_input (str): Input argin for command
- ClearCommandCallInfo() None
Clears commandCallInfo to empty list
- AddTransition(state_duration_info: str) None
This command will establish a duration for the observation state, so that when the corresponding command for the observation state is triggered,it will transition to a provided observation state after the specified duration
- ResetTransitions() None
This command will reset ObsState duration which is set
- SetDirectObsState(value: ska_tango_base.control_model.ObsState) None
Trigger defective change :param: values :type: str
- push_obs_state_event(obs_state: ska_tango_base.control_model.ObsState) None
Push Obs State Change Event
- is_AssignResources_allowed() bool
This method checks if the AssignResources command is allowed or not :return:
Trueif the command is allowed :raises CommandNotAllowed: command is not allowed
- AssignResources(argin: str = '') Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke AssignResources command. :return: ResultCode, message :rtype: tuple
- is_Configure_allowed() bool
This method checks the Configure is allowed in the current device state. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- Configure(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke Configure command. :return: ResultCode, message :rtype: tuple
- is_Scan_allowed() bool
This method checks if the Scan command is allowed in the current device state. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- Scan(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke Scan command. :return: ResultCode, message :rtype: tuple
- is_EndScan_allowed() bool
This method checks if the EndScan command is allowed in the current device state. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- EndScan() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke EndScan command. :return: ResultCode, message :rtype: tuple
- is_End_allowed() bool
This method checks if the End command is allowed in the current device state. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- End() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke End command. :return: ResultCode, message :rtype: tuple
- is_GoToIdle_allowed() bool
This method checks if the GoToIdle command is allowed in the current device state. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- GoToIdle() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke GoToIdle command. :return: ResultCode, message :rtype: tuple
- is_Abort_allowed() bool
This method checks if the Abort command is allowed in the current device state. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- Abort() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke Abort command. :return: ResultCode, message :rtype: tuple
- is_Restart_allowed() bool
This method checks if the Restart command is allowed in the current device state. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- Restart() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke Restart command. :return: ResultCode, message :rtype: tuple
- is_ReleaseAllResources_allowed() bool
This method checks if the ReleaseAllResources command is allowed in the current device state. :return:
Trueif the command is allowed :raises CommandNotAllowed: command is not allowed :rtype: bool
- ReleaseAllResources() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke ReleaseAllResources command. :return: ResultCode, message :rtype: tuple
- is_ReleaseResources_allowed() bool
This method checks if the ReleaseResources command is allowed in the current device state. :return:
Trueif the command is allowed :raises CommandNotAllowed: command is not allowed :rtype: bool
- ReleaseResources(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke ReleaseResources command. :return: ResultCode, message :rtype: tuple
8. Helper_Dish_LN_Device
This module implements the Helper Dish Leaf Node Device for testing an integrated TMC.
- class ska_tmc_common.test_helpers.helper_dish_ln_device.HelperDishLNDevice(*args: Any, **kwargs: Any)
Bases:
HelperBaseDeviceA device exposing commands and attributes of the Dish Leaf Node device.
- init_device() None
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperDishLNDevice’s init_device() command.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialisation. :return: ResultCode and message
- read_kValueValidationResult() str
Get the k-value validation result. :return: kValue validation result :rtype:str
- read_trackTableErrors()
Read method for trackTableErrors
- sourceOffset() list[float]
This attribute is used for storing the commanded offsets received as a part of delta/partial configuration. This attribute is subscribed by SDP queue connector device. :return: sourceOffset
- sdpQueueConnectorFqdn(sdpqc_fqdn: str) None
This Method is used to get the SDP queue connector FQDN from subarray node and then Dish Leaf Node have to subscribe to its respective pointing_cal attribute on queue connector device.
- kValue(kvalue: int) None
Set memorized dish vcc map :param kvalue: dish vcc config json string :type str
- read_defective() str
Returns defective status of devices :return: defective status of devices :rtype: str
- read_actualPointing() str
Read method for actual pointing. :return: actual pointing value
- read_pointingState() PointingState
This method reads the pointingState of of dish leaf node’s respective dish. :return: pointingState of dishes :rtype: PointingState
- read_dishMode() DishMode
This method reads the DishMode of dishes of dish leaf node’s respective dish. :return: DishMode of dishes :rtype: DishMode
- SetDirectDishMode(argin: DishMode) None
Trigger a DishMode change
- SetDirectPointingState(argin: PointingState) None
Trigger a PointingState change
- process_pointing_cal(event_data: tango.EventData) None
This Method takes the pointing calibration data from SDP queue connector device and invokes the TrackLoadStaticOff command on the Dish Master
- set_dish_mode(dishMode: DishMode) None
This method set the Dish Mode
- set_pointing_state(pointingState: PointingState) None
This method set the Pointing State of dish leaf node’s respective dish.
- set_offset(cross_elevation: float, elevation: float) None
Sets the offset for Dish.
- SetDirectkValueValidationResult(result_code: str) None
Set the kValuValidationResult :argin dtype: str :rtype:None
- SetSourceOffset(sourceOffset: list) None
Sets the commanded offsets
- read_commandCallInfo()
This method is used to read the attribute value for commandCallInfo. :return: command_call_info value
- read_commandDelayInfo() str
This method is used to read the attribute value for delay. :return: command_delay_infp value
- push_dish_kvalue_validation_result()
Push Dish k-value Validation result event If memorized k-value already set then push Result Code as OK else push result code event as UNKNOWN
- push_dish_kvalue_val_result_after_initialization()
This method gets invoked only once after initialization and push the k-value validation result.
- is_SetKValue_allowed() bool
This method checks if the SetKValue Command is allowed in current State. :return: boolean value if command is allowed or not :rtype: bool
- SetKValue(kvalue: int) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This command invokes SetKValue command on Dish Master.
- Parameters:
kvalue – k value between range 1-2222.
- Kvalue dtype:
int
- Returns:
ResultCode and message
- Return type:
Tuple[List[ResultCode], List[str]]
- SetDelayInfo(command_delay_info: str) None
Update delay value
- ResetDelayInfo() None
Reset Delay to it’s default values
- ClearCommandCallInfo() None
Clears commandCallInfo to empty list
- is_Off_allowed() bool
This method checks if the Off Command is allowed in current State. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- Off()
This method invokes Off command on Dish Simulator.
- is_SetStandbyFPMode_allowed() bool
This method checks if the is_SetStandbyFPMode_allowed Command is allowed in current State. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- SetStandbyFPMode() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes SetStandbyFPMode command on Dish Master :return: ResultCode and message :rtype: tuple
- is_SetStandbyLPMode_allowed() bool
This method checks if the is_SetStandbyLPMode_allowed Command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- SetStandbyLPMode() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes SetStandbyLPMode command on Dish Master :return: ResultCode and message :rtype: tuple
- is_SetOperateMode_allowed() bool
This method checks if the SetOperateMode Command is allowed in current State. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- SetOperateMode() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes SetOperateMode command on Dish Master :return: ResultCode and message :rtype: tuple
- is_SetStowMode_allowed() bool
This method checks if the SetStowMode Command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- SetStowMode() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes SetStowMode command on Dish Master :return: ResultCode and message :rtype : tuple
- is_Track_allowed() bool
This method checks if the Track Command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- Track() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Track command on Dish Master :return: ResultCode and message :rtype: tuple
- is_TrackStop_allowed() bool
This method checks if the TrackStop Command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- TrackStop() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes TrackStop command on Dish Master :return: ResultCode and message :rtype: tuple
- is_AbortCommands_allowed() bool
This method checks if the AbortCommands command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- AbortCommands() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes AbortCommands command on Dish Master :return: ResultCode and message :rtype: tuple
- is_Configure_allowed() bool
This method checks if the Configure Command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- Configure(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Configure command on Dish Master :return: ResultCode and message :rtype: tuple
- is_TrackLoadStaticOff_allowed() bool
This method checks if the TrackLoadStaticOff command is allowed in current State. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- TrackLoadStaticOff(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes TrackLoadStaticOff command on Dish Master.
- Parameters:
argin – A list containing scan_id/ time, cross elevation and elevation offsets.
- Argin dtype:
str(List)
- Returns:
ResultCode and message
- Return type:
Tuple[List[ResultCode], List[str]]
- update_command_info(command_name: str = '', command_input: str = '') None
This method updates the commandCallInfo attribute, with the respective command information.
- Args:
command_name (str): command name command_input (str): Input argin for command
- is_Scan_allowed() bool | CommandNotAllowed
This method checks if the Scan Command is allowed in current State. :return:
Trueif the command is allowed :raises CommandNotAllowed: command is not allowed :rtype: Union[bool,CommandNotAllowed]
- Scan(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Scan command on Dish Master :param argin: scan_id as and string. :return: ResultCode and message :rtype: Tuple[List[ResultCode], List[str]]
- ApplyPointingModel(global_pointing_data: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes ApplyPointingModel command on Dish Master :param global_pointing_data: input json string. :return: ResultCode and message :rtype: Tuple[List[ResultCode], List[str]]
- is_EndScan_allowed() bool | CommandNotAllowed
This method checks if the EndScan Command is allowed in current State. :rtype:bool :raises CommandNotAllowed: command is not allowed :rtype: Union[bool,CommandNotAllowed]
- EndScan() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes EndScan command on Dish Master :return: ResultCode and message :rtype: Tuple[List[ResultCode], List[str]]
9. Helper_Mccs_Subarray_Device
This module implements the Helper Mccs subarray device
- class ska_tmc_common.test_helpers.helper_mccs_subarray_device.HelperMccsSubarrayDevice(*args: Any, **kwargs: Any)
Bases:
HelperSubArrayDeviceA device exposing commands and attributes of the Mccs Subarray Device.
- init_device()
- ReleaseResources(argin) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method simulates ReleaseResources command on MCCS subarray device :return: ResultCode and message
10. Helper_MCCS_Master_Leaf_Node
This module implements the Helper MCCS master leaf node devices for testing an integrated TMC
- class ska_tmc_common.test_helpers.helper_mccs_master_leaf_node_device.HelperMCCSMasterLeafNode(*args: Any, **kwargs: Any)
Bases:
HelperBaseDeviceA helper MCCS master leafnode device for triggering state changes with a command
- init_device() None
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperMccsStateDevice’s init_device() “command”.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialisation. :return: ResultCode, message :rtype:tuple
- read_mccsControllerAdminMode() int
Reads the current admin mode of the mccs controller :return: obs state
- SetMccsControllerAdminMode(argin: int) None
Trigger a admin mode change :param argin: adminMode enum to set the admin mode. :dtype: int
- is_AssignResources_allowed() bool
Check if command AssignResources is allowed in the current device state.
- Returns:
Trueif the command is allowed- Return type:
bool
- Raises:
CommandNotAllowed – command is not allowed
- AssignResources(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes AssignResources command on MCCS master leaf node device.
- Returns:
a tuple containing ResultCode and Message
- Return type:
Tuple
- is_ReleaseAllResources_allowed() bool
Check if command ReleaseAllResources is allowed in the current device state.
- Returns:
Trueif the command is allowed- Raises:
CommandNotAllowed – command is not allowed
- Return type:
bool
- ReleaseAllResources(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes ReleaseAllResources command on MCCS master leaf node device.
- Returns:
a tuple containing ResultCode and Message
- Return type:
Tuple
11. Helper_Base_Device
A common module for different helper devices(mock devices)”
- class ska_tmc_common.test_helpers.helper_base_device.HelperBaseDevice(*args: Any, **kwargs: Any)
Bases:
SKABaseDeviceA common base device for helper devices.
- init_device() None
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperBaseDevice’s init_device() command.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
- create_component_manager() EmptyComponentManager
Creates an instance of EmptyComponentManager :return: component manager instance :rtype: EmptyComponentManager
- read_isAdminModeEnabled() bool
This method is used to read the attribute value for isAdminModeEnabled. :return: isAdminModeEnabled
- write_isAdminModeEnabled(value: bool)
This method is used to write the attribute value for isAdminModeEnabled :param value: The new value to set for isAdminModeEnabled.
- read_delay() int
This method is used to read the attribute value for delay. :return: delay
- read_defective() str
Returns defective status of devices :return: attribute value for defective params :rtype: str
- read_isSubsystemAvailable() bool
Returns availability status for the leaf nodes devices :return: availabitlity status :rtype: bool
- read_adminMode() ska_tango_base.control_model.AdminMode
This method reads the adminMode value of the device. :return: admin_mode value :rtype: AdminMode
- write_adminMode(value)
This method writes the adminMode value of the device.
- always_executed_hook() None
- delete_device() None
- SetDelay(delay: int) None
Set the delay value. :param delay: Delay to be set :type delay: int
- SetDefective(values: str) None
Trigger defective change :param: values :type: str
- induce_fault(command_name: str, command_id: str, is_dish: bool = False) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
Induces a fault into the device based on the given parameters.
- Parameters:
command_name (str) – The name of the command for which a fault is being induced.
command_id (str) – The command id over which the LRCR event is to be pushed.
- Returns:
ResultCode and Unique_ID
- Return type:
Tuple[List[ResultCode], List[str]]
- Example:
defective_params = json.dumps({“enabled”: False,”fault_type”: FaultType.FAILED_RESULT,”error_message”: “Default exception.”, “result”: ResultCode.FAILED,}) proxy.SetDefective(defective_params)
Explanation: This method induces various types of faults into a device to test its robustness and error-handling capabilities.
- FAILED_RESULT:
A fault type that triggers a failed result code for the command. The device will return a result code of ‘FAILED’ along with a unique_id indicating that the command execution has failed.
- LONG_RUNNING_EXCEPTION:
A fault type where a failed result will be sent over the LongRunningCommandResult attribute in ‘delay’ amount of time.
- STUCK_IN_INTERMEDIATE_STATE:
This fault type makes it such that the device is stuck in the given Observation state.
- COMMAND_NOT_ALLOWED_AFTER_QUEUING:
This fault type sends a ResultCode.NOT_ALLOWED event through the LongRunningCommandResult attribute.
- COMMAND_NOT_ALLOWED_EXCEPTION_AFTER_QUEUING:
This fault type sends a ResultCode.REJECTED event through the LongRunningCommandResult attribute.
- push_pointing_state_event(pointing_state: PointingState) None
Push Pointing State Change Event
- push_command_result(result_code: ska_tango_base.commands.ResultCode, command_name: str, message: str = 'Command Completed', command_id: str = '') None
Push long running command result event for given command.
- Parameters:
result_code (ResultCode) – The result code to be pushed as an event
command_name (str) – The command name for which event is being pushed
message (str) – The message associated with the command result
command_id (str) – The unique command id
- SetDirectState(argin: tango.DevState) None
Trigger a DevState change
:param tango.DevState
- SetSubsystemAvailable(value: bool) None
Sets Availability of the device :rtype: bool
- SetDirectHealthState(argin: ska_tango_base.control_model.HealthState) None
Trigger a HealthState change :param tango.DevState
- is_On_allowed() bool
This method checks if the On command is allowed in current state. :rtype: bool :return:
Trueif the command is allowed :raises CommandNotAllowed: command is not allowed
- On() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes On command :return: ResultCode and message :rtype: Tuple
- is_Off_allowed() bool
This method checks if the Off command is allowed in current state. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- Off() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Off command :return: ResultCode and message :rtype: Tuple
- is_Standby_allowed() bool
This method checks if the Standby command is allowed in current state. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- Standby() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Standby command :return: ResultCode and message :rtype: Tuple
- is_SetAdminMode_allowed() bool
This method checks if SetAdminMode command is allowed in the current device state. :return:
Trueif the command is allowed :rtype:bool :raises CommandNotAllowed: command is not allowed
- SetAdminMode(argin) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This is the method to invoke SetAdminMode command. :return: ResultCode, message :rtype: tuple
- is_Disable_allowed() bool
This method checks if the Disable command is allowed in current state. :return:
Trueif the command is allowed :rtype: bool :raises CommandNotAllowed: command is not allowed
- Disable() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This method invokes Disable command :return: ResultCode and message :rtype: Tuple
12. Helper_Csp_Master_Leaf_Device
This module defines a helper device that acts as csp master in our testing.
- class ska_tmc_common.test_helpers.helper_csp_master_leaf_node.HelperCspMasterLeafDevice(*args: Any, **kwargs: Any)
Bases:
HelperBaseDeviceA helper device class for Csp Master Leaf device
- init_device() None
- memorizedDishVccMap(value: str)
Set memorized dish vcc map :param value: dish vcc config json string :type str
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperCspMasterDevice’s init_device() command.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialisation. :return: ResultCode and message
- read_sourceDishVccConfig() str
This method reads the sourceDishVccConfig value of the dish. :return: sourceDishVccConfig value of the dish. :rtype:str
- read_dishVccConfig() str
This method reads the dishVccConfig value of the dish. :return: dishVccConfig value of the dish :rtype:str
- read_DishVccMapValidationResult() str
- Returns:
DishVccMapValidationResult value of the dish
- Return type:
str
- read_cspControllerAdminMode() int
Reads the current admin mode of the CSP controller :return: obs state
- SetCspControllerAdminMode(argin: int) None
Trigger a admin mode change :param argin: adminMode enum to set the admin mode. :dtype: int
- ResetSysParams() Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This Command Reset dishVccConfig and sourceDishVccConfig attribute :return: ResultCode and message
- is_LoadDishCfg_allowed() bool
This method checks if the LoadDishCfg command is allowed in current state. :return:
Trueif the command is allowed :rtype: bool
- LoadDishCfg(argin: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
This command updates attribute sourceDishVccConfig and dishVccConfig :return: ResultCode and message :rtype: Tuple
- Parameters:
argin – json with File URI.
- Dtype:
str
Example argin: { “interface”: “https://schema.skao.int/ska-mid-cbf-initial-parameters/2.2”,
“tm_data_sources”: [tm_data_sources] #The data source that is used to store the data and is accessible through the Telescope Model
“tm_data_filepath”: “path/to/file.json” #The path to the json file containing the Mid.CBF initialization parameters within the data source
}
- SetDishVccValidationResult(result: str) Tuple[List[ska_tango_base.commands.ResultCode], List[str]]
Set DishVccValidationResult and push event for same :return: ResultCode and message
- push_dish_vcc_validation_result()
Push Dish Vcc Validation result event If memorized dish vcc already set then push Result Code as OK else push result code event as UNKNOWN
- start_dish_vcc_validation()
Push Dish Vcc Validation result after Initialization
13. Helper_Csp_Subarray_Leaf_Device
This module implements the Helper devices for subarray leaf nodes for testing an integrated TMC
- class ska_tmc_common.test_helpers.helper_csp_subarray_leaf_device.HelperCspSubarrayLeafDevice(*args: Any, **kwargs: Any)
Bases:
HelperSubarrayLeafDeviceA device exposing commands and attributes of the CSP Subarray Leaf Node devices.
- init_device() None
- class InitCommand(*args: Any, **kwargs: Any)
Bases:
InitCommandA class for the HelperSubarrayDevice’s init_device() “command”.
- do() Tuple[ska_tango_base.commands.ResultCode, str]
Stateless hook for device initialisation. :return: ResultCode and message
- read_cspSubarrayObsState()
Reads the current observation state of the CSP subarray :return: obs state
- read_cspSubarrayAdminMode()
Reads the current observation state of the CSP subarray :return: obs state
- SetCspSubarrayLeafNodeObsState(argin: int) None
Trigger a ObsState change
- SetCspSubarrayLeafNodeAdminMode(argin: int) None
Trigger a ObsState change
- push_obs_state_event(obs_state: ska_tango_base.control_model.ObsState) None
Push Obs State Change Event
14. Helper_Sdp_Queue_Connector
This module defines a helper device that acts as SDP Queue Connector in testing.
- class ska_tmc_common.test_helpers.helper_sdp_queue_connector_device.HelperSdpQueueConnector(*args: Any, **kwargs: Any)
Bases:
HelperBaseDeviceA helper device that emulates the behavior of pointing_cal_{dish_id} attributes from SdpQueueConnector device for testing. Queue Connector is a tango device of SDP.
- init_device()
- pointing_cal_SKA001() list[float]
Attribute to give calibrated pointing offsets of dish SKA001
- pointing_cal_SKA002() list[float]
Attribute to give calibrated pointing offsets of dish SKA002
- pointing_cal_SKA003() list[float]
Attribute to give calibrated pointing offsets of dish SKA003
- pointing_cal_SKA004() list[float]
Attribute to give calibrated pointing offsets of dish SKA004
- pointing_cal_SKA036() list[float]
Attribute to give calibrated pointing offsets of dish SKA036
- pointing_cal_SKA063() list[float]
Attribute to give calibrated pointing offsets of dish SKA063
- pointing_cal_SKA100() list[float]
Attribute to give calibrated pointing offsets of dish SKA100
- SetPointingCalSka001(pointing_cal: list) None
This method sets the value of pointing_cal_SKA001 attribute also push the event for the attribute
- SetPointingCalSka002(pointing_cal: list) None
This method sets the value of pointing_cal_SKA002 attribute also push the event for the attribute
- SetPointingCalSka003(pointing_cal: list) None
This method sets the value of pointing_cal_SKA003 attribute also push the event for the attribute
- SetPointingCalSka004(pointing_cal: list) None
This method sets the value of pointing_cal_SKA004 attribute also push the event for the attribute
- SetPointingCalSka036(pointing_cal: list) None
This method sets the value of pointing_cal_SKA036 attribute also push the event for the attribute
- SetPointingCalSka063(pointing_cal: list) None
This method sets the value of pointing_cal_SKA063 attribute also push the event for the attribute
- SetPointingCalSka100(pointing_cal: list) None
This method sets the value of pointing_cal_SKA100 attribute also push the event for the attribute
Conclusion
This module contain all helper devices required in TMC for testing and debugging