FNDH component manager
This module implements the component management for fndh.
- class FndhComponentManager(logger, communication_state_callback, component_state_callback, attribute_change_callback, update_port_power_states, pasd_fqdn, ports_with_smartbox, event_serialiser=None, _pasd_bus_proxy=None)
A component manager for an fndh.
This communicates via a proxy to a MccsPasdBus that talks to a simulator or the real hardware.
- __init__(logger, communication_state_callback, component_state_callback, attribute_change_callback, update_port_power_states, pasd_fqdn, ports_with_smartbox, event_serialiser=None, _pasd_bus_proxy=None)
Initialise a new instance.
- Parameters:
logger (
Logger) – a logger for this object to usecommunication_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 changesattribute_change_callback (
Callable[...,None]) – callback to be called when a attribute changesupdate_port_power_states (
Callable[...,None]) – callback to be called when the power state changes.pasd_fqdn (
str) – the fqdn of the pasdbus to connect to.ports_with_smartbox (
list[int]) – the list of ports with smartboxes.event_serialiser (
Optional[EventSerialiser]) – the event serialiser to be used by this object._pasd_bus_proxy (
Optional[MccsDeviceProxy]) – a optional injected device proxy for testing purposes only. defaults to None
- abort(task_callback=None)
Abort in-flight tasks and propagate to the PaSD bus.
Calls the base class abort to signal the task abort event, then calls Abort on the PaSD bus device to clear any pending port power changes.
- do_on(task_callback=None, task_abort_event=None)
Turn the Fndh on.
- do_standby(task_callback=None, task_abort_event=None)
Turn the Fndh to standby.
- power_off_port(port_number, task_callback=None, task_abort_event=None)
Turn a port off.
This port may or may not have a smartbox attached.
- Parameters:
- Return type:
- Returns:
the task status and a human-readable status message
- power_on_port(port_number, task_callback=None, task_abort_event=None)
Turn a port on.
This port may or may not have a smartbox attached.
- Parameters:
- Return type:
- Returns:
the task status and a human-readable status message
- set_port_powers(json_argument, task_callback=None, task_abort_event=None)
Set port powers.
- Parameters:
- Return type:
- Returns:
the task status and a human-readable status message