TMC Common TMC Component Manager

1. TmcComponent

class ska_tmc_common.tmc_component_manager.TmcComponent(logger: <Mock id='139757325897392'>)

This class provides a reference implementation of BaseComponentManager.

get_device(device_name)

Retrieve information about a specific device. This is a base method that should be implemented by derived classes. :raises NotImplementedError: Not implemented error

update_device(dev_info)

Base method for update_device method for different nodes :raises NotImplementedError: Not implemented error

update_device_exception(device_info, exception)

Base method for update_device_exception method for different nodes :raises NotImplementedError: Not implemented error

to_json() str

Base method for to_json method for different nodes :return: json

to_dict()

Base method for to_dict method for different nodes :raises NotImplementedError: Not implemented error

2. BaseTmcComponentManager

class ska_tmc_common.tmc_component_manager.BaseTmcComponentManager(*args: Any, **kwargs: Any)

This class manages obsstates , commands and various checks on TMC components.

property command_id: str

Read method for reading command id used for error propagation. :return: command_id

is_command_allowed(command_name: str)

Checks whether this command is allowed It checks that the device is in a state to perform this command

Parameters:

command_name (str) – command_name

Return type:

boolean

Raises:

NotImplementedError – raise not implemented error

start_liveliness_probe(liveliness_probe_type: LivelinessProbeType) None

Starts Liveliness Probe for the given device.

Parameters:

liveliness_probe_type – enum of class LivelinessProbeType

stop_liveliness_probe() None

Stops the liveliness probe

start_event_receiver() None

Starts the Event Receiver for given device

stop_event_receiver() None

Stops the Event Receiver

start_timer(timeout_id: str, timeout: int, timeout_callback: TimeoutCallback) None

Starts a timer for the command execution which will run for given amount of seconds. After the timer runs out, it will execute the task failed method.

Parameters:
  • timeout_id – Id for TimeoutCallback class object.

  • timeout – Interval value for the Timer

  • timeout_callback – An instance of TimeoutCallback class that acts as a callable functions to call in the event of timeout.

timeout_handler(timeout_id: str, timeout_callback: TimeoutCallback) None

Updates the timeout callback to reflect timeout failure.

Parameters:
  • timeout_id – Id for TimeoutCallback class object.

  • timeout_callback – An instance of TimeoutCallback class that acts as a callable functions to call in the event of timeout.

stop_timer() None

Stops the timer for command execution

3. TmcComponentManager

class ska_tmc_common.tmc_component_manager.TmcComponentManager(*args: Any, **kwargs: Any)

A component manager for The TMC 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 various aggregation logic

  • Receiving the change events from the component

reset() None

Method to reset components

property devices: list

Return the list of the monitored devices

Returns:

list of the monitored devices

add_device(device_name: str) None

Add device to the monitoring loop

Parameters:

device_name (str) – device name

get_device(device_name: str) DeviceInfo

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

Parameters:

device_name (str) – name of the device

Returns:

a device info

Return type:

DeviceInfo

update_device_ping_failure(device_info: DeviceInfo, exception: str) None

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

Parameters:
  • device_info (DeviceInfo) – a device info

  • exception – an exception

Type:

Exception

update_event_failure(device_name: str) None

Update the failure status of an event for a specific device.

update_device_info(device_info: DeviceInfo) None

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

Parameters:

device_info (DeviceInfo) – a device info

update_ping_info(ping: int, device_name: str) None

Update a device with correct ping information.

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

  • ping (int) – device response time

update_device_health_state(device_name: str, health_state: ska_tango_base.control_model.HealthState) None

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

update_device_state(device_name: str, state: tango.DevState) None

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

is_command_allowed(command_name: str)

Checks whether this command is allowed It checks that the device is in a state to perform this command

Parameters:

command_name (str) – command_name

Return type:

boolean

Raises:

NotImplementedError – raise not implemented error

4. TmcLeafNodeComponentManager

class ska_tmc_common.tmc_component_manager.TmcLeafNodeComponentManager(*args: Any, **kwargs: Any)

A component manager for The TMC Leaf 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 various aggregation logic

  • Receiving the change events from the component

reset() None

Method for device reset information

get_device() DeviceInfo

Return the device info our of the monitoring loop with name device_name :return: a device info :rtype: DeviceInfo

update_device_ping_failure(exception: str) None

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

Parameters:

exception – an exception

Type:

Exception

update_device_info(device_info: DeviceInfo) None

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

Parameters:

device_info (DeviceInfo) – a device info

update_ping_info(ping: int, device_name: str) None

Update a device with the correct ping information.

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

  • ping (int) – device response time

update_event_failure(device_name: str) None

Update a monitored device failure status

Parameters:

device_name (str) – name of the device

update_device_health_state(device_name: str, health_state: ska_tango_base.control_model.HealthState) None

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

update_device_state(device_name: str, state: tango.DevState) None

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

update_device_obs_state(device_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:
  • device_name (str) – name of the device

  • obs_state (ObsState) – obs state of the device