diff --git a/CHANGELOG b/CHANGELOG index eb23d204a..1485cca3f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +sdrangel (4.9.1-1) unstable; urgency=medium + + * WFM demod: variable RF bandwidth. Implements #320 + * Fixed buddies list handling at buddy termination time. Fixes #359 + + -- Edouard Griffiths, F4EXB Sat, 08 Jun 2019 20:44:06 +0100 + sdrangel (4.9.0-1) unstable; urgency=medium * New build system diff --git a/debian/changelog b/debian/changelog index eb23d204a..1485cca3f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +sdrangel (4.9.1-1) unstable; urgency=medium + + * WFM demod: variable RF bandwidth. Implements #320 + * Fixed buddies list handling at buddy termination time. Fixes #359 + + -- Edouard Griffiths, F4EXB Sat, 08 Jun 2019 20:44:06 +0100 + sdrangel (4.9.0-1) unstable; urgency=medium * New build system diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.cpp b/plugins/channelrx/demodwfm/wfmdemodgui.cpp index be72ae242..b60b1772e 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.cpp +++ b/plugins/channelrx/demodwfm/wfmdemodgui.cpp @@ -126,10 +126,10 @@ void WFMDemodGUI::on_deltaFrequency_changed(qint64 value) applySettings(); } -void WFMDemodGUI::on_rfBW_currentIndexChanged(int index) +void WFMDemodGUI::on_rfBW_changed(quint64 value) { - m_channelMarker.setBandwidth(WFMDemodSettings::getRFBW(index)); - m_settings.m_rfBandwidth = WFMDemodSettings::getRFBW(index); + m_channelMarker.setBandwidth(value); + m_settings.m_rfBandwidth = value; applySettings(); } @@ -225,16 +225,11 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); - blockApplySettings(true); - ui->rfBW->clear(); - for (int i = 0; i < WFMDemodSettings::m_nbRFBW; i++) { - ui->rfBW->addItem(QString("%1").arg(WFMDemodSettings::getRFBW(i) / 1000.0, 0, 'f', 2)); - } - ui->rfBW->setCurrentIndex(6); - blockApplySettings(false); + ui->rfBW->setColorMapper(ColorMapper(ColorMapper::GrayYellow)); + ui->rfBW->setValueRange(WFMDemodSettings::m_rfBWDigits, WFMDemodSettings::m_rfBWMin, WFMDemodSettings::m_rfBWMax); m_channelMarker.blockSignals(true); - m_channelMarker.setBandwidth(WFMDemodSettings::getRFBW(4)); + m_channelMarker.setBandwidth(m_settings.m_rfBandwidth); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("WFM Demodulator"); m_channelMarker.setColor(m_settings.m_rgbColor); @@ -273,7 +268,7 @@ void WFMDemodGUI::applySettings(bool force) if (m_doApplySettings) { WFMDemod::MsgConfigureChannelizer *msgChan = WFMDemod::MsgConfigureChannelizer::create( - WFMDemod::requiredBW(WFMDemodSettings::getRFBW(ui->rfBW->currentIndex())), + m_settings.m_rfBandwidth, m_channelMarker.getCenterFrequency()); m_wfmDemod->getInputMessageQueue()->push(msgChan); @@ -297,18 +292,13 @@ void WFMDemodGUI::displaySettings() blockApplySettings(true); ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); - - ui->rfBW->setCurrentIndex(WFMDemodSettings::getRFBWIndex(m_settings.m_rfBandwidth)); - + ui->rfBW->setValue(m_settings.m_rfBandwidth); ui->afBW->setValue(m_settings.m_afBandwidth/1000.0); ui->afBWText->setText(QString("%1 kHz").arg(m_settings.m_afBandwidth/1000.0)); - ui->volume->setValue(m_settings.m_volume * 10.0); ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1)); - ui->squelch->setValue(m_settings.m_squelch); ui->squelchText->setText(QString("%1 dB").arg(m_settings.m_squelch)); - ui->audioMute->setChecked(m_settings.m_audioMute); blockApplySettings(false); diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.h b/plugins/channelrx/demodwfm/wfmdemodgui.h index c7998cc8e..650bfe535 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.h +++ b/plugins/channelrx/demodwfm/wfmdemodgui.h @@ -65,7 +65,7 @@ private: private slots: void on_deltaFrequency_changed(qint64 value); - void on_rfBW_currentIndexChanged(int index); + void on_rfBW_changed(quint64 value); void on_afBW_valueChanged(int value); void on_volume_valueChanged(int value); void on_squelch_valueChanged(int value); diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.ui b/plugins/channelrx/demodwfm/wfmdemodgui.ui index 3373fd7a7..05e404bed 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.ui +++ b/plugins/channelrx/demodwfm/wfmdemodgui.ui @@ -216,15 +216,56 @@ - - + + + + 0 + 0 + + + - 70 - 16777215 + 32 + 16 + + + Liberation Mono + 12 + 50 + false + + + + RF Bandwidth (Hz) + + + + + Hz + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + @@ -270,10 +311,6 @@ - - - - @@ -416,6 +453,12 @@
gui/valuedialz.h
1 + + ValueDial + QWidget +
gui/valuedial.h
+ 1 +
diff --git a/plugins/channelrx/demodwfm/wfmdemodsettings.cpp b/plugins/channelrx/demodwfm/wfmdemodsettings.cpp index 0e630623c..50539a138 100644 --- a/plugins/channelrx/demodwfm/wfmdemodsettings.cpp +++ b/plugins/channelrx/demodwfm/wfmdemodsettings.cpp @@ -24,10 +24,9 @@ #include "wfmdemodsettings.h" -const int WFMDemodSettings::m_rfBW[] = { - 12500, 25000, 40000, 60000, 75000, 80000, 100000, 125000, 140000, 160000, 180000, 200000, 220000, 250000 -}; -const int WFMDemodSettings::m_nbRFBW = 14; +const int WFMDemodSettings::m_rfBWMin = 10000; +const int WFMDemodSettings::m_rfBWMax = 300000; +const int WFMDemodSettings::m_rfBWDigits = 6; WFMDemodSettings::WFMDemodSettings() : m_channelMarker(0) @@ -38,7 +37,7 @@ WFMDemodSettings::WFMDemodSettings() : void WFMDemodSettings::resetToDefaults() { m_inputFrequencyOffset = 0; - m_rfBandwidth = getRFBW(5); + m_rfBandwidth = 80000; m_afBandwidth = 15000; m_volume = 2.0; m_squelch = -60.0; @@ -57,7 +56,7 @@ QByteArray WFMDemodSettings::serialize() const { SimpleSerializer s(1); s.writeS32(1, m_inputFrequencyOffset); - s.writeS32(2, getRFBWIndex(m_rfBandwidth)); + s.writeS32(2, m_rfBandwidth); s.writeS32(3, m_afBandwidth/1000.0); s.writeS32(4, m_volume*10.0); s.writeS32(5, m_squelch); @@ -98,7 +97,7 @@ bool WFMDemodSettings::deserialize(const QByteArray& data) d.readS32(1, &tmp, 0); m_inputFrequencyOffset = tmp; d.readS32(2, &tmp, 4); - m_rfBandwidth = getRFBW(tmp); + m_rfBandwidth = tmp < m_rfBWMin ? m_rfBWMin : tmp > m_rfBWMax ? m_rfBWMax : tmp; d.readS32(3, &tmp, 3); m_afBandwidth = tmp * 1000.0; d.readS32(4, &tmp, 20); @@ -138,28 +137,3 @@ bool WFMDemodSettings::deserialize(const QByteArray& data) return false; } } - -int WFMDemodSettings::getRFBW(int index) -{ - if (index < 0) { - return m_rfBW[0]; - } else if (index < m_nbRFBW) { - return m_rfBW[index]; - } else { - return m_rfBW[m_nbRFBW-1]; - } -} - -int WFMDemodSettings::getRFBWIndex(int rfbw) -{ - for (int i = 0; i < m_nbRFBW; i++) - { - if (rfbw <= m_rfBW[i]) - { - return i; - } - } - - return m_nbRFBW-1; -} - diff --git a/plugins/channelrx/demodwfm/wfmdemodsettings.h b/plugins/channelrx/demodwfm/wfmdemodsettings.h index 47c8c1d32..e0a4d1389 100644 --- a/plugins/channelrx/demodwfm/wfmdemodsettings.h +++ b/plugins/channelrx/demodwfm/wfmdemodsettings.h @@ -42,17 +42,15 @@ struct WFMDemodSettings Serializable *m_channelMarker; - static const int m_nbRFBW; - static const int m_rfBW[]; + static const int m_rfBWMin; + static const int m_rfBWMax; + static const int m_rfBWDigits; WFMDemodSettings(); void resetToDefaults(); void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; } QByteArray serialize() const; bool deserialize(const QByteArray& data); - - static int getRFBW(int index); - static int getRFBWIndex(int rfbw); }; #endif /* PLUGINS_CHANNELRX_DEMODWFM_WFMDEMODSETTINGS_H_ */