From c56765b873ce2044320a295d8205399e2a440265 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Tue, 9 May 2023 16:18:24 +0800 Subject: [PATCH] fix: fix: Switching to a new device without stopping the current device --- DSView/pv/mainwindow.cpp | 13 ++++++++++++- DSView/pv/sigsession.cpp | 2 +- DSView/pv/view/header.cpp | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index 2ab93c18..df18eadd 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -1518,6 +1518,10 @@ namespace pv { dsv_info("The data save confirm end, auto switch to the new device."); _is_auto_switch_device = false; + + if (_session->is_working()) + _session->stop_capture(); + _session->set_default_device(); } } @@ -1855,10 +1859,17 @@ namespace pv if (confirm_to_store_data()) { _is_auto_switch_device = true; + + if (_session->is_working()) + _session->stop_capture(); + on_save(); } else - { + { + if (_session->is_working()) + _session->stop_capture(); + _session->set_default_device(); } } diff --git a/DSView/pv/sigsession.cpp b/DSView/pv/sigsession.cpp index b9bc6489..17416664 100644 --- a/DSView/pv/sigsession.cpp +++ b/DSView/pv/sigsession.cpp @@ -177,7 +177,7 @@ namespace pv assert(!_is_saving); if (_is_working){ - dsv_info("The current device is working, now to stop it."); + dsv_info("SigSession::set_default_device(),The current device is working, now to stop it."); dsv_info("SigSession::set_default_device(), stop capture"); stop_capture(); } diff --git a/DSView/pv/view/header.cpp b/DSView/pv/view/header.cpp index eae444a3..55fc80a6 100644 --- a/DSView/pv/view/header.cpp +++ b/DSView/pv/view/header.cpp @@ -201,7 +201,7 @@ void Header::mousePressEvent(QMouseEvent *event) for(auto t : traces){ if (t->signal_type() == LOGIC_SIGNAL && _view.session().is_working()){ - // Disable to set trigger when capturing. + // Disable set trigger from left pannel when capturing. break; } if (t->mouse_press(width(), event->pos()))