1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-17 13:51:47 -05:00

New scope: added trigger delay, mutiple occurences and chained triggers features

This commit is contained in:
f4exb 2017-02-09 18:45:06 +01:00
parent c56f852a85
commit 1f37bcf3de

View File

@ -199,8 +199,24 @@ void ScopeVisNG::processTrace(const SampleVector::const_iterator& cbegin, const
while (begin < end) while (begin < end)
{ {
// look for trigger if (m_triggerState == TriggerDelay)
if (m_triggerComparator.triggered(*begin, triggerCondition)) {
if (triggerCondition.m_triggerDelayCount > 0) // skip samples during delay period
{
triggerCondition.m_triggerDelayCount--;
++begin;
continue;
}
else // process trigger
{
if (nextTrigger()) // move to next trigger and keep going
{
m_triggerComparator.reset();
m_triggerState = TriggerUntriggered;
++begin;
continue;
}
else // this was the last trigger then start trace
{ {
m_traceStart = true; // start trace processing m_traceStart = true; // start trace processing
m_nbSamples = m_traceSize + m_maxTraceDelay; m_nbSamples = m_traceSize + m_maxTraceDelay;
@ -209,6 +225,35 @@ void ScopeVisNG::processTrace(const SampleVector::const_iterator& cbegin, const
triggerPointToEnd = end - begin; triggerPointToEnd = end - begin;
break; break;
} }
}
}
// look for trigger
if (m_triggerComparator.triggered(*begin, triggerCondition))
{
if (triggerCondition.m_triggerData.m_triggerDelay > 0)
{
triggerCondition.m_triggerDelayCount = triggerCondition.m_triggerData.m_triggerDelay; // initialize delayed samples counter
m_triggerState = TriggerDelay;
++begin;
continue;
}
if (nextTrigger()) // move to next trigger and keep going
{
m_triggerComparator.reset();
m_triggerState = TriggerUntriggered;
}
else // this was the last trigger then start trace
{
m_traceStart = true; // start trace processing
m_nbSamples = m_traceSize + m_maxTraceDelay;
m_triggerComparator.reset();
m_triggerState = TriggerTriggered;
triggerPointToEnd = end - begin;
break;
}
}
++begin; ++begin;
} }
@ -280,8 +325,7 @@ bool ScopeVisNG::nextTrigger()
if (triggerCondition.m_triggerCounter < triggerCondition.m_triggerData.m_triggerRepeat) if (triggerCondition.m_triggerCounter < triggerCondition.m_triggerData.m_triggerRepeat)
{ {
triggerCondition.m_triggerCounter++; triggerCondition.m_triggerCounter++;
m_triggerState = TriggerUntriggered; // repeat operations for next occurence return true; // not final keep going
return true;
} }
else else
{ {
@ -289,16 +333,14 @@ bool ScopeVisNG::nextTrigger()
} }
} }
if (m_currentTriggerIndex < m_triggerConditions.size() - 1) if (m_currentTriggerIndex < m_triggerConditions.size() - 1) // check if next trigger is available
{ {
m_currentTriggerIndex++; m_currentTriggerIndex++;
m_triggerState = TriggerUntriggered; // repeat operations for next trigger
return true; // not final keep going return true; // not final keep going
} }
else else
{ {
// now this is really finished // now this is really finished
m_triggerState = TriggerTriggered;
m_currentTriggerIndex = 0; m_currentTriggerIndex = 0;
return false; // final return false; // final
} }