Daq Component Manager

This module implements component management for DaqReceivers.

class DaqComponentManager(daq_id, receiver_interface, receiver_ip, receiver_ports, consumers_to_start, nof_tiles, skuid_url, logger, communication_state_callback, component_state_callback, received_data_callback, dedicated_bandpass_daq=False, simulation_mode=False)[source]

A component manager for a DaqReceiver.

__init__(daq_id, receiver_interface, receiver_ip, receiver_ports, consumers_to_start, nof_tiles, skuid_url, logger, communication_state_callback, component_state_callback, received_data_callback, dedicated_bandpass_daq=False, simulation_mode=False)[source]

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.

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

  • nof_tiles (int) – The number of tiles this DAQ will receive data from.

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

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

  • 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

  • dedicated_bandpass_daq (bool) – Flag indicating whether this DaqReceiver is dedicated exclusively to monitoring bandpasses. If true then this DaqReceiver will attempt to automatically monitor bandpasses.

  • simulation_mode (bool) – whether or not to use a simulated backend.

configure_daq(**daq_config)

Apply a configuration to the DaqReceiver.

Parameters:

daq_config (Any) – Validated kwargs 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.

property daq_library: str

Get the filename of the current daq library used.

Returns:

a string corresponding to the library filename.

generate_bandpass_plots(filepath)[source]

Generate antenna bandpass plots.

Parameters:

filepath (str) – the location of the data file for bandpass plots.

Return type:

None

get_configuration()

Get the active configuration from DAQ.

Return type:

dict[str, str]

Returns:

The configuration in use by the DaqReceiver instance.

get_external_ip(logger)[source]

Get the IP of the serivice which exposes this device.

This is exceptionally ugly code, however we are not allowed initcontainers in ska-tango-util. Anyhow this should be deleted once SP-5187 is finished, then we don’t need to use the 1G, so we don’t need to attach a loadbalancer to the bandpass DAQ so we don’t need to grab the IP of that loadbalancer here.

Parameters:

logger (Logger) – passing in the logger as we haven’t yet run super().__init__().

Return type:

str

Returns:

the ip of the loadbalancer service.

get_status()

Provide status information for this MccsDaqReceiver.

This method returns status as a json string with entries for:
  • Running Consumers: [DaqMode.name: str, DaqMode.value: int]

  • Receiver Interface: “Interface Name”: str

  • Receiver Ports: [Port_List]: list[int]

  • Receiver IP: “IP_Address”: str

  • Bandpass Monitor: “Monitoring Status”: bool

Return type:

dict[str, Any]

Returns:

A json string containing the status of this DaqReceiver.

initialise(config)[source]

Initialise a new DaqReceiver instance.

Parameters:

config (dict[str, Any]) – the configuration to apply

Return type:

tuple[ResultCode, str]

Returns:

a resultcode, message tuple

start_bandpass_monitor(task_callback=None)[source]

Start monitoring antenna bandpasses.

The MccsDaqReceiver will begin monitoring antenna bandpasses

and producing plots of the spectra.

Parameters:

task_callback (TaskCallbackType | None) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a Taskstatus and response message

start_communicating()[source]

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 (TaskCallbackType | None) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

start_data_rate_monitor(interval=2.0, task_callback=None)[source]

Start the data rate monitor on the receiver interface.

Parameters:
  • interval (float) – The interval in seconds at which to monitor the data rate.

  • task_callback (TaskCallbackType | None) – Update task state, defaults to None.

Return type:

tuple[ResultCode, str]

Returns:

a result code 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 (TaskCallbackType | None) – Update task state, defaults to None

Return type:

tuple[ResultCode, str]

Returns:

a ResultCode and response message

stop_communicating()[source]

Break off communication with the DaqReceiver components.

Return type:

None

stop_daq(task_callback=None)

Stop data acquisition.

Parameters:

task_callback (TaskCallbackType | None) – Update task state, defaults to None

Return type:

tuple[TaskStatus, str]

Returns:

a task status and response message

stop_data_rate_monitor(task_callback=None)[source]

Start the data rate monitor on the receiver interface.

Parameters:

task_callback (TaskCallbackType | None) – Update task state, defaults to None.

Return type:

tuple[ResultCode, str]

Returns:

a result code and response message