mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-04 16:01:14 -05:00
GLScope: IQ linear and IQ polar displays
This commit is contained in:
parent
2726625e97
commit
f8e6cc6cce
@ -179,6 +179,7 @@ For Debian Jessie or Stretch:
|
|||||||
- Scope: trace history
|
- Scope: trace history
|
||||||
- Scope: trigger countdown
|
- Scope: trigger countdown
|
||||||
- Scope: multiple trigger chaining
|
- Scope: multiple trigger chaining
|
||||||
|
- Scope: new mode with linear IQ (two traces) on the primary display and polar IQ on the secondary display
|
||||||
|
|
||||||
<h2>Major redesign</h2>
|
<h2>Major redesign</h2>
|
||||||
|
|
||||||
|
@ -670,32 +670,71 @@ void GLScope::paintGL()
|
|||||||
|
|
||||||
// paint trace #2
|
// paint trace #2
|
||||||
if(m_displayTrace->size() > 0) {
|
if(m_displayTrace->size() > 0) {
|
||||||
glPushMatrix();
|
if (m_mode == ModeIQPolar)
|
||||||
glTranslatef(m_glScopeRect2.x(), m_glScopeRect2.y() + m_glScopeRect2.height() / 2.0, 0);
|
{
|
||||||
glScalef(m_glScopeRect2.width() * (float)m_timeBase / (float)(m_displayTrace->size() - 1), -(m_glScopeRect2.height() / 2) * m_amp2, 1);
|
glPushMatrix();
|
||||||
glEnable(GL_BLEND);
|
glTranslatef(m_glScopeRect2.x() + m_glScopeRect2.width() / 2.0, m_glScopeRect2.y() + m_glScopeRect2.height() / 2.0, 0);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glScalef(m_glScopeRect2.width() / 2, -(m_glScopeRect2.height() / 2), 1);
|
||||||
//glEnable(GL_LINE_SMOOTH);
|
|
||||||
glLineWidth(1.0f);
|
glEnable(GL_BLEND);
|
||||||
glColor4f(1, 1, 0.25f, m_displayTraceIntensity / 100.0);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
int start = (m_timeOfsProMill/1000.0) * m_displayTrace->size();
|
glLineWidth(1.0f);
|
||||||
int end = std::min(start + m_displayTrace->size()/m_timeBase, m_displayTrace->size());
|
glColor4f(1, 1, 0.25f, m_displayTraceIntensity / 100.0);
|
||||||
if(end - start < 2)
|
|
||||||
start--;
|
int start = (m_timeOfsProMill/1000.0) * m_displayTrace->size();
|
||||||
float posLimit = 1.0 / m_amp2;
|
int end = std::min(start + m_displayTrace->size()/m_timeBase, m_displayTrace->size());
|
||||||
float negLimit = -1.0 / m_amp2;
|
if(end - start < 2)
|
||||||
glBegin(GL_LINE_STRIP);
|
start--;
|
||||||
for(int i = start; i < end; i++) {
|
|
||||||
float v = (*m_displayTrace)[i].imag();
|
glBegin(GL_LINE_STRIP);
|
||||||
if(v > posLimit)
|
|
||||||
v = posLimit;
|
for(int i = start; i < end; i++)
|
||||||
else if(v < negLimit)
|
{
|
||||||
v = negLimit;
|
float x = (*m_displayTrace)[i].real() * m_amp1;
|
||||||
glVertex2f(i - start, v);
|
float y = (*m_displayTrace)[i].imag() * m_amp2;
|
||||||
|
if(x > 1.0f)
|
||||||
|
x = 1.0f;
|
||||||
|
else if(x < -1.0f)
|
||||||
|
x = -1.0f;
|
||||||
|
if(y > 1.0f)
|
||||||
|
y = 1.0f;
|
||||||
|
else if(y < -1.0f)
|
||||||
|
y = -1.0f;
|
||||||
|
glVertex2f(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
glEnd();
|
||||||
|
glPopMatrix();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glPushMatrix();
|
||||||
|
glTranslatef(m_glScopeRect2.x(), m_glScopeRect2.y() + m_glScopeRect2.height() / 2.0, 0);
|
||||||
|
glScalef(m_glScopeRect2.width() * (float)m_timeBase / (float)(m_displayTrace->size() - 1), -(m_glScopeRect2.height() / 2) * m_amp2, 1);
|
||||||
|
glEnable(GL_BLEND);
|
||||||
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
//glEnable(GL_LINE_SMOOTH);
|
||||||
|
glLineWidth(1.0f);
|
||||||
|
glColor4f(1, 1, 0.25f, m_displayTraceIntensity / 100.0);
|
||||||
|
int start = (m_timeOfsProMill/1000.0) * m_displayTrace->size();
|
||||||
|
int end = std::min(start + m_displayTrace->size()/m_timeBase, m_displayTrace->size());
|
||||||
|
if(end - start < 2)
|
||||||
|
start--;
|
||||||
|
float posLimit = 1.0 / m_amp2;
|
||||||
|
float negLimit = -1.0 / m_amp2;
|
||||||
|
glBegin(GL_LINE_STRIP);
|
||||||
|
for(int i = start; i < end; i++) {
|
||||||
|
float v = (*m_displayTrace)[i].imag();
|
||||||
|
if(v > posLimit)
|
||||||
|
v = posLimit;
|
||||||
|
else if(v < negLimit)
|
||||||
|
v = negLimit;
|
||||||
|
glVertex2f(i - start, v);
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
//glDisable(GL_LINE_SMOOTH);
|
||||||
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
glEnd();
|
|
||||||
//glDisable(GL_LINE_SMOOTH);
|
|
||||||
glPopMatrix();
|
|
||||||
}
|
}
|
||||||
} // Both displays or secondary display only
|
} // Both displays or secondary display only
|
||||||
|
|
||||||
|
@ -110,15 +110,9 @@ QByteArray GLScopeGUI::serialize() const
|
|||||||
s.writeS32(6, m_displayGridIntensity);
|
s.writeS32(6, m_displayGridIntensity);
|
||||||
s.writeS32(7, m_amp1OffsetCoarse);
|
s.writeS32(7, m_amp1OffsetCoarse);
|
||||||
s.writeS32(8, m_displays);
|
s.writeS32(8, m_displays);
|
||||||
//s.writeS32(9, m_triggerChannel);
|
|
||||||
//s.writeS32(10, m_triggerLevelCoarse);
|
|
||||||
//s.writeBool(11, m_triggerPositiveEdge);
|
|
||||||
s.writeS32(12, m_displayTraceIntensity);
|
s.writeS32(12, m_displayTraceIntensity);
|
||||||
s.writeS32(13, m_triggerPre);
|
s.writeS32(13, m_triggerPre);
|
||||||
s.writeS32(14, m_traceLenMult);
|
s.writeS32(14, m_traceLenMult);
|
||||||
//s.writeS32(15, m_triggerDelay);
|
|
||||||
//s.writeBool(16, m_triggerBothEdges);
|
|
||||||
//s.writeS32(17, m_triggerLevelFine);
|
|
||||||
s.writeS32(18, m_amp1OffsetFine);
|
s.writeS32(18, m_amp1OffsetFine);
|
||||||
s.writeS32(19, m_amplification2);
|
s.writeS32(19, m_amplification2);
|
||||||
s.writeS32(20, m_amp2OffsetCoarse);
|
s.writeS32(20, m_amp2OffsetCoarse);
|
||||||
@ -158,11 +152,6 @@ bool GLScopeGUI::deserialize(const QByteArray& data)
|
|||||||
m_timeBase = 1;
|
m_timeBase = 1;
|
||||||
d.readS32(7, &m_amp1OffsetCoarse, 0);
|
d.readS32(7, &m_amp1OffsetCoarse, 0);
|
||||||
d.readS32(8, &m_displays, GLScope::DisplayBoth);
|
d.readS32(8, &m_displays, GLScope::DisplayBoth);
|
||||||
//d.readS32(9, &m_triggerChannel, ScopeVis::TriggerFreeRun);
|
|
||||||
//ui->trigMode->setCurrentIndex(m_triggerChannel);
|
|
||||||
//d.readS32(10, &m_triggerLevelCoarse, 0);
|
|
||||||
//ui->trigLevelCoarse->setValue(m_triggerLevelCoarse);
|
|
||||||
//d.readBool(11, &m_triggerPositiveEdge, true);
|
|
||||||
d.readS32(12, &m_displayTraceIntensity, 50);
|
d.readS32(12, &m_displayTraceIntensity, 50);
|
||||||
d.readS32(13, &m_triggerPre, 0);
|
d.readS32(13, &m_triggerPre, 0);
|
||||||
ui->trigPre->setValue(m_triggerPre);
|
ui->trigPre->setValue(m_triggerPre);
|
||||||
@ -170,24 +159,7 @@ bool GLScopeGUI::deserialize(const QByteArray& data)
|
|||||||
d.readS32(14, &m_traceLenMult, 20);
|
d.readS32(14, &m_traceLenMult, 20);
|
||||||
ui->traceLen->setValue(m_traceLenMult);
|
ui->traceLen->setValue(m_traceLenMult);
|
||||||
setTraceLenDisplay();
|
setTraceLenDisplay();
|
||||||
//d.readS32(15, &m_triggerDelay, 0);
|
|
||||||
//ui->trigDelay->setValue(m_triggerDelay);
|
|
||||||
setTrigDelayDisplay();
|
setTrigDelayDisplay();
|
||||||
//d.readBool(16, &m_triggerBothEdges, false);
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (m_triggerBothEdges) {
|
|
||||||
ui->slopePos->setChecked(false);
|
|
||||||
ui->slopeNeg->setChecked(false);
|
|
||||||
ui->slopeBoth->setChecked(true);
|
|
||||||
} else {
|
|
||||||
ui->slopeBoth->setChecked(false);
|
|
||||||
ui->slopePos->setChecked(m_triggerPositiveEdge);
|
|
||||||
ui->slopeNeg->setChecked(!m_triggerPositiveEdge);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//d.readS32(17, &m_triggerLevelFine, 0);
|
|
||||||
//ui->trigLevelFine->setValue(m_triggerLevelFine);
|
|
||||||
d.readS32(18, &m_amp1OffsetFine, 0);
|
d.readS32(18, &m_amp1OffsetFine, 0);
|
||||||
d.readS32(19, &m_amplification2, 0);
|
d.readS32(19, &m_amplification2, 0);
|
||||||
d.readS32(20, &m_amp2OffsetCoarse, 0);
|
d.readS32(20, &m_amp2OffsetCoarse, 0);
|
||||||
@ -673,26 +645,26 @@ void GLScopeGUI::on_dataMode_currentIndexChanged(int index)
|
|||||||
case 0: // i+q
|
case 0: // i+q
|
||||||
m_glScope->setMode(GLScope::ModeIQ);
|
m_glScope->setMode(GLScope::ModeIQ);
|
||||||
break;
|
break;
|
||||||
case 1: // mag(lin)+pha
|
case 1: // clostationary
|
||||||
|
m_glScope->setMode(GLScope::ModeIQPolar);
|
||||||
|
break;
|
||||||
|
case 2: // mag(lin)+pha
|
||||||
m_glScope->setMode(GLScope::ModeMagLinPha);
|
m_glScope->setMode(GLScope::ModeMagLinPha);
|
||||||
break;
|
break;
|
||||||
case 2: // mag(dB)+pha
|
case 3: // mag(dB)+pha
|
||||||
m_glScope->setMode(GLScope::ModeMagdBPha);
|
m_glScope->setMode(GLScope::ModeMagdBPha);
|
||||||
break;
|
break;
|
||||||
case 3: // mag(lin)+dPha
|
case 4: // mag(lin)+dPha
|
||||||
m_glScope->setMode(GLScope::ModeMagLinDPha);
|
m_glScope->setMode(GLScope::ModeMagLinDPha);
|
||||||
break;
|
break;
|
||||||
case 4: // mag(dB)+dPha
|
case 5: // mag(dB)+dPha
|
||||||
m_glScope->setMode(GLScope::ModeMagdBDPha);
|
m_glScope->setMode(GLScope::ModeMagdBDPha);
|
||||||
break;
|
break;
|
||||||
case 5: // derived1+derived2
|
case 6: // derived1+derived2
|
||||||
m_glScope->setMode(GLScope::ModeDerived12);
|
m_glScope->setMode(GLScope::ModeDerived12);
|
||||||
break;
|
break;
|
||||||
case 6: // clostationary
|
|
||||||
m_glScope->setMode(GLScope::ModeCyclostationary);
|
|
||||||
break;
|
|
||||||
case 7: // clostationary
|
case 7: // clostationary
|
||||||
m_glScope->setMode(GLScope::ModeIQPolar);
|
m_glScope->setMode(GLScope::ModeCyclostationary);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -82,6 +82,11 @@
|
|||||||
<string>1:I 2:Q (lin)</string>
|
<string>1:I 2:Q (lin)</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>1:IQ (lin) 2:IQ (pol)</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>1:Mag (lin) 2:Phi</string>
|
<string>1:Mag (lin) 2:Phi</string>
|
||||||
@ -112,11 +117,6 @@
|
|||||||
<string>1,2:Cyclostationary</string>
|
<string>1,2:Cyclostationary</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>1:IQ (lin) 2:IQ (pol)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
Loading…
Reference in New Issue
Block a user