1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 18:15:45 -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();
}
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)
{
m_audioBinaural = binaural;
@ -200,17 +189,10 @@ void SSBDemodGUI::on_dsb_toggled(bool dsb)
setNewRate(m_spanLog2);
}
void SSBDemodGUI::on_deltaFrequency_changed(quint64 value)
{
if (ui->deltaMinus->isChecked())
{
m_channelMarker.setCenterFrequency(-value);
}
else
void SSBDemodGUI::on_deltaFrequency_changed(qint64 value)
{
m_channelMarker.setCenterFrequency(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_deviceAPI->addThreadedSink(m_threadedChannelizer);
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);
ui->glSpectrum->setCenterFrequency(m_rate/2);
@ -465,8 +449,7 @@ void SSBDemodGUI::applySettings()
if (m_doApplySettings)
{
setTitleColor(m_channelMarker.getColor());
ui->deltaFrequency->setValue(abs(m_channelMarker.getCenterFrequency()));
ui->deltaMinus->setChecked(m_channelMarker.getCenterFrequency() < 0);
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
m_channelizer->configure(m_channelizer->getInputMessageQueue(),
48000,

View File

@ -41,8 +41,7 @@ public:
private slots:
void viewChanged();
void on_deltaFrequency_changed(quint64 value);
void on_deltaMinus_toggled(bool minus);
void on_deltaFrequency_changed(qint64 value);
void on_audioBinaural_toggled(bool binaural);
void on_audioFlipChannels_toggled(bool flip);
void on_dsb_toggled(bool dsb);

View File

@ -73,26 +73,20 @@
<item>
<layout class="QHBoxLayout" name="deltaFrequencyLayout">
<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>
@ -534,12 +528,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>LevelMeterSignalDB</class>
<extends>QWidget</extends>
@ -558,6 +546,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"/>