From ba729a58ca7c8bc5bffcab42b96c734ce474a85a Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 18 May 2017 00:01:46 +0200 Subject: [PATCH] WFM demod: use ValueDialZ for channel delta frequency value dial --- plugins/channelrx/demodwfm/wfmdemodgui.cpp | 30 ++++--------------- plugins/channelrx/demodwfm/wfmdemodgui.h | 3 +- plugins/channelrx/demodwfm/wfmdemodgui.ui | 34 +++++++++------------- 3 files changed, 21 insertions(+), 46 deletions(-) diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.cpp b/plugins/channelrx/demodwfm/wfmdemodgui.cpp index 420bf4feb..b21346729 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.cpp +++ b/plugins/channelrx/demodwfm/wfmdemodgui.cpp @@ -145,27 +145,9 @@ void WFMDemodGUI::viewChanged() applySettings(); } -void WFMDemodGUI::on_deltaMinus_toggled(bool minus) +void WFMDemodGUI::on_deltaFrequency_changed(qint64 value) { - int deltaFrequency = m_channelMarker.getCenterFrequency(); - bool minusDelta = (deltaFrequency < 0); - - if (minus ^ minusDelta) // sign change - { - m_channelMarker.setCenterFrequency(-deltaFrequency); - } -} - -void WFMDemodGUI::on_deltaFrequency_changed(quint64 value) -{ - if (ui->deltaMinus->isChecked()) - { - m_channelMarker.setCenterFrequency(-value); - } - else - { - m_channelMarker.setCenterFrequency(value); - } + m_channelMarker.setCenterFrequency(value); } void WFMDemodGUI::on_rfBW_currentIndexChanged(int index) @@ -222,8 +204,9 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg m_channelPowerDbAvg(20,0) { ui->setupUi(this); - ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); - ui->deltaFrequency->setValueRange(7, 0U, 9999999U); + ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); + ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); + ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); setAttribute(Qt::WA_DeleteOnClose, true); @@ -287,8 +270,7 @@ void WFMDemodGUI::applySettings() requiredBW(m_rfBW[ui->rfBW->currentIndex()]), // TODO: this is where requested sample rate is specified m_channelMarker.getCenterFrequency()); - ui->deltaFrequency->setValue(abs(m_channelMarker.getCenterFrequency())); - ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0); + ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); m_wfmDemod->configure(m_wfmDemod->getInputMessageQueue(), m_rfBW[ui->rfBW->currentIndex()], diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.h b/plugins/channelrx/demodwfm/wfmdemodgui.h index 238987bcf..a06c550ce 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.h +++ b/plugins/channelrx/demodwfm/wfmdemodgui.h @@ -39,8 +39,7 @@ public: private slots: void viewChanged(); - void on_deltaFrequency_changed(quint64 value); - void on_deltaMinus_toggled(bool minus); + void on_deltaFrequency_changed(qint64 value); void on_rfBW_currentIndexChanged(int index); void on_afBW_valueChanged(int value); void on_volume_valueChanged(int value); diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.ui b/plugins/channelrx/demodwfm/wfmdemodgui.ui index 5755128a2..1ddd0c1f5 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.ui +++ b/plugins/channelrx/demodwfm/wfmdemodgui.ui @@ -79,26 +79,20 @@ - - - Frequency shift direction + + + + 16 + 0 + - ... - - - - :/plus.png - :/minus.png - - - - true + Df - + 0 @@ -407,18 +401,18 @@
gui/rollupwidget.h
1 - - ValueDial - QWidget -
gui/valuedial.h
- 1 -
LevelMeterSignalDB QWidget
gui/levelmeter.h
1
+ + ValueDialZ + QWidget +
gui/valuedialz.h
+ 1 +