Documentation control room

Control room functionality

The control room is one way of composing Dareplane modules to experimental setups. schematic_image

The github repository for this module is located at: https://github.com/bsdlab/dp-control-room/

Main

The main script to start and spawn the control_room.

main.run_control_room Run the control room application with the given setup configuration.
main.close_down_connections Close all ModuleConnection instances.
main.initialize_python_modules Initialize Python modules based on the provided configurations.
main.initialize_exe_modules Initialize modules provided with an executable target. NOT WORKING ATM.

UI

UI components implemented in dash are the core of the control room.

gui.app.build_app Build and configure a Dash web application for the control room.
gui.callbacks.add_json_verification_cb Add a callback to the Dash app to verify JSON strings in input fields.
gui.callbacks.add_macros_sender Add a callbacks to dynamically to macro sections on a Dash app.
gui.callbacks.evaluate_templates If a dictionary contains $ templates in its values,
gui.callbacks.add_pcomm_sender Add a callback to the Dash app to send pcomm commands to modules.
gui.layout.get_layout Generate the layout for the control room application.
gui.layout.create_macro_tile Create a tile containing buttons for each macro.
gui.layout.get_macro_button_input_pair Create a macro button and input pair for a given macro configuration.
gui.layout.get_log_stream_tile Create the tile showing the last lines of the log file
gui.layout.get_module_tile_layout Create the tile showing the individual modules
gui.layout.get_pcomm_button_input_pair Create pairs of buttons and inputs for each pcommand

Process management

The control_room spawns and manages the life-times of other python modules.

processes.close_child_processes Close all child processes of a Popen instance
processes.start_container Start a container for a given module.
connection
socket

Inter module communication

The control_room also routes control_room callbacks, which allow intermodule communication if this is not solved by using something like LSL.

callbacks.CallbackBroker A class to handle callbacks from socket clients.

Logging

Utils of the control_room concern mainly logging. This relates to providing a TCP that listenes on the standard port for python logging (9020), and therefore consolidates all logging messages shared this way. E.g., when using dareplane-utils and the from dareplane_utils.logging.logger import get_logger.