XTRX: fixed apply settigns loop in case NCO is used on both channels. Refactored debug messages

This commit is contained in:
f4exb 2019-01-04 10:47:34 +01:00
parent 7173032645
commit b1d1d3c5e0
2 changed files with 24 additions and 20 deletions

View File

@ -621,7 +621,7 @@ bool XTRXOutput::handleMessage(const Message& message)
if (m_settings.m_ncoEnable) // need to reset NCO after sample rate change
{
applySettings(m_settings, true, true);
applySettings(m_settings, false, true);
}
int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0;
@ -771,6 +771,18 @@ bool XTRXOutput::applySettings(const XTRXOutputSettings& settings, bool force, b
// apply settings
qDebug() << "XTRXOutput::applySettings: m_centerFrequency: " << m_settings.m_centerFrequency
<< " m_devSampleRate: " << m_settings.m_devSampleRate
<< " m_log2SoftInterp: " << m_settings.m_log2SoftInterp
<< " m_gain: " << m_settings.m_gain
<< " m_lpfBW: " << m_settings.m_lpfBW
<< " m_ncoEnable: " << m_settings.m_ncoEnable
<< " m_ncoFrequency: " << m_settings.m_ncoFrequency
<< " m_antennaPath: " << m_settings.m_antennaPath
<< " m_extClock: " << m_settings.m_extClock
<< " m_extClockFreq: " << m_settings.m_extClockFreq
<< " force: " << force;
if ((m_settings.m_pwrmode != settings.m_pwrmode))
{
reverseAPIKeys.append("pwrmode");
@ -1142,21 +1154,13 @@ bool XTRXOutput::applySettings(const XTRXOutputSettings& settings, bool force, b
}
}
qDebug() << "XTRXOutput::applySettings: center freq: " << m_settings.m_centerFrequency << " Hz"
qDebug() << "XTRXOutput::applySettings:"
<< " device stream sample rate: " << getDevSampleRate() << "S/s"
<< " sample rate with soft interpolation: " << getSampleRate() << "S/s"
<< " m_devSampleRate: " << m_settings.m_devSampleRate
<< " m_log2SoftInterp: " << m_settings.m_log2SoftInterp
<< " m_gain: " << m_settings.m_gain
<< " m_lpfBW: " << m_settings.m_lpfBW
<< " m_ncoEnable: " << m_settings.m_ncoEnable
<< " m_ncoFrequency: " << m_settings.m_ncoFrequency
<< " m_antennaPath: " << m_settings.m_antennaPath
<< " m_extClock: " << m_settings.m_extClock
<< " m_extClockFreq: " << m_settings.m_extClockFreq
<< " force: " << force
<< " forceNCOFrequency: " << forceNCOFrequency
<< " doLPCalibration: " << doLPCalibration;
<< " doLPCalibration: " << doLPCalibration
<< " doChangeFreq: " << doChangeFreq
<< " doChangeSampleRate: " << doChangeSampleRate;
return true;
}

View File

@ -636,7 +636,7 @@ bool XTRXInput::handleMessage(const Message& message)
if (m_settings.m_ncoEnable) // need to reset NCO after sample rate change
{
applySettings(m_settings, true, true);
applySettings(m_settings, false, true);
}
int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0;
@ -809,9 +809,9 @@ void XTRXInput::apply_gain_lna(double gain)
XTRX_RX_LNA_GAIN,
gain,
0) < 0) {
qDebug("XTRXInput::applySettings: xtrx_set_gain(LNA) failed");
qDebug("XTRXInput::apply_gain_lna: xtrx_set_gain(LNA) failed");
} else {
qDebug() << "XTRXInput::applySettings: Gain (LNA) set to " << gain;
qDebug() << "XTRXInput::apply_gain_lna: Gain (LNA) set to " << gain;
}
}
@ -822,9 +822,9 @@ void XTRXInput::apply_gain_tia(double gain)
XTRX_RX_TIA_GAIN,
gain,
0) < 0) {
qDebug("XTRXInput::applySettings: xtrx_set_gain(TIA) failed");
qDebug("XTRXInput::apply_gain_tia: xtrx_set_gain(TIA) failed");
} else {
qDebug() << "XTRXInput::applySettings: Gain (TIA) set to " << gain;
qDebug() << "XTRXInput::apply_gain_tia: Gain (TIA) set to " << gain;
}
}
@ -836,11 +836,11 @@ void XTRXInput::apply_gain_pga(double gain)
gain,
0) < 0)
{
qDebug("XTRXInput::applySettings: xtrx_set_gain(PGA) failed");
qDebug("XTRXInput::apply_gain_pga: xtrx_set_gain(PGA) failed");
}
else
{
qDebug() << "XTRXInput::applySettings: Gain (PGA) set to " << gain;
qDebug() << "XTRXInput::apply_gain_pga: Gain (PGA) set to " << gain;
}
}