From df986ae99ceef716ee06af03886233e6b7fb9e5e Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Thu, 13 Apr 2023 19:46:16 +0800 Subject: [PATCH] fix: Load form the dso file, it works as repeat mode --- DSView/pv/sigsession.cpp | 13 ++++++++++--- DSView/pv/toolbars/samplingbar.cpp | 2 -- DSView/pv/view/viewport.cpp | 9 +++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/DSView/pv/sigsession.cpp b/DSView/pv/sigsession.cpp index 4ebd7fb3..b78ebd82 100644 --- a/DSView/pv/sigsession.cpp +++ b/DSView/pv/sigsession.cpp @@ -209,7 +209,9 @@ namespace pv { assert(!_is_saving); assert(!_is_working); - assert(_callback); + assert(_callback); + + set_operation_mode(OPT_SINGLE); _callback->trigger_message(DSV_MSG_CURRENT_DEVICE_CHANGE_PREV); @@ -241,10 +243,12 @@ namespace pv _capture_data->_cur_snap_samplerate = _device_agent.get_sample_rate(); _capture_data->_cur_samplelimits = _device_agent.get_sample_limit(); + /* if (_device_agent.get_work_mode() == DSO) _opt_mode = OPT_REPEAT; else _opt_mode = OPT_SINGLE; + */ // The current device changed. _callback->trigger_message(DSV_MSG_CURRENT_DEVICE_CHANGED); @@ -488,7 +492,10 @@ namespace pv if (_device_agent.get_config_value_int16(SR_CONF_OPERATION_MODE, mode_val)){ _is_stream_mode = mode_val == LO_OP_STREAM; } - } + } + else if (instant && mode == LOGIC && _device_agent.is_demo()){ + _is_stream_mode = true; + } update_view(); @@ -1554,7 +1561,7 @@ namespace pv int SigSession::get_repeat_hold() { - if (!_is_instant && _is_working && is_repeat_mode()) + if (_is_working && is_repeat_mode()) return _repeat_hold_prg; else return 0; diff --git a/DSView/pv/toolbars/samplingbar.cpp b/DSView/pv/toolbars/samplingbar.cpp index f623aa2c..f15801cf 100644 --- a/DSView/pv/toolbars/samplingbar.cpp +++ b/DSView/pv/toolbars/samplingbar.cpp @@ -801,8 +801,6 @@ namespace pv { bool test = false; - dsv_info("Commit device settings."); - if (_device_agent->have_instance()) { GVariant *gvar = _device_agent->get_config(NULL, NULL, SR_CONF_TEST); diff --git a/DSView/pv/view/viewport.cpp b/DSView/pv/view/viewport.cpp index 936d2ee4..9be84cc5 100644 --- a/DSView/pv/view/viewport.cpp +++ b/DSView/pv/view/viewport.cpp @@ -170,9 +170,10 @@ void Viewport::doPaint() break; } - if (_view.session().get_device()->get_work_mode() == LOGIC || - _view.session().is_instant()) - { + int mode = _view.session().get_device()->get_work_mode(); + + if (mode == LOGIC || _view.session().is_instant()) + { if (_view.session().is_init_status()) { paintCursors(p); @@ -1349,7 +1350,7 @@ void Viewport::set_receive_len(quint64 length) } // Received new data, and refresh the view. - update(); + repaint(); } void Viewport::clear_measure()