mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-29 13:32:26 -04:00
New scope: added trigger delay, mutiple occurences and chained triggers features
This commit is contained in:
parent
c56f852a85
commit
1f37bcf3de
@ -199,8 +199,24 @@ void ScopeVisNG::processTrace(const SampleVector::const_iterator& cbegin, const
|
||||
|
||||
while (begin < end)
|
||||
{
|
||||
// look for trigger
|
||||
if (m_triggerComparator.triggered(*begin, triggerCondition))
|
||||
if (m_triggerState == TriggerDelay)
|
||||
{
|
||||
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_nbSamples = m_traceSize + m_maxTraceDelay;
|
||||
@ -209,6 +225,35 @@ void ScopeVisNG::processTrace(const SampleVector::const_iterator& cbegin, const
|
||||
triggerPointToEnd = end - begin;
|
||||
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;
|
||||
}
|
||||
@ -280,8 +325,7 @@ bool ScopeVisNG::nextTrigger()
|
||||
if (triggerCondition.m_triggerCounter < triggerCondition.m_triggerData.m_triggerRepeat)
|
||||
{
|
||||
triggerCondition.m_triggerCounter++;
|
||||
m_triggerState = TriggerUntriggered; // repeat operations for next occurence
|
||||
return true;
|
||||
return true; // not final keep going
|
||||
}
|
||||
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_triggerState = TriggerUntriggered; // repeat operations for next trigger
|
||||
return true; // not final keep going
|
||||
}
|
||||
else
|
||||
{
|
||||
// now this is really finished
|
||||
m_triggerState = TriggerTriggered;
|
||||
m_currentTriggerIndex = 0;
|
||||
return false; // final
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user