mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-04 10:38:45 -04:00
Added trace intensity control to scope
This commit is contained in:
parent
14955f6e11
commit
15a5afad55
@ -60,6 +60,7 @@ public:
|
||||
void setDisplays(Displays displays);
|
||||
void setOrientation(Qt::Orientation orientation);
|
||||
void setDisplayGridIntensity(int intensity);
|
||||
void setDisplayTraceIntensity(int intensity);
|
||||
void setTriggerChannel(ScopeVis::TriggerChannel triggerChannel);
|
||||
void setTriggerLevel(Real triggerLevel);
|
||||
|
||||
@ -112,6 +113,7 @@ private:
|
||||
QRectF m_glScopeRect1;
|
||||
QRectF m_glScopeRect2;
|
||||
int m_displayGridIntensity;
|
||||
int m_displayTraceIntensity;
|
||||
QRectF m_glLeft1ScaleRect;
|
||||
QRectF m_glLeft2ScaleRect;
|
||||
QRectF m_glBot1ScaleRect;
|
||||
|
@ -47,6 +47,7 @@ private:
|
||||
qint32 m_amplification;
|
||||
qint32 m_ampOffset;
|
||||
int m_displayGridIntensity;
|
||||
int m_displayTraceIntensity;
|
||||
qint32 m_triggerChannel;
|
||||
qint32 m_triggerLevel; // percent
|
||||
bool m_triggerPositiveEdge;
|
||||
@ -70,6 +71,7 @@ private slots:
|
||||
void on_timeOfs_valueChanged(int value);
|
||||
void on_dataMode_currentIndexChanged(int index);
|
||||
void on_gridIntensity_valueChanged(int index);
|
||||
void on_traceIntensity_valueChanged(int index);
|
||||
|
||||
void on_horizView_clicked();
|
||||
void on_vertView_clicked();
|
||||
|
@ -36,6 +36,7 @@ GLScope::GLScope(QWidget* parent) :
|
||||
m_triggerChannel(ScopeVis::TriggerFreeRun),
|
||||
m_triggerLevel(0.0),
|
||||
m_displayGridIntensity(5),
|
||||
m_displayTraceIntensity(50),
|
||||
m_left1ScaleTextureAllocated(false),
|
||||
m_left2ScaleTextureAllocated(false),
|
||||
m_bot1ScaleTextureAllocated(false),
|
||||
@ -134,6 +135,19 @@ void GLScope::setDisplayGridIntensity(int intensity)
|
||||
m_displayGridIntensity = intensity;
|
||||
if (m_displayGridIntensity > 100) {
|
||||
m_displayGridIntensity = 100;
|
||||
} else if (m_displayGridIntensity < 0) {
|
||||
m_displayGridIntensity = 0;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void GLScope::setDisplayTraceIntensity(int intensity)
|
||||
{
|
||||
m_displayTraceIntensity = intensity;
|
||||
if (m_displayTraceIntensity > 100) {
|
||||
m_displayTraceIntensity = 100;
|
||||
} else if (m_displayTraceIntensity < 0) {
|
||||
m_displayTraceIntensity = 0;
|
||||
}
|
||||
update();
|
||||
}
|
||||
@ -338,7 +352,7 @@ void GLScope::paintGL()
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
glLineWidth(1.0f);
|
||||
glColor4f(1, 1, 0.25f, 0.4f);
|
||||
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)
|
||||
@ -510,7 +524,7 @@ void GLScope::paintGL()
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
glLineWidth(1.0f);
|
||||
glColor4f(1, 1, 0.25f, 0.4f);
|
||||
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)
|
||||
|
@ -80,6 +80,7 @@ QByteArray GLScopeGUI::serialize() const
|
||||
s.writeS32(9, m_triggerChannel);
|
||||
s.writeS32(10, m_triggerLevel);
|
||||
s.writeBool(11, m_triggerPositiveEdge);
|
||||
s.writeS32(12, m_displayTraceIntensity);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@ -112,6 +113,7 @@ bool GLScopeGUI::deserialize(const QByteArray& data)
|
||||
d.readBool(11, &m_triggerPositiveEdge, true);
|
||||
ui->slopePos->setChecked(m_triggerPositiveEdge);
|
||||
ui->slopeNeg->setChecked(!m_triggerPositiveEdge);
|
||||
d.readS32(12, &m_displayTraceIntensity, 50);
|
||||
applySettings();
|
||||
applyTriggerSettings();
|
||||
return true;
|
||||
@ -161,6 +163,7 @@ void GLScopeGUI::applySettings()
|
||||
ui->amp->setValue(m_amplification);
|
||||
ui->ampOfs->setValue(m_ampOffset);
|
||||
ui->gridIntensity->setSliderPosition(m_displayGridIntensity);
|
||||
ui->traceIntensity->setSliderPosition(m_displayTraceIntensity);
|
||||
}
|
||||
|
||||
void GLScopeGUI::applyTriggerSettings()
|
||||
@ -380,10 +383,19 @@ void GLScopeGUI::on_onlySecondView_clicked()
|
||||
void GLScopeGUI::on_gridIntensity_valueChanged(int index)
|
||||
{
|
||||
m_displayGridIntensity = index;
|
||||
ui->gridIntensity->setToolTip(QString("Grid intensity: %1").arg(m_displayGridIntensity));
|
||||
if(m_glScope != NULL)
|
||||
m_glScope->setDisplayGridIntensity(m_displayGridIntensity);
|
||||
}
|
||||
|
||||
void GLScopeGUI::on_traceIntensity_valueChanged(int index)
|
||||
{
|
||||
m_displayTraceIntensity = index;
|
||||
ui->traceIntensity->setToolTip(QString("Trace intensity: %1").arg(m_displayTraceIntensity));
|
||||
if(m_glScope != NULL)
|
||||
m_glScope->setDisplayTraceIntensity(m_displayTraceIntensity);
|
||||
}
|
||||
|
||||
void GLScopeGUI::on_trigMode_currentIndexChanged(int index)
|
||||
{
|
||||
m_triggerChannel = index;
|
||||
|
@ -460,6 +460,9 @@
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Grid intensity</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
@ -692,6 +695,35 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="traceIntensityLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDial" name="traceIntensity">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Trace intensity</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
Loading…
Reference in New Issue
Block a user