backend.Backend¶
- class backend.Backend(address, log_queue: multiprocessing.context.BaseContext.Queue, start_plots=False, timing=False, gpu='-1')¶
This is the main backend process. It is initialized by main.py. The run() method is what runs in this process. This process handles all the heavy I/O and computations.
- __init__(address, log_queue: multiprocessing.context.BaseContext.Queue, start_plots=False, timing=False, gpu='-1')¶
Initialize the backend. This does NOT start the process. This function simply saves the given arguments and generates all the default data for the backend.
- run()¶
This is the method that runs in the process. This initializes the logger and then runs in a loop waiting for commands from the frontend in the command_pipe.
This will exit when the QUIT command is sent or if it times out
- socket_listener_thread_func()¶
- socket_send_thread_func()¶
- socket_recv_thread_func()¶
- async_gui_thread_func()¶
This is the Async thread’s main loop This thread loops while it is alive at rate of 2 Hz.
Inside the loop, the update to the gui is created as a dict comprised of anything inside self.async_gui_updates (which is cleared after every loop), and the fps and sample rate if the corresponding streaming flags are true.
After sending the update to the gui, we process all async commands received from the GUI.
- run_py_script(filename='')¶
- save_command_history(filename='', append=False)¶
- connect(**kwargs)¶
Connect to the specified peripherals. Successfully connected peripherals will not be None.
- get(connections=False, general_settings=False, **kwargs)¶