1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-01 16:38:06 -04:00

Scope: rationalize trigger location computation

This commit is contained in:
f4exb
2018-11-21 11:08:43 +01:00
parent f1eeed38da
commit e2440afd87
2 changed files with 7 additions and 8 deletions
+6 -7
View File
@@ -253,9 +253,8 @@ void ScopeVis::feed(const SampleVector::const_iterator& cbegin, const SampleVect
{
triggerPointToEnd = -1;
processTrace(begin, end, triggerPointToEnd); // use all buffer
if (triggerPointToEnd >= 0) {
m_triggerLocation = triggerPointToEnd;
}
m_triggerLocation = triggerPointToEnd < 0 ? 0 : triggerPointToEnd; // trim negative values
m_triggerLocation = m_triggerLocation > end - begin ? end - begin : m_triggerLocation; // trim past begin values
begin = end; // effectively breaks out the loop
}
@@ -263,10 +262,10 @@ void ScopeVis::feed(const SampleVector::const_iterator& cbegin, const SampleVect
{
triggerPointToEnd = -1;
processTrace(begin, begin + m_traceSize, triggerPointToEnd); // use part of buffer to fit trace size
if (triggerPointToEnd >= 0) {
//m_triggerPoint = begin + m_traceSize - triggerPointToEnd;
m_triggerLocation = triggerPointToEnd - m_traceSize;
}
//m_triggerPoint = begin + m_traceSize - triggerPointToEnd;
m_triggerLocation = end - begin + m_traceSize - triggerPointToEnd; // should always refer to end iterator
m_triggerLocation = m_triggerLocation < 0 ? 0 : m_triggerLocation; // trim negative values
m_triggerLocation = m_triggerLocation > end - begin ? end - begin : m_triggerLocation; // trim past begin values
begin += m_traceSize;
}
+1 -1
View File
@@ -21,7 +21,7 @@ void SpectrumScopeComboVis::feed(const SampleVector::const_iterator& begin, cons
//SampleVector::const_iterator triggerPoint = m_scopeVis->getTriggerPoint();
//m_spectrumVis->feedTriggered(triggerPoint, end, positiveOnly);
int triggerPointLocation = m_scopeVis->getTriggerLocation();
if ((triggerPointLocation >= 0) && (triggerPointLocation < end - begin)) {
if ((triggerPointLocation >= 0) && (triggerPointLocation <= end - begin)) {
m_spectrumVis->feedTriggered(end - triggerPointLocation, end, positiveOnly);
} else {
m_spectrumVis->feedTriggered(begin, end, positiveOnly);