ska_tmc_cspsubarrayleafnode.commands package

Submodules

ska_tmc_cspsubarrayleafnode.commands.abstract_command module

Abstract Command Class for CspSubarrayLeafNode

class ska_tmc_cspsubarrayleafnode.commands.abstract_command.CspSLNCommand(*args: Any, **kwargs: Any)

Bases: TmcLeafNodeCommand

Abstract command class for all CspSubarrayLeafNode

do(argin=None)

This method will determine if telescope device types are for low or mid and accordingly invoke required behaviour

init_adapter() tuple

ska_tmc_cspsubarrayleafnode.commands.on_command module

ska_tmc_cspsubarrayleafnode.commands.off_command module

ska_tmc_cspsubarrayleafnode.commands.assign_resources_command module

AssignResources command class for CspSubarrayLeafNode.

class ska_tmc_cspsubarrayleafnode.commands.assign_resources_command.AssignResources(*args: Any, **kwargs: Any)

Bases: CspSLNCommand

A class for CspSubarayLeafNode’s AssignResources() command.

It accepts subarrayID and receptor ids in JSON string format and invokes AssignResources command on CSP Subarray.

assign_resources(argin: str, logger=None, task_callback: Optional[Callable] = None, task_abort_event: Optional[Event] = None) None

This is a long running method for AssignResources command, it executes do hook, invokes AssignResources command on CspSubarray.

Parameters:

argin – Input JSON string

:type argin : str :param logger: logger :type logger: logging.Logger :param task_callback: Update task state, defaults to None :type task_callback: Callable, optional :param task_abort_event: Check for abort, defaults to None :type task_abort_event: Event, optional

do_low(argin: ~typing.Optional[str] = None) -> (<class 'int'>, <class 'str'>)

Method to invoke AssignResources command on CSP low Subarray. :param argin: DevString. The string in JSON format. The JSON contains following values: subarray_id: integer Example: {“interface”:”https://schema.skao.int/ska-low-csp-assignresources/2.0”, “common”:{“subarray_id”:1},”lowcbf”:{“resources”:[{“device”:”fsp_01”,”shared”:true, “fw_image”:”pst”,”fw_mode”:”unused”},{“device”:”p4_01”,”shared”:true,”fw_image”:”p4.bin”, “fw_mode”:”p4”}]},}

Note: Enter the json string without spaces as an input. :return: (ResultCode, message) :raises Exception: if the command execution is not successful

do_mid(argin: ~typing.Optional[str] = None) -> (<class 'int'>, <class 'str'>)

Method to invoke AssignResources command on CSP Subarray. :param argin: DevString. The string in JSON format. The JSON contains following values: subarray_id: integer dish: Mandatory JSON object consisting of receptor_ids: DevVarString The individual string should contain dish numbers in string format with preceding zeroes upto 3 digits. E.g. SKA001, SKA002. Example: { “interface”: “https: //schema.skao.int/ska-mid-csp-assignresources/2.0”, “subarray_id”: 1, “dish”: { “receptor_ids”: [ “SKA001”, “SKA002” ] } } Note: Enter the json string without spaces as an input. :return: (ResultCode, message)

Raises:

Exception – if the command execution is not successful

update_task_status(result: ska_tango_base.commands.ResultCode, message: str = '')
validate_json_argument(input_argin: str) tuple

Validates the json argument

validate_json_argument_low(input_argin: str) tuple

Validates the json argument

ska_tmc_cspsubarrayleafnode.commands.release_all_resources_command module

ReleaseAllResources command class for CSPSubarrayLeafNode.

class ska_tmc_cspsubarrayleafnode.commands.release_all_resources_command.ReleaseAllResources(*args: Any, **kwargs: Any)

Bases: CspSLNCommand

A class for CspSubarayLeafNode’s ReleaseAllResources() command.

Releases all the resources of given CSP Subarray Leaf Node.

do_low(argin: Optional[str] = None) None

Method to invoke ReleaseAllResources command on CSP Subarray.

Parameters:

argin – DevString. The string in JSON format. Defaults to None.

Returns:

(ResultCode, message)

Raises:

Exception – if the command execution is not successful

do_mid(argin: Optional[str] = None) None

Method to invoke ReleaseAllResources command on CSP Subarray.

Parameters:

argin – DevString. The string in JSON format. Defaults to None.

Returns:

(ResultCode, message)

Raises:

Exception – if the command execution is not successful

release_all_resources(logger, task_callback: Optional[Callable] = None, task_abort_event: Optional[Event] = None) None

This is a long running method for ReleaseAllResources command, it executes do hook, invokes ReleaseAllResources command on CspSubarray.

Parameters:
  • logger (logging.Logger) – logger

  • task_callback (Callable, optional) – Update task state, defaults to None

  • task_abort_event (Event, optional) – Check for abort, defaults to None

update_task_status(result: ska_tango_base.commands.ResultCode, message: str = '')

Module contents