Daq Component Manager

This module implements component management for DaqReceivers.

class DaqComponentManager(daq_id, receiver_interface, receiver_ip, receiver_ports, daq_address, consumers_to_start, skuid_url, logger, max_workers, communication_state_callback, component_state_callback, received_data_callback)

A component manager for a DaqReceiver.

__init__(daq_id, receiver_interface, receiver_ip, receiver_ports, daq_address, consumers_to_start, skuid_url, logger, max_workers, communication_state_callback, component_state_callback, received_data_callback)

Initialise a new instance of DaqComponentManager.

Parameters:
  • daq_id (int) – The ID of this DaqReceiver.

  • receiver_interface (str) – The interface this DaqReceiver is to watch.

  • receiver_ip (str) – The IP address of this DaqReceiver.

  • receiver_ports (str) – The port this DaqReceiver is to watch.

  • daq_address (str) – the address of the DAQ receiver. This is dependent on the communication mechanism used. For gRPC, this is the channel.

  • consumers_to_start (str) – The default consumers to be started.

  • skuid_url (str) – The address at which a SKUID service is running.

  • logger (Logger) – the logger to be used by this object.

  • max_workers (int) – the maximum worker threads for the slow commands associated with this component manager.

  • communication_state_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_callback (Callable[..., None]) – callback to be called when the component state changes

  • received_data_callback (Callable[[str, str, str], None]) – callback to be called when data is received from a tile

configure_daq(daq_config)

Apply a configuration to the DaqReceiver.

Parameters:

daq_config (str) – A json containing configuration settings.

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.

daq_status(task_callback=None)

Provide status information for this MccsDaqReceiver.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

str

Returns:

a task status and response message

get_configuration()

Get the active configuration from DAQ.

Return type:

dict[str, str]

Returns:

The configuration in use by the DaqReceiver instance.

start_bandpass_monitor(argin, task_callback=None)

Start monitoring antenna bandpasses.

The MccsDaqReceiver will begin monitoring antenna bandpasses

and producing plots of the spectra.

Parameters:
  • argin (str) – A json string with keywords - plot_directory Directory in which to store bandpass plots. - monitor_rms Whether or not to additionally produce RMS plots. Default: False. - auto_handle_daq Whether DAQ should be automatically reconfigured, started and stopped without user action if necessary. This set to False means we expect DAQ to already be properly configured and listening for traffic and DAQ will not be stopped when StopBandpassMonitor is called. Default: False. - cadence The time in seconds over which to average bandpass data. Default: 0 returns snapshots.

  • task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

start_communicating()

Establish communication with the DaqReceiver components.

Return type:

None

start_daq(modes_to_start, task_callback=None)

Start data acquisition with the current configuration.

Extracts the required consumers from configuration and starts them.

Parameters:
  • modes_to_start (str) – A comma separated string of daq modes.

  • task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

stop_bandpass_monitor(task_callback=None)

Stop monitoring antenna bandpasses.

The MccsDaqReceiver will cease monitoring antenna bandpasses

and producing plots of the spectra.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[ResultCode, str]

Returns:

a ResultCode and response message

stop_communicating()

Break off communication with the DaqReceiver components.

Return type:

None

stop_daq(task_callback=None)

Stop data acquisition.

Stops the DAQ receiver and all running consumers.

Parameters:

task_callback (Optional[Callable]) – Update task state, defaults to None

Return type:

tuple[ResultCode, str]

Returns:

a task status and response message