TMC Common TMC Component Manager
1. TmcComponent
- class ska_tmc_common.v1.tmc_component_manager.TmcComponent(logger: <Mock id='123145425510336'>)
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.v1.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
- property is_admin_mode_enabled
Return the admin mode enabled flag.
- Returns:
admin mode enabled flag
- Return type:
bool
- get_device() DeviceInfo
Return the device info out of the monitoring loop with name device_name :return: a device info :rtype: DeviceInfo
- 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.
- update_device_admin_mode(admin_mode: ska_tango_base.control_model.AdminMode) None
Update a monitored device admin mode, and call the relative callbacks if available
- Parameters:
admin_mode (AdminMode) – admin mode of the device
- 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.v1.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_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_exception_for_unresponsiveness(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_responsiveness_info(device_name: str) None
Update a device with correct responsiveness information.
- 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
- 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
- check_event_error(event: tango.EventData, callback: str)
Method for checking event error.
4. TmcLeafNodeComponentManager
- class ska_tmc_common.v1.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 out of the monitoring loop with name device_name :return: a device info :rtype: DeviceInfo
- 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_event_error(device_name: str) None
Update a monitored device failure status
- Parameters:
device_name (str) – name of the device
- update_device_health_state(health_state: ska_tango_base.control_model.HealthState) None
Update a monitored device health state aggregate the health states available
- Parameters:
health_state (HealthState) – health state of the device
- update_device_state(state: tango.DevState) None
Update a monitored device state, aggregate the states available and call the relative callbacks if available
- Parameters:
state (DevState) – state of the device
- update_exception_for_unresponsiveness(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_responsiveness_info(device_name: str = '') None
Update a device with correct responsiveness information.
- Parameters:
device_name (str) – name of the device
- update_health_state_event(event: tango.EventData)
Updates health state event in respective queue
- update_state_event(event: tango.EventData)
Updates state event in respective queue
- update_obs_state_event(event: tango.EventData)
Updates obsState event in respective queue
- update_command_result_event(event: tango.EventData)
Updates longRunningCommandResult event in respective queue
- update_admin_mode_event(event: tango.EventData)
Updates adminMode event in respective queue
- update_dishvcc_config_event(event: tango.EventData)
Updates dishVccConfig event in respective queue
- update_source_dishvcc_config_event(event: tango.EventData)
Updates sourceDishVccConfig event in respective queue
- process_event(attribute_name: str) None
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
- check_event_error(event: tango.EventData, callback: str)
Method for checking event error.
- start_event_processing_threads() None
Start all the event processing threads.
- update_event_failure() None
Update the failure status of an event for a specific device.