diff --git a/sdrbase/dsp/scopevisng.cpp b/sdrbase/dsp/scopevisng.cpp index 01048798b..7732b8122 100644 --- a/sdrbase/dsp/scopevisng.cpp +++ b/sdrbase/dsp/scopevisng.cpp @@ -144,6 +144,25 @@ void ScopeVisNG::feed(const SampleVector::const_iterator& cbegin, const SampleVe SampleVector::const_iterator begin(cbegin); + while (begin < end) + { + if (begin + m_traceSize > end) + { + processTrace(begin, end); + begin = end; + } + else + { + processTrace(begin, begin + m_traceSize); + begin += m_traceSize; + } + } +} + +void ScopeVisNG::processTrace(const SampleVector::const_iterator& cbegin, const SampleVector::const_iterator& end) +{ + SampleVector::const_iterator begin(cbegin); + // memory storage m_traceDiscreteMemory.current().write(cbegin, end); @@ -215,7 +234,7 @@ void ScopeVisNG::feed(const SampleVector::const_iterator& cbegin, const SampleVe if (remainder > 0) { - feed(nbegin, nend, positiveOnly); + processTrace(nbegin, nend); } } diff --git a/sdrbase/dsp/scopevisng.h b/sdrbase/dsp/scopevisng.h index d9d61efbd..015122c54 100644 --- a/sdrbase/dsp/scopevisng.h +++ b/sdrbase/dsp/scopevisng.h @@ -777,6 +777,11 @@ private: */ bool nextTrigger(); //!< Returns true if not final + /** + * Process a sample trace which length is at most the trace length (m_traceSize) + */ + void processTrace(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end); + /** * Process traces from complex trace memory buffer. * - if finished it returns the number of unprocessed samples left in the buffer