Field station component manager

This module implements the component management for FieldStation.

class FieldStationComponentManager(logger, station_name, fndh_name, smartbox_names, nof_blocks, communication_state_callback, component_state_changed, event_serialiser=None, _fndh_proxy=None, _smartbox_proxys=None)

A component manager for MccsFieldStation.

__init__(logger, station_name, fndh_name, smartbox_names, nof_blocks, communication_state_callback, component_state_changed, event_serialiser=None, _fndh_proxy=None, _smartbox_proxys=None)

Initialise a new instance.

Parameters:
  • logger (Logger) – a logger for this object to use

  • station_name (str) – the station name.

  • fndh_name (str) – the name of the fndh this field station encompasses

  • smartbox_names (list[str]) – the names of the smartboxes this field station encompasses

  • nof_blocks (int) – the number of blocks to split smartboxes into for ON command execution.

  • communication_state_callback (Callable[..., None]) – callback to be called when the status of the communications channel between the component manager and its component changes

  • component_state_changed (Callable[..., None]) – callback to be called when the component state changes

  • event_serialiser (Optional[EventSerialiser]) – the event serialiser to be used by this object.

  • _fndh_proxy (Optional[DeviceComponentManager]) – a injected fndh proxy for purposes of testing only.

  • _smartbox_proxys (Optional[dict[str, DeviceComponentManager]]) – injected smartbox proxys for purposes of testing only.

abort(task_callback=None)

Abort in-flight tasks and propagate to the PaSD bus via the FNDH.

Calls the base class abort to signal the task abort event, then calls Abort on the FNDH device, which in turn aborts pending port power changes on the PaSD bus.

Parameters:

task_callback (Optional[Callable]) – notified of task progress.

Return type:

tuple[TaskStatus, str]

Returns:

tuple of TaskStatus and message.

cleanup()

Cleanup for threads and processes.

Return type:

None

configure(configure_args, task_callback, task_abort_event=None)

Configure the field station.

Currently this only supports configuring FNDH alarm thresholds.

Parameters:
  • task_callback (Callable) – callback to be called when the status of the command changes

  • task_abort_event (Optional[Event]) – Event signalling an abort

  • configure_args (str) – keyword arguments extracted from the JSON string.

Return type:

None

do_off(task_callback, task_abort_event=None)

Turn off the FieldStation.

Turning off the FieldStation will cut off power to all antennas that make up that FieldStation.

Parameters:
  • task_callback (Callable) – Update task state, defaults to None

  • task_abort_event (Optional[Event]) – Event signalling an abort

Return type:

None

do_on(task_callback, task_abort_event=None)

Turn on the FieldStation.

Turning on the FieldStation will distribute power to all antennas that make up that FieldStation.

Parameters:
  • task_callback (Callable) – Update task state, defaults to None

  • task_abort_event (Optional[Event]) – Event signalling an abort

Return type:

None

do_standby(task_callback, task_abort_event=None)

Turn the FieldStation to Standby.

Turning the FieldStation to Standby will turn on all smartboxes, but leave their ports turned off.

Parameters:
  • task_callback (Callable) – Update task state, defaults to None

  • task_abort_event (Optional[Event]) – Event signalling an abort

Return type:

None

power_off_antenna(antenna_name, task_callback, task_abort_event=None)

Turn off an antenna.

The Field station knows what ports need to be turned on and what fndh and smartboxes it is connected to.

Parameters:
  • antenna_name (str) – (one-based) number of the TPM to turn on.

  • task_callback (Callable) – callback to be called when the status of the command changes

  • task_abort_event (Optional[Event]) – Event signalling an abort

Return type:

None

power_on_antenna(antenna_name, task_callback, task_abort_event=None)

Turn on an antenna on this station.

Parameters:
  • antenna_name (str) – (one-based) number of the Antenna to turn on.

  • task_callback (Callable) – callback to be called when the status of the command changes

  • task_abort_event (Optional[Event]) – Event signalling an abort

Return type:

None

set_antenna_masking(antenna_mask, task_callback, task_abort_event=None)

Set the masking status for antennas across smartboxes.

Completes with REJECTED if none of the supplied antenna names are found on any smartbox.

Parameters:
  • antenna_mask (str) – JSON string mapping antenna names to masked status, e.g. '{"sb01-01": true, "sb03-01": false}'.

  • task_callback (Callable) – callback to be called when the status of the command changes

  • task_abort_event (Optional[Event]) – Event signalling an abort

Return type:

None

smartbox_state_change(smartbox_trl, power)

Register a state change for a smartbox.

Parameters:
  • smartbox_trl (str) – the name of the smartbox with a state change

  • power (PowerState) – the power state of the smartbox.

Return type:

None

start_communicating()

Establish communication.

Return type:

None

stop_communicating()

Break off communication with the PasdData.

Return type:

None