ska_tmc_subarraynode.manager package

Link to the TMC User documentation is here.

Subpackages

Submodules

aggregators

Path: src/ska_tmc_subarraynode/manager/aggregators.py

This Module is for Aggregating the HealthState and ObsStates of Devices

class ska_tmc_subarraynode.manager.aggregators.SubarrayAvailabilityAggregatorLow(component_manager, logger)

Bases: Aggregator

Class to aggregate tmc low subarray device availability depending on tmc low leaf nodes

aggregate()

Aggregates the subarray availability

Return type

Tuple[bool, List]

Returns

a tuple containing bool representing subarray availability and list containing unavailable devices

class ska_tmc_subarraynode.manager.aggregators.SubarrayAvailabilityAggregatorMid(component_manager, logger)

Bases: Aggregator

class to aggregate tmc mid subarray device availability depending on tmc mid leaf nodes

aggregate()

Aggregates the subarray availability

Return type

Tuple[bool, List]

Returns

a tuple comtaining bool representing subarray availability and list conataining unavailable devices

aggregate_process

Path: src/ska_tmc_subarraynode/manager/aggregate_process.py

This module contain process for aggregation

class ska_tmc_subarraynode.manager.aggregate_process.AggregationProcessLow(event_data_queue, aggregated_obs_state, aggregate_update_event, callback=None)

Bases: AggregationProcess

Aggregation Process for Low

set_state_aggregator()

Return an instance of StateAggregator for Low

Return type

StateAggregator

Returns

An instance of StateAggregator for Low

class ska_tmc_subarraynode.manager.aggregate_process.AggregationProcessMid(event_data_queue, aggregated_obs_state, aggregate_update_event, callback=None)

Bases: AggregationProcess

Aggregation Process for Mid

set_state_aggregator()

Return an instance of StateAggregator for Mid

Return type

StateAggregator

Returns

An instance of StateAggregator for Mid

class ska_tmc_subarraynode.manager.aggregate_process.HealthAggregatorFactory

Bases: object

Factory class to return the appropriate HealthStateAggregator instance.

static get_aggregator(telescope)

Static method to return aggregator class instance

Parameters

telescope (str) – Type of telescope (“mid” or “low”)

Return type

StateAggregator

Returns

An instance of StateAggregator for the given telescope type.

Raises

ValueError – If the telescope type is unknown.

class ska_tmc_subarraynode.manager.aggregate_process.HealthStateAggregationProcessor(event_data_queue, aggregated_health_state, aggregate_update_event, telescope='mid', callback=None)

Bases: AggregationProcess

Health State Aggregation Processor

Inherits from AggregationProcess and implements health-specific state aggregation logic.

set_state_aggregator()

Return an instance of HealthStateAggregator for the given telescope.

Return type

HealthAggregatorFactory

Returns

An instance of HealthStateAggregator for the given telescope.

event_data_manager

Path: src/ska_tmc_subarraynode/manager/event_data_manager.py

Use event manager to manager all event related data

class ska_tmc_subarraynode.manager.event_data_manager.AdminModeData(admin_mode, event_timestamp)

Bases: object

DataClass for admin mode and its timestamp

admin_mode
event_timestamp
class ska_tmc_subarraynode.manager.event_data_manager.CommandResultData(result, unique_id, event_timestamp)

Bases: object

DataClass for longrunningcommandresult and its timestamp.

event_timestamp
result
unique_id
class ska_tmc_subarraynode.manager.event_data_manager.DishModeData(dish_mode, event_timestamp)

Bases: object

DataClass for DishMode and its timestamp.

dish_mode
event_timestamp
class ska_tmc_subarraynode.manager.event_data_manager.EventDataManager(component_manager)

Bases: object

A class to update the values of events received for different attributes in EventDataStorage class

clear_dish_data()

clear dish data from event info

Return type

None

clear_lrcr()

clears LongRunning Command Results

Return type

None

compare_timevals(current_timestamp, received_timestamp)

A method to compare the timestamps of events received with the existing timestamp.

Parameters
  • current_timestamp (datetime) – Curent time stamp.

  • received_timestamp (datetime) – Received time stamp.

Returns

True, if current timestamp is less than received timestamp. False, otherwise.

Return type

bool

get_enum_name_from_value(enum_class, value)

Get the name from value of enum

Parameters
  • enum_class – Enum class.

  • valuename, member of enum.

Returns

Name of the enum

Return type

str

update_aggregation_queue(is_health_event=False)

A method to put a copy of the EventDataStorage object whenever it receives an event.

Parameters

is_health_event (bool) – True, if health event. False otherwise.

Return type

None

update_event_data(device, data, data_type, received_timestamp=None)

A method to receive and update device name, data, and timestamp in the EventDataStorage Class

Parameters
  • device (str) – Device name

  • data (Union[ObsState, CommandResultData, PointingState, DishMode, HealthState]) – Event data

  • data_type (str) – Data type

  • recieved_timestamp – Received timestamp

Return type

None

class ska_tmc_subarraynode.manager.event_data_manager.EventDataStorage(obs_state_data=<factory>, command_result_data=<factory>, dish_mode_data=<factory>, pointing_state_data=<factory>, health_state_data=<factory>, admin_mode_data=<factory>, kvalue_validation_data=<factory>, command_timestamp=None, command_in_progress='', is_partial_configuration=False, is_single_subsystem_configured=False, single_subsystem_configured='')

Bases: object

A class to store the Events received for different attributes.

admin_mode_data
command_in_progress = ''
command_result_data
command_timestamp = None
dish_mode_data
health_state_data
is_partial_configuration = False
is_single_subsystem_configured = False
kvalue_validation_data
obs_state_data
pointing_state_data
single_subsystem_configured = ''
class ska_tmc_subarraynode.manager.event_data_manager.HealthStateData(health_state, is_dish, event_timestamp)

Bases: object

DataClass for health state and its timestamp

event_timestamp
health_state
is_dish
class ska_tmc_subarraynode.manager.event_data_manager.ObsStateData(obs_state, event_timestamp)

Bases: object

DataClass for ObsState and its Timestamp.

event_timestamp
obs_state
class ska_tmc_subarraynode.manager.event_data_manager.PointingStateData(pointing_state, event_timestamp)

