ska_tmc_mccsmasterleafnode.commands package
Link to the TMC User documentation is here.
Submodules
ska_tmc_mccsmasterleafnode.commands.mccsmln_command module
Mccs Master Leaf Node Command module
- class ska_tmc_mccsmasterleafnode.commands.mccs_mln_command.MccsMLNCommand(*args: Any, **kwargs: Any)
Bases:
TmcLeafNodeCommandA common command class for Mccs Master Leaf Node
- do(argin: Optional[Any] = None)
Abstract Method from TmcLeafNodeCommand is defined here but not utilized by this Class.
- Parameters:
argin (_type_, optional) – Accepts argument if required. Defaults to None.
- do_low(argin: Optional[Any] = None)
Abstract Method from TmcLeafNodeCommand is defined here but not utilized by this Class.
- Parameters:
argin (_type_, optional) – Accepts argument if required. Defaults to None.
- init_adapter() Tuple[ska_tango_base.commands.ResultCode, str]
Method to iniatialise MCCS master adapter
- Returns:
tuple of resultcode and message
- Return type:
Tuple[ResultCode, str]
- init_adapter_low()
Initialize the adapter for the low-level device.
- reject_command(message) tuple[ska_control_model.TaskStatus, str]
Command will get rejected with a given message .
- Parameters:
message – Message for rejection
- Returns:
TaskStatus.REJECTED and message
- Return type:
tuple[TaskStatus, str]
- set_command_id(command_name: str)
Sets the command id for error propagation.
- Parameters:
command_name (str) – Name of the command
- update_task_status(**kwargs)
Abstract Method from TmcLeafNodeCommand is defined here but not utilized by this Class.
- wait_for_completion(device_length: int = 1) Tuple[ska_tango_base.commands.ResultCode, str]
Wait for command completion using CommandCompletionTracker
- Parameters:
device_length (int) – Number of devices to wait for completion
1) ((default is) –
- Returns:
Final result code and corresponding message
- Return type:
Tuple[ResultCode, str]
- ska_tmc_mccsmasterleafnode.commands.mccs_mln_command.task_callback_default(**kwargs) None
Default method if the taskcallback is not passed
- Parameters:
status – status of the task.
progress – progress of the task.
result – result of the task.
exception – an exception raised from the task.
ska_tmc_mccsmasterleafnode.commands.off_command module
Off command class for LowTmcLeafNodeMccs.
- class ska_tmc_mccsmasterleafnode.commands.off_command.Off(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class for LowTmcLeafNodeMccs’s Off() command.
Off command on LowTmcLeafNodeMccs enables the telescope to perform further operations and observations. It Invokes Off command on Mccs Controller device.
- do(argin: Optional[Any] = None) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Off command on Mccs Controller.
- Parameters:
argin – Optional argument
- Returns:
tuple of ResultCode and message
- Return type:
Tuple[ResultCode, str]
- off(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None) None
A method to invoke the Off command. It sets the task_callback status according to command progress.
- Parameters:
logger (logging.Logger) – logger
task_callback (TaskCallbackType, optional) – Update task state
task_abort_event (Event, optional) – Check for abort, defaults to None
ska_tmc_mccsmasterleafnode.commands.on_command module
On command class for LowTmcLeafNodeMccs.
- class ska_tmc_mccsmasterleafnode.commands.on_command.On(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class for LowTmcLeafNodeMccs’s On() command.
On command on LowTmcLeafNodeMccs enables the telescope to perform further operations and observations. It Invokes On command on Mccs Controller device.
- do(argin: Optional[Any] = None) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke On command on Mccs Controller.
- Parameters:
argin – Optional input arg
- Returns:
ResultCode and message
- Return type:
Tuple[ResultCode, str]
- on(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None) None
A method to invoke the On command. It sets the task_callback status according to command progress.
- Parameters:
logger (logging.Logger) – logger
task_callback (TaskCallbackType, optional) – Update task state
task_abort_event (Event, optional) – Check for abort, defaults to None
ska_tmc_mccsmasterleafnode.commands.standby_command module
Standby command class for LowTmcLeafNodeMccs.
- class ska_tmc_mccsmasterleafnode.commands.standby_command.Standby(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class for LowTmcLeafNodeMccs’s Standby() command.
Standby command on LowTmcLeafNodeMccs enables the telescope to perform further operations and observations. It invokes Standby command on Mccs Controller device.
- do(argin: Optional[Any] = None) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Standby command on Mccs Controller.
- Parameters:
argin – Optional input argument
- Returns:
Resultcode and message
- Return type:
Tuple[ResultCode, str]
- standby(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None) None
This is a long running method for Standby command, it executes do hook, invokes Standby command on MCCS Controller.
- Parameters:
logger (logging.Logger) – logger
task_callback (TaskCallbackType) – Update task state
task_abort_event (Event) – Check for abort, defaults to None
ska_tmc_mccsmasterleafnode.commands.assign_resources_command module
AssignResources command class for MCCS Master Leaf Node.
- class ska_tmc_mccsmasterleafnode.commands.assign_resources_command.AssignResources(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class for MCCS Master LeafNode’s AssignResources() command. Assign resources command will be sent to MCCS Controller.
- assign_resources(argin: str, task_callback: Optional[ska_tango_base.base.TaskCallbackType] = None, task_abort_event=None) Tuple[ska_tango_base.commands.ResultCode, str]
This is a long running method for the AssignResources command on MCCS Master Leaf Node. It executes the do hook and invokes the Allocate command on the MCCS Controller.
- Parameters:
argin (str) – Input JSON string.
- Returns:
A tuple containing the result code and a message.
- Return type:
Tuple[ResultCode, str]
- do(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke the Allocate command on the MCCS Controller.
- Parameters:
argin (str) – The string in JSON format. The JSON contains the following values: - resources: List of resources to be assigned.
- Returns:
A tuple containing the result code and a message or unique ID.
- Return type:
Tuple[ResultCode, str]
- get_lrcr_result() ska_tango_base.commands.ResultCode
Returns long running command result for command with current command ID
- Returns:
Returns long running command result for command with current command ID
- Return type:
ResultCode
- set_command_id(command_name: str)
Sets the command id for error propagation.
- Parameters:
command_name (str) – Name of the command
- update_task_status(**kwargs) None
Method to update task status with result code and exception message if any.
- Parameters:
kwargs – Keyword arguments containing task result details.
ska_tmc_mccsmasterleafnode.commands.release_all_resources_command module
ReleaseAllResources command class for MCCS Master Leaf Node.
- class ska_tmc_mccsmasterleafnode.commands.release_all_resources_command.ReleaseAllResources(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class to send Release command to MCCS Controller.
- do(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Release command.
- Parameters:
argin (str) – The string in JSON format.
- Returns:
A tuple containing a return code and “” as a string on successful release all resources. or Exception Message on failure / Rejection
- Return type:
Tuple[ResultCode, str]
- get_lrcr_result() ska_tango_base.commands.ResultCode
Returns long running command result for command with current command ID
- Returns:
Returns long running command result for command with current command ID
- Return type:
ResultCode
- release_all_resources(argin: str, task_callback: Optional[ska_tango_base.base.TaskCallbackType] = None, task_abort_event=None) Tuple[ska_tango_base.commands.ResultCode, str]
This is a long running method for ReleaseAllResources command, it executes do hook, invokes Release command on MCCS Master Leaf Node.
- Parameters:
argin (str) – Input JSON string
- Returns:
ResultCode and message
- Return type:
Tuple[ResultCode, str]
- set_command_id(command_name: str)
Sets the command id for error propagation.
- Parameters:
command_name (str) – Name of the command
- update_task_status(**kwargs) None
Method to update task status with result code and exception message if any.
- Parameters:
kwargs – Keyword arguments containing task result details.
Module contents
Init module for Mccs Master Leaf Node
- class ska_tmc_mccsmasterleafnode.commands.Abort(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class for MCCSMasterLeafNode’s Abort() command.
Abort command on MCCSMasterLeafNode enables to abort the in progress assign resource
- do(argin: str) Tuple[ska_tango_base.commands.ResultCode, str]
A method to abort the assign resource of MCCS controller device
- Parameters:
argin (str) – subarray id to abort
- Returns:
Tuple of ResultCode and message
- Return type:
Tuple[ResultCode, str]
- invoke_abort(argin: str, task_callback: ska_tango_base.base.TaskCallbackType = <function task_callback_default>, task_abort_event: ~typing.Optional[~threading.Event] = None) Tuple[ska_tango_base.commands.ResultCode, str]
This method calls do for Abort command
- Parameters:
task_callback (TaskCallbackType) – task_callback_default is default
task_abort_event (Optional[threading.Event]) – task abort event
- Returns:
tuple of ResultCode and message
- Return type:
Tuple[ResultCode, str]
- update_task_status(**kwargs: Dict[str, Union[Tuple[ska_tango_base.commands.ResultCode, str], ska_control_model.TaskStatus, str]]) None
Update the status of a task.
- Parameters:
**kwargs – Keyword arguments for task status update.
- class ska_tmc_mccsmasterleafnode.commands.AssignResources(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class for MCCS Master LeafNode’s AssignResources() command. Assign resources command will be sent to MCCS Controller.
- assign_resources(argin: str, task_callback: Optional[ska_tango_base.base.TaskCallbackType] = None, task_abort_event=None) Tuple[ska_tango_base.commands.ResultCode, str]
This is a long running method for the AssignResources command on MCCS Master Leaf Node. It executes the do hook and invokes the Allocate command on the MCCS Controller.
- Parameters:
argin (str) – Input JSON string.
- Returns:
A tuple containing the result code and a message.
- Return type:
Tuple[ResultCode, str]
- do(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke the Allocate command on the MCCS Controller.
- Parameters:
argin (str) – The string in JSON format. The JSON contains the following values: - resources: List of resources to be assigned.
- Returns:
A tuple containing the result code and a message or unique ID.
- Return type:
Tuple[ResultCode, str]
- get_lrcr_result() ska_tango_base.commands.ResultCode
Returns long running command result for command with current command ID
- Returns:
Returns long running command result for command with current command ID
- Return type:
ResultCode
- set_command_id(command_name: str)
Sets the command id for error propagation.
- Parameters:
command_name (str) – Name of the command
- update_task_status(**kwargs) None
Method to update task status with result code and exception message if any.
- Parameters:
kwargs – Keyword arguments containing task result details.
- class ska_tmc_mccsmasterleafnode.commands.Off(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class for LowTmcLeafNodeMccs’s Off() command.
Off command on LowTmcLeafNodeMccs enables the telescope to perform further operations and observations. It Invokes Off command on Mccs Controller device.
- do(argin: Optional[Any] = None) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Off command on Mccs Controller.
- Parameters:
argin – Optional argument
- Returns:
tuple of ResultCode and message
- Return type:
Tuple[ResultCode, str]
- off(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None) None
A method to invoke the Off command. It sets the task_callback status according to command progress.
- Parameters:
logger (logging.Logger) – logger
task_callback (TaskCallbackType, optional) – Update task state
task_abort_event (Event, optional) – Check for abort, defaults to None
- class ska_tmc_mccsmasterleafnode.commands.On(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class for LowTmcLeafNodeMccs’s On() command.
On command on LowTmcLeafNodeMccs enables the telescope to perform further operations and observations. It Invokes On command on Mccs Controller device.
- do(argin: Optional[Any] = None) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke On command on Mccs Controller.
- Parameters:
argin – Optional input arg
- Returns:
ResultCode and message
- Return type:
Tuple[ResultCode, str]
- on(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None) None
A method to invoke the On command. It sets the task_callback status according to command progress.
- Parameters:
logger (logging.Logger) – logger
task_callback (TaskCallbackType, optional) – Update task state
task_abort_event (Event, optional) – Check for abort, defaults to None
- class ska_tmc_mccsmasterleafnode.commands.ReleaseAllResources(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class to send Release command to MCCS Controller.
- do(argin: str = '') Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Release command.
- Parameters:
argin (str) – The string in JSON format.
- Returns:
A tuple containing a return code and “” as a string on successful release all resources. or Exception Message on failure / Rejection
- Return type:
Tuple[ResultCode, str]
- get_lrcr_result() ska_tango_base.commands.ResultCode
Returns long running command result for command with current command ID
- Returns:
Returns long running command result for command with current command ID
- Return type:
ResultCode
- release_all_resources(argin: str, task_callback: Optional[ska_tango_base.base.TaskCallbackType] = None, task_abort_event=None) Tuple[ska_tango_base.commands.ResultCode, str]
This is a long running method for ReleaseAllResources command, it executes do hook, invokes Release command on MCCS Master Leaf Node.
- Parameters:
argin (str) – Input JSON string
- Returns:
ResultCode and message
- Return type:
Tuple[ResultCode, str]
- set_command_id(command_name: str)
Sets the command id for error propagation.
- Parameters:
command_name (str) – Name of the command
- update_task_status(**kwargs) None
Method to update task status with result code and exception message if any.
- Parameters:
kwargs – Keyword arguments containing task result details.
- class ska_tmc_mccsmasterleafnode.commands.Standby(*args: Any, **kwargs: Any)
Bases:
MccsMLNCommandA class for LowTmcLeafNodeMccs’s Standby() command.
Standby command on LowTmcLeafNodeMccs enables the telescope to perform further operations and observations. It invokes Standby command on Mccs Controller device.
- do(argin: Optional[Any] = None) Tuple[ska_tango_base.commands.ResultCode, str]
Method to invoke Standby command on Mccs Controller.
- Parameters:
argin – Optional input argument
- Returns:
Resultcode and message
- Return type:
Tuple[ResultCode, str]
- standby(logger: Logger, task_callback: ska_tango_base.base.TaskCallbackType, task_abort_event: Optional[Event] = None) None
This is a long running method for Standby command, it executes do hook, invokes Standby command on MCCS Controller.
- Parameters:
logger (logging.Logger) – logger
task_callback (TaskCallbackType) – Update task state
task_abort_event (Event) – Check for abort, defaults to None