1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-19 06:41:47 -05:00

SSB demod: use ValueDialZ for channel delta frequency value dial

This commit is contained in:
f4exb 2017-05-17 23:57:54 +02:00
parent 1899ca788c
commit 9c9c74d24d
3 changed files with 21 additions and 45 deletions

View File

@ -146,17 +146,6 @@ void SSBDemodGUI::viewChanged()
applySettings(); applySettings();
} }
void SSBDemodGUI::on_deltaMinus_toggled(bool minus)
{
int deltaFrequency = m_channelMarker.getCenterFrequency();
bool minusDelta = (deltaFrequency < 0);
if (minus ^ minusDelta) // sign change
{
m_channelMarker.setCenterFrequency(-deltaFrequency);
}
}
void SSBDemodGUI::on_audioBinaural_toggled(bool binaural) void SSBDemodGUI::on_audioBinaural_toggled(bool binaural)
{ {
m_audioBinaural = binaural; m_audioBinaural = binaural;
@ -200,16 +189,9 @@ void SSBDemodGUI::on_dsb_toggled(bool dsb)
setNewRate(m_spanLog2); setNewRate(m_spanLog2);
} }
void SSBDemodGUI::on_deltaFrequency_changed(quint64 value) void SSBDemodGUI::on_deltaFrequency_changed(qint64 value)
{ {
if (ui->deltaMinus->isChecked())
{
m_channelMarker.setCenterFrequency(-value);
}
else
{
m_channelMarker.setCenterFrequency(value); m_channelMarker.setCenterFrequency(value);
}
} }
void SSBDemodGUI::on_BW_valueChanged(int value) void SSBDemodGUI::on_BW_valueChanged(int value)
@ -346,7 +328,9 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addThreadedSink(m_threadedChannelizer);
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);
ui->glSpectrum->setCenterFrequency(m_rate/2); ui->glSpectrum->setCenterFrequency(m_rate/2);
@ -465,8 +449,7 @@ void SSBDemodGUI::applySettings()
if (m_doApplySettings) if (m_doApplySettings)
{ {
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());
ui->deltaFrequency->setValue(abs(m_channelMarker.getCenterFrequency())); ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0);
m_channelizer->configure(m_channelizer->getInputMessageQueue(), m_channelizer->configure(m_channelizer->getInputMessageQueue(),
48000, 48000,

View File

@ -41,8 +41,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_audioBinaural_toggled(bool binaural); void on_audioBinaural_toggled(bool binaural);
void on_audioFlipChannels_toggled(bool flip); void on_audioFlipChannels_toggled(bool flip);
void on_dsb_toggled(bool dsb); void on_dsb_toggled(bool dsb);

View File

@ -73,26 +73,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>
@ -534,12 +528,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>
@ -558,6 +546,12 @@
<header>gui/glspectrumgui.h</header> <header>gui/glspectrumgui.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"/>