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

AM demod: use ValueDialZ for channel delta frequency value dial

This commit is contained in:
f4exb 2017-05-17 23:34:14 +02:00
parent 048ef1bf67
commit b31e0ace57
4 changed files with 22 additions and 43 deletions

View File

@ -154,25 +154,10 @@ void AMDemodGUI::viewChanged()
applySettings(); applySettings();
} }
void AMDemodGUI::on_deltaMinus_toggled(bool minus) void AMDemodGUI::on_deltaFrequency_changed(qint64 value)
{ {
int deltaFrequency = m_channelMarker.getCenterFrequency();
bool minusDelta = (deltaFrequency < 0);
if (minus ^ minusDelta) // sign change
{
m_channelMarker.setCenterFrequency(-deltaFrequency);
}
}
void AMDemodGUI::on_deltaFrequency_changed(quint64 value)
{
if (ui->deltaMinus->isChecked()) {
m_channelMarker.setCenterFrequency(-value);
} else {
m_channelMarker.setCenterFrequency(value); m_channelMarker.setCenterFrequency(value);
} }
}
void AMDemodGUI::on_bandpassEnable_toggled(bool checked) void AMDemodGUI::on_bandpassEnable_toggled(bool checked)
{ {
@ -243,7 +228,9 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget
connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
//m_channelMarker = new ChannelMarker(this); //m_channelMarker = new ChannelMarker(this);
@ -287,8 +274,7 @@ void AMDemodGUI::applySettings()
48000, 48000,
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_amDemod->configure(m_amDemod->getInputMessageQueue(), m_amDemod->configure(m_amDemod->getInputMessageQueue(),
ui->rfBW->value() * 100.0, ui->rfBW->value() * 100.0,

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_bandpassEnable_toggled(bool checked); void on_bandpassEnable_toggled(bool checked);
void on_rfBW_valueChanged(int value); void on_rfBW_valueChanged(int value);
void on_volume_valueChanged(int value); void on_volume_valueChanged(int value);

View File

@ -76,26 +76,20 @@
<item> <item>
<layout class="QHBoxLayout" name="deltaFrequencyLayout"> <layout class="QHBoxLayout" name="deltaFrequencyLayout">
<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>
@ -396,12 +390,6 @@
<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>
@ -413,6 +401,12 @@
<extends>QToolButton</extends> <extends>QToolButton</extends>
<header>gui/buttonswitch.h</header> <header>gui/buttonswitch.h</header>
</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"/>

View File

@ -189,7 +189,7 @@ void DSDDemodGUI::viewChanged()
void DSDDemodGUI::on_deltaFrequency_changed(qint64 value) void DSDDemodGUI::on_deltaFrequency_changed(qint64 value)
{ {
m_channelMarker.setCenterFrequency(-value); m_channelMarker.setCenterFrequency(value);
} }
void DSDDemodGUI::on_rfBW_valueChanged(int value) void DSDDemodGUI::on_rfBW_valueChanged(int value)