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:
  • maser_fqdns (Iterable[str]) – FQDNS of all maser devices

  • 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 changes

  • component_state_changed_callback (Callable) – callback to be called when state changes

off()

Turn off the SatLMC subsystem.

Return type:

ResultCode

Returns:

a result code

on()

Turn on the SatLMC subsystem.

Return type:

ResultCode

Returns:

a result code

start_communicating()

Establish communication with its components.

Return type:

None

stop_communicating()

Break off communication with its components.

Return type:

None

class ControllerHealthModel(maser_fqdns, health_changed_callback)

A health model for a controller.

__init__(maser_fqdns, health_changed_callback)

Initialise a new instance.

Parameters:
  • maser_fqdns (Sequence[str]) – the FQDNs of the masers

  • 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:

HealthState

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 changed

  • maser_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:

None

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 during SatController’s initialisation.

do(*args, **kwargs)

Initialise the attributes and properties.

Parameters:
  • args (Any) – additional positional arguments; unused here

  • kwargs (Any) – additional keyword arguments; unused here

Return type:

tuple[ResultCode, str]

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:

ControllerComponentManager

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:

None

init_command_objects()

Set up the handler objects for Commands.

Return type:

None

init_device()

Initialise the device.

Return type:

None