ska_tmc_subarraynode.manager package

Submodules

ska_tmc_subarraynode.manager.aggregators module

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

Bases: ska_tmc_common.aggregators.ska_tmc_common.aggregators.Aggregator._name

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

Bases: ska_tmc_common.aggregators.ska_tmc_common.aggregators.Aggregator._name

aggregate()
class ska_tmc_subarraynode.manager.aggregators.ObsStateAggregatorLow(*args: Any, **kwargs: Any)

Bases: ska_tmc_common.aggregators.ska_tmc_common.aggregators.Aggregator._name

aggregate()

Calculates aggregated observation state of Subarray.

class ska_tmc_subarraynode.manager.aggregators.ObsStateAggregatorMid(*args: Any, **kwargs: Any)

Bases: ska_tmc_common.aggregators.ska_tmc_common.aggregators.Aggregator._name

aggregate()

Calculates aggregated observation state of Subarray.

subarray_node_obstate_not_aggregated()

ska_tmc_subarraynode.manager.event_receiver module

class ska_tmc_subarraynode.manager.event_receiver.SubarrayNodeEventReceiver(*args: Any, **kwargs: Any)

Bases: ska_tmc_common.event_receiver.ska_tmc_common.event_receiver.EventReceiver._name

The SubarrayNodeEventReceiver class has the responsibility to receive events from the sub devices managed by the Subarray node.

The ComponentManager uses the handle events methods for the attribute of interest. For each of them a callback is defined.

TBD: what about scalability? what if we have 1000 devices?

handle_pointing_state_event(evt)
handle_receive_addresses_event(evt)
subscribe_events(dev_info)
unscubscribe_dish_health(dish_proxy, evt_id)
unscubscribe_dish_leaf_health(dish_leaf_proxy, evt_id)
unscubscribe_dish_leaf_state(dish_leaf_proxy, evt_id)
unscubscribe_dish_pointing(dish_proxy, evt_id)
unscubscribe_dish_state(dish_proxy, evt_id)
unsubscribe_dish_events()
unsubscribe_dish_leaf_events()

ska_tmc_subarraynode.manager.subarray_node_component_manager module

This module provided a reference implementation of a BaseComponentManager.

It is provided for explanatory purposes, and to support testing of this package.

class ska_tmc_subarraynode.manager.subarray_node_component_manager.SubarrayNodeComponentManager(*args: Any, **kwargs: Any)

Bases: ska_tango_base.subarray.ska_tango_base.subarray.SubarrayComponentManager._name

A component manager for The Subarray Node component.

It supports:

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

  • Fetching the latest SCM indicator values of the components periodically and trigger the subarray health state and observation state aggregation

  • Receiving the change events from the subarray component and trigger the subarray health state and observation state aggregation

adapter_error_message_result(dev_name, e)
add_device(dev_name)

Add device to the monitoring loop

Parameters

dev_name (str) – device name

add_multiple_devices(device_list)

Add multiple devices to the monitoring loop

Parameters

device_list – list of device names

property assigned_resources

Return the resources assigned to the component.

Returns

the resources assigned to the component

Return type

list of str

check_command_not_allowed_exception(op_state, states_not_allowed, cmd_name)
check_device_unresponsive_exception(dev_name)
check_if_no_dishes_available()
property checked_devices

Return the list of the checked monitored devices

Returns

list of the checked monitored devices

property command_executed
property command_executor
property command_in_progress
device_failed(device_info, exception)

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

Parameters
  • device_info (DeviceInfo) – a device info

  • exception – an exception

Type

Exception

property devices

Return the list of the monitored devices

Returns

list of the monitored devices

generate_command_result(result_code, message)
get_assigned_resources()
get_csp_subarray_dev_name()

Return Csp Subarray device name

get_dev_info(dev_name)
get_device(dev_name)

Return the device info our of the monitoring loop with name dev_name

Parameters

dev_name (str) – name of the device

Returns

a device info

Return type

DeviceInfo

get_dish_dev_names()

Return the names of the dishes assigned to Subarray

get_dish_leaf_prefix()

Return the Dish Leaf Node prefix

get_mccs_subarray_dev_name()

Returns Mccs Subarray device name

get_sb_id()
get_scan_duration()
get_scan_id()
get_sdp_subarray_dev_name()

Return Sdp Subarray device name

get_tm_leaf_csp_subarray_dev_name()

Return Csp Subarray Leaf Node device name

get_tm_leaf_dish_dev_names()

Return the names of the dish leaf nodes assigned to Subarray

init_adapters(adapter_factory)
init_adapters_low(adapter_factory)
init_adapters_mid(adapter_factory)
property input_parameter

Return the input parameter

Returns

input parameter

Return type

InputParameter

is_scan_timer_running()
property last_command_executed
remove_dish_devices()
reset()
set_assigned_resources(resources=[])

For SubarrayNode Mid, set assigned_resources with the list of dishes in argin. :param dev_name: name of the dish devices :type list: list[str]

set_dish_dev_names(dish_dev_names)

Update the names of the dishes assigned to Subarray

Parameters

dev_name – name of the dish devices

set_sb_id(sb_id)
set_scan_duration(scan_duration)
set_scan_id(scan_id)
set_tmc_leaf_dish_dev_names(tm_leaf_dish_dev_names)

Update the names of the dish leaf nodes assigned to Subarray

Parameters

dev_name – name of the dish devices

stop()
stop_scan_timer()
unsubscribe_dish_events()
update_assigned_resources_low()
update_device_health_state(dev_name, health_state)

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_info(device_info)

Update a device with correct monitoring information and call the relative callback if available

Parameters

device_info (DeviceInfo) – a device info

update_device_obs_state(dev_name, obs_state)

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_device_pointing_state(dev_name, pointing_state)

Update a monitored device pointing state aggregate the Subarray obs states and Dish pointing states

Parameters
  • dev_name (str) – name of the device

  • pointing_state (PointingState) – pointing state of the device

update_device_state(dev_name, state)

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

Parameters
  • dev_name (str) – name of the device

  • state (DevState) – state of the device

update_event_failure(dev_name)
update_input_parameter()
update_receive_addresses(dev_name, receive_addresses)

Update recesiveAddresses for a monitored device

Parameters
  • dev_name (str) – name of the device

  • receive_addresses (str) – recesiveAddresses

ska_tmc_subarraynode.manager.monitoring_loop module

class ska_tmc_subarraynode.manager.monitoring_loop.SubarrayNodeMonitoringLoop(*args: Any, **kwargs: Any)

Bases: ska_tmc_common.monitoring_loop.ska_tmc_common.monitoring_loop.MonitoringLoop._name

The SubarrayNodeMonitoringLoop class has the responsibility to monitor the sub devices managed by the subarray node.

It is an infinite loop which ping, get the state, the obsState, the healthState and device information of the monitored SKA devices

TBD: what about scalability? what if we have 1000 devices?

create_device_info(dev_info, proxy)
device_task(dev_info)

Module contents