mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-29 21:42:26 -04:00
SDRPlay plugin: added option to handle global tuner gain or individual lna, mixer and baseband gains
This commit is contained in:
parent
d25e7b613e
commit
edd6ab751b
@ -143,11 +143,31 @@ bool SDRPlayGui::deserialize(const QByteArray& data)
|
|||||||
|
|
||||||
bool SDRPlayGui::handleMessage(const Message& message)
|
bool SDRPlayGui::handleMessage(const Message& message)
|
||||||
{
|
{
|
||||||
if (SDRPlayInput::MsgReportSDRPlay::match(message))
|
if (SDRPlayInput::MsgReportSDRPlayGains::match(message))
|
||||||
{
|
{
|
||||||
qDebug() << "SDRPlayGui::handleMessage: MsgReportSDRPlay";
|
qDebug() << "SDRPlayGui::handleMessage: MsgReportSDRPlayGains";
|
||||||
m_gains = ((SDRPlayInput::MsgReportSDRPlay&) message).getGains();
|
|
||||||
displaySettings();
|
SDRPlayInput::MsgReportSDRPlayGains msg = (SDRPlayInput::MsgReportSDRPlayGains&) message;
|
||||||
|
|
||||||
|
if (m_settings.m_tunerGainMode)
|
||||||
|
{
|
||||||
|
ui->gainLNA->setChecked(msg.getLNAGain() != 0);
|
||||||
|
ui->gainMixer->setChecked(msg.getMixerGain() != 0);
|
||||||
|
ui->gainBaseband->setValue(msg.getBasebandGain());
|
||||||
|
|
||||||
|
QString gainText;
|
||||||
|
gainText.sprintf("%02d", msg.getBasebandGain());
|
||||||
|
ui->gainBasebandText->setText(gainText);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->gainTuner->setValue(msg.getTunerGain());
|
||||||
|
|
||||||
|
QString gainText;
|
||||||
|
gainText.sprintf("%03d", msg.getTunerGain());
|
||||||
|
ui->gainTunerText->setText(gainText);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -221,33 +241,7 @@ void SDRPlayGui::displaySettings()
|
|||||||
ui->decim->setCurrentIndex(m_settings.m_log2Decim);
|
ui->decim->setCurrentIndex(m_settings.m_log2Decim);
|
||||||
ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
|
ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
|
||||||
|
|
||||||
if (m_gains.size() > 0)
|
ui->gainTunerOn->setChecked(true);
|
||||||
{
|
|
||||||
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_tunerGain - m_gains[i]) < dist)
|
|
||||||
{
|
|
||||||
dist = abs(m_settings.m_tunerGain - m_gains[i]);
|
|
||||||
pos = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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->gainTuner->setMaximum(0);
|
|
||||||
ui->gainTuner->setEnabled(false);
|
|
||||||
ui->gainTuner->setValue(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDRPlayGui::sendSettings()
|
void SDRPlayGui::sendSettings()
|
||||||
@ -365,17 +359,19 @@ void SDRPlayGui::on_fcPos_currentIndexChanged(int index)
|
|||||||
|
|
||||||
void SDRPlayGui::on_gainTunerOn_toggled(bool checked)
|
void SDRPlayGui::on_gainTunerOn_toggled(bool checked)
|
||||||
{
|
{
|
||||||
// TODO
|
qDebug("SDRPlayGui::on_gainTunerOn_toggled: %s", checked ? "on" : "off");
|
||||||
|
m_settings.m_tunerGainMode = true;
|
||||||
|
ui->gainTuner->setEnabled(true);
|
||||||
|
ui->gainLNA->setEnabled(false);
|
||||||
|
ui->gainMixer->setEnabled(false);
|
||||||
|
ui->gainBaseband->setEnabled(false);
|
||||||
|
|
||||||
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDRPlayGui::on_gainTuner_valueChanged(int value)
|
void SDRPlayGui::on_gainTuner_valueChanged(int value)
|
||||||
{
|
{
|
||||||
if (value > (int)m_gains.size())
|
int gain = value;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int gain = m_gains[value];
|
|
||||||
QString gainText;
|
QString gainText;
|
||||||
gainText.sprintf("%03d", gain);
|
gainText.sprintf("%03d", gain);
|
||||||
ui->gainTunerText->setText(gainText);
|
ui->gainTunerText->setText(gainText);
|
||||||
@ -386,22 +382,37 @@ void SDRPlayGui::on_gainTuner_valueChanged(int value)
|
|||||||
|
|
||||||
void SDRPlayGui::on_gainManualOn_toggled(bool checked)
|
void SDRPlayGui::on_gainManualOn_toggled(bool checked)
|
||||||
{
|
{
|
||||||
// TODO
|
qDebug("SDRPlayGui::on_gainManualOn_toggled: %s", checked ? "on" : "off");
|
||||||
|
m_settings.m_tunerGainMode = false;
|
||||||
|
ui->gainTuner->setEnabled(false);
|
||||||
|
ui->gainLNA->setEnabled(true);
|
||||||
|
ui->gainMixer->setEnabled(true);
|
||||||
|
ui->gainBaseband->setEnabled(true);
|
||||||
|
|
||||||
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDRPlayGui::on_gainLNA_toggled(bool checked)
|
void SDRPlayGui::on_gainLNA_toggled(bool checked)
|
||||||
{
|
{
|
||||||
// TODO
|
m_settings.m_lnaOn = checked ? 1 : 0;
|
||||||
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDRPlayGui::on_gainMixer_toggled(bool checked)
|
void SDRPlayGui::on_gainMixer_toggled(bool checked)
|
||||||
{
|
{
|
||||||
// TODO
|
m_settings.m_mixerAmpOn = checked ? 1 : 0;
|
||||||
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDRPlayGui::on_gainBaseband_valueChanged(int value)
|
void SDRPlayGui::on_gainBaseband_valueChanged(int value)
|
||||||
{
|
{
|
||||||
// TODO
|
m_settings.m_basebandGain = value;
|
||||||
|
|
||||||
|
QString gainText;
|
||||||
|
gainText.sprintf("%02d", value);
|
||||||
|
ui->gainBasebandText->setText(gainText);
|
||||||
|
|
||||||
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDRPlayGui::on_startStop_toggled(bool checked)
|
void SDRPlayGui::on_startStop_toggled(bool checked)
|
||||||
|
@ -57,7 +57,6 @@ private:
|
|||||||
SDRPlaySettings m_settings;
|
SDRPlaySettings m_settings;
|
||||||
QTimer m_updateTimer;
|
QTimer m_updateTimer;
|
||||||
QTimer m_statusTimer;
|
QTimer m_statusTimer;
|
||||||
std::vector<int> m_gains;
|
|
||||||
DeviceSampleSource* m_sampleSource;
|
DeviceSampleSource* m_sampleSource;
|
||||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||||
int m_sampleRate;
|
int m_sampleRate;
|
||||||
|
@ -35,16 +35,7 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -543,7 +534,7 @@
|
|||||||
<string>Use global tuner gain</string>
|
<string>Use global tuner gain</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string>T</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -568,6 +559,12 @@
|
|||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Tuner gain in step units</string>
|
<string>Tuner gain in step units</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>102</number>
|
||||||
|
</property>
|
||||||
|
<property name="pageStep">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="5">
|
<item row="0" column="5">
|
||||||
@ -583,7 +580,7 @@
|
|||||||
<string>Use individual LNA, Mixer and Baseband gains</string>
|
<string>Use individual LNA, Mixer and Baseband gains</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string>M</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -608,6 +605,12 @@
|
|||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Baseband gain (dB)</string>
|
<string>Baseband gain (dB)</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>59</number>
|
||||||
|
</property>
|
||||||
|
<property name="pageStep">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="4">
|
<item row="0" column="4">
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include "sdrplaythread.h"
|
#include "sdrplaythread.h"
|
||||||
|
|
||||||
MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgConfigureSDRPlay, Message)
|
MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgConfigureSDRPlay, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgReportSDRPlay, Message)
|
MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgReportSDRPlayGains, Message)
|
||||||
|
|
||||||
SDRPlayInput::SDRPlayInput(DeviceSourceAPI *deviceAPI) :
|
SDRPlayInput::SDRPlayInput(DeviceSourceAPI *deviceAPI) :
|
||||||
m_deviceAPI(deviceAPI),
|
m_deviceAPI(deviceAPI),
|
||||||
@ -157,21 +157,6 @@ bool SDRPlayInput::start(int device)
|
|||||||
qDebug("SDRPlayInput::start: supported gain values: %d", numberOfGains);
|
qDebug("SDRPlayInput::start: supported gain values: %d", numberOfGains);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_gains.resize(numberOfGains);
|
|
||||||
|
|
||||||
if (mirisdr_get_tuner_gains(m_dev, &m_gains[0]) < 0)
|
|
||||||
{
|
|
||||||
qCritical("SDRPlayInput::start: error getting gain values");
|
|
||||||
stop();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qDebug() << "SDRPlayInput::start: " << m_gains.size() << "gains";
|
|
||||||
MsgReportSDRPlay *message = MsgReportSDRPlay::create(m_gains);
|
|
||||||
getOutputMessageQueueToGUI()->push(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((res = mirisdr_reset_buffer(m_dev)) < 0)
|
if ((res = mirisdr_reset_buffer(m_dev)) < 0)
|
||||||
{
|
{
|
||||||
qCritical("SDRPlayInput::start: could not reset USB EP buffers: %s", strerror(errno));
|
qCritical("SDRPlayInput::start: could not reset USB EP buffers: %s", strerror(errno));
|
||||||
@ -253,6 +238,7 @@ bool SDRPlayInput::handleMessage(const Message& message)
|
|||||||
bool SDRPlayInput::applySettings(const SDRPlaySettings& settings, bool force)
|
bool SDRPlayInput::applySettings(const SDRPlaySettings& settings, bool force)
|
||||||
{
|
{
|
||||||
bool forwardChange = false;
|
bool forwardChange = false;
|
||||||
|
bool forceGainSetting = false;
|
||||||
QMutexLocker mutexLocker(&m_mutex);
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
|
|
||||||
if ((m_settings.m_dcBlock != settings.m_dcBlock) || force)
|
if ((m_settings.m_dcBlock != settings.m_dcBlock) || force)
|
||||||
@ -267,20 +253,109 @@ bool SDRPlayInput::applySettings(const SDRPlaySettings& settings, bool force)
|
|||||||
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
|
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_settings.m_tunerGain != settings.m_tunerGain) || force)
|
if ((m_settings.m_tunerGainMode != settings.m_tunerGainMode) || force)
|
||||||
{
|
{
|
||||||
m_settings.m_tunerGain = settings.m_tunerGain;
|
m_settings.m_tunerGainMode = settings.m_tunerGainMode;
|
||||||
|
forceGainSetting = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(m_dev != 0)
|
if (m_settings.m_tunerGainMode)
|
||||||
|
{
|
||||||
|
if ((m_settings.m_tunerGain != settings.m_tunerGain) || forceGainSetting)
|
||||||
{
|
{
|
||||||
int r = mirisdr_set_tuner_gain(m_dev, m_settings.m_tunerGain);
|
m_settings.m_tunerGain = settings.m_tunerGain;
|
||||||
|
|
||||||
if (r < 0)
|
if(m_dev != 0)
|
||||||
{
|
{
|
||||||
qDebug("SDRPlayInput::applySettings: could not set tuner gain()");
|
int r = mirisdr_set_tuner_gain(m_dev, m_settings.m_tunerGain);
|
||||||
|
|
||||||
|
if (r < 0)
|
||||||
|
{
|
||||||
|
qDebug("SDRPlayInput::applySettings: could not set tuner gain");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MsgReportSDRPlayGains *message = MsgReportSDRPlayGains::create(
|
||||||
|
mirisdr_get_lna_gain(m_dev),
|
||||||
|
mirisdr_get_mixer_gain(m_dev),
|
||||||
|
mirisdr_get_baseband_gain(m_dev),
|
||||||
|
mirisdr_get_tuner_gain(m_dev)
|
||||||
|
);
|
||||||
|
getOutputMessageQueueToGUI()->push(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bool anyChange = false;
|
||||||
|
|
||||||
|
if ((m_settings.m_lnaOn != settings.m_lnaOn) || forceGainSetting)
|
||||||
|
{
|
||||||
|
if(m_dev != 0)
|
||||||
|
{
|
||||||
|
int r = mirisdr_set_lna_gain(m_dev, settings.m_lnaOn ? 0 : 1); // mirisdr_set_lna_gain takes gain reduction
|
||||||
|
|
||||||
|
if (r != 0)
|
||||||
|
{
|
||||||
|
qDebug("SDRPlayInput::applySettings: could not set LNA gain");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_settings.m_lnaOn = settings.m_lnaOn;
|
||||||
|
anyChange = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((m_settings.m_mixerAmpOn != settings.m_mixerAmpOn) || forceGainSetting)
|
||||||
|
{
|
||||||
|
if(m_dev != 0)
|
||||||
|
{
|
||||||
|
int r = mirisdr_set_mixer_gain(m_dev, settings.m_mixerAmpOn ? 0 : 1); // mirisdr_set_lna_gain takes gain reduction
|
||||||
|
|
||||||
|
if (r != 0)
|
||||||
|
{
|
||||||
|
qDebug("SDRPlayInput::applySettings: could not set mixer gain");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_settings.m_mixerAmpOn = settings.m_mixerAmpOn;
|
||||||
|
anyChange = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((m_settings.m_basebandGain != settings.m_basebandGain) || forceGainSetting)
|
||||||
|
{
|
||||||
|
if(m_dev != 0)
|
||||||
|
{
|
||||||
|
int r = mirisdr_set_baseband_gain(m_dev, settings.m_basebandGain);
|
||||||
|
|
||||||
|
if (r != 0)
|
||||||
|
{
|
||||||
|
qDebug("SDRPlayInput::applySettings: could not set mixer gain");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_settings.m_basebandGain = settings.m_basebandGain;
|
||||||
|
anyChange = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (anyChange)
|
||||||
|
{
|
||||||
|
MsgReportSDRPlayGains *message = MsgReportSDRPlayGains::create(
|
||||||
|
mirisdr_get_lna_gain(m_dev),
|
||||||
|
mirisdr_get_mixer_gain(m_dev),
|
||||||
|
mirisdr_get_baseband_gain(m_dev),
|
||||||
|
mirisdr_get_tuner_gain(m_dev)
|
||||||
|
);
|
||||||
|
getOutputMessageQueueToGUI()->push(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((m_settings.m_devSampleRateIndex != settings.m_devSampleRateIndex) || force)
|
if ((m_settings.m_devSampleRateIndex != settings.m_devSampleRateIndex) || force)
|
||||||
{
|
{
|
||||||
|
@ -49,23 +49,32 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
class MsgReportSDRPlay : public Message {
|
class MsgReportSDRPlayGains : public Message {
|
||||||
MESSAGE_CLASS_DECLARATION
|
MESSAGE_CLASS_DECLARATION
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const std::vector<int>& getGains() const { return m_gains; }
|
static MsgReportSDRPlayGains* create(int lnaGain, int mixerGain, int basebandGain, int tunerGain)
|
||||||
|
|
||||||
static MsgReportSDRPlay* create(const std::vector<int>& gains)
|
|
||||||
{
|
{
|
||||||
return new MsgReportSDRPlay(gains);
|
return new MsgReportSDRPlayGains(lnaGain, mixerGain, basebandGain, tunerGain);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
int getLNAGain() const { return m_lnaGain; }
|
||||||
std::vector<int> m_gains;
|
int getMixerGain() const { return m_mixerGain; }
|
||||||
|
int getBasebandGain() const { return m_basebandGain; }
|
||||||
|
int getTunerGain() const { return m_tunerGain; }
|
||||||
|
|
||||||
MsgReportSDRPlay(const std::vector<int>& gains) :
|
protected:
|
||||||
|
int m_lnaGain;
|
||||||
|
int m_mixerGain;
|
||||||
|
int m_basebandGain;
|
||||||
|
int m_tunerGain;
|
||||||
|
|
||||||
|
MsgReportSDRPlayGains(int lnaGain, int mixerGain, int basebandGain, int tunerGain) :
|
||||||
Message(),
|
Message(),
|
||||||
m_gains(gains)
|
m_lnaGain(lnaGain),
|
||||||
|
m_mixerGain(mixerGain),
|
||||||
|
m_basebandGain(basebandGain),
|
||||||
|
m_tunerGain(tunerGain)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -92,7 +101,6 @@ private:
|
|||||||
mirisdr_dev_t* m_dev;
|
mirisdr_dev_t* m_dev;
|
||||||
SDRPlayThread* m_sdrPlayThread;
|
SDRPlayThread* m_sdrPlayThread;
|
||||||
QString m_deviceDescription;
|
QString m_deviceDescription;
|
||||||
std::vector<int> m_gains;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYINPUT_H_ */
|
#endif /* PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYINPUT_H_ */
|
||||||
|
@ -37,6 +37,10 @@ void SDRPlaySettings::resetToDefaults()
|
|||||||
m_fcPos = FC_POS_CENTER;
|
m_fcPos = FC_POS_CENTER;
|
||||||
m_dcBlock = false;
|
m_dcBlock = false;
|
||||||
m_iqCorrection = false;
|
m_iqCorrection = false;
|
||||||
|
m_tunerGainMode = true;
|
||||||
|
m_lnaOn = false;
|
||||||
|
m_mixerAmpOn = false;
|
||||||
|
m_basebandGain = 29;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray SDRPlaySettings::serialize() const
|
QByteArray SDRPlaySettings::serialize() const
|
||||||
@ -53,6 +57,10 @@ QByteArray SDRPlaySettings::serialize() const
|
|||||||
s.writeS32(8, (int) m_fcPos);
|
s.writeS32(8, (int) m_fcPos);
|
||||||
s.writeBool(9, m_dcBlock);
|
s.writeBool(9, m_dcBlock);
|
||||||
s.writeBool(10, m_iqCorrection);
|
s.writeBool(10, m_iqCorrection);
|
||||||
|
s.writeBool(11, m_tunerGainMode);
|
||||||
|
s.writeBool(12, m_lnaOn);
|
||||||
|
s.writeBool(13, m_mixerAmpOn);
|
||||||
|
s.writeS32(14, m_basebandGain);
|
||||||
|
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
@ -82,6 +90,10 @@ bool SDRPlaySettings::deserialize(const QByteArray& data)
|
|||||||
m_fcPos = (fcPos_t) intval;
|
m_fcPos = (fcPos_t) intval;
|
||||||
d.readBool(9, &m_dcBlock, false);
|
d.readBool(9, &m_dcBlock, false);
|
||||||
d.readBool(10, &m_iqCorrection, false);
|
d.readBool(10, &m_iqCorrection, false);
|
||||||
|
d.readBool(11, &m_tunerGainMode, true);
|
||||||
|
d.readBool(12, &m_lnaOn, false);
|
||||||
|
d.readBool(13, &m_mixerAmpOn, false);
|
||||||
|
d.readS32(14, &m_basebandGain, 29);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,10 @@ struct SDRPlaySettings {
|
|||||||
fcPos_t m_fcPos;
|
fcPos_t m_fcPos;
|
||||||
bool m_dcBlock;
|
bool m_dcBlock;
|
||||||
bool m_iqCorrection;
|
bool m_iqCorrection;
|
||||||
|
bool m_tunerGainMode; // true: tuner (table) gain, false: manual (LNA, Mixer, BB) gain
|
||||||
|
bool m_lnaOn;
|
||||||
|
bool m_mixerAmpOn;
|
||||||
|
int m_basebandGain;
|
||||||
|
|
||||||
SDRPlaySettings();
|
SDRPlaySettings();
|
||||||
void resetToDefaults();
|
void resetToDefaults();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user