diff --git a/sdrbase/dsp/glspectrumsettings.cpp b/sdrbase/dsp/glspectrumsettings.cpp index 328efe17b..3b3e987f8 100644 --- a/sdrbase/dsp/glspectrumsettings.cpp +++ b/sdrbase/dsp/glspectrumsettings.cpp @@ -109,7 +109,7 @@ bool GLSpectrumSettings::deserialize(const QByteArray& data) d.readReal(4, &m_refLevel, 0); d.readReal(5, &m_powerRange, 100); d.readBool(6, &m_displayWaterfall, true); - d.readBool(7, &m_invertedWaterfall, false); + d.readBool(7, &m_invertedWaterfall, true); d.readBool(8, &m_displayMaxHold, false); d.readBool(9, &m_displayHistogram, false); d.readS32(10, &m_decay, 1); @@ -117,7 +117,7 @@ bool GLSpectrumSettings::deserialize(const QByteArray& data) d.readS32(13, &m_displayGridIntensity, 5); d.readS32(14, &m_decayDivisor, 1); d.readS32(15, &m_histogramStroke, 30); - d.readBool(16, &m_displayCurrent, false); + d.readBool(16, &m_displayCurrent, true); d.readS32(17, &m_displayTraceIntensity, 50); d.readReal(18, &m_waterfallShare, 0.66); d.readS32(19, &tmp, 0); diff --git a/sdrgui/gui/glspectrum.cpp b/sdrgui/gui/glspectrum.cpp index 301c2ecf0..2022ac7d1 100644 --- a/sdrgui/gui/glspectrum.cpp +++ b/sdrgui/gui/glspectrum.cpp @@ -31,6 +31,7 @@ #include MESSAGE_CLASS_DEFINITION(GLSpectrum::MsgReportSampleRate, Message) +MESSAGE_CLASS_DEFINITION(GLSpectrum::MsgReportWaterfallShare, Message) GLSpectrum::GLSpectrum(QWidget* parent) : QGLWidget(parent), @@ -1909,6 +1910,10 @@ void GLSpectrum::mouseMoveEvent(QMouseEvent* event) m_waterfallShare = newShare; m_changesPending = true; + if (m_messageQueueToGUI) { + m_messageQueueToGUI->push(new MsgReportWaterfallShare(m_waterfallShare)); + } + update(); return; } diff --git a/sdrgui/gui/glspectrum.h b/sdrgui/gui/glspectrum.h index 64323a3e1..2d6369ccc 100644 --- a/sdrgui/gui/glspectrum.h +++ b/sdrgui/gui/glspectrum.h @@ -51,9 +51,7 @@ public: MsgReportSampleRate(quint32 sampleRate) : Message(), m_sampleRate(sampleRate) - { - m_sampleRate = sampleRate; - } + {} quint32 getSampleRate() const { return m_sampleRate; } @@ -61,6 +59,21 @@ public: quint32 m_sampleRate; }; + class MsgReportWaterfallShare : public Message { + MESSAGE_CLASS_DECLARATION + + public: + MsgReportWaterfallShare(Real waterfallShare) : + Message(), + m_waterfallShare(waterfallShare) + {} + + Real getWaterfallShare() const { return m_waterfallShare; } + + private: + Real m_waterfallShare; + }; + GLSpectrum(QWidget* parent = nullptr); virtual ~GLSpectrum(); diff --git a/sdrgui/gui/glspectrumgui.cpp b/sdrgui/gui/glspectrumgui.cpp index 0d6f5b0a3..ee70baa99 100644 --- a/sdrgui/gui/glspectrumgui.cpp +++ b/sdrgui/gui/glspectrumgui.cpp @@ -93,7 +93,7 @@ bool GLSpectrumGUI::deserialize(const QByteArray& data) { if (m_settings.deserialize(data)) { - displaySettings(); + displaySettings(); // ends with blockApplySettings(false) applySettings(); return true; } @@ -189,6 +189,7 @@ void GLSpectrumGUI::applyGLSpectrumSettings() m_glSpectrum->setDisplayGrid(m_settings.m_displayGrid); m_glSpectrum->setDisplayGridIntensity(m_settings.m_displayGridIntensity); m_glSpectrum->setDisplayTraceIntensity(m_settings.m_displayTraceIntensity); + m_glSpectrum->setWaterfallShare(m_settings.m_waterfallShare); if ((m_settings.m_averagingMode == GLSpectrumSettings::AvgModeFixed) || (m_settings.m_averagingMode == GLSpectrumSettings::AvgModeMax)) { m_glSpectrum->setTimingRate(getAveragingValue(m_settings.m_averagingIndex, m_settings.m_averagingMode) == 0 ? @@ -527,6 +528,11 @@ bool GLSpectrumGUI::handleMessage(const Message& message) ui->wsSpectrum->blockSignals(false); return true; } + else if (GLSpectrum::MsgReportWaterfallShare::match(message)) + { + const GLSpectrum::MsgReportWaterfallShare& report = (const GLSpectrum::MsgReportWaterfallShare&) message; + m_settings.m_waterfallShare = report.getWaterfallShare(); + } else if (SpectrumVis::MsgStartStop::match(message)) { const SpectrumVis::MsgStartStop& msg = (SpectrumVis::MsgStartStop&) message;