From 9c9c74d24d38c64801aea93c070067f89b4f0816 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 17 May 2017 23:57:54 +0200 Subject: [PATCH] SSB demod: use ValueDialZ for channel delta frequency value dial --- plugins/channelrx/demodssb/ssbdemodgui.cpp | 29 ++++-------------- plugins/channelrx/demodssb/ssbdemodgui.h | 3 +- plugins/channelrx/demodssb/ssbdemodgui.ui | 34 +++++++++------------- 3 files changed, 21 insertions(+), 45 deletions(-) diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index ba83eeeac..7d3a077a2 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -146,17 +146,6 @@ void SSBDemodGUI::viewChanged() applySettings(); } -void SSBDemodGUI::on_deltaMinus_toggled(bool minus) -{ - int deltaFrequency = m_channelMarker.getCenterFrequency(); - bool minusDelta = (deltaFrequency < 0); - - if (minus ^ minusDelta) // sign change - { - m_channelMarker.setCenterFrequency(-deltaFrequency); - } -} - void SSBDemodGUI::on_audioBinaural_toggled(bool binaural) { m_audioBinaural = binaural; @@ -200,16 +189,9 @@ void SSBDemodGUI::on_dsb_toggled(bool dsb) setNewRate(m_spanLog2); } -void SSBDemodGUI::on_deltaFrequency_changed(quint64 value) +void SSBDemodGUI::on_deltaFrequency_changed(qint64 value) { - if (ui->deltaMinus->isChecked()) - { - m_channelMarker.setCenterFrequency(-value); - } - else - { - m_channelMarker.setCenterFrequency(value); - } + m_channelMarker.setCenterFrequency(value); } void SSBDemodGUI::on_BW_valueChanged(int value) @@ -346,7 +328,9 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); - ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); + 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); ui->glSpectrum->setCenterFrequency(m_rate/2); @@ -465,8 +449,7 @@ void SSBDemodGUI::applySettings() if (m_doApplySettings) { setTitleColor(m_channelMarker.getColor()); - ui->deltaFrequency->setValue(abs(m_channelMarker.getCenterFrequency())); - ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0); + ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); m_channelizer->configure(m_channelizer->getInputMessageQueue(), 48000, diff --git a/plugins/channelrx/demodssb/ssbdemodgui.h b/plugins/channelrx/demodssb/ssbdemodgui.h index ac8519bbb..d4b7394b1 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.h +++ b/plugins/channelrx/demodssb/ssbdemodgui.h @@ -41,8 +41,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_audioBinaural_toggled(bool binaural); void on_audioFlipChannels_toggled(bool flip); void on_dsb_toggled(bool dsb); diff --git a/plugins/channelrx/demodssb/ssbdemodgui.ui b/plugins/channelrx/demodssb/ssbdemodgui.ui index 7f6ba63bd..d66c81c44 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.ui +++ b/plugins/channelrx/demodssb/ssbdemodgui.ui @@ -73,26 +73,20 @@ - - - Frequency shift direction + + + + 16 + 0 + - ... - - - - :/plus.png - :/minus.png - - - - true + Df - + 0 @@ -534,12 +528,6 @@
gui/rollupwidget.h
1 - - ValueDial - QWidget -
gui/valuedial.h
- 1 -
LevelMeterSignalDB QWidget @@ -558,6 +546,12 @@
gui/glspectrumgui.h
1
+ + ValueDialZ + QWidget +
gui/valuedialz.h
+ 1 +