From e3b933350c94a6ff87595c041d34eb1a1312c165 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 9 Feb 2017 00:00:21 +0100 Subject: [PATCH] New scope: review freerun / trigger processing --- sdrbase/dsp/scopevisng.cpp | 46 +++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/sdrbase/dsp/scopevisng.cpp b/sdrbase/dsp/scopevisng.cpp index 7732b8122..b8953e3c3 100644 --- a/sdrbase/dsp/scopevisng.cpp +++ b/sdrbase/dsp/scopevisng.cpp @@ -174,29 +174,33 @@ void ScopeVisNG::processTrace(const SampleVector::const_iterator& cbegin, const // trigger process - if (!m_freeRun && (m_triggerConditions.size() > 0) && ((m_triggerState == TriggerUntriggered) || (m_triggerState == TriggerDelay))) - { - TriggerCondition& triggerCondition = m_triggerConditions[m_currentTriggerIndex]; // current trigger condition - - while (begin < end) + if ((m_freeRun) || (m_triggerConditions.size() == 0)) // immediate re-trigger + { + m_traceStart = true; // start trace processing + m_triggerState = TriggerTriggered; + } + else + { + if ((m_triggerState == TriggerUntriggered) || (m_triggerState == TriggerDelay)) { - // look for trigger - if (m_triggerComparator.triggered(*begin, triggerCondition)) - { - m_traceStart = true; // start trace processing - m_triggerPoint = begin; - m_triggerComparator.reset(); - m_triggerState = TriggerTriggered; - break; - } + TriggerCondition& triggerCondition = m_triggerConditions[m_currentTriggerIndex]; // current trigger condition - ++begin; + while (begin < end) + { + // look for trigger + if (m_triggerComparator.triggered(*begin, triggerCondition)) + { + m_traceStart = true; // start trace processing + m_triggerPoint = begin; + m_triggerComparator.reset(); + m_triggerState = TriggerTriggered; + break; + } + + ++begin; + } } - } - else - { - m_traceStart = true; - } + } int remainder = -1; int count = end - begin; // number of samples in traceback buffer past the current point @@ -204,7 +208,7 @@ void ScopeVisNG::processTrace(const SampleVector::const_iterator& cbegin, const SampleVector::iterator nbegin = nend - count; // trace process - if ((m_freeRun) || (m_triggerConditions.size() == 0) || (m_triggerState == TriggerTriggered)) + if (m_triggerState == TriggerTriggered) { // trace back