From c32f2b72f7c21456b8927f90e20761004243d076 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 14 Jul 2015 01:45:16 +0200 Subject: [PATCH] Show trigger line on phase display --- include-gpl/gui/glscope.h | 2 ++ sdrbase/gui/glscope.cpp | 14 +++++++++++++- sdrbase/gui/glscopegui.cpp | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include-gpl/gui/glscope.h b/include-gpl/gui/glscope.h index 6e5a73da7..7008c9ec2 100644 --- a/include-gpl/gui/glscope.h +++ b/include-gpl/gui/glscope.h @@ -60,6 +60,8 @@ public: void setDisplays(Displays displays); void setOrientation(Qt::Orientation orientation); void setDisplayGridIntensity(int intensity); + void setTriggerChannel(ScopeVis::TriggerChannel triggerChannel); + void setTriggerLevel(Real triggerLevel); void newTrace(const std::vector& trace, int sampleRate); int getTraceSize() const { return m_rawTrace.size(); } diff --git a/sdrbase/gui/glscope.cpp b/sdrbase/gui/glscope.cpp index e88ceab9b..f416604d1 100644 --- a/sdrbase/gui/glscope.cpp +++ b/sdrbase/gui/glscope.cpp @@ -263,6 +263,7 @@ void GLScope::paintGL() glDisable(GL_TEXTURE_2D); glPopMatrix(); + // paint trigger level if(m_triggerChannel == ScopeVis::TriggerChannelI) { glPushMatrix(); glTranslatef(m_glScopeRect1.x(), m_glScopeRect1.y() + m_glScopeRect1.height() / 2.0, 0); @@ -401,7 +402,8 @@ void GLScope::paintGL() glDisable(GL_TEXTURE_2D); glPopMatrix(); - if(m_triggerChannel == ScopeVis::TriggerChannelQ) { + // paint trigger level + if(m_triggerChannel == ScopeVis::TriggerPhase) { glPushMatrix(); glTranslatef(m_glScopeRect2.x(), m_glScopeRect2.y() + m_glScopeRect2.height() / 2.0, 0); glScalef(m_glScopeRect2.width(), -(m_glScopeRect2.height() / 2) * m_amp2, 1); @@ -1239,3 +1241,13 @@ void GLScope::tick() if(m_dataChanged) update(); } + +void GLScope::setTriggerChannel(ScopeVis::TriggerChannel triggerChannel) +{ + m_triggerChannel = triggerChannel; +} + +void GLScope::setTriggerLevel(Real triggerLevel) +{ + m_triggerLevel = triggerLevel; +} diff --git a/sdrbase/gui/glscopegui.cpp b/sdrbase/gui/glscopegui.cpp index a9c5ec320..8c29eaa96 100644 --- a/sdrbase/gui/glscopegui.cpp +++ b/sdrbase/gui/glscopegui.cpp @@ -174,6 +174,9 @@ void GLScopeGUI::applyTriggerSettings() triggerLevel = m_triggerLevel / 100.0; } + m_glScope->setTriggerChannel((ScopeVis::TriggerChannel) m_triggerChannel); + m_glScope->setTriggerLevel(m_triggerLevel / 100.0); + m_scopeVis->configure(m_messageQueue, (ScopeVis::TriggerChannel) m_triggerChannel, triggerLevel, m_triggerPositiveEdge); }