ska_tmc_centralnode.manager package

Submodules

ska_tmc_centralnode.manager.aggregators module

Aggregation method for telescope state Aggregating for Mid

class ska_tmc_centralnode.manager.aggregators.DishkValueValidationResultAggregator(cm, logger)

Bases: object

This Class Aggregate k-value validation results received from Dish Leaf Nodes.

aggregate(dish_leaf_node_fqdn, kvalue_validation_result: str) None

Aggregate the k-value validation result received from Dish leaf nodes and provide the aggregated k-value report result to Central Node. :param dish_leaf_node_fqdn: dish leaf node fqdn :type dish_leaf_node_fqdn: str :param kvalue_validation_result: kvalue validation result code :type kvalue_validation_result: str :return: : None :rtype: None

is_events_received_percentage_valid() bool

Verify the percent of kvalue validation result event received as specified by DishKvalueAggregationAllowedPercent property. :rtype: bool

update_central_node_with_result() None

This method updates the DishVccValidationStatus of Central Node. :rtype: None

class ska_tmc_centralnode.manager.aggregators.HealthStateAggregatorLow(*args: Any, **kwargs: Any)

Bases: Aggregator

Class for TelescopeStateAggregation for low Telescope

aggregate()

aggregate method for HealthStateAggregation

class ska_tmc_centralnode.manager.aggregators.HealthStateAggregatorMid(*args: Any, **kwargs: Any)

Bases: Aggregator

Class for HealthStateAggregation for Mid Telescope

aggregate()

Aggregation method for HealthState for Mid Telescope

class ska_tmc_centralnode.manager.aggregators.LoadDishCfgCommandResultAggregator(cm, logger)

Bases: object

This Class Aggregate LoadDishCfg command results from Csp Master Leaf Nodes and Dish Leaf Nodes

aggregate() tuple

Aggregate the results and return Final Result code :retrun: result code and message :return type: tuple

class ska_tmc_centralnode.manager.aggregators.TMCOpStateAggregator(*args: Any, **kwargs: Any)

Bases: Aggregator

Class for TelescopeOpStateAggregation for low Telescope

aggregate()

Aggregate method for TMC Op State

class ska_tmc_centralnode.manager.aggregators.TelescopeAvailabilityAggregatorLow(*args: Any, **kwargs: Any)

Bases: Aggregator

Class for TelescopeAvailablity for low Telescope

aggregate()

Aggregate method for Low Telescope Availability

class ska_tmc_centralnode.manager.aggregators.TelescopeAvailabilityAggregatorMid(*args: Any, **kwargs: Any)

Bases: Aggregator

Class for TelescopeAvailablity for Mid Telescope

aggregate()

Aggregate method for Mid Telescope Availability

class ska_tmc_centralnode.manager.aggregators.TelescopeStateAggregatorLow(*args: Any, **kwargs: Any)

Bases: Aggregator

Class for TelescopeStateAggregation for low Telescope

aggregate()

Aggregate method for TelescopeStateAggregatorLow

class ska_tmc_centralnode.manager.aggregators.TelescopeStateAggregatorMid(*args: Any, **kwargs: Any)

Bases: Aggregator

Class for TelescopeStateAggregation for Mid Telescope

aggregate()

Aggregate method for TelescopeStateAggregateMid

ska_tmc_centralnode.manager.component_manager module

This module provided an implementation of the Central Node ComponentManager.

class ska_tmc_centralnode.manager.component_manager.CNComponentManager(*args: Any, **kwargs: Any)

Bases: TmcComponentManager

A component manager for The Central Node component.

It supports:

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

  • Receiving the change events from lower level devices and trigger the TMC and telescope state aggregation

add_device(device_name: str) None

Add device to the liveliness probe function :param dev_name: device name :type dev_name: str

add_multiple_devices(device_list: List[str])

Add multiple devices to the liveliness probe function

Parameters:

device_list (list[str]) – list of device names

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

Submit the AssignResources command in queue.

Parameters:
  • argin (str) – input json string for assign resource command

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

Returns:

task_status

Return type:

tuple

check_device_responsiveness(command_name: str) None

Override this method to add responsive checks for the devices :param command_name: Command name for the check :type command_name: str

check_event_error(event: tango.EventData, callback: str)

Method for checking event error.

check_if_csp_mln_is_available() bool

Returns boolean value based on availability of CspMasterLeafNode, which ultimately indicated availability of CspMasterNode

check_if_sdp_mln_is_available() bool

Returns boolean value based on availability of SdpMasterLeafNode, which ultimately indicated availability of SdpMasterNode

check_if_subarrays_are_responsive() bool

Checks if subarray are responsive

check_subarray_id_in_json(json_argument: str) Tuple[bool, str]

Checks subarray id is present in json or not.

param json_argument: input json string :type json_argument: str

property checked_devices

Return the list of the checked monitored devices

Returns:

list of the checked monitored devices

command_not_allowed_callable(subarray_id: int = 0, desired_obsstate: Optional[List] = None, command_name: str = '')

This method provides callable for command not allowed

Parameters:
  • subarray_id (int) – subarray_id

  • desired_obsstate (List) – desired observation state

  • command_name (str) – command name

property component

Return the managed component

Returns:

the managed component

Return type:

Component

property devices

Return the list of the monitored devices

Returns:

list of the monitored devices

property event_queues

event queue property

get_csp_master_dev_name() str

Return Csp Master device name

get_csp_subarray_dev_names() list

Return Csp Subarray device names

get_device(device_name)

Return the device info with device name dev_name

Parameters:

dev_name (str) – name of the device

Returns:

a device info

Return type:

DeviceInfo

get_dish_device_names() tuple

Return Dish Master device names

get_dish_leaf_node_device_names() tuple

Return Dish leaf node device names

get_sdp_master_dev_name() str

Return Sdp Master device name

get_sdp_subarray_dev_names() list

Return Sdp Subarray device names

get_subarray_obsstate() ska_tango_base.control_model.ObsState

Get Current device obsState

Returns:

current obsstate

Return type:

ObsState

get_telescope_availability() bool

Getter method for Telescope Availability

get_telescope_health_state() ska_control_model.HealthState

Getter method for telescope health state

get_telescope_state()

Getter method for telescope state

get_tmc_op_state()

Getter method for TMC Op State Model

property input_parameter

Return the input parameter

Returns:

input parameter

Return type:

InputParameter

is_already_assigned(dish_id: str) bool

Check if a Dish is already assigned to a subarray

Parameters:

dish_id (str) – id of the dish

:return True is already assigned, False otherwise

is_command_allowed()

This method needs to be overridden by the child classes in order to check whether command is allowed or not

is_input_json_valid(argin: str) Tuple[bool, str]

Checks inputs json.

param argin: input json string :type argin: str

log_state(msg: str = 'Device States') None

Log state method for

off(task_callback: TaskCallbackType | None = None) tuple[TaskStatus, str]

This method needs to be overridden by the child classes in order to check have functionality under off command

on(task_callback: TaskCallbackType | None = None) tuple[TaskStatus, str]

This method needs to be overridden by the child classes in order to check have functionality under off command

process_event(attribute_name: str) None

Process the given attribute’s event using the data from the event_queues and invoke corresponding process method. :param attribute_name: Name of the attribute for which event is to be

processed

Returns:

None

release_resources(argin: str, task_callback: Optional[Callable] = None)

Submit the ReleaseResource command in queue.

Parameters:
  • argin (str) – input json string for release resource command

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

Returns:

task_status

Return type:

tuple

reset(task_callback: Optional[Callable] = None) tuple[ska_tango_base.executor.TaskStatus, str]

Placeholder method for reset command. :param task_callback: Update task status, defaults to None :type task_callback: Callable, optional :return: task_status, message :rtype: tuple

set_admin_mode(argin: int, task_callback: ska_tango_base.base.TaskCallbackType) Tuple

set the admin mode of subarray and master(csp, mccs, sdp) devices :return: a result code and message

set_aggregators(_telescope_state_aggregator, _health_state_aggregator, _op_state_aggregator) None

Sets Aggregators callback

set_telescope_availability(telescope_availability) None

Setter method for telescope availability

standby(task_callback: TaskCallbackType | None = None) tuple[TaskStatus, str]

This method needs to be overridden by the child classes in order to check have functionality under off command

start_communicating()

This method needs to be overridden by the child classes to have this functionality

stop() None

stops liveliness probe

stop_communicating()

This method needs to be overridden by the child classes to have this functionality

stop_event_receiver()

Stops the event receiver.

telescope_off(task_callback: Optional[Callable] = None)

Turn the Telescope Off.

Returns:

a result code and message

telescope_on(task_callback: TaskCallbackType | None = None)

Turn the Telescope On.

Returns:

a result code and message

telescope_standby(task_callback: Optional[Callable] = None)

Standby the Telescope.

Returns:

a result code and message

update_device_assigned_resource(dev_name: str, assign_resources: str) None

Update assign_resources for a monitored device

Parameters:
  • dev_name (str) – name of the device

  • assign_resources (str) – assigned resources in JSON format

update_device_health_state(device_name: str, health_state: ska_control_model.HealthState) None

Update a monitored device health state aggregate the health states available

Parameters:
  • dev_name (str) – name of the device

  • health_state (HealthState) – health state of the device

update_device_obs_state(dev_name: str, obs_state: ska_tango_base.control_model.ObsState) None

Update a monitored device obs state, and call the relative callbacks if available

Parameters:
  • dev_name (str) – name of the device

  • obs_state (ObsState) – obs state of the device

update_event_failure(device_name: str) None

updates event failures in Dev info

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

Set a device to failed and call the relative callback if available.

Parameters:
  • device_info (DeviceInfo) – Information about the device

  • exception (Exception) – Exception raised during the ping failure

update_input_parameter() None

updates the input parameter for component manager instance

update_responsiveness_info(device_name: str) None

Update a device with correct responsiveness information.

Parameters:

dev_name (str) – name of the device

Module contents