Bases: object

DataClass for PointingState and its timestamp.

event_timestamp
pointing_state
class ska_tmc_subarraynode.manager.event_data_manager.kValueValidationData(is_failed, event_timestamp)

Bases: object

DataClass for KValue Validation and its timestamp.

event_timestamp
is_failed
ska_tmc_subarraynode.manager.event_data_manager.pre_process(func)

Decorator for preprocessing event data

Return type

Callable

event_manager

Path: src/ska_tmc_subarraynode/manager/event_manager.py

Event manager class for SubarrayNode

class ska_tmc_subarraynode.manager.event_manager.SubarrayNodeEventManager(component_manager, subscription_configuration=None, logger=<Logger ska_tmc_subarraynode.manager.event_manager (WARNING)>, stateless=True, event_subscription_check_period=1, event_error_max_count=10, status_update_callback=None, maximum_status_queue_size=50)

Bases: EventManager

Event manager for handling TANGO events for the SubarrayNode component. Inherits from ska_tmc_common.v2.EventManager and provides specific callbacks for different TANGO attributes and states relevant to SubarrayNode.

adminmode_event_callback(event)

Callback for handling adminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

assignedresources_event_callback(event)

Callback for handling assignedResources TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

cspsubarrayadminmode_event_callback(event)

Callback for handling cspSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

cspsubarrayobsstate_event_callback(event)

Callback for handling cspSubarrayObsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

dishmode_event_callback(event)

Callback for handling dishMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

healthstate_event_callback(event)

Callback for handling healthState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

issubsystemavailable_event_callback(event)

Callback for handling isSubsystemAvailable TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

longrunningcommandresult_event_callback(event)

Callback for handling longRunningCommandResult TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

mccssubarrayadminmode_event_callback(event)

Callback for handling mccsSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

obsstate_event_callback(event)

Callback for handling obsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

pointingstate_event_callback(event)

Callback for handling pointingState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

receiveaddresses_event_callback(event)

Callback for handling receiveAddresses TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

sdpsubarrayadminmode_event_callback(event)

Callback for handling sdpSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

sdpsubarrayobsstate_event_callback(event)

Callback for handling sdpSubarrayObsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

state_event_callback(event)

Callback for handling state TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

subarray_node_component_manager

Path: src/ska_tmc_subarraynode/manager/subarray_node_component_manager.py

This module provided a reference implementation of a SubarrayComponentManager inheritted from BaseComponentManager.

class ska_tmc_subarraynode.manager.subarray_node_component_manager.SubarrayNodeComponentManager(op_state_model, obs_state_model, _command_tracker, _input_parameter, dev_family, logger, _update_device_callback, _update_subarray_health_state_callback, _update_assigned_resources_callback, _update_subarray_availability_status_callback, component_state_changed_callback, _component=None, _liveliness_probe=True, _event_manager=True, command_timeout=30, abort_command_timeout=40, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, csp_assign_interface='', csp_scan_interface='', sdp_scan_interface='', jones_uri='')

Bases: TmcComponentManager, SubarrayComponentManager

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 and receiving change events of the components periodically and trigger the subarray health state and observation state aggregation

abstract abort(task_callback)

Aborting the subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

abort_timer()

Method for managing abort timer

Return type

Tuple[ResultCode, str]

Returns

A tuple containing ResultCode and message

add_device_to_lp(device_name)

Add device to the liveliness probe

Parameters

device_name (str) – device name

Raises

NotImplementedError – Not implemented in this class

Return type

None

add_multiple_devices(device_list)

Add multiple devices to the liveliness probe

Parameters

device_list (List) – list of device names

Return type

List

Returns

list after adding the devices

add_similar_low_mid_device(device_name)

Add Similar Low and Mid device to the liveliness probe

Parameters

device_name (str) – device name

Return type

None

aggregate_process_monitor()

This method keep tracking aggregate obs state changed from aggregation process

Return type

None

abstract assign(argin, task_callback)

Submits AssignResources command as a separate task.

Parameters
  • argin – Assign json

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

Return type

Tuple

Returns

a result code and message

property assigned_resources

Return the resources assigned to the component.

Returns

the resources assigned to the component

build_device_attribute_map()

Builds a dictionary mapping device names to lists of attributes to be subscribed.

Returns

A mapping from device names to list of attributes.

Return type

Dict[str, List[str]]

check_command_not_allowed_exception(op_state, states_not_allowed, cmd_name)

This method checks command not allowed exception

Parameters
  • op_state – Current op_state

  • states_not_allowed (list) – List of states that dont allow command

  • cmd_name (str) – Command name

Raises

CommandNotAllowed – When Command is not allowed in current state

Return type

None

check_event_error(event, callback)

Method for checking event error.

Parameters
  • event (EventData) – Event Data

  • callback (str) – Event callback

Returns

True if there is an event error, else False

Return type

bool

check_for_incremental_assign_and_revise_obsstate(command_in_progress_id, device_events, error_dict)

This method checks for incremental assign resources and evaluates final obsstate

Parameters
  • command_in_progress_id (str) – command in progress id

  • device_events (dict) – events for each device

  • error_dict (dict) – error dict

Return type

ObsState

Returns

ObsState

check_if_sdp_sln_is_available()

Check if the sdp subarray device availability is True.

Returns

True if sdp subarray leafnode is available

Return type

bool

check_subarray_device_availability()

Checks if the subarray device availability is True if not, raises exception CommandNotAllowed.

Raises

CommandNotAllowed – When Command is not allowed due to unavailability of device

Return type

None

check_successive_configure_revise_obsstate(command_in_progress_id, device_events, error_dict)

This method checks for successive configure resources and evaluates final obsstate

Parameters
  • command_in_progress_id (str) – command in progress id

  • device_events (dict) – events for each device

  • error_dict (dict) – error dict

Return type

ObsState

Returns

ObsState

property checked_devices

Return the list of the checked monitored devices

Returns

list of the checked monitored devices

clear_assigned_resources()

Clears assigned resources after the aggregation of obsState EMPTY This method is overridden by the child classes. For Mid it clears dish dev names. For low currently no resources are cleared.

Return type

None

command_allowed_callable(command_name)

This method provides callable for is_cmd_allowed parameter set while submitting the task. This check will be done after command has been put on the queue.

Parameters

command_name (str) – Tango Device Command Name

Returns

True if the command is callable, else false

Return type

bool

property command_in_progress

Returns the command_in_progress variable

Returns

command in progress

Return type

str

component_state_changed_callback_and_logging(callback_action, command_in_progress, aggregated_obsstate)

Method calls component_state_changed_callback to complete aggregate obsState change and logs completion message.

Parameters
  • callback_action (Union[list, Dict]) – contains details required by component state changed callback and log statement.

  • command_in_progress (Optional[str]) – name of command in progress

  • aggregated_obsstate (ObsState) – obsstate aggregated from subsystem obsstate values.

Return type

None

abstract configure(argin, task_callback)

Configure to allocated Subarray device.

Parameters
  • argin (str) – json input

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

property devices

Return the list of the monitored devices

Returns

list of the monitored devices

abstract end(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

abstract end_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

abstract end_singular_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

generate_command_result(result_code, message)

Method for generating command result

Parameters
  • result_code (int) – send result_code

  • message (str) – message of invoking command

Return type

tuple

Returns

A tuple containing ResultCode and message

get_adapter_by_device_name(device_name)

The get_adapter_by_device_name method takes a device_name as input and searches for an adapter object in the adapter_factory object’s adapters attribute that matches the input device_name. If a matching adapter object is found, it is returned. If no matching adapter object is found, first adapter is returned.

Parameters

device_name (str) – The name of the device to search for.

Returns

An adapter object if a matching device is found, otherwise first adapter object is returned.

get_assigned_resources()
Returns

assigned_resources

Return type

list

get_csp_subarray_admin_mode()

Retrieve the adminMode of csp subarray

Returns

This method returns the adminMode of CSP Subarray Node.

Return type

AdminMode

get_csp_subarray_dev_name()

Return Csp Subarray device name

Returns

CSP subarray device name

Return type

str

get_device(device_name)

Return the device info with device name device_name

Parameters

device_name (str) – name of the device

Return type

DeviceInfo

Returns

a device info

get_mccs_subarray_admin_mode()

Retrieve the adminMode of MCCS subarray.

Returns

The adminMode of the TMC MCCS Subarray Node.

Return type

AdminMode

get_mccs_subarray_dev_name()

Returns Mccs Subarray device name

Returns

MCCS subarray device name

Return type

str

get_sb_id()

Returns sb_id value.

Returns

sb_id

Return type

float

get_scan_duration()

Returns scan_duration value.

Returns

scan duration

Return type

float

get_scan_id()

Returns scan_id value.

Returns

scan_id

Return type

float

get_sdp_subarray_admin_mode()

Retrieve the adminMode of SDP subarray.

Returns

The adminMode of the TMC SDP Subarray Node.

Return type

AdminMode

get_sdp_subarray_dev_name()

Return Sdp Subarray device name

Returns

SDP subarray device name

Return type

str

get_subarray_availability()

Returns subarray availability status

Return type

bool

Returns

subarray availability status

get_subarray_healthstate()

Returns value of subarray’s health state.

Return type

HealthState

Returns

value of subarray health state

get_subarray_id()

Returns subarray_id value.

Returns

subarray_id

Return type

int

get_subarray_obsstate()

Returns aggregated subarray ObsState

Return type

ObsState

Returns

Current aggregated subarray ObsState

get_tmc_csp_sln_device_name()

Return Csp Subarray Leaf Node device name

Returns

CSP subarray leafnode device name

Return type

str

get_tmc_mccs_sln_device_name()

Return Mccs Subarray Leaf Node device name

Returns

MCCS subarray leafnode device name

Return type

str

get_tmc_sdp_sln_device_name()

Return Sdp Subarray Leaf Node device name

Returns

SDP subarray leafnode device name

Return type

str

healthstate_aggregate_monitor()

This method keeps tracking aggregated health state changes from the aggregation process for the SubarrayNode.

Return type

None

property input_parameter

Return the input parameter

Returns

input parameter

is_command_allowed(command_name)

Checks whether this command is allowed It checks that the device is in a state to perform this command and that all the component needed for the operation are not unresponsive This check will be called before putting command in queue. It will also be called from tango device.

Parameters

command_name (str) – name of the command

Return type

bool

Returns

True if this command is allowed, False otherwise

Raises

CommandNotAllowed – Command is not allowed in adminMode OFFLINE ot NOT-FITTED

property is_operation_aborted

Aborted Flag

Returns

True if operation is aborted

property is_partial_configuration

Returns True if the configuration is partial.

Returns

True if configuration is partial

is_scan_completed()

A function to check whether Scan Command is completed succesfully.

Return type

bool

Returns

True if scan is completed, False otherwise

is_scan_timer_running()

Checks if the scan_timer thread is alive.

Returns

True if Scan timer is running

Return type

bool

is_valid_admin_mode()

Validates that all relevant subarray devices are in a valid admin mode.

Returns

True if all subarrays are in a valid mode, False otherwise.

Return type

bool

log_state(msg='Device States')

Logs the state of devices and dishes.

This method logs the observation states of generic devices and

the pointing states of dish devices.

Parameters

msg (str) – A message to be included in the log.

Return type

None

abstract off(task_callback)

Submits Off command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

abstract on(task_callback)

Submits On command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

process_event(attribute_name)

Process the given attribute’s event using the data from the event_queues and invoke corresponding process method.

Parameters

attribute_name (str) – Name of the attribute for which event is to be processed

Return type

None

abstract release_all(task_callback)

Submits ReleaseAllResources command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

remove_devices_from_lp(device_names)

Remove the given devices from liveliness probe.

Parameters

device_names (List[str]) – Device names for devices to be removed from Liveliness Probe

Return type

None

reset()

Method for resetting Not implemented

Return type

None

reset_is_single_subsystem_data()

resets single subsystem variable back to default

Return type

None

reset_sb_id()

Resets sb_id value.

Return type

None

reset_scan_duration()

Reset scan_duration value.

reset_scan_id()

Resets scan_id value.

Return type

None

reset_subarray_id()

Resets subarray_id value.

Return type

None

abstract restart(task_callback)

Restarting the subarray.

Parameters

task_callback (TaskCallbackType) – task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

abstract scan(argin, task_callback)

Scanning the devices.

Parameters
  • argin – Scan json

  • task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

set_admin_mode(argin, task_callback)

set the admin mode of subarray devices

Parameters
  • argin (int) – Admin mode

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

set_assigned_resources(resources)

For SubarrayNode Mid, set assigned_resources with the list of dishes in argin.

Parameters

resources (list) – name of the dish devices

Return type

None

set_pattern_scan_data(group_list)

This method set pattern scan data. Override this method to set pattern scan data provided in configure

Parameters

group_list – List of group

Return type

None

set_sb_id(sb_id)

Sets sb_id value.

Parameters

sb_id (float) – value to set

Return type

None

set_scan_duration(scan_duration)

Sets scan_duration value.

Parameters

scan_duration (float) – value to set

Return type

None

set_scan_id(scan_id)

Sets scan_id value.

Parameters

scan_id (float) – value to set

Return type

None

set_subarray_id(subarray_id)

Sets subarray_id value.

Parameters

subarray_id (int) – value to set

Return type

None

setup_event_subscription()

Sets up the event subscription after input parameters are updated.

Return type

None

stop()

stops liveliness probe

Return type

None

stop_aggregation_process()

Override this method in mid and low

Raises

NotImplementedError – This method is overrided in mid and low cm

Return type

None

stop_all_process()

This stop aggregation process

Return type

None

stop_liveliness_probe()

Stops the liveliness probe

Return type

None

stop_scan_timer()

Stops scan_timer thread.

Return type

None

property subarray_obsstate

Keeps track of aggregated subarray ObsState

Returns

Current aggregated ObsState

property unavailable_devices

Returns List of the unavailable_devices.

Returns

list of unavailable devices

unsubscribe_dish_events()

Unsubscribes the events for Dishleafnode and Dishmaster

Return type

None

unsubscribe_dish_leaf_node_events()

abstract - override

Return type

None

update_assigned_resources(device_name, assigned_resources, timestamp)

Update assignedResources for a monitored device

Parameters
  • device_name (str) – name of the device

  • assigned_resources (str) – assignedResources

  • timestamp (datetime) – timestamp of execution

Return type

None

update_device_admin_mode(device_name, admin_mode, timestamp)

Update a monitored device admin mode

Parameters
  • device_name (str) – name of the device

  • admin_mode (AdminMode) – admin mode of the device

  • timestamp (datetime) – timestamp of start

Return type

None

update_device_dish_mode(device_name, dish_mode, timestamp)

Update the dish mode for given device.

Parameters
  • device_name (str) – name of the device

  • dish_mode (DishMode) – dish mode of the device

  • timestamp (datetime) – timestamp of start

update_device_health_state(device_name, health_state, timestamp)

Update a monitored device health state aggregate the health states available

Parameters
  • device_name (str) – name of the device

  • health_state (HealthState) – health state of the device

  • timestamp (datetime) – timestamp of start

Return type

None

update_device_obs_state(device_name, obs_state, timestamp)

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

Parameters
  • device_name (str) – name of the device

  • obs_state (ObsState) – obs state of the device

  • timestamp (datetime) – timestamp of start

Return type

None

update_device_pointing_state(device_name, pointing_state, timestamp)

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

Parameters
  • device_name (str) – name of the device

  • pointing_state (PointingState) – pointing state of the device

  • timestamp (datetime) – timestamp of start

Return type

None

update_device_state(device_name, state, timestamp)

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

Parameters
  • device_name (str) – name of the device

  • state (DevState) – state of the device

  • timestamp (datetime) – timestamp of execution

Return type

None

update_event_failure(device_name)

Update the event failures if any for the given Device.

Parameters

device_name (str) – name of the device

Return type

None

update_exception_for_unresponsiveness(device_info, exception)

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

Parameters
  • device_info (DeviceInfo) – a device info

  • exception (str) – an exception

Return type

None

update_input_parameter()

Updates the input parameter of a class instance with the current state of the instance.

Return type

None

update_long_running_command_result(dev_name, value, timestamp)

Abstract method for processing LongRunningCommandResult events.

Parameters
  • dev_name (str) – device name

  • value (Tuple[str, str]) – Uniqueid and result

  • timestamp (datetime) – timestamp of command

Raises

NotImplementedError – This method is abstract

Return type

None

update_receive_addresses(device_name, receive_addresses, timestamp)

Update receiveAddresses for a monitored device

Parameters
  • device_name (str) – name of the device

  • receive_addresses (str) – receiveAddresses

  • timestamp (datetime) – timestamp of start

Return type

None

update_responsiveness_info(device_name)

Update a device with correct ping information.

Parameters

device_name (str) – name of the device

Return type

None

update_subarray_availability_status(device_name, availability_status, timestamp)

Update a monitored device availability status aggregate the subarray availability

Parameters
  • device_name (str) – name of the device

  • availability_status (bool) – availability status of the device

  • timestamp (datetime) – timestamp of execution

Return type

None

validate_scan(argin)

scan validation

Parameters

argin (_type_) – _description_

subarray_node_component_manager_low

Path: src/ska_tmc_subarraynode/manager/subarray_node_component_manager_low.py

This module is inherited from SubarrayNodeComponentManager.

Module for Low Telescope component manager.

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

class ska_tmc_subarraynode.manager.subarray_node_component_manager_low.SubarrayNodeComponentManagerLow(op_state_model, obs_state_model, _command_tracker, _input_parameter, dev_family, component_state_changed_callback, _update_device_callback, _update_subarray_health_state_callback, _update_assigned_resources_callback, _update_subarray_availability_status_callback, update_scan_duration_callback, logger=None, _component=None, _liveliness_probe=True, _event_manager=True, command_timeout=30, abort_command_timeout=40, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, csp_assign_interface='https://schema.skao.int/ska-low-csp-assignresources/3.0', csp_scan_interface='https://schema.skao.int/ska-low-csp-scan/0.0', sdp_scan_interface='https://schema.skao.int/ska-sdp-scan/0.4', mccs_configure_interface='https://schema.skao.int/ska-low-mccs-configure/1.0', mccs_scan_interface='https://schema.skao.int/ska-low-mccs-scan/3.0', jones_uri='tango://jones.skao.int/low/stn-beam/1')

Bases: SubarrayNodeComponentManager

Initialise a new ComponentManager instance for low.

abort(task_callback)

Aborting the subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

add_device_to_lp(device_name)

Add device to the liveliness probe

Parameters

device_name (str) – device name

Return type

None

assign(argin, task_callback)

Submits AssignResources command as a separate task.

Parameters
  • argin – Assign json

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

Return type

Tuple

Returns

a result code and message

check_successive_configure_revise_obsstate(command_in_progress_id, device_events, error_dict)

This method checks for successive configure resources and evaluates final obsstate

Parameters
  • command_in_progress_id (str) – command in progress id

  • device_events (dict) – events for each device

  • error_dict (dict) – error dict

Return type

ObsState

Returns

ObsState

configure(argin, task_callback)

Configure to allocated Subarray device.

Parameters
  • argin (str) – json input

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

property configured_capabilities

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

deconfigure()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

end(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

end_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

end_singular_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

get_devices_availability_dict()

Returns the dictionary with the devices and it’s availability

Returns

Dictionary with devices and their availability

Return type

dict

is_valid_admin_mode()

Extends the base admin mode validation with MCCS check for LOW telescope.

Returns

True if all subarrays including MCCS are in valid admin mode.

Return type

bool

obsreset()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

off(task_callback)

Submits Off command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

on(task_callback)

Submits On command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

release()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

release_all(task_callback)

Submits ReleaseAllResources command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

restart(task_callback)

Restarting the subarray.

Parameters

task_callback (TaskCallbackType) – task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

scan(argin, task_callback)

Scanning the devices.

Parameters
  • argin – Scan json

  • task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

standby()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

start_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

stop_aggregation_process()

Stop aggregation process

Return type

None

stop_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

update_long_running_command_result(dev_name, value, timestamp)

Stores the longRunningCommandResult values for devices and Updates the long_running_result_callback if the required criteria is met (i.e received events from all the expected devices for a given command).

Parameters
  • dev_name (str) – Device name for which the longRunningCommandResult event was received

  • value (Tuple[str, str]) – longRunningCommandResult event value

  • timestamp (datetime) – timestamp of execution

Return type

None

validate_configuration_json(argin, configure_command)

_summary_

Parameters
  • argin (_type_) – _description_

  • json_argument (_type_) – _description_

  • configure_validator (_type_) – _description_

  • configure_command (_type_) – _description_

validate_scan(argin)

scan validation

Parameters

argin (_type_) – _description_

subarray_node_component_manager_mid

Path: src/ska_tmc_subarraynode/manager/subarray_node_component_manager_mid.py

This module is inherited from SubarrayNodeComponentManager.

It is component Manager for Mid Telecope.

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

class ska_tmc_subarraynode.manager.subarray_node_component_manager_mid.SubarrayNodeComponentManagerMid(op_state_model, obs_state_model, _command_tracker, _input_parameter, dev_family, component_state_changed_callback, _update_device_callback, _update_subarray_health_state_callback, _update_assigned_resources_callback, _update_subarray_availability_status_callback, update_scan_duration_callback, logger=None, _component=None, _liveliness_probe=True, _event_manager=True, command_timeout=30, abort_command_timeout=40, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, csp_assign_interface='https://schema.skao.int/ska-csp-assignresources/2.0', csp_scan_interface='https://schema.skao.int/ska-csp-scan/2.0', sdp_scan_interface='https://schema.skao.int/ska-sdp-scan/0.4')

Bases: SubarrayNodeComponentManager

Initialise a new ComponentManager instance for mid.

abort(task_callback)

Aborting the subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

abort_dishes(tmc_leaf_dish_adapters)

Invokes Abort command on Dish Leaf Node Group

Return type

Tuple[ResultCode, str]

Returns

A tuple containing ResultCode and message

add_device_to_lp(device_name)

Add device to the liveliness probe

Parameters

device_name (str) – device name

Return type

None

assign(argin, task_callback)

Submits AssignResources command as a separate task.

Parameters
  • argin – Assign json

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

Return type

Tuple

Returns

a result code and message

clear_assigned_resources()

Removes Dish Leaf Node and Dish Master devices from Input Parameter

Return type

None

configure(argin, task_callback)

Configure to allocated Subarray device.

Parameters
  • argin (str) – json input

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

property configured_capabilities

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

deconfigure()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

end(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

end_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

end_singular_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

get_devices_availability_dict()

Returns the dictionary with the devices and it’s availability

Returns

the dictionary with the devices and it’s availability

Return type

dict

get_dish_dev_names()

Return the names of the dishes assigned to Subarray

Return type

List[str]

Returns

names of the dishes assigned to Subarray

get_dish_leaf_node_prefix()

Return the Dish Leaf Node prefix

Returns

Dish Leaf Node prefix

Return type

str

get_keys_required_for_getting_sdpqc_fqdn()

Returns the keys that are required to get sdpqc fqdn from dictionary received from SDP subarray receivedAddresses attribute at runtime

Return type

List

Returns

keys required for getting fqdn

get_normal_scan_dish_device_names()

Get normal scan dishln device names

Returns

normal scan dishln device names

Return type

list

get_tmc_dish_ln_device_names()

Return the names of the dishes assigned to Subarray

Return type

List[str]

Returns

names of the dishes assigned to Subarray

get_trajectory_dish_device_names()

Get Trajectory dishln device names

Returns

Trajectory dishln device names

Return type

list

invoke_pointing_calibration(event_attribute_value)

This method get sdpQueueConnectorFqdn from event attribute value and set on dish leaf node

Parameters

event_attribute_value (str) – receiveAddresses attribute value

Return type

None

property kvalue_validation_failed

Gives the bool value for kvalue validation result

Returns

boolean value for kvalue validation result

mid_cleanup_on_abort_or_restart()

Method to clean the mid resources assigned on Abort or Restart command

obsreset()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

off(task_callback)

Submits Off command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

on(task_callback)

Submits On command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

process_lrcrevent(dev_name, value, timestamp)

Process Long Running Command Result

Parameters
  • dev_name (str) – Device name for which the longRunningCommandResult event was received

  • value (Tuple[str, str]) – longRunningCommandResult event value

  • timestamp (datetime) – timestamp

release()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

release_all(task_callback)

Submits ReleaseAllResources command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

remove_dish_devices()

Removes dish devices from component

Return type

None

restart(task_callback)

Restarting the subarray.

Parameters

task_callback (TaskCallbackType) – task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

scan(argin, task_callback)

Scanning the devices.

Parameters
  • argin – Scan json

  • task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

set_dish_device_names(dish_dev_names)

Update the names of the dishes assigned to Subarray

Parameters

dish_dev_names (List) – name of the dish devices

Return type

None

set_keys_required_for_getting_sdpqc_fqdn(set_the_keys)

Set the values that are required to get sdpqc fqdn from dictionary received from SDP subarray receivedAddresses attribute at runtime

Parameters

set_the_keys (List) – Set the values that are required to get sdpqc fqdn from dictionary received

Return type

None

set_normal_scan_dish_device_names(dish_ln_names)

Update the normal scan dishln device names

Parameters

dish_ln_names (List) – dish leaf node name list

Return type

None

set_pattern_scan_data(group_list)

Set up Pattern scan data

Parameters

group_list (List) – Group list

Return type

None

set_tmc_leaf_dish_device_names(tmc_dish_ln_device_names)

Update the names of the dish leaf nodes assigned to Subarray, and subscribe to dishMode and pointingState events.

Parameters

tmc_dish_ln_device_names (List[str]) – List of TMC dish leaf node FQDNs.

Return type

None

set_trajectory_dish_device_names(dish_ln_names)

Update the trajectory dishln device names

Parameters

dish_ln_names (List) – dish leaf node name list

Return type

None

standby()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

start_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

stop_aggregation_process()

Stop aggregation process

Return type

None

stop_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

unsubscribe_dish_leaf_node_events()

Unsubscribes from dishMode, pointingState, and longRunningCommandResult events for all currently assigned dish leaf node devices.

Return type

None

update_long_running_command_result(dev_name, value, timestamp)

Stores the longRunningCommandResult values for devices and Updates the long_running_result_callback if the required criteria is met (i.e received events from all the expected devices for a given command).

Parameters
  • dev_name (str) – Device name for which the longRunningCommandResult event was received

  • value (Tuple[str, str]) – longRunningCommandResult event value

  • timestamp (datetime) – timestamp

Return type

None

update_receive_addresses(device_name, receive_addresses, timestamp)

Update receiveAddresses for a monitored device

Parameters
  • device_name (str) – name of the device

  • receive_addresses (str) – receiveAddresses

  • timestamp (datetime) – timestamp

Return type

None

validate_configuration_json(argin, configure_command)

_summary_

Parameters
  • argin (_type_) – _description_

  • json_argument (_type_) – _description_

  • configure_validator (_type_) – _description_

  • configure_command (_type_) – _description_

validate_scan(argin)

scan validation

Parameters

argin (_type_) – _description_

Module contents

Init module for manager

class ska_tmc_subarraynode.manager.AggregationProcessLow(event_data_queue, aggregated_obs_state, aggregate_update_event, callback=None)

Bases: AggregationProcess

Aggregation Process for Low

set_state_aggregator()

Return an instance of StateAggregator for Low

Return type

StateAggregator

Returns

An instance of StateAggregator for Low

class ska_tmc_subarraynode.manager.AggregationProcessMid(event_data_queue, aggregated_obs_state, aggregate_update_event, callback=None)

Bases: AggregationProcess

Aggregation Process for Mid

set_state_aggregator()

Return an instance of StateAggregator for Mid

Return type

StateAggregator

Returns

An instance of StateAggregator for Mid

class ska_tmc_subarraynode.manager.EventDataManager(component_manager)

Bases: object

A class to update the values of events received for different attributes in EventDataStorage class

clear_dish_data()

clear dish data from event info

Return type

None

clear_lrcr()

clears LongRunning Command Results

Return type

None

compare_timevals(current_timestamp, received_timestamp)

A method to compare the timestamps of events received with the existing timestamp.

Parameters
  • current_timestamp (datetime) – Curent time stamp.

  • received_timestamp (datetime) – Received time stamp.

Returns

True, if current timestamp is less than received timestamp. False, otherwise.

Return type

bool

get_enum_name_from_value(enum_class, value)

Get the name from value of enum

Parameters
  • enum_class – Enum class.

  • valuename, member of enum.

Returns

Name of the enum

Return type

str

update_aggregation_queue(is_health_event=False)

A method to put a copy of the EventDataStorage object whenever it receives an event.

Parameters

is_health_event (bool) – True, if health event. False otherwise.

Return type

None

update_event_data(device, data, data_type, received_timestamp=None)

A method to receive and update device name, data, and timestamp in the EventDataStorage Class

Parameters
  • device (str) – Device name

  • data (Union[ObsState, CommandResultData, PointingState, DishMode, HealthState]) – Event data

  • data_type (str) – Data type

  • recieved_timestamp – Received timestamp

Return type

None

class ska_tmc_subarraynode.manager.HealthStateAggregationProcessor(event_data_queue, aggregated_health_state, aggregate_update_event, telescope='mid', callback=None)

Bases: AggregationProcess

Health State Aggregation Processor

Inherits from AggregationProcess and implements health-specific state aggregation logic.

set_state_aggregator()

Return an instance of HealthStateAggregator for the given telescope.

Return type

HealthAggregatorFactory

Returns

An instance of HealthStateAggregator for the given telescope.

class ska_tmc_subarraynode.manager.SubarrayAvailabilityAggregatorLow(component_manager, logger)

Bases: Aggregator

Class to aggregate tmc low subarray device availability depending on tmc low leaf nodes

aggregate()

Aggregates the subarray availability

Return type

Tuple[bool, List]

Returns

a tuple containing bool representing subarray availability and list containing unavailable devices

class ska_tmc_subarraynode.manager.SubarrayAvailabilityAggregatorMid(component_manager, logger)

Bases: Aggregator

class to aggregate tmc mid subarray device availability depending on tmc mid leaf nodes

aggregate()

Aggregates the subarray availability

Return type

Tuple[bool, List]

Returns

a tuple comtaining bool representing subarray availability and list conataining unavailable devices

class ska_tmc_subarraynode.manager.SubarrayNodeComponentManagerLow(op_state_model, obs_state_model, _command_tracker, _input_parameter, dev_family, component_state_changed_callback, _update_device_callback, _update_subarray_health_state_callback, _update_assigned_resources_callback, _update_subarray_availability_status_callback, update_scan_duration_callback, logger=None, _component=None, _liveliness_probe=True, _event_manager=True, command_timeout=30, abort_command_timeout=40, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, csp_assign_interface='https://schema.skao.int/ska-low-csp-assignresources/3.0', csp_scan_interface='https://schema.skao.int/ska-low-csp-scan/0.0', sdp_scan_interface='https://schema.skao.int/ska-sdp-scan/0.4', mccs_configure_interface='https://schema.skao.int/ska-low-mccs-configure/1.0', mccs_scan_interface='https://schema.skao.int/ska-low-mccs-scan/3.0', jones_uri='tango://jones.skao.int/low/stn-beam/1')

Bases: SubarrayNodeComponentManager

Initialise a new ComponentManager instance for low.

abort(task_callback)

Aborting the subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

add_device_to_lp(device_name)

Add device to the liveliness probe

Parameters

device_name (str) – device name

Return type

None

assign(argin, task_callback)

Submits AssignResources command as a separate task.

Parameters
  • argin – Assign json

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

Return type

Tuple

Returns

a result code and message

check_successive_configure_revise_obsstate(command_in_progress_id, device_events, error_dict)

This method checks for successive configure resources and evaluates final obsstate

Parameters
  • command_in_progress_id (str) – command in progress id

  • device_events (dict) – events for each device

  • error_dict (dict) – error dict

Return type

ObsState

Returns

ObsState

configure(argin, task_callback)

Configure to allocated Subarray device.

Parameters
  • argin (str) – json input

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

property configured_capabilities

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

deconfigure()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

end(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

end_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

end_singular_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

get_devices_availability_dict()

Returns the dictionary with the devices and it’s availability

Returns

Dictionary with devices and their availability

Return type

dict

is_valid_admin_mode()

Extends the base admin mode validation with MCCS check for LOW telescope.

Returns

True if all subarrays including MCCS are in valid admin mode.

Return type

bool

obsreset()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

off(task_callback)

Submits Off command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

on(task_callback)

Submits On command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

release()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

release_all(task_callback)

Submits ReleaseAllResources command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

restart(task_callback)

Restarting the subarray.

Parameters

task_callback (TaskCallbackType) – task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

scan(argin, task_callback)

Scanning the devices.

Parameters
  • argin – Scan json

  • task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

standby()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

start_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

stop_aggregation_process()

Stop aggregation process

Return type

None

stop_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

update_long_running_command_result(dev_name, value, timestamp)

Stores the longRunningCommandResult values for devices and Updates the long_running_result_callback if the required criteria is met (i.e received events from all the expected devices for a given command).

Parameters
  • dev_name (str) – Device name for which the longRunningCommandResult event was received

  • value (Tuple[str, str]) – longRunningCommandResult event value

  • timestamp (datetime) – timestamp of execution

Return type

None

validate_configuration_json(argin, configure_command)

_summary_

Parameters
  • argin (_type_) – _description_

  • json_argument (_type_) – _description_

  • configure_validator (_type_) – _description_

  • configure_command (_type_) – _description_

validate_scan(argin)

scan validation

Parameters

argin (_type_) – _description_

class ska_tmc_subarraynode.manager.SubarrayNodeComponentManagerMid(op_state_model, obs_state_model, _command_tracker, _input_parameter, dev_family, component_state_changed_callback, _update_device_callback, _update_subarray_health_state_callback, _update_assigned_resources_callback, _update_subarray_availability_status_callback, update_scan_duration_callback, logger=None, _component=None, _liveliness_probe=True, _event_manager=True, command_timeout=30, abort_command_timeout=40, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, csp_assign_interface='https://schema.skao.int/ska-csp-assignresources/2.0', csp_scan_interface='https://schema.skao.int/ska-csp-scan/2.0', sdp_scan_interface='https://schema.skao.int/ska-sdp-scan/0.4')

Bases: SubarrayNodeComponentManager

Initialise a new ComponentManager instance for mid.

abort(task_callback)

Aborting the subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

abort_dishes(tmc_leaf_dish_adapters)

Invokes Abort command on Dish Leaf Node Group

Return type

Tuple[ResultCode, str]

Returns

A tuple containing ResultCode and message

add_device_to_lp(device_name)

Add device to the liveliness probe

Parameters

device_name (str) – device name

Return type

None

assign(argin, task_callback)

Submits AssignResources command as a separate task.

Parameters
  • argin – Assign json

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

Return type

Tuple

Returns

a result code and message

clear_assigned_resources()

Removes Dish Leaf Node and Dish Master devices from Input Parameter

Return type

None

configure(argin, task_callback)

Configure to allocated Subarray device.

Parameters
  • argin (str) – json input

  • task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

property configured_capabilities

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

deconfigure()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

end(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

end_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

end_singular_scan(task_callback)

End the configuration of Subarray.

Parameters

task_callback (TaskCallbackType) – Task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

get_devices_availability_dict()

Returns the dictionary with the devices and it’s availability

Returns

the dictionary with the devices and it’s availability

Return type

dict

get_dish_dev_names()

Return the names of the dishes assigned to Subarray

Return type

List[str]

Returns

names of the dishes assigned to Subarray

get_dish_leaf_node_prefix()

Return the Dish Leaf Node prefix

Returns

Dish Leaf Node prefix

Return type

str

get_keys_required_for_getting_sdpqc_fqdn()

Returns the keys that are required to get sdpqc fqdn from dictionary received from SDP subarray receivedAddresses attribute at runtime

Return type

List

Returns

keys required for getting fqdn

get_normal_scan_dish_device_names()

Get normal scan dishln device names

Returns

normal scan dishln device names

Return type

list

get_tmc_dish_ln_device_names()

Return the names of the dishes assigned to Subarray

Return type

List[str]

Returns

names of the dishes assigned to Subarray

get_trajectory_dish_device_names()

Get Trajectory dishln device names

Returns

Trajectory dishln device names

Return type

list

invoke_pointing_calibration(event_attribute_value)

This method get sdpQueueConnectorFqdn from event attribute value and set on dish leaf node

Parameters

event_attribute_value (str) – receiveAddresses attribute value

Return type

None

property kvalue_validation_failed

Gives the bool value for kvalue validation result

Returns

boolean value for kvalue validation result

mid_cleanup_on_abort_or_restart()

Method to clean the mid resources assigned on Abort or Restart command

obsreset()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

off(task_callback)

Submits Off command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

on(task_callback)

Submits On command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

process_lrcrevent(dev_name, value, timestamp)

Process Long Running Command Result

Parameters
  • dev_name (str) – Device name for which the longRunningCommandResult event was received

  • value (Tuple[str, str]) – longRunningCommandResult event value

  • timestamp (datetime) – timestamp

release()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

release_all(task_callback)

Submits ReleaseAllResources command as a separate task.

Parameters

task_callback (TaskCallbackType) – Update task state, defaults to None

Return type

Tuple

Returns

a result code and message

remove_dish_devices()

Removes dish devices from component

Return type

None

restart(task_callback)

Restarting the subarray.

Parameters

task_callback (TaskCallbackType) – task Callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

scan(argin, task_callback)

Scanning the devices.

Parameters
  • argin – Scan json

  • task_callback (TaskCallbackType) – task callback

Return type

Tuple[ResultCode, str]

Returns

a result code and message

set_dish_device_names(dish_dev_names)

Update the names of the dishes assigned to Subarray

Parameters

dish_dev_names (List) – name of the dish devices

Return type

None

set_keys_required_for_getting_sdpqc_fqdn(set_the_keys)

Set the values that are required to get sdpqc fqdn from dictionary received from SDP subarray receivedAddresses attribute at runtime

Parameters

set_the_keys (List) – Set the values that are required to get sdpqc fqdn from dictionary received

Return type

None

set_normal_scan_dish_device_names(dish_ln_names)

Update the normal scan dishln device names

Parameters

dish_ln_names (List) – dish leaf node name list

Return type

None

set_pattern_scan_data(group_list)

Set up Pattern scan data

Parameters

group_list (List) – Group list

Return type

None

set_tmc_leaf_dish_device_names(tmc_dish_ln_device_names)

Update the names of the dish leaf nodes assigned to Subarray, and subscribe to dishMode and pointingState events.

Parameters

tmc_dish_ln_device_names (List[str]) – List of TMC dish leaf node FQDNs.

Return type

None

set_trajectory_dish_device_names(dish_ln_names)

Update the trajectory dishln device names

Parameters

dish_ln_names (List) – dish leaf node name list

Return type

None

standby()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

start_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

stop_aggregation_process()

Stop aggregation process

Return type

None

stop_communicating()

This method serves as a placeholder to address linting warnings or errors related to missing or unused functions. It is intentionally left empty to satisfy linting requirements without affecting the program’s behavior.

Return type

None

unsubscribe_dish_leaf_node_events()

Unsubscribes from dishMode, pointingState, and longRunningCommandResult events for all currently assigned dish leaf node devices.

Return type

None

update_long_running_command_result(dev_name, value, timestamp)

Stores the longRunningCommandResult values for devices and Updates the long_running_result_callback if the required criteria is met (i.e received events from all the expected devices for a given command).

Parameters
  • dev_name (str) – Device name for which the longRunningCommandResult event was received

  • value (Tuple[str, str]) – longRunningCommandResult event value

  • timestamp (datetime) – timestamp

Return type

None

update_receive_addresses(device_name, receive_addresses, timestamp)

Update receiveAddresses for a monitored device

Parameters
  • device_name (str) – name of the device

  • receive_addresses (str) – receiveAddresses

  • timestamp (datetime) – timestamp

Return type

None

validate_configuration_json(argin, configure_command)

_summary_

Parameters
  • argin (_type_) – _description_

  • json_argument (_type_) – _description_

  • configure_validator (_type_) – _description_

  • configure_command (_type_) – _description_

validate_scan(argin)

scan validation

Parameters

argin (_type_) – _description_

class ska_tmc_subarraynode.manager.SubarrayNodeEventManager(component_manager, subscription_configuration=None, logger=<Logger ska_tmc_subarraynode.manager.event_manager (WARNING)>, stateless=True, event_subscription_check_period=1, event_error_max_count=10, status_update_callback=None, maximum_status_queue_size=50)

Bases: EventManager

Event manager for handling TANGO events for the SubarrayNode component. Inherits from ska_tmc_common.v2.EventManager and provides specific callbacks for different TANGO attributes and states relevant to SubarrayNode.

adminmode_event_callback(event)

Callback for handling adminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

assignedresources_event_callback(event)

Callback for handling assignedResources TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

cspsubarrayadminmode_event_callback(event)

Callback for handling cspSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

cspsubarrayobsstate_event_callback(event)

Callback for handling cspSubarrayObsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

dishmode_event_callback(event)

Callback for handling dishMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

healthstate_event_callback(event)

Callback for handling healthState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

issubsystemavailable_event_callback(event)

Callback for handling isSubsystemAvailable TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

longrunningcommandresult_event_callback(event)

Callback for handling longRunningCommandResult TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

mccssubarrayadminmode_event_callback(event)

Callback for handling mccsSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

obsstate_event_callback(event)

Callback for handling obsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

pointingstate_event_callback(event)

Callback for handling pointingState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

receiveaddresses_event_callback(event)

Callback for handling receiveAddresses TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

sdpsubarrayadminmode_event_callback(event)

Callback for handling sdpSubarrayAdminMode TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

sdpsubarrayobsstate_event_callback(event)

Callback for handling sdpSubarrayObsState TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None

state_event_callback(event)

Callback for handling state TANGO events.

Parameters

event (EventData) – The received TANGO event data.

Return type

None