From c8ec9e4ea8678569ff3b308b64524cc8e323a25c Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 13 Jul 2020 01:17:36 +0200 Subject: [PATCH] Channel Analyzer: let spectrum free running when in free running mode --- sdrgui/dsp/scopevis.h | 1 + sdrgui/dsp/spectrumscopecombovis.cpp | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sdrgui/dsp/scopevis.h b/sdrgui/dsp/scopevis.h index 9f6ddd367..b162408ea 100644 --- a/sdrgui/dsp/scopevis.h +++ b/sdrgui/dsp/scopevis.h @@ -246,6 +246,7 @@ public: virtual void stop(); virtual bool handleMessage(const Message& message); int getTriggerLocation() const { return m_triggerLocation; } + bool getFreeRun() const { return m_freeRun; } private: // === messages === diff --git a/sdrgui/dsp/spectrumscopecombovis.cpp b/sdrgui/dsp/spectrumscopecombovis.cpp index 62de78b74..18178df96 100644 --- a/sdrgui/dsp/spectrumscopecombovis.cpp +++ b/sdrgui/dsp/spectrumscopecombovis.cpp @@ -20,12 +20,15 @@ void SpectrumScopeComboVis::feed(const SampleVector::const_iterator& begin, cons m_scopeVis->feed(begin, end, false); //SampleVector::const_iterator triggerPoint = m_scopeVis->getTriggerPoint(); //m_spectrumVis->feedTriggered(triggerPoint, end, positiveOnly); - int triggerPointLocation = m_scopeVis->getTriggerLocation(); - if ((triggerPointLocation >= 0) && (triggerPointLocation <= end - begin)) { - m_spectrumVis->feedTriggered(end - triggerPointLocation, end, positiveOnly); - } else { - m_spectrumVis->feedTriggered(begin, end, positiveOnly); - } + int triggerPointLocation = m_scopeVis->getTriggerLocation(); + + if (m_scopeVis->getFreeRun()) { + m_spectrumVis->feed(begin, end, positiveOnly); + } else if ((triggerPointLocation >= 0) && (triggerPointLocation <= end - begin)) { + m_spectrumVis->feedTriggered(end - triggerPointLocation, end, positiveOnly); + } else { + m_spectrumVis->feedTriggered(begin, end, positiveOnly); + } } void SpectrumScopeComboVis::start()