1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-16 13:21:50 -05:00

WFM demod: use ValueDialZ for channel delta frequency value dial

This commit is contained in:
f4exb 2017-05-18 00:01:46 +02:00
parent 9c9c74d24d
commit ba729a58ca
3 changed files with 21 additions and 46 deletions

View File

@ -145,27 +145,9 @@ void WFMDemodGUI::viewChanged()
applySettings(); 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) void WFMDemodGUI::on_rfBW_currentIndexChanged(int index)
@ -222,8 +204,9 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
m_channelPowerDbAvg(20,0) m_channelPowerDbAvg(20,0)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->deltaFrequency->setValueRange(7, 0U, 9999999U); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
setAttribute(Qt::WA_DeleteOnClose, true); 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 requiredBW(m_rfBW[ui->rfBW->currentIndex()]), // TODO: this is where requested sample rate is specified
m_channelMarker.getCenterFrequency()); m_channelMarker.getCenterFrequency());
ui->deltaFrequency->setValue(abs(m_channelMarker.getCenterFrequency())); ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0);
m_wfmDemod->configure(m_wfmDemod->getInputMessageQueue(), m_wfmDemod->configure(m_wfmDemod->getInputMessageQueue(),
m_rfBW[ui->rfBW->currentIndex()], m_rfBW[ui->rfBW->currentIndex()],

View File

@ -39,8 +39,7 @@ public:
private slots: private slots:
void viewChanged(); void viewChanged();
void on_deltaFrequency_changed(quint64 value); void on_deltaFrequency_changed(qint64 value);
void on_deltaMinus_toggled(bool minus);
void on_rfBW_currentIndexChanged(int index); void on_rfBW_currentIndexChanged(int index);
void on_afBW_valueChanged(int value); void on_afBW_valueChanged(int value);
void on_volume_valueChanged(int value); void on_volume_valueChanged(int value);

View File

@ -79,26 +79,20 @@
<item> <item>
<layout class="QHBoxLayout" name="deltaFreqiencyLayout"> <layout class="QHBoxLayout" name="deltaFreqiencyLayout">
<item> <item>
<widget class="QToolButton" name="deltaMinus"> <widget class="QLabel" name="deltaFrequencyLabel">
<property name="toolTip"> <property name="minimumSize">
<string>Frequency shift direction</string> <size>
<width>16</width>
<height>0</height>
</size>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>Df</string>
</property>
<property name="icon">
<iconset>
<selectedoff>:/plus.png</selectedoff>
<selectedon>:/minus.png</selectedon>
</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="ValueDial" name="deltaFrequency" native="true"> <widget class="ValueDialZ" name="deltaFrequency" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -407,18 +401,18 @@
<header>gui/rollupwidget.h</header> <header>gui/rollupwidget.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>ValueDial</class>
<extends>QWidget</extends>
<header>gui/valuedial.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>LevelMeterSignalDB</class> <class>LevelMeterSignalDB</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>gui/levelmeter.h</header> <header>gui/levelmeter.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../../../sdrbase/resources/res.qrc"/> <include location="../../../sdrbase/resources/res.qrc"/>