diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index e2e21f57..7025cef1 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -1119,16 +1119,10 @@ namespace pv switch (ke->key()) { case Qt::Key_S: - if (_session->is_working()) - _session->stop_capture(); - else - _session->start_capture(false); + _sampling_bar->run_or_stop(); break; case Qt::Key_I: - if (_session->is_working()) - _session->stop_capture(); - else - _session->start_capture(true); + _sampling_bar->run_or_stop_instant(); break; case Qt::Key_T: if (_device_agent->get_work_mode() == DSO) diff --git a/DSView/pv/toolbars/samplingbar.cpp b/DSView/pv/toolbars/samplingbar.cpp index df7f25fd..e4ebe60c 100644 --- a/DSView/pv/toolbars/samplingbar.cpp +++ b/DSView/pv/toolbars/samplingbar.cpp @@ -1224,5 +1224,16 @@ namespace pv _mode_button.setIcon(QIcon(iconPath + "/modes.svg")); } + + void SamplingBar::run_or_stop() + { + on_run_stop(); + } + + void SamplingBar::run_or_stop_instant() + { + on_instant_stop(); + } + } // namespace toolbars } // namespace pv diff --git a/DSView/pv/toolbars/samplingbar.h b/DSView/pv/toolbars/samplingbar.h index 6775c86c..8e83c6e1 100644 --- a/DSView/pv/toolbars/samplingbar.h +++ b/DSView/pv/toolbars/samplingbar.h @@ -90,6 +90,10 @@ namespace pv _view = view; } + void run_or_stop(); + + void run_or_stop_instant(); + signals: void sig_store_session_data();