From 42dd9cfd58cc6c5a34f1e679fcd45cdef6e4ff92 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Mon, 27 Mar 2023 18:57:29 +0800 Subject: [PATCH] Enable the toolbar when it capturing on DSO mode --- DSView/pv/mainwindow.cpp | 2 +- DSView/pv/sigsession.h | 6 ++++++ DSView/pv/toolbars/samplingbar.cpp | 9 +++++---- DSView/pv/toolbars/trigbar.cpp | 9 +++++++++ DSView/pv/view/dsosignal.cpp | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index de768fe9..ed9b9c34 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -1696,7 +1696,7 @@ namespace pv case DSV_MSG_DEVICE_OPTIONS_UPDATED: _trigger_widget->device_updated(); _measure_widget->reload(); - _view->check_calibration(); + _view->check_calibration(); break; case DSV_MSG_DEVICE_DURATION_UPDATED: diff --git a/DSView/pv/sigsession.h b/DSView/pv/sigsession.h index d5128382..f768adfe 100644 --- a/DSView/pv/sigsession.h +++ b/DSView/pv/sigsession.h @@ -175,6 +175,12 @@ public: double cur_snap_sampletime(); double cur_view_time(); + inline bool re_start(){ + if (_is_working) + stop_capture(); + start_capture(_is_instant); + } + inline void set_session_time(QDateTime time){ _session_time = time; } diff --git a/DSView/pv/toolbars/samplingbar.cpp b/DSView/pv/toolbars/samplingbar.cpp index 765ebb8f..f5c54310 100644 --- a/DSView/pv/toolbars/samplingbar.cpp +++ b/DSView/pv/toolbars/samplingbar.cpp @@ -1173,10 +1173,6 @@ namespace pv int mode = _session->get_device()->get_work_mode(); _device_type.setEnabled(bEnable); - _configure_button.setEnabled(bEnable); - _mode_button.setEnabled(bEnable); - _device_type.setEnabled(bEnable); - _mode_button.setEnabled(bEnable); _configure_button.setEnabled(bEnable); _device_selector.setEnabled(bEnable); @@ -1188,6 +1184,11 @@ namespace pv else if (mode == DSO){ _sample_rate.setEnabled(false); _sample_count.setEnabled(bEnable); + + if (_session->is_working() && _session->is_instant() == false) + { + _sample_count.setEnabled(true); + } } else{ _sample_rate.setEnabled(bEnable); diff --git a/DSView/pv/toolbars/trigbar.cpp b/DSView/pv/toolbars/trigbar.cpp index 52c1bf21..48d608f1 100644 --- a/DSView/pv/toolbars/trigbar.cpp +++ b/DSView/pv/toolbars/trigbar.cpp @@ -331,6 +331,15 @@ void TrigBar::on_actionLissajous_triggered() _search_button.setEnabled(bEnable); _function_button.setEnabled(bEnable); _setting_button.setEnabled(bEnable); + + if (_session->is_working() && _session->get_device()->get_work_mode() == DSO){ + if (_session->is_instant() == false){ + _trig_button.setEnabled(true); + _measure_button.setEnabled(true); + _function_button.setEnabled(true); + _setting_button.setEnabled(true); + } + } } } // namespace toolbars diff --git a/DSView/pv/view/dsosignal.cpp b/DSView/pv/view/dsosignal.cpp index cc0462ae..ff080647 100644 --- a/DSView/pv/view/dsosignal.cpp +++ b/DSView/pv/view/dsosignal.cpp @@ -1156,7 +1156,7 @@ void DsoSignal::paint_type_options(QPainter &p, int right, const QPoint pt, QCol } bool DsoSignal::mouse_press(int right, const QPoint pt) -{ +{ int y = get_y(); const QRectF vDial_rect = get_rect(DSO_VDIAL, y, right); const QRectF chEn_rect = get_rect(DSO_CHEN, y, right);