SDRPlay plugin: removed usless auto gain mode

pull/27/head
f4exb 2016-11-17 03:19:05 +01:00
rodzic d68b34bd88
commit b997f6ca39
6 zmienionych plików z 5 dodań i 48 usunięć

Wyświetl plik

@ -375,13 +375,6 @@ void SDRPlayGui::on_gain_valueChanged(int value)
sendSettings();
}
void SDRPlayGui::on_gainAuto_toggled(bool checked)
{
qDebug("SDRPlayGui::on_gainAuto_toggled: %s", checked ? "on" : "off");
m_settings.m_autoGain = checked;
sendSettings();
}
void SDRPlayGui::on_startStop_toggled(bool checked)
{
if (checked)

Wyświetl plik

@ -84,7 +84,6 @@ private slots:
void on_decim_currentIndexChanged(int index);
void on_fcPos_currentIndexChanged(int index);
void on_gain_valueChanged(int value);
void on_gainAuto_toggled(bool checked);
void on_startStop_toggled(bool checked);
void on_record_toggled(bool checked);
};

Wyświetl plik

@ -552,7 +552,7 @@
</size>
</property>
<property name="toolTip">
<string> </string>
<string/>
</property>
<property name="text">
<string>000</string>
@ -569,13 +569,6 @@
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="ButtonSwitch" name="gainAuto">
<property name="text">
<string>A</string>
</property>
</widget>
</item>
</layout>
</item>
<item>

Wyświetl plik

@ -253,7 +253,6 @@ bool SDRPlayInput::handleMessage(const Message& message)
bool SDRPlayInput::applySettings(const SDRPlaySettings& settings, bool force)
{
bool forwardChange = false;
bool forceManualGain = false;
QMutexLocker mutexLocker(&m_mutex);
if ((m_settings.m_dcBlock != settings.m_dcBlock) || force)
@ -268,40 +267,17 @@ bool SDRPlayInput::applySettings(const SDRPlaySettings& settings, bool force)
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
}
if ((m_settings.m_autoGain != settings.m_autoGain) || force)
if ((m_settings.m_gain != settings.m_gain) || force)
{
m_settings.m_autoGain = settings.m_autoGain;
m_settings.m_gain = settings.m_gain;
if(m_dev != 0)
{
int r = mirisdr_set_tuner_gain_mode(m_dev, m_settings.m_autoGain ? 0 : 1);
int r = mirisdr_set_tuner_gain(m_dev, m_settings.m_gain);
if (r < 0)
{
qDebug("SDRPlayInput::applySettings: could not set auto gain %s: rc: %d", m_settings.m_autoGain ? "on" : "off", r);
}
else
{
qDebug("SDRPlayInput::applySettings: auto gain set to %s", m_settings.m_autoGain ? "on" : "off");
forceManualGain = !m_settings.m_autoGain;
}
}
}
if (!m_settings.m_autoGain)
{
if ((m_settings.m_gain != settings.m_gain) || force || forceManualGain)
{
m_settings.m_gain = settings.m_gain;
if(m_dev != 0)
{
int r = mirisdr_set_tuner_gain(m_dev, m_settings.m_gain);
if (r < 0)
{
qDebug("SDRPlayInput::applySettings: could not set tuner gain()");
}
qDebug("SDRPlayInput::applySettings: could not set tuner gain()");
}
}
}

Wyświetl plik

@ -37,7 +37,6 @@ void SDRPlaySettings::resetToDefaults()
m_fcPos = FC_POS_CENTER;
m_dcBlock = false;
m_iqCorrection = false;
m_autoGain = false;
}
QByteArray SDRPlaySettings::serialize() const
@ -54,7 +53,6 @@ QByteArray SDRPlaySettings::serialize() const
s.writeS32(8, (int) m_fcPos);
s.writeBool(9, m_dcBlock);
s.writeBool(10, m_iqCorrection);
s.writeBool(11, m_autoGain);
return s.final();
}
@ -84,7 +82,6 @@ bool SDRPlaySettings::deserialize(const QByteArray& data)
m_fcPos = (fcPos_t) intval;
d.readBool(9, &m_dcBlock, false);
d.readBool(10, &m_iqCorrection, false);
d.readBool(11, &m_autoGain, false);
return true;
}

Wyświetl plik

@ -38,7 +38,6 @@ struct SDRPlaySettings {
fcPos_t m_fcPos;
bool m_dcBlock;
bool m_iqCorrection;
bool m_autoGain;
SDRPlaySettings();
void resetToDefaults();