From 49a0dbac404dd0a0d37b29ee2a596caeaec75696 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 2 Oct 2018 05:18:34 +0200 Subject: [PATCH] ScopeVis: corrected memory index when in trace memory mode --- sdrgui/dsp/scopevis.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdrgui/dsp/scopevis.cpp b/sdrgui/dsp/scopevis.cpp index 3e6883bdf..2c2967281 100644 --- a/sdrgui/dsp/scopevis.cpp +++ b/sdrgui/dsp/scopevis.cpp @@ -232,7 +232,13 @@ void ScopeVis::processMemoryTrace() { if ((m_currentTraceMemoryIndex > 0) && (m_currentTraceMemoryIndex < m_nbTraceMemories)) { - SampleVector::const_iterator mend = m_traceDiscreteMemory.at(m_currentTraceMemoryIndex).m_endPoint; + int traceMemoryIndex = m_traceDiscreteMemory.currentIndex() - m_currentTraceMemoryIndex; // actual index in memory bank + + if (traceMemoryIndex < 0) { + traceMemoryIndex += m_nbTraceMemories; + } + + SampleVector::const_iterator mend = m_traceDiscreteMemory.at(traceMemoryIndex).m_endPoint; SampleVector::const_iterator mbegin = mend - m_traceSize; SampleVector::const_iterator mbegin_tb = mbegin - m_maxTraceDelay; m_nbSamples = m_traceSize + m_maxTraceDelay;