Exemplo n.º 1
0
def display_files(files):
    display_boards()
    show_spinner("Loading files...")

    create_files_signal(files)

    change_selected_signals_in_data_selector([""])
    hide_spinner()
Exemplo n.º 2
0
def load_directory_group():
    show_spinner("Loading directories group...")
    directory = open_directory_dialog()
    # no files selected
    if not directory:
        hide_spinner()
        return

    display_directory_group(directory)
Exemplo n.º 3
0
def load_files():
    show_spinner("Loading files...")
    files = open_file_dialog()

    # no files selected
    if not files or not files[0]:
        hide_spinner()
        return

    display_files(files)
Exemplo n.º 4
0
def change_x_axis(val):
    global x_axis
    show_spinner("Updating the X axis...")
    x_axis[0] = x_axis_options[val]
    plot.xaxis.axis_label = x_axis_labels[val]

    for file_to_load in signals_files.values():
        file_to_load.update_x_axis_index()

    update_axis_range(x_axis[0], plot.x_range)
    hide_spinner()
Exemplo n.º 5
0
def toggle_second_axis():
    show_spinner("Switching the Y axis...")
    plot.yaxis[-1].visible = True
    selected_file.toggle_y_axis()

    # this is just for redrawing the signals
    selected_file.reload_data()

    update_y_axis_ranges()
    update_legend()

    hide_spinner()
Exemplo n.º 6
0
def display_directory_group(directory):
    display_boards()
    show_spinner("Loading directories group...")

    while get_run_type(directory) == FolderType.EMPTY:
        show_spinner("Waiting for experiment directory to get populated...")
        sys.stdout.write(
            "Waiting for experiment directory to get populated...\r")
        time.sleep(10)

    handle_dir(directory, get_run_type(directory))

    change_selected_signals_in_data_selector([""])
    hide_spinner()
Exemplo n.º 7
0
def select_data(args, old, new):
    if selected_file is None:
        return
    show_spinner("Updating the signal selection...")
    selected_signals = new
    for signal_name in selected_file.signals.keys():
        is_selected = signal_name in selected_signals
        selected_file.set_signal_selection(signal_name, is_selected)

    # update axes ranges
    update_y_axis_ranges()
    update_x_axis_ranges()

    # update the legend
    update_legend()

    hide_spinner()
Exemplo n.º 8
0
def load_files_group():
    show_spinner("Loading files group...")
    files = open_file_dialog()
    # no files selected
    if not files or not files[0]:
        hide_spinner()
        return

    display_boards()

    if len(files) == 1:
        create_files_signal(files)
    else:
        create_files_group_signal(files)

    change_selected_signals_in_data_selector([""])
    hide_spinner()
Exemplo n.º 9
0
def change_data_selector(args, old, new):
    global selected_file
    if new is None:
        selected_file = None
        return
    show_spinner("Updating selection...")
    selected_file = signals_files[new]
    data_selector.remove_on_change('value', select_data)
    data_selector.options = sorted(list(selected_file.signals.keys()))
    data_selector.on_change('value', select_data)
    selected_signal_names = [
        s.name for s in selected_file.signals.values() if s.selected
    ]
    if not selected_signal_names:
        selected_signal_names = [""]
    change_selected_signals_in_data_selector(selected_signal_names)
    averaging_slider.value = selected_file.signals_averaging_window
    if len(averaging_slider_dummy_source.data['value']) > 0:
        averaging_slider_dummy_source.data['value'][
            0] = selected_file.signals_averaging_window
    group_cb.active = [0 if selected_file.show_bollinger_bands else None]
    group_cb.active += [1 if selected_file.separate_files else None]
    hide_spinner()
Exemplo n.º 10
0
def select_color(attr, old, new):
    show_spinner("Changing signal color...")
    signals = selected_file.get_selected_signals()
    for signal in signals:
        signal.set_color(rgb_to_hex(crRGBs[new['1d']['indices'][0]]))
    hide_spinner()
Exemplo n.º 11
0
def update_averaging(args, old, new):
    show_spinner("Smoothing the signals...")
    # get the actual value from the dummy source
    new = averaging_slider_dummy_source.data['value'][0]
    selected_file.change_averaging_window(new)
    hide_spinner()