Device Component Manager
This module implements an abstract component manager for simple object components.
- class DeviceComponentManager(name, logger, max_workers, communication_state_callback, component_state_callback)
An abstract component manager for a Tango device component.
- __init__(name, logger, max_workers, communication_state_callback, component_state_callback)
Initialise a new instance.
- Parameters:
name (
str
) – the name of the devicelogger (
Logger
) – the logger to be used by this object.max_workers (
int
) – Nos of worker threads for async commands.communication_state_callback (
Callable
[[CommunicationStatus
],None
]) – callback to be called when the status of the communications channel between the component manager and its component changescomponent_state_callback (
Callable
[...
,None
]) – callback to be called when the component state changes
- property health: HealthState | None
Return the evaluated health state of the device.
This will be either the health state that the device reports, or None if the device is in an admin mode that indicates that its health should not be rolled up.
- Returns:
the evaluated health state of the device.
- off(task_callback=None)
Turn the device off.
- on(task_callback=None)
Turn the device on.
- property power_state: PowerState | None
Return the current power state of the device.
- Returns:
the current power state of the device.
- reset(task_callback=None)
Reset the device.
- standby(task_callback=None)
Turn the device to standby.
- start_communicating()
Establish communication with the component, then start monitoring.
This is a public method that enqueues the work to be done.
- Return type:
- class ObsDeviceComponentManager(fqdn, logger, max_workers, communication_state_callback, component_state_callback)
An abstract component manager for a Tango observation device component.
- __init__(fqdn, logger, max_workers, communication_state_callback, component_state_callback)
Initialise a new instance.
- Parameters:
fqdn (
str
) – the FQDN of the device.logger (
Logger
) – the logger to be used by this object.communication_state_callback (
Callable
[[CommunicationStatus
],None
]) – callback to be called when the status of the communications channel between the component manager and its component changes.component_state_callback (
Callable
[...
,None
]) – callback to be called when the component’s state changes.max_workers (
int
) – Maximum number of workers in thread pool.