mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
NFM demod: GUI: use combo box for RF demodulator bandwidths
This commit is contained in:
parent
0c4d4ee385
commit
dbad815b2a
@ -55,7 +55,7 @@ void NFMDemodGUI::resetToDefaults()
|
|||||||
{
|
{
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
|
|
||||||
ui->rfBW->setValue(4);
|
ui->rfBW->setCurrentIndex(4);
|
||||||
ui->afBW->setValue(3);
|
ui->afBW->setValue(3);
|
||||||
ui->volume->setValue(20);
|
ui->volume->setValue(20);
|
||||||
ui->squelchGate->setValue(5);
|
ui->squelchGate->setValue(5);
|
||||||
@ -72,7 +72,7 @@ QByteArray NFMDemodGUI::serialize() const
|
|||||||
{
|
{
|
||||||
SimpleSerializer s(1);
|
SimpleSerializer s(1);
|
||||||
s.writeS32(1, m_channelMarker.getCenterFrequency());
|
s.writeS32(1, m_channelMarker.getCenterFrequency());
|
||||||
s.writeS32(2, ui->rfBW->value());
|
s.writeS32(2, ui->rfBW->currentIndex());
|
||||||
s.writeS32(3, ui->afBW->value());
|
s.writeS32(3, ui->afBW->value());
|
||||||
s.writeS32(4, ui->volume->value());
|
s.writeS32(4, ui->volume->value());
|
||||||
s.writeS32(5, ui->squelch->value());
|
s.writeS32(5, ui->squelch->value());
|
||||||
@ -107,7 +107,7 @@ bool NFMDemodGUI::deserialize(const QByteArray& data)
|
|||||||
d.readS32(1, &tmp, 0);
|
d.readS32(1, &tmp, 0);
|
||||||
m_channelMarker.setCenterFrequency(tmp);
|
m_channelMarker.setCenterFrequency(tmp);
|
||||||
d.readS32(2, &tmp, 4);
|
d.readS32(2, &tmp, 4);
|
||||||
ui->rfBW->setValue(tmp);
|
ui->rfBW->setCurrentIndex(tmp);
|
||||||
d.readS32(3, &tmp, 3);
|
d.readS32(3, &tmp, 3);
|
||||||
ui->afBW->setValue(tmp);
|
ui->afBW->setValue(tmp);
|
||||||
d.readS32(4, &tmp, 20);
|
d.readS32(4, &tmp, 20);
|
||||||
@ -175,10 +175,11 @@ void NFMDemodGUI::on_deltaFrequency_changed(quint64 value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NFMDemodGUI::on_rfBW_valueChanged(int value)
|
void NFMDemodGUI::on_rfBW_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
ui->rfBWText->setText(QString("%1 k").arg(m_rfBW[value] / 1000.0));
|
qDebug() << "NFMDemodGUI::on_rfBW_currentIndexChanged" << index;
|
||||||
m_channelMarker.setBandwidth(m_rfBW[value]);
|
//ui->rfBWText->setText(QString("%1 k").arg(m_rfBW[value] / 1000.0));
|
||||||
|
m_channelMarker.setBandwidth(m_rfBW[index]);
|
||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,6 +257,14 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
|
|
||||||
|
blockApplySettings(true);
|
||||||
|
ui->rfBW->clear();
|
||||||
|
for (int i = 0; i < m_nbRfBW; i++) {
|
||||||
|
ui->rfBW->addItem(QString("%1").arg(m_rfBW[i] / 1000.0, 0, 'f', 2));
|
||||||
|
}
|
||||||
|
blockApplySettings(false);
|
||||||
|
|
||||||
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
||||||
connect(this, SIGNAL(menuDoubleClickEvent()), this, SLOT(onMenuDoubleClicked()));
|
connect(this, SIGNAL(menuDoubleClickEvent()), this, SLOT(onMenuDoubleClicked()));
|
||||||
|
|
||||||
@ -320,7 +329,7 @@ void NFMDemodGUI::applySettings()
|
|||||||
ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0);
|
ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0);
|
||||||
|
|
||||||
m_nfmDemod->configure(m_nfmDemod->getInputMessageQueue(),
|
m_nfmDemod->configure(m_nfmDemod->getInputMessageQueue(),
|
||||||
m_rfBW[ui->rfBW->value()],
|
m_rfBW[ui->rfBW->currentIndex()],
|
||||||
ui->afBW->value() * 1000.0,
|
ui->afBW->value() * 1000.0,
|
||||||
ui->volume->value() / 10.0,
|
ui->volume->value() / 10.0,
|
||||||
ui->squelchGate->value(), // in 10ths of ms
|
ui->squelchGate->value(), // in 10ths of ms
|
||||||
|
@ -40,7 +40,7 @@ private slots:
|
|||||||
void viewChanged();
|
void viewChanged();
|
||||||
void on_deltaFrequency_changed(quint64 value);
|
void on_deltaFrequency_changed(quint64 value);
|
||||||
void on_deltaMinus_toggled(bool minus);
|
void on_deltaMinus_toggled(bool minus);
|
||||||
void on_rfBW_valueChanged(int value);
|
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);
|
||||||
void on_squelchGate_valueChanged(int value);
|
void on_squelchGate_valueChanged(int value);
|
||||||
|
@ -153,37 +153,34 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSlider" name="rfBW">
|
<widget class="QComboBox" name="rfBW">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Demodulator (RF) bandwidth</string>
|
<string>RF demodulator bandwidth (kHz)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="currentIndex">
|
||||||
<number>8</number>
|
<number>-1</number>
|
||||||
</property>
|
|
||||||
<property name="pageStep">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="rfBWText">
|
<widget class="QLabel" name="rfBWUnitText">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>10</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>12.5 k</string>
|
<string>k</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -200,6 +197,19 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="afLabel">
|
<widget class="QLabel" name="afLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -216,7 +226,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Audio bandwidth</string>
|
<string>Audio bandwidth (kHz)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
@ -270,6 +280,9 @@
|
|||||||
<height>24</height>
|
<height>24</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Sound volume</string>
|
||||||
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>100</number>
|
<number>100</number>
|
||||||
</property>
|
</property>
|
||||||
@ -295,6 +308,9 @@
|
|||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Sound volume</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>2.0</string>
|
<string>2.0</string>
|
||||||
</property>
|
</property>
|
||||||
@ -331,6 +347,9 @@
|
|||||||
<height>24</height>
|
<height>24</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Squelch threshold (dB)</string>
|
||||||
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-1000</number>
|
<number>-1000</number>
|
||||||
</property>
|
</property>
|
||||||
|
Loading…
Reference in New Issue
Block a user