From e23fa13d363eb5febec97bb4325476a7e027f8d2 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 18 May 2017 00:21:48 +0200 Subject: [PATCH] NFM modulator: use ValueDialZ for channel delta frequency value dial --- plugins/channeltx/modnfm/nfmmodgui.cpp | 26 +++++--------------- plugins/channeltx/modnfm/nfmmodgui.h | 3 +-- plugins/channeltx/modnfm/nfmmodgui.ui | 34 +++++++++++--------------- 3 files changed, 21 insertions(+), 42 deletions(-) diff --git a/plugins/channeltx/modnfm/nfmmodgui.cpp b/plugins/channeltx/modnfm/nfmmodgui.cpp index 967702890..57c1acee7 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.cpp +++ b/plugins/channeltx/modnfm/nfmmodgui.cpp @@ -211,24 +211,9 @@ void NFMModGUI::handleSourceMessages() } } -void NFMModGUI::on_deltaMinus_toggled(bool minus) +void NFMModGUI::on_deltaFrequency_changed(qint64 value) { - int deltaFrequency = m_channelMarker.getCenterFrequency(); - bool minusDelta = (deltaFrequency < 0); - - if (minus ^ minusDelta) // sign change - { - m_channelMarker.setCenterFrequency(-deltaFrequency); - } -} - -void NFMModGUI::on_deltaFrequency_changed(quint64 value) -{ - if (ui->deltaMinus->isChecked()) { - m_channelMarker.setCenterFrequency(-value); - } else { - m_channelMarker.setCenterFrequency(value); - } + m_channelMarker.setCenterFrequency(value); } void NFMModGUI::on_rfBW_currentIndexChanged(int index) @@ -410,7 +395,9 @@ NFMModGUI::NFMModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* pa connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); - 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); //m_channelMarker = new ChannelMarker(this); m_channelMarker.setColor(Qt::red); @@ -468,8 +455,7 @@ void NFMModGUI::applySettings() 48000, m_channelMarker.getCenterFrequency()); - ui->deltaFrequency->setValue(abs(m_channelMarker.getCenterFrequency())); - ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0); + ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); m_nfmMod->configure(m_nfmMod->getInputMessageQueue(), m_rfBW[ui->rfBW->currentIndex()], diff --git a/plugins/channeltx/modnfm/nfmmodgui.h b/plugins/channeltx/modnfm/nfmmodgui.h index 4cbe059cc..7a638bb97 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.h +++ b/plugins/channeltx/modnfm/nfmmodgui.h @@ -59,8 +59,7 @@ private slots: void viewChanged(); void handleSourceMessages(); - 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_fmDev_valueChanged(int value); diff --git a/plugins/channeltx/modnfm/nfmmodgui.ui b/plugins/channeltx/modnfm/nfmmodgui.ui index 8a378b12a..72755746c 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.ui +++ b/plugins/channeltx/modnfm/nfmmodgui.ui @@ -76,26 +76,20 @@ - - - Frequency shift direction + + + + 16 + 0 + - ... - - - - :/plus.png - :/minus.png - - - - true + Df - + 0 @@ -750,12 +744,6 @@
gui/rollupwidget.h
1 - - ValueDial - QWidget -
gui/valuedial.h
- 1 -
LevelMeterVU QWidget @@ -773,6 +761,12 @@
gui/cwkeyergui.h
1
+ + ValueDialZ + QWidget +
gui/valuedialz.h
+ 1 +