From 250a81ba5adacfd93afd6716260d5ccbf4e5ceb8 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Tue, 28 Mar 2023 18:04:23 +0800 Subject: [PATCH] Add the log about stop capture --- DSView/pv/mainwindow.cpp | 7 +++++-- DSView/pv/sigsession.cpp | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index 1c5d2075..0d1d39fa 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -351,12 +351,14 @@ namespace pv switch (_session->get_error()) { case SigSession::Hw_err: + dsv_info("MainWindow::on_session_error(),Hw_err, stop capture"); _session->stop_capture(); title = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_HARDWARE_ERROR), "Hardware Operation Failed"); details = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_HARDWARE_ERROR_DET), "Please replug device to refresh hardware configuration!"); break; case SigSession::Malloc_err: + dsv_info("MainWindow::on_session_error(),Malloc_err, stop capture"); _session->stop_capture(); title = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_MALLOC_ERROR), "Malloc Error"); details = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_MALLOC_ERROR_DET), @@ -369,6 +371,7 @@ namespace pv _session->refresh(0); break; case SigSession::Data_overflow: + dsv_info("MainWindow::on_session_error(),Data_overflow, stop capture"); _session->stop_capture(); title = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DATA_OVERFLOW), "Data Overflow"); details = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DATA_OVERFLOW_DET), @@ -566,7 +569,7 @@ namespace pv } if (_session->is_working()){ - dsv_info("Save data: stop the current device."); + dsv_info("Save data: stop the current device."); _session->stop_capture(); } @@ -581,7 +584,7 @@ namespace pv using pv::dialogs::StoreProgress; if (_session->is_working()){ - dsv_info("Export data: stop the current device."); + dsv_info("Export data: stop the current device."); _session->stop_capture(); } diff --git a/DSView/pv/sigsession.cpp b/DSView/pv/sigsession.cpp index bc6a2d7c..17696b39 100644 --- a/DSView/pv/sigsession.cpp +++ b/DSView/pv/sigsession.cpp @@ -172,6 +172,7 @@ namespace pv if (_is_working){ dsv_info("The current device is working, now to stop it."); + dsv_info("SigSession::set_default_device(), stop capture"); stop_capture(); } @@ -577,7 +578,7 @@ namespace pv if (!_is_working) return; - dsv_info("%s", "Stop collect."); + dsv_info("Stop collect."); if (_bClose) { @@ -1568,6 +1569,7 @@ namespace pv // Stop decode thread. clear_all_decoder(false); + dsv_info("SigSession::Close(), stop capture"); stop_capture(); // TODO: This should not be necessary @@ -1811,8 +1813,10 @@ namespace pv case DS_EV_CURRENT_DEVICE_DETACH: { - if (_is_working) + if (_is_working){ + dsv_info("SigSession::on_device_lib_event,DS_EV_CURRENT_DEVICE_DETACH, stop capture"); stop_capture(); + } _callback->trigger_message(DSV_MSG_CURRENT_DEVICE_DETACHED); }