From b1d1d3c5e06423dfe9740caa52df120b0ac00b41 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 4 Jan 2019 10:47:34 +0100 Subject: [PATCH] XTRX: fixed apply settigns loop in case NCO is used on both channels. Refactored debug messages --- plugins/samplesink/xtrxoutput/xtrxoutput.cpp | 30 +++++++++++--------- plugins/samplesource/xtrxinput/xtrxinput.cpp | 14 ++++----- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/plugins/samplesink/xtrxoutput/xtrxoutput.cpp b/plugins/samplesink/xtrxoutput/xtrxoutput.cpp index 6e4e40b10..8aec482a3 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutput.cpp +++ b/plugins/samplesink/xtrxoutput/xtrxoutput.cpp @@ -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; } diff --git a/plugins/samplesource/xtrxinput/xtrxinput.cpp b/plugins/samplesource/xtrxinput/xtrxinput.cpp index 2b361d321..bbf2727b0 100644 --- a/plugins/samplesource/xtrxinput/xtrxinput.cpp +++ b/plugins/samplesource/xtrxinput/xtrxinput.cpp @@ -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; } }