diff --git a/plugins/samplesource/sdrplay/sdrplaygui.cpp b/plugins/samplesource/sdrplay/sdrplaygui.cpp
index baf644718..8a92319a7 100644
--- a/plugins/samplesource/sdrplay/sdrplaygui.cpp
+++ b/plugins/samplesource/sdrplay/sdrplaygui.cpp
@@ -223,28 +223,30 @@ void SDRPlayGui::displaySettings()
if (m_gains.size() > 0)
{
- int dist = abs(m_settings.m_gain - m_gains[0]);
+ int dist = abs(m_settings.m_tunerGain - m_gains[0]);
int pos = 0;
for (uint i = 1; i < m_gains.size(); i++)
{
- if (abs(m_settings.m_gain - m_gains[i]) < dist)
+ if (abs(m_settings.m_tunerGain - m_gains[i]) < dist)
{
- dist = abs(m_settings.m_gain - m_gains[i]);
+ dist = abs(m_settings.m_tunerGain - m_gains[i]);
pos = i;
}
}
- ui->gainText->setText(tr("%1.%2").arg(m_gains[pos] / 10).arg(abs(m_gains[pos] % 10)));
- ui->gain->setMaximum(m_gains.size() - 1);
- ui->gain->setEnabled(true);
- ui->gain->setValue(pos);
+ QString gainText;
+ gainText.sprintf("%03d", m_gains[pos]);
+ ui->gainTunerText->setText(gainText);
+ ui->gainTuner->setMaximum(m_gains.size() - 1);
+ ui->gainTuner->setEnabled(true);
+ ui->gainTuner->setValue(pos);
}
else
{
- ui->gain->setMaximum(0);
- ui->gain->setEnabled(false);
- ui->gain->setValue(0);
+ ui->gainTuner->setMaximum(0);
+ ui->gainTuner->setEnabled(false);
+ ui->gainTuner->setValue(0);
}
}
@@ -361,7 +363,12 @@ void SDRPlayGui::on_fcPos_currentIndexChanged(int index)
sendSettings();
}
-void SDRPlayGui::on_gain_valueChanged(int value)
+void SDRPlayGui::on_gainTunerOn_toggled(bool checked)
+{
+ // TODO
+}
+
+void SDRPlayGui::on_gainTuner_valueChanged(int value)
{
if (value > (int)m_gains.size())
{
@@ -369,12 +376,34 @@ void SDRPlayGui::on_gain_valueChanged(int value)
}
int gain = m_gains[value];
- ui->gainText->setText(tr("%1.%2").arg(gain / 10).arg(abs(gain % 10)));
- m_settings.m_gain = gain;
+ QString gainText;
+ gainText.sprintf("%03d", gain);
+ ui->gainTunerText->setText(gainText);
+ m_settings.m_tunerGain = gain;
sendSettings();
}
+void SDRPlayGui::on_gainManualOn_toggled(bool checked)
+{
+ // TODO
+}
+
+void SDRPlayGui::on_gainLNA_toggled(bool checked)
+{
+ // TODO
+}
+
+void SDRPlayGui::on_gainMixer_toggled(bool checked)
+{
+ // TODO
+}
+
+void SDRPlayGui::on_gainBaseband_valueChanged(int value)
+{
+ // TODO
+}
+
void SDRPlayGui::on_startStop_toggled(bool checked)
{
if (checked)
diff --git a/plugins/samplesource/sdrplay/sdrplaygui.h b/plugins/samplesource/sdrplay/sdrplaygui.h
index 5bd684b77..e4cb21363 100644
--- a/plugins/samplesource/sdrplay/sdrplaygui.h
+++ b/plugins/samplesource/sdrplay/sdrplaygui.h
@@ -83,7 +83,12 @@ private slots:
void on_ifFrequency_currentIndexChanged(int index);
void on_decim_currentIndexChanged(int index);
void on_fcPos_currentIndexChanged(int index);
- void on_gain_valueChanged(int value);
+ void on_gainTunerOn_toggled(bool checked);
+ void on_gainTuner_valueChanged(int value);
+ void on_gainManualOn_toggled(bool checked);
+ void on_gainLNA_toggled(bool checked);
+ void on_gainMixer_toggled(bool checked);
+ void on_gainBaseband_valueChanged(int value);
void on_startStop_toggled(bool checked);
void on_record_toggled(bool checked);
};
diff --git a/plugins/samplesource/sdrplay/sdrplaygui.ui b/plugins/samplesource/sdrplay/sdrplaygui.ui
index 92889f06b..f31bf98b0 100644
--- a/plugins/samplesource/sdrplay/sdrplaygui.ui
+++ b/plugins/samplesource/sdrplay/sdrplaygui.ui
@@ -35,7 +35,16 @@
3
-
+
+ 2
+
+
+ 2
+
+
+ 2
+
+
2
-
@@ -521,47 +530,6 @@
3
-
-
-
-
- Tuner gain
-
-
- 0
-
-
- 0
-
-
- 1
-
-
- 0
-
-
- Qt::Horizontal
-
-
-
- -
-
-
-
- 40
- 0
-
-
-
-
-
-
- 000
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
-
@@ -569,6 +537,106 @@
+ -
+
+
+ Use global tuner gain
+
+
+
+
+
+
+ -
+
+
+ LNA toggle
+
+
+ LNA
+
+
+
+ -
+
+
+
+ 24
+ 24
+
+
+
+ Tuner gain in step units
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ -
+
+
+ Use individual LNA, Mixer and Baseband gains
+
+
+
+
+
+
+ -
+
+
+ Mixer amplifier toggle
+
+
+ MIX
+
+
+
+ -
+
+
+
+ 24
+ 24
+
+
+
+ Baseband gain (dB)
+
+
+
+ -
+
+
+ Current tuner gain step unit
+
+
+ 000
+
+
+
+ -
+
+
+ Baseband amplifier gain in dB
+
+
+ 00
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
-
diff --git a/plugins/samplesource/sdrplay/sdrplayinput.cpp b/plugins/samplesource/sdrplay/sdrplayinput.cpp
index cb74d9073..ed913c679 100644
--- a/plugins/samplesource/sdrplay/sdrplayinput.cpp
+++ b/plugins/samplesource/sdrplay/sdrplayinput.cpp
@@ -267,13 +267,13 @@ bool SDRPlayInput::applySettings(const SDRPlaySettings& settings, bool force)
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
}
- if ((m_settings.m_gain != settings.m_gain) || force)
+ if ((m_settings.m_tunerGain != settings.m_tunerGain) || force)
{
- m_settings.m_gain = settings.m_gain;
+ m_settings.m_tunerGain = settings.m_tunerGain;
if(m_dev != 0)
{
- int r = mirisdr_set_tuner_gain(m_dev, m_settings.m_gain);
+ int r = mirisdr_set_tuner_gain(m_dev, m_settings.m_tunerGain);
if (r < 0)
{
diff --git a/plugins/samplesource/sdrplay/sdrplaysettings.cpp b/plugins/samplesource/sdrplay/sdrplaysettings.cpp
index a8a441baf..19a88b0cc 100644
--- a/plugins/samplesource/sdrplay/sdrplaysettings.cpp
+++ b/plugins/samplesource/sdrplay/sdrplaysettings.cpp
@@ -27,7 +27,7 @@ SDRPlaySettings::SDRPlaySettings()
void SDRPlaySettings::resetToDefaults()
{
m_centerFrequency = 7040*1000;
- m_gain = 0;
+ m_tunerGain = 0;
m_LOppmTenths = 0;
m_frequencyBandIndex = 0;
m_ifFrequencyIndex = 0;
@@ -46,7 +46,7 @@ QByteArray SDRPlaySettings::serialize() const
s.writeS32(1, m_LOppmTenths);
s.writeU32(2, m_frequencyBandIndex);
s.writeU32(3, m_ifFrequencyIndex);
- s.writeS32(4, m_gain);
+ s.writeS32(4, m_tunerGain);
s.writeU32(5, m_bandwidthIndex);
s.writeU32(6, m_devSampleRateIndex);
s.writeU32(7, m_log2Decim);
@@ -74,7 +74,7 @@ bool SDRPlaySettings::deserialize(const QByteArray& data)
d.readS32(1, &m_LOppmTenths, 0);
d.readU32(2, &m_frequencyBandIndex, 0);
d.readU32(3, &m_ifFrequencyIndex, 0);
- d.readS32(4, &m_gain, 0);
+ d.readS32(4, &m_tunerGain, 0);
d.readU32(5, &m_bandwidthIndex, 0);
d.readU32(6, &m_devSampleRateIndex, 0);
d.readU32(7, &m_log2Decim, 0);
diff --git a/plugins/samplesource/sdrplay/sdrplaysettings.h b/plugins/samplesource/sdrplay/sdrplaysettings.h
index 46bc95506..26aa2ec76 100644
--- a/plugins/samplesource/sdrplay/sdrplaysettings.h
+++ b/plugins/samplesource/sdrplay/sdrplaysettings.h
@@ -28,7 +28,7 @@ struct SDRPlaySettings {
} fcPos_t;
uint64_t m_centerFrequency;
- qint32 m_gain;
+ qint32 m_tunerGain;
int32_t m_LOppmTenths;
uint32_t m_frequencyBandIndex;
uint32_t m_ifFrequencyIndex;