diff --git a/include-gpl/gui/glspectrum.h b/include-gpl/gui/glspectrum.h index 0983e6cd1..152f7a83e 100644 --- a/include-gpl/gui/glspectrum.h +++ b/include-gpl/gui/glspectrum.h @@ -48,6 +48,7 @@ public: void setDisplayHistogram(bool display); void setDisplayGrid(bool display); void setDisplayGridIntensity(int intensity); + void setDisplayTraceIntensity(int intensity); void addChannelMarker(ChannelMarker* channelMarker); void removeChannelMarker(ChannelMarker* channelMarker); @@ -95,6 +96,7 @@ private: bool m_displayGrid; int m_displayGridIntensity; + int m_displayTraceIntensity; bool m_invertedWaterfall; std::vector m_maxHold; diff --git a/include-gpl/gui/glspectrumgui.h b/include-gpl/gui/glspectrumgui.h index f7c9cc2e8..8c55d3e66 100644 --- a/include-gpl/gui/glspectrumgui.h +++ b/include-gpl/gui/glspectrumgui.h @@ -42,6 +42,7 @@ private: int m_histogramLateHoldoff; int m_histogramStroke; int m_displayGridIntensity; + int m_displayTraceIntensity; bool m_displayWaterfall; bool m_invertedWaterfall; bool m_displayMaxHold; @@ -61,6 +62,7 @@ private slots: void on_holdoff_valueChanged(int index); void on_stroke_valueChanged(int index); void on_gridIntensity_valueChanged(int index); + void on_traceIntensity_valueChanged(int index); void on_waterfall_toggled(bool checked); void on_histogram_toggled(bool checked); diff --git a/sdrbase/gui/glspectrum.cpp b/sdrbase/gui/glspectrum.cpp index d4cf15242..61618a421 100644 --- a/sdrbase/gui/glspectrum.cpp +++ b/sdrbase/gui/glspectrum.cpp @@ -34,6 +34,7 @@ GLSpectrum::GLSpectrum(QWidget* parent) : m_fftSize(512), m_displayGrid(true), m_displayGridIntensity(5), + m_displayTraceIntensity(50), m_invertedWaterfall(false), m_displayMaxHold(false), m_currentSpectrum(0), @@ -260,6 +261,19 @@ void GLSpectrum::setDisplayGridIntensity(int intensity) m_displayGridIntensity = intensity; if (m_displayGridIntensity > 100) { m_displayGridIntensity = 100; + } else if (m_displayGridIntensity < 0) { + m_displayGridIntensity = 0; + } + update(); +} + +void GLSpectrum::setDisplayTraceIntensity(int intensity) +{ + m_displayTraceIntensity = intensity; + if (m_displayTraceIntensity > 100) { + m_displayTraceIntensity = 100; + } else if (m_displayTraceIntensity < 0) { + m_displayTraceIntensity = 0; } update(); } @@ -768,7 +782,7 @@ void GLSpectrum::paintGL() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_LINE_SMOOTH); glLineWidth(1.0f); - glColor3f(1, 0, 0); + glColor4f(1, 0, 0, m_displayTraceIntensity / 100.0); Real bottom = -m_powerRange; glBegin(GL_LINE_STRIP); for(int i = 0; i < m_fftSize; i++) { @@ -793,7 +807,7 @@ void GLSpectrum::paintGL() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_LINE_SMOOTH); glLineWidth(1.0f); - glColor3f(1.0f, 1.0f, 0.25f); // intense yellow + glColor4f(1.0f, 1.0f, 0.25f, m_displayTraceIntensity / 100.0); // intense yellow Real bottom = -m_powerRange; glBegin(GL_LINE_STRIP); for(int i = 0; i < m_fftSize; i++) { diff --git a/sdrbase/gui/glspectrumgui.cpp b/sdrbase/gui/glspectrumgui.cpp index 2f4984950..65b53918f 100644 --- a/sdrbase/gui/glspectrumgui.cpp +++ b/sdrbase/gui/glspectrumgui.cpp @@ -19,7 +19,8 @@ GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) : m_decay(0), m_histogramLateHoldoff(1), m_histogramStroke(40), - m_displayGridIntensity(1), + m_displayGridIntensity(5), + m_displayTraceIntensity(50), m_displayWaterfall(true), m_invertedWaterfall(false), m_displayMaxHold(false), @@ -87,6 +88,7 @@ QByteArray GLSpectrumGUI::serialize() const s.writeS32(14, m_histogramLateHoldoff); s.writeS32(15, m_histogramStroke); s.writeBool(16, m_displayCurrent); + s.writeS32(17, m_displayTraceIntensity); return s.final(); } @@ -112,10 +114,11 @@ bool GLSpectrumGUI::deserialize(const QByteArray& data) d.readS32(10, &m_decay, 0); d.readBool(11, &m_displayGrid, false); d.readBool(12, &m_invert, true); - d.readS32(13, &m_displayGridIntensity, 0); + d.readS32(13, &m_displayGridIntensity, 5); d.readS32(14, &m_histogramLateHoldoff, 1); d.readS32(15, &m_histogramStroke, 40); d.readBool(16, &m_displayCurrent, false); + d.readS32(17, &m_displayTraceIntensity, 50); applySettings(); return true; } else { @@ -150,6 +153,7 @@ void GLSpectrumGUI::applySettings() ui->holdoff->setToolTip(QString("Holdoff: %1").arg(m_histogramLateHoldoff)); ui->stroke->setToolTip(QString("Stroke: %1").arg(m_histogramStroke)); ui->gridIntensity->setToolTip(QString("Grid intensity: %1").arg(m_displayGridIntensity)); + ui->traceIntensity->setToolTip(QString("Trace intensity: %1").arg(m_displayTraceIntensity)); m_glSpectrum->setDisplayWaterfall(m_displayWaterfall); m_glSpectrum->setInvertedWaterfall(m_invertedWaterfall); @@ -276,3 +280,11 @@ void GLSpectrumGUI::on_gridIntensity_valueChanged(int index) if(m_glSpectrum != NULL) m_glSpectrum->setDisplayGridIntensity(m_displayGridIntensity); } + +void GLSpectrumGUI::on_traceIntensity_valueChanged(int index) +{ + m_displayTraceIntensity = index; + ui->traceIntensity->setToolTip(QString("Trace intensity: %1").arg(m_displayTraceIntensity)); + if(m_glSpectrum != NULL) + m_glSpectrum->setDisplayTraceIntensity(m_displayTraceIntensity); +} diff --git a/sdrbase/gui/glspectrumgui.ui b/sdrbase/gui/glspectrumgui.ui index 655d3ab96..220d0a8c7 100644 --- a/sdrbase/gui/glspectrumgui.ui +++ b/sdrbase/gui/glspectrumgui.ui @@ -7,13 +7,13 @@ 0 0 273 - 94 + 60 Oscilloscope - + 2 @@ -29,195 +29,7 @@ 3 - - - - - 0 - 0 - - - - FFT Size - - - - - - - - 0 - 0 - - - - FFT window function - - - QComboBox::AdjustToContents - - - - 128 - - - - - 256 - - - - - 512 - - - - - 1k - - - - - 2k - - - - - 4k - - - - - - - - - 0 - 0 - - - - Range (dB) - - - - - - - - 0 - 0 - - - - Window - - - - - - - - 0 - 0 - - - - Ref (dB) - - - - - - - - 0 - 0 - - - - - 30 - 0 - - - - - 100 - 16777215 - - - - FFT window function - - - QComboBox::AdjustToContents - - - - Bartlett - - - - - Blackman-Harris - - - - - Flat Top - - - - - Hamming - - - - - Hanning - - - - - Rectangle - - - - - - - - - 0 - 0 - - - - FFT window function - - - QComboBox::AdjustToContents - - - - - - - - 0 - 0 - - - - FFT window function - - - QComboBox::AdjustToContents - - - - + 3 @@ -522,6 +334,168 @@ + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + 100 + 16777215 + + + + FFT window function + + + QComboBox::AdjustToContents + + + + Bartlett + + + + + Blackman-Harris + + + + + Flat Top + + + + + Hamming + + + + + Hanning + + + + + Rectangle + + + + + + + + + 0 + 0 + + + + FFT size + + + QComboBox::AdjustToContents + + + + 128 + + + + + 256 + + + + + 512 + + + + + 1k + + + + + 2k + + + + + 4k + + + + + + + + + 0 + 0 + + + + Reference level + + + QComboBox::AdjustToContents + + + + + + + + 0 + 0 + + + + Range + + + QComboBox::AdjustToContents + + + + + + + + 24 + 24 + + + + Trace intensity + + + 100 + + + 1 + + + 50 + + + + + @@ -532,10 +506,6 @@ - fftWindow - fftSize - refLevel - levelRange histogram maxHold invert