gui.GUI

class gui.GUI(address, shortcut_filename=None)

This class holds a reference to the tk root and creates the main window GUI that the user interacts with. This class also handles all interactions with the backend process.

This is mean to be initialized and then run() on the main thread of the main process!!!!

__init__(address, shortcut_filename=None)

Initialize the GUI.

This saves the given arguments, adjusts settings depending on the current OS, builds the UI, and initializes shortcuts.

run()

This runs the GUI. This starts the async ui updates and the console print updates at 2 and 10 Hz respectively and then enters the tk root’s main event loop.

socket_send_thread_func()
socket_recv_thread_func()
update_ui_callback(kwargs)

the success callback to update all frames

update_ui()

This GETs all data from the backend and then provides that data to all the frames in the main window so that they can update their interface and widgets.

update_backend(update_type: common.enums.UpdateType, params: dict, new=False, success_cb=None, error_cb=None)

The Backend Update command. This updates or creates the specified data in the backend using the params.

eval_cmd(cmd: str, env='Backend')

This evaluates a command entered in the debug box.

If the env==’Backend’, then the command is sent to the backend to be evaluated in the backend’s scope, otherwise the command is evaluated in the scope of this GUI.

stop_task()

The async command to stop a backend task

connect(**kwargs)
refilter_data(save=True)
replay()
test_eval()
update_movements(params: dict, train=True)
load_movements(train=True)
export_results(analysis: bool, recalc=False, group=False)
load_all(use_old_format=False, inspect=False)
load_data(use_old_format=False, inspect=False, **kwargs)
load_multiple_data(**kwargs)
load_analysis_data()
save_all()
save_data(prefix='', suffix='', data_type=None)
store_data()
swap_data()
cross_validation()
load_decoder(use_old_format=False)
save_decoder()
train_decoder(gradient=False, moving_dofs_only=False, save=True)
load_autoenc(use_old_format=False)
save_autoenc()
train_autoenc(reset_autoenc=True, save=True)
save_settings()
load_settings(use_old_format=False)
toggle_filter_graphs(update_checkbox=True)

The async command to toggle the filtering of the emg graphs

toggle_output_filters(update_checkbox=True)

The async command to toggle the filtering of the emg graphs

toggle_compress(update_checkbox=True)

The async command to toggle compression when saving data

toggle_srb2()

The async command to toggle using SRB2

toggle_raw_plots()

The async command to toggle using SRB2

toggle_scroll()

The async command to toggle console scrolling

calibrate_feature_baseline(use_rest_data=False)
collect(save=True)
test(save=True)
control(save=True)
update_autencoder_mode()
simulate_emg(repetitions=1, test=False, shuffle=False)
load_emg_simulator()
save_emg_simulator()
simulate_decoder(repetitions=1, test=False)
load_decoder_simulator()
save_decoder_simulator()
mov_detect(**kwargs)
load_detector_replay(filename='', erase_instead=False)
run_py_script()
save_command_history()
toggle_record_commands()
update_menubar(data)

Updates the menubar using the data sent to the update_ui_callback

update_title(data)

Updates the window title using the data sent to the update_ui_callback

get_relative_path(path)str

Return the path as relative the current working directory

get_filename(filepath)str
build_right_click_menu(widget, commands: dict)

Construct a right click menu for the given widget using the commands dict of name:callback pairs

load_file(dir_init, multiple_files=None, filetypes=None)
save_file(dir_init, file_init='', filetypes=None)
connect_backend(address, update_ui=True)

Connect to the backend via sockets

disconnect_backend(notify_backend=True, clear_command=True)

Disconnect our socket connections to the backend. Can be called if we are already disconnected.

notify_backend signals whether to send the async DISCONNECT command to the backend before closing the sockets.