From f245dc8206f1d3ace0ff5eb4b12fc0f5575859cf Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 3 Apr 2016 01:49:58 +0200 Subject: [PATCH] GLScope: fixed pre-trigger samples initialization when trace size changes --- sdrbase/gui/glscopegui.cpp | 18 +++++++++++++++++- sdrbase/gui/glscopegui.h | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sdrbase/gui/glscopegui.cpp b/sdrbase/gui/glscopegui.cpp index f98a28ee6..1d9fcfac4 100644 --- a/sdrbase/gui/glscopegui.cpp +++ b/sdrbase/gui/glscopegui.cpp @@ -183,7 +183,6 @@ bool GLScopeGUI::deserialize(const QByteArray& data) setTrigUI(m_triggerIndex); setTrigLevelDisplay(); applySettings(); - applyTriggerSettings(); return true; } else { resetToDefaults(); @@ -191,6 +190,19 @@ bool GLScopeGUI::deserialize(const QByteArray& data) } } +void GLScopeGUI::applyAllTriggerSettings() +{ + quint32 currentTriggerIndex = m_triggerIndex; + + for (int i = 0; i < ScopeVis::m_nbTriggers; i++) + { + m_triggerIndex = i; + applyTriggerSettings(); + } + + m_triggerIndex = currentTriggerIndex; +} + void GLScopeGUI::setTrigUI(uint index) { index %= ScopeVis::m_nbTriggers; @@ -479,6 +491,10 @@ void GLScopeGUI::on_scope_traceSizeChanged(int) setTrigPreDisplay(); setTrigDelayDisplay(); applySettings(); + + if (m_triggerPre > 0) { + applyAllTriggerSettings(); // change of trace size changes number of pre-trigger samples + } } void GLScopeGUI::on_scope_sampleRateChanged(int) diff --git a/sdrbase/gui/glscopegui.h b/sdrbase/gui/glscopegui.h index 6e21fc295..74c17b1e9 100644 --- a/sdrbase/gui/glscopegui.h +++ b/sdrbase/gui/glscopegui.h @@ -67,6 +67,7 @@ private: void applySettings(); void applyTriggerSettings(); + void applyAllTriggerSettings(); void setTimeScaleDisplay(); void setTraceLenDisplay(); void setTimeOfsDisplay();