From a64fb011193bc442d950931b56d1adfc2449cbb5 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 9 Feb 2017 00:18:28 +0100 Subject: [PATCH] New scope: separate trace delay and pre-trigger trace processes --- sdrbase/dsp/scopevisng.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/sdrbase/dsp/scopevisng.cpp b/sdrbase/dsp/scopevisng.cpp index ba470cccb..cd520152d 100644 --- a/sdrbase/dsp/scopevisng.cpp +++ b/sdrbase/dsp/scopevisng.cpp @@ -210,14 +210,24 @@ void ScopeVisNG::processTrace(const SampleVector::const_iterator& cbegin, const SampleVector::iterator mend = m_traceDiscreteMemory.current().current(); SampleVector::iterator mbegin = mend - count; - // trace back - - if ((m_traceStart) && (m_preTriggerDelay + m_maxTraceDelay > 0)) + if (m_traceStart) { - remainder = processTraces(mbegin - m_preTriggerDelay - m_maxTraceDelay, mbegin, true); + // trace back + if (m_maxTraceDelay > 0) + { + processTraces(mbegin - m_preTriggerDelay - m_maxTraceDelay, mbegin - m_preTriggerDelay, true); + } + + // pre-trigger + if (m_preTriggerDelay > 0) + { + remainder = processTraces(mbegin - m_preTriggerDelay, mbegin); + } + m_traceStart = false; } + if (remainder < 0) { // live trace @@ -287,7 +297,7 @@ int ScopeVisNG::processTraces(const SampleVector::const_iterator& cbegin, const for (; itCtl != m_traces.m_tracesControl.end(); ++itCtl, ++itData, ++itTrace) { - if (traceBack && ((end - begin) > m_preTriggerDelay + itData->m_traceDelay)) { + if (traceBack && ((end - begin) > itData->m_traceDelay)) { continue; }