From 7fdb2d487ed63304037bae4f1b2bed5f278225ae Mon Sep 17 00:00:00 2001 From: DreamSourceLab Date: Sat, 29 Jul 2017 17:16:55 +0800 Subject: [PATCH] fix sample depth issue for single capture @ osc mode --- DSView/pv/view/dsosignal.cpp | 9 ++++++--- DSView/pv/view/dsosignal.h | 2 +- DSView/pv/view/view.cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/DSView/pv/view/dsosignal.cpp b/DSView/pv/view/dsosignal.cpp index 4eafb718..1efc298d 100644 --- a/DSView/pv/view/dsosignal.cpp +++ b/DSView/pv/view/dsosignal.cpp @@ -211,7 +211,7 @@ void DsoSignal::set_enable(bool enable) g_variant_new_boolean(enable)); if (running) { - update_capture(); + update_capture(_view->session().get_instant()); _view->session().repeat_resume(); } @@ -333,7 +333,7 @@ bool DsoSignal::go_hDialPre(bool setted) } } -bool DsoSignal::update_capture() +bool DsoSignal::update_capture(bool instant) { int ch_num = _view->session().get_ch_num(SR_CHANNEL_DSO); if (ch_num == 0) @@ -350,7 +350,10 @@ bool DsoSignal::update_capture() qDebug() << "ERROR: config_get SR_CONF_MAX_DSO_SAMPLERATE failed."; return false; } - gvar = _dev_inst->get_config(NULL, NULL, SR_CONF_MAX_DSO_SAMPLELIMITS); + if (instant) + gvar = _dev_inst->get_config(NULL, NULL, SR_CONF_HW_DEPTH); + else + gvar = _dev_inst->get_config(NULL, NULL, SR_CONF_MAX_DSO_SAMPLELIMITS); if (gvar != NULL) { max_sample_limit = g_variant_get_uint64(gvar); g_variant_unref(gvar); diff --git a/DSView/pv/view/dsosignal.h b/DSView/pv/view/dsosignal.h index 78d8522d..f8f89cbf 100644 --- a/DSView/pv/view/dsosignal.h +++ b/DSView/pv/view/dsosignal.h @@ -115,7 +115,7 @@ public: bool go_vDialNext(); bool go_hDialPre(bool setted); bool go_hDialNext(bool setted); - bool update_capture(); + bool update_capture(bool instant); uint64_t get_vDialValue() const; uint64_t get_hDialValue() const; uint16_t get_vDialSel() const; diff --git a/DSView/pv/view/view.cpp b/DSView/pv/view/view.cpp index bbbd79be..5dc1e300 100644 --- a/DSView/pv/view/view.cpp +++ b/DSView/pv/view/view.cpp @@ -253,7 +253,7 @@ void View::update_sample(bool instant) BOOST_FOREACH(const boost::shared_ptr s, _session.get_signals()) { boost::shared_ptr dsoSig; if (dsoSig = dynamic_pointer_cast(s)) { - dsoSig->update_capture(); + dsoSig->update_capture(instant); break; } }