1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Show trigger line on phase display

This commit is contained in:
f4exb 2015-07-14 01:45:16 +02:00
parent 9d9e419fd4
commit c32f2b72f7
3 changed files with 18 additions and 1 deletions

View File

@ -60,6 +60,8 @@ public:
void setDisplays(Displays displays); void setDisplays(Displays displays);
void setOrientation(Qt::Orientation orientation); void setOrientation(Qt::Orientation orientation);
void setDisplayGridIntensity(int intensity); void setDisplayGridIntensity(int intensity);
void setTriggerChannel(ScopeVis::TriggerChannel triggerChannel);
void setTriggerLevel(Real triggerLevel);
void newTrace(const std::vector<Complex>& trace, int sampleRate); void newTrace(const std::vector<Complex>& trace, int sampleRate);
int getTraceSize() const { return m_rawTrace.size(); } int getTraceSize() const { return m_rawTrace.size(); }

View File

@ -263,6 +263,7 @@ void GLScope::paintGL()
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
glPopMatrix(); glPopMatrix();
// paint trigger level
if(m_triggerChannel == ScopeVis::TriggerChannelI) { if(m_triggerChannel == ScopeVis::TriggerChannelI) {
glPushMatrix(); glPushMatrix();
glTranslatef(m_glScopeRect1.x(), m_glScopeRect1.y() + m_glScopeRect1.height() / 2.0, 0); glTranslatef(m_glScopeRect1.x(), m_glScopeRect1.y() + m_glScopeRect1.height() / 2.0, 0);
@ -401,7 +402,8 @@ void GLScope::paintGL()
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
glPopMatrix(); glPopMatrix();
if(m_triggerChannel == ScopeVis::TriggerChannelQ) { // paint trigger level
if(m_triggerChannel == ScopeVis::TriggerPhase) {
glPushMatrix(); glPushMatrix();
glTranslatef(m_glScopeRect2.x(), m_glScopeRect2.y() + m_glScopeRect2.height() / 2.0, 0); glTranslatef(m_glScopeRect2.x(), m_glScopeRect2.y() + m_glScopeRect2.height() / 2.0, 0);
glScalef(m_glScopeRect2.width(), -(m_glScopeRect2.height() / 2) * m_amp2, 1); glScalef(m_glScopeRect2.width(), -(m_glScopeRect2.height() / 2) * m_amp2, 1);
@ -1239,3 +1241,13 @@ void GLScope::tick()
if(m_dataChanged) if(m_dataChanged)
update(); update();
} }
void GLScope::setTriggerChannel(ScopeVis::TriggerChannel triggerChannel)
{
m_triggerChannel = triggerChannel;
}
void GLScope::setTriggerLevel(Real triggerLevel)
{
m_triggerLevel = triggerLevel;
}

View File

@ -174,6 +174,9 @@ void GLScopeGUI::applyTriggerSettings()
triggerLevel = m_triggerLevel / 100.0; 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); m_scopeVis->configure(m_messageQueue, (ScopeVis::TriggerChannel) m_triggerChannel, triggerLevel, m_triggerPositiveEdge);
} }