1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

SSB demod: fixed span slider aspect

This commit is contained in:
f4exb 2018-04-27 06:59:36 +02:00
parent 45aa323cf6
commit 34ff36926e
4 changed files with 40 additions and 25 deletions

View File

@ -85,7 +85,7 @@ bool SSBDemodGUI::handleMessage(const Message& message)
if (DSPConfigureAudio::match(message))
{
qDebug("SSBDemodGUI::handleMessage: DSPConfigureAudio: %d", m_ssbDemod->getAudioSampleRate());
applyBandwidths(); // will update spectrum details with new sample rate
applyBandwidths(5 - ui->spanLog2->value()); // will update spectrum details with new sample rate
return true;
}
else
@ -136,7 +136,7 @@ void SSBDemodGUI::on_audioFlipChannels_toggled(bool flip)
void SSBDemodGUI::on_dsb_toggled(bool dsb)
{
ui->flipSidebands->setEnabled(!dsb);
applyBandwidths();
applyBandwidths(5 - ui->spanLog2->value());
}
void SSBDemodGUI::on_deltaFrequency_changed(qint64 value)
@ -148,12 +148,12 @@ void SSBDemodGUI::on_deltaFrequency_changed(qint64 value)
void SSBDemodGUI::on_BW_valueChanged(int value __attribute__((unused)))
{
applyBandwidths();
applyBandwidths(5 - ui->spanLog2->value());
}
void SSBDemodGUI::on_lowCut_valueChanged(int value __attribute__((unused)))
{
applyBandwidths();
applyBandwidths(5 - ui->spanLog2->value());
}
void SSBDemodGUI::on_volume_valueChanged(int value)
@ -207,11 +207,11 @@ void SSBDemodGUI::on_audioMute_toggled(bool checked)
void SSBDemodGUI::on_spanLog2_valueChanged(int value)
{
if ((value < 1) || (value > 5)) {
if ((value < 0) || (value > 4)) {
return;
}
applyBandwidths();
applyBandwidths(5 - ui->spanLog2->value());
}
void SSBDemodGUI::on_flipSidebands_clicked(bool checked __attribute__((unused)))
@ -311,7 +311,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_iconDSBLSB.addPixmap(QPixmap("://lsb.png"), QIcon::Normal, QIcon::Off);
displaySettings();
applyBandwidths(true); // does applySettings(true)
applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
}
SSBDemodGUI::~SSBDemodGUI()
@ -342,10 +342,10 @@ void SSBDemodGUI::applySettings(bool force)
}
}
void SSBDemodGUI::applyBandwidths(bool force)
void SSBDemodGUI::applyBandwidths(int spanLog2, bool force)
{
bool dsb = ui->dsb->isChecked();
int spanLog2 = ui->spanLog2->value();
//int spanLog2 = ui->spanLog2->value();
m_spectrumRate = m_ssbDemod->getAudioSampleRate() / (1<<spanLog2);
int bw = ui->BW->value();
int lw = ui->lowCut->value();
@ -493,7 +493,7 @@ void SSBDemodGUI::displaySettings()
ui->BW->blockSignals(true);
ui->dsb->setChecked(m_settings.m_dsb);
ui->spanLog2->setValue(m_settings.m_spanLog2);
ui->spanLog2->setValue(5 - m_settings.m_spanLog2);
ui->BW->setValue(m_settings.m_rfBandwidth / 100.0);
QString s = QString::number(m_settings.m_rfBandwidth/1000.0, 'f', 1);

View File

@ -70,7 +70,7 @@ private:
bool blockApplySettings(bool block);
void applySettings(bool force = false);
void applyBandwidths(bool force = false);
void applyBandwidths(int spanLog2, bool force = false);
void displaySettings();
void displayAGCPowerThreshold(int value);

View File

@ -274,11 +274,20 @@
</item>
<item>
<layout class="QHBoxLayout" name="spanLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="spanLabel">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Span</string>
</property>
@ -290,33 +299,39 @@
<string>Demod frequency span</string>
</property>
<property name="minimum">
<number>1</number>
<number>0</number>
</property>
<property name="maximum">
<number>5</number>
<number>4</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>3</number>
<number>2</number>
</property>
<property name="sliderPosition">
<number>3</number>
<number>2</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>true</bool>
</property>
<property name="invertedControls">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="spanText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>6.0k</string>
</property>

View File

@ -8,7 +8,7 @@
const PluginDescriptor SSBPlugin::m_pluginDescriptor = {
QString("SSB Demodulator"),
QString("3.14.4"),
QString("3.14.5"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,