Controller subpackage
This subpackage implements sat controller functionality for SAT.LMC.
- class ControllerComponentManager(maser_fqdns, logger, communication_status_changed_callback, component_state_changed_callback)
A component manager for an SAT LMC controller.
- __init__(maser_fqdns, logger, communication_status_changed_callback, component_state_changed_callback)
Initialise a new instance.
- Parameters:
logger (
Logger
) – the logger to be used by this object.communication_status_changed_callback (
Callable
[[CommunicationStatus
],None
]) – callback to be called when the status of the communications channel between the component manager and its component changescomponent_state_changed_callback (
Callable
) – callback to be called when state changes
- off()
Turn off the SatLMC subsystem.
- Return type:
- Returns:
a result code
- on()
Turn on the SatLMC subsystem.
- Return type:
- Returns:
a result code
- class ControllerHealthModel(maser_fqdns, health_changed_callback)
A health model for a controller.
- __init__(maser_fqdns, health_changed_callback)
Initialise a new instance.
- Parameters:
health_changed_callback (
Callable
[[HealthState
],None
]) – callback to be called whenever there is a change to this health model’s evaluated health state.
- evaluate_health()
Compute overall health of the controller.
The overall health is based on the fault and communication status of the controller overall, together with the health of the subservient devices that it manages.
This implementation simply sets the health of the controller to the health of its least healthy component.
- Return type:
- Returns:
an overall health of the controller
- maser_health_changed(maser_fqdn, maser_health)
Handle a change in maser health.
- Parameters:
maser_fqdn (
str
) – the FQDN of the maser whose health has changedmaser_health (
Optional
[HealthState
]) – the health state of the specified maser, or None if the maser’s admin mode indicates that its health should not be rolled up.
- Return type:
- class SatController(*args, **kwargs)
An implementation of a controller Tango device for SatLMC.
- class InitCommand(*args, **kwargs)
A class for
SatController
’s Init command.The
do()
method below is called duringSatController
’s initialisation.- do(*args, **kwargs)
Initialise the attributes and properties.
- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- create_component_manager()
Create and return a component manager for this device.
- Return type:
- Returns:
a component manager for this device.
- health_changed(health)
Call this method whenever the HealthModel’s health state changes.
Responsible for updating the tango side of things i.e. making sure the attribute is up to date, and events are pushed.
- Parameters:
health (
HealthState
) – the new health value- Return type: