1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

BFM demod: use ValueDialZ for channel delta frequency value dial

This commit is contained in:
f4exb 2017-05-17 23:52:10 +02:00
parent 14b7cb093e
commit 1899ca788c
3 changed files with 21 additions and 46 deletions

View File

@ -193,27 +193,9 @@ void BFMDemodGUI::viewChanged()
applySettings();
}
void BFMDemodGUI::on_deltaMinus_toggled(bool minus)
void BFMDemodGUI::on_deltaFrequency_changed(qint64 value)
{
int deltaFrequency = m_channelMarker.getCenterFrequency();
bool minusDelta = (deltaFrequency < 0);
if (minus ^ minusDelta) // sign change
{
m_channelMarker.setCenterFrequency(-deltaFrequency);
}
}
void BFMDemodGUI::on_deltaFrequency_changed(quint64 value)
{
if (ui->deltaMinus->isChecked())
{
m_channelMarker.setCenterFrequency(-value);
}
else
{
m_channelMarker.setCenterFrequency(value);
}
m_channelMarker.setCenterFrequency(value);
}
void BFMDemodGUI::on_rfBW_valueChanged(int value)
@ -372,8 +354,9 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
m_rate(625000)
{
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);
@ -445,8 +428,7 @@ void BFMDemodGUI::applySettings()
requiredBW(m_rfBW[ui->rfBW->value()]), // 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_bfmDemod->configure(m_bfmDemod->getInputMessageQueue(),
m_rfBW[ui->rfBW->value()],

View File

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

View File

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