SMART Box component manager
This module implements the component management for smartbox.
- class SmartBoxComponentManager(logger, communication_state_callback, component_state_callback, attribute_change_callback, smartbox_nr, readable_name, port_count, pasd_fqdn, ports_with_antennas, antenna_names, fndh_port, masked_antennas=None, event_serialiser=None, _pasd_bus_proxy=None)
A component manager for MccsSmartBox.
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, smartbox_nr, readable_name, port_count, pasd_fqdn, ports_with_antennas, antenna_names, fndh_port, masked_antennas=None, 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 of interest changes.smartbox_nr (
int) – the smartbox’s ID number.readable_name (
str) – the smartbox’s nameport_count (
int) – the number of smartbox ports.pasd_fqdn (
str) – the fqdn of the pasdbus to connect to.ports_with_antennas (
list[int]) – list of ports which have antennas attached.antenna_names (
list[str]) – list of antenna names attached to ports.fndh_port (
int) – the fndh port to which this smartbox is attached.masked_antennas (
Optional[list[str]]) – list of antenna names whose ports should be masked.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
- abort(task_callback=None)
Abort any in-flight tasks and propagate to the PaSD bus.
- do_off(task_callback=None, task_abort_event=None)
Turn the Smartbox off.
- do_on(task_callback=None, task_abort_event=None)
Turn the Smartbox on.
- do_standby(task_callback=None, task_abort_event=None)
Turn the Smartbox to standby.
- property port_mask: list[bool]
Getter for the port mask.
- Returns:
list of masked ports on the smartbox.
- set_antenna_masking(antenna_mask)
Update the masking status for specific antennas.
Antennas absent from the dict are left unchanged.
- set_port_powers(json_argument, task_callback=None, task_abort_event=None)
Set port powers.
These ports will not have an antenna attached.
- Parameters:
- Return type:
- Returns:
the result code and a human-readable status message
- turn_off_port(port_number, task_callback, task_abort_event=None)
Turn a Port off.
This may or may not have a Antenna attached.
- Parameters:
- Raises:
NotImplementedError – if no PaSD proxy is configured
- Return type:
- Returns:
the result code and a human-readable status message
- turn_on_port(port_number, task_callback, task_abort_event=None)
Turn a port on.
This may or may not have a Antenna attached.
- Parameters:
- Raises:
NotImplementedError – if no PaSD proxy is configured
- Return type:
- Returns:
the result code and a human-readable status message