ska_tmc_mccsmasterleafnode.manager package

Submodules

ska_tmc_mccsmasterleafnode.manager.component_manager module

This module implements ComponentManager class for the Mccs Master Leaf Node.

class ska_tmc_mccsmasterleafnode.manager.component_manager.MccsMLNComponentManager(*args: Any, **kwargs: Any)

Bases: TmcLeafNodeComponentManager

A component manager for MCCSMasterLeafNode component.

It supports:

  • Monitoring its component, e.g. detect that it has been turned off or on

  • Controlling the behaviour of MCCS Master.

call_assign_resources(argin, task_callback: Optional[Callable] = None) Tuple[ska_control_model.TaskStatus, str]

Submits AssignResources command as a separate task.

Returns:

a result code and message

call_off_command(task_callback: Callable) Tuple[ska_control_model.TaskStatus, str]

Submits the Off command for execution.

Return type:

tuple

call_on_command(task_callback: Callable) Tuple[ska_control_model.TaskStatus, str]

Submits the On command for execution.

Return type:

tuple

call_release_resources(argin, task_callback: Optional[Callable] = None) Tuple[ska_control_model.TaskStatus, str]

Submits ReleaseAllResources command as a separate task.

Returns:

a result code and message

call_standby_command(task_callback: Callable) Tuple[ska_control_model.TaskStatus, str]

Submits the Standby command for execution. :rtype: tuple

device_failed(device_info: ska_tmc_common.DeviceInfo, exception: Exception) None

Mark a device as failed and invoke the corresponding callback if it exists.

param device_info:

a device info

type device_info:

DeviceInfo

param exception:

an exception

type:

Exception

get_device() ska_tmc_common.DeviceInfo
get_lrcr_result(command_id)

Returns long running command result for command with given command ID

is_command_allowed(command_name: str) bool

Checks whether this command is allowed. It checks that the device is not in the FAULT and UNKNOWN state before executing the command and that all the components needed for the operation are not unresponsive.

Returns:

True if this command is allowed

Return type:

boolean

is_mccs_master_responsive() None

Checks if MCCS Master device is responsive.

property mccs_master_device_name: str

Returns device name for the MCCS Master Device.

start_liveliness_probe(lp: ska_tmc_common.LivelinessProbeType) None

Need to override this method here because in super self._device is setting to None so overriden here to set self._device

update_command_result(device_name: str, value: tuple)

Updates the long-running command result callback

update_lrcr_result(event_command_id, event_command_result)

This function will update result of longrunningcommandresult attribute against a command Id

update_ping_info(ping: int, device_name: str) None

Update a device with the correct ping information. :param ping: device response time :type ping: int

validate_json_argument_low(json_argument, req_keys) tuple

To validate the low json for assign resources command before entering the queue :param json_argument: Json Argument :type json_argument: dict :param req_keys: Required key list to check in json argument :type req_keys: list

Module contents

Init file for MCCSMasterLeafNode Manager

class ska_tmc_mccsmasterleafnode.manager.MccsMLNComponentManager(*args: Any, **kwargs: Any)

Bases: TmcLeafNodeComponentManager

A component manager for MCCSMasterLeafNode component.

It supports:

  • Monitoring its component, e.g. detect that it has been turned off or on

  • Controlling the behaviour of MCCS Master.

call_assign_resources(argin, task_callback: Optional[Callable] = None) Tuple[ska_control_model.TaskStatus, str]

Submits AssignResources command as a separate task.

Returns:

a result code and message

call_off_command(task_callback: Callable) Tuple[ska_control_model.TaskStatus, str]

Submits the Off command for execution.

Return type:

tuple

call_on_command(task_callback: Callable) Tuple[ska_control_model.TaskStatus, str]

Submits the On command for execution.

Return type:

tuple

call_release_resources(argin, task_callback: Optional[Callable] = None) Tuple[ska_control_model.TaskStatus, str]

Submits ReleaseAllResources command as a separate task.

Returns:

a result code and message

call_standby_command(task_callback: Callable) Tuple[ska_control_model.TaskStatus, str]

Submits the Standby command for execution. :rtype: tuple

device_failed(device_info: ska_tmc_common.DeviceInfo, exception: Exception) None

Mark a device as failed and invoke the corresponding callback if it exists.

param device_info:

a device info

type device_info:

DeviceInfo

param exception:

an exception

type:

Exception

get_device() ska_tmc_common.DeviceInfo
get_lrcr_result(command_id)

Returns long running command result for command with given command ID

is_command_allowed(command_name: str) bool

Checks whether this command is allowed. It checks that the device is not in the FAULT and UNKNOWN state before executing the command and that all the components needed for the operation are not unresponsive.

Returns:

True if this command is allowed

Return type:

boolean

is_mccs_master_responsive() None

Checks if MCCS Master device is responsive.

property mccs_master_device_name: str

Returns device name for the MCCS Master Device.

start_liveliness_probe(lp: ska_tmc_common.LivelinessProbeType) None

Need to override this method here because in super self._device is setting to None so overriden here to set self._device

update_command_result(device_name: str, value: tuple)

Updates the long-running command result callback

update_lrcr_result(event_command_id, event_command_result)

This function will update result of longrunningcommandresult attribute against a command Id

update_ping_info(ping: int, device_name: str) None

Update a device with the correct ping information. :param ping: device response time :type ping: int

validate_json_argument_low(json_argument, req_keys) tuple

To validate the low json for assign resources command before entering the queue :param json_argument: Json Argument :type json_argument: dict :param req_keys: Required key list to check in json argument :type req_keys: list