From 5fde3dfb18e50da9a28d06ee3912c2ec0731cccb Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 12 Jun 2021 10:47:03 +0200 Subject: [PATCH] GLScope redesign: set number of streams separately --- sdrbase/dsp/scopevis.cpp | 18 +++++++++++------- sdrbase/dsp/scopevis.h | 2 +- sdrgui/gui/glscopegui.cpp | 7 ------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/sdrbase/dsp/scopevis.cpp b/sdrbase/dsp/scopevis.cpp index 1d0c94b4a..ac2c3cfa8 100644 --- a/sdrbase/dsp/scopevis.cpp +++ b/sdrbase/dsp/scopevis.cpp @@ -133,8 +133,18 @@ void ScopeVis::setPreTriggerDelay(uint32_t preTriggerDelay, bool emitSignal) } } +void ScopeVis::setNbStreams(uint32_t nbStreams) +{ + QMutexLocker configLocker(&m_mutex); + + if (m_nbStreams != nbStreams) + { + m_traceDiscreteMemory.setNbStreams(nbStreams); + m_nbStreams = nbStreams; + } +} + void ScopeVis::configure( - uint32_t nbStreams, uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, @@ -150,12 +160,6 @@ void ScopeVis::configure( m_settings.m_traceLen = traceSize; } - if (m_nbStreams != nbStreams) - { - m_traceDiscreteMemory.setNbStreams(nbStreams); - m_nbStreams = nbStreams; - } - if (m_timeBase != timeBase) { m_timeBase = timeBase; diff --git a/sdrbase/dsp/scopevis.h b/sdrbase/dsp/scopevis.h index a8ffe163a..3ac1f6d59 100644 --- a/sdrbase/dsp/scopevis.h +++ b/sdrbase/dsp/scopevis.h @@ -345,8 +345,8 @@ public: MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication void setLiveRate(int sampleRate); + void setNbStreams(uint32_t nbStreams); void configure( - uint32_t nbStreams, uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, diff --git a/sdrgui/gui/glscopegui.cpp b/sdrgui/gui/glscopegui.cpp index c8473ae05..23a1b8dd8 100644 --- a/sdrgui/gui/glscopegui.cpp +++ b/sdrgui/gui/glscopegui.cpp @@ -114,7 +114,6 @@ void GLScopeGUI::setBuddies(MessageQueue* messageQueue, ScopeVis* scopeVis, GLSc fillProjectionCombo(ui->trigMode); m_scopeVis->configure( - 1, 2*m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_timeBase, m_timeOffset*10, @@ -123,7 +122,6 @@ void GLScopeGUI::setBuddies(MessageQueue* messageQueue, ScopeVis* scopeVis, GLSc ); m_scopeVis->configure( - 1, m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_timeBase, m_timeOffset*10, @@ -591,7 +589,6 @@ void GLScopeGUI::on_time_valueChanged(int value) setTimeScaleDisplay(); setTraceDelayDisplay(); m_scopeVis->configure( - 1, m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_timeBase, m_timeOffset*10, @@ -610,7 +607,6 @@ void GLScopeGUI::on_timeOfs_valueChanged(int value) m_settings.m_timeOfs = value; setTimeOfsDisplay(); m_scopeVis->configure( - 1, m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_timeBase, m_timeOffset*10, @@ -634,7 +630,6 @@ void GLScopeGUI::on_traceLen_valueChanged(int value) m_traceLenMult = value; m_settings.m_traceLen = m_traceLenMult*m_scopeVis->getTraceChunkSize(); m_scopeVis->configure( - 1, m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_timeBase, m_timeOffset*10, @@ -1022,7 +1017,6 @@ void GLScopeGUI::on_trigPre_valueChanged(int value) (void) value; setTrigPreDisplay(); m_scopeVis->configure( - 1, m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_timeBase, m_timeOffset*10, @@ -1064,7 +1058,6 @@ void GLScopeGUI::on_freerun_toggled(bool checked) } m_scopeVis->configure( - 1, m_traceLenMult*m_scopeVis->getTraceChunkSize(), m_timeBase, m_timeOffset*10,