示例#1
0
def test_widget_channels_save(qtbot):
    w = MainWindow()
    qtbot.addWidget(w)

    assert not w.channels.action['save_channels'].isEnabled()
    w.info.open_dataset(str(gui_file))
    assert w.channels.action['save_channels'].isEnabled()

    channel_make_group(w)

    w.channels.new_group(test_name='eog')

    chan_tab_i = w.channels.tabs.currentIndex()
    channelsgroup = w.channels.tabs.widget(chan_tab_i)
    channelsgroup.idx_l0.item(2).setSelected(True)

    channelsgroup.idx_hp.setValue(20)
    channelsgroup.idx_lp.setValue(0)
    channelsgroup.idx_scale.setValue(10)
    w.channels.color_group(test_color=QColor('#ff4a87'))

    w.channels.button_apply.click()

    toolbar = w.findChild(QToolBar, 'File Management')
    button_save = find_in_qt(toolbar, QToolButton, "Save Montage")
    button_save.setStyleSheet("background-color: red;")
    w.grab().save(str(GUI_PATH / 'channels_12_save_chan.png'))
    button_save.setStyleSheet("")

    w.channels.save_channels(test_name=str(channel_montage_file))
示例#2
0
def test_widget_notes_load(qtbot):
    w = MainWindow()
    qtbot.addWidget(w)

    toolbar = w.findChild(QToolBar, 'File Management')
    button_save = find_in_qt(toolbar, QToolButton, "Load Annotations")
    button_save.setStyleSheet("background-color: red;")
    w.grab().save(str(GUI_PATH / 'notes_03_load.png'))
    button_save.setStyleSheet("")
示例#3
0
def test_widget_channels_load(qtbot):

    w = MainWindow()
    qtbot.addWidget(w)

    assert not w.channels.action['load_channels'].isEnabled()
    w.info.open_dataset(str(gui_file))
    assert w.channels.action['load_channels'].isEnabled()

    toolbar = w.findChild(QToolBar, 'File Management')
    button_load = find_in_qt(toolbar, QToolButton, "Load Montage")
    button_load.setStyleSheet("background-color: red;")
    w.grab().save(str(GUI_PATH / 'channels_13_load_chan.png'))
    button_load.setStyleSheet("")

    w.channels.load_channels(test_name=str(channel_montage_file))
    w.grab().save(str(GUI_PATH / 'channels_14_loaded.png'))
示例#4
0
def test_widget_notes_toolbar(qtbot):

    w = MainWindow()
    qtbot.addWidget(w)

    w.info.open_dataset(str(gui_file))
    channel_make_group(w)
    w.channels.button_apply.click()
    w.channels.new_group(test_name='eog')
    w.notes.update_notes(annot_psg_path)
    w.traces.Y_wider()
    w.traces.go_to_epoch(test_text_str='23:00')

    toolbar = w.findChild(QToolBar, 'Annotations')

    button_event = find_in_qt(toolbar, QToolButton, 'Event Mode')
    button_event.setStyleSheet("background-color: red;")
    w.grab().save(str(GUI_PATH / 'notes_07_event_mode.png'))
    button_event.setStyleSheet("")

    box_evttype = find_in_qt_by_idx(toolbar, QComboBox, 0)
    box_evttype.setStyleSheet("background-color: red;")
    w.grab().save(str(GUI_PATH / 'notes_08_evt_type_box.png'))
    box_evttype.setStyleSheet("")

    box_stage = find_in_qt_by_idx(toolbar, QComboBox, 1)
    box_stage.setStyleSheet("background-color: red;")
    w.grab().save(str(GUI_PATH / 'notes_09_stage_box.png'))
    box_stage.setStyleSheet("")

    box_qual = find_in_qt_by_idx(toolbar, QComboBox, 2)
    box_qual.setStyleSheet("background-color: red;")
    w.grab().save(str(GUI_PATH / 'notes_10_quality_box.png'))
    box_qual.setStyleSheet("")

    w.close()