1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

XTRX: REST API fixes

This commit is contained in:
f4exb 2019-01-16 00:37:27 +01:00
parent 7603848bbe
commit 919c88b0ce
4 changed files with 40 additions and 16 deletions

View File

@ -776,6 +776,7 @@ bool XTRXOutput::applySettings(const XTRXOutputSettings& settings, bool force, b
<< " m_log2SoftInterp: " << m_settings.m_log2SoftInterp << " m_log2SoftInterp: " << m_settings.m_log2SoftInterp
<< " m_gain: " << m_settings.m_gain << " m_gain: " << m_settings.m_gain
<< " m_lpfBW: " << m_settings.m_lpfBW << " m_lpfBW: " << m_settings.m_lpfBW
<< " m_pwrmode: " << m_settings.m_pwrmode
<< " m_ncoEnable: " << m_settings.m_ncoEnable << " m_ncoEnable: " << m_settings.m_ncoEnable
<< " m_ncoFrequency: " << m_settings.m_ncoFrequency << " m_ncoFrequency: " << m_settings.m_ncoFrequency
<< " m_antennaPath: " << m_settings.m_antennaPath << " m_antennaPath: " << m_settings.m_antennaPath

View File

@ -242,6 +242,15 @@ void XTRXOutputGUI::handleInputMessages()
delete message; delete message;
} }
else if (XTRXOutput::MsgConfigureXTRX::match(*message))
{
qDebug("XTRXOutputGUI::handleInputMessages: MsgConfigureXTRX");
const XTRXOutput::MsgConfigureXTRX& cfg = (XTRXOutput::MsgConfigureXTRX&) *message;
m_settings = cfg.getSettings();
displaySettings();
delete message;
}
else else
{ {
if (handleMessage(*message)) { if (handleMessage(*message)) {
@ -283,6 +292,7 @@ void XTRXOutputGUI::displaySettings()
updateDACRate(); updateDACRate();
ui->lpf->setValue(m_settings.m_lpfBW / 1000); ui->lpf->setValue(m_settings.m_lpfBW / 1000);
ui->pwrmode->setCurrentIndex(m_settings.m_pwrmode);
ui->gain->setValue(m_settings.m_gain); ui->gain->setValue(m_settings.m_gain);
ui->gainText->setText(tr("%1").arg(m_settings.m_gain)); ui->gainText->setText(tr("%1").arg(m_settings.m_gain));

View File

@ -866,6 +866,25 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
// apply settings // apply settings
qDebug() << "XTRXInput::applySettings: center freq: " << m_settings.m_centerFrequency << " Hz"
<< " device stream sample rate: " << getDevSampleRate() << "S/s"
<< " sample rate with soft decimation: " << getSampleRate() << "S/s"
<< " m_devSampleRate: " << m_settings.m_devSampleRate
<< " m_dcBlock: " << m_settings.m_dcBlock
<< " m_iqCorrection: " << m_settings.m_iqCorrection
<< " m_log2SoftDecim: " << m_settings.m_log2SoftDecim
<< " m_gain: " << m_settings.m_gain
<< " m_lpfBW: " << m_settings.m_lpfBW
<< " m_pwrmode: " << m_settings.m_pwrmode
<< " 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;
if ((m_settings.m_dcBlock != settings.m_dcBlock) || force) if ((m_settings.m_dcBlock != settings.m_dcBlock) || force)
{ {
reverseAPIKeys.append("dcBlock"); reverseAPIKeys.append("dcBlock");
@ -1300,22 +1319,6 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
} }
} }
qDebug() << "XTRXInput::applySettings: center freq: " << m_settings.m_centerFrequency << " Hz"
<< " device stream sample rate: " << getDevSampleRate() << "S/s"
<< " sample rate with soft decimation: " << getSampleRate() << "S/s"
<< " m_devSampleRate: " << m_settings.m_devSampleRate
<< " m_log2SoftDecim: " << m_settings.m_log2SoftDecim
<< " 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;
return true; return true;
} }

View File

@ -244,6 +244,15 @@ void XTRXInputGUI::handleInputMessages()
delete message; delete message;
} }
else if (XTRXInput::MsgConfigureXTRX::match(*message))
{
qDebug("XTRXInputGUI::handleInputMessages: MsgConfigureXTRX");
const XTRXInput::MsgConfigureXTRX& cfg = (XTRXInput::MsgConfigureXTRX&) *message;
m_settings = cfg.getSettings();
displaySettings();
delete message;
}
else else
{ {
if (handleMessage(*message)) { if (handleMessage(*message)) {
@ -288,6 +297,7 @@ void XTRXInputGUI::displaySettings()
updateADCRate(); updateADCRate();
ui->lpf->setValue(m_settings.m_lpfBW / 1000); ui->lpf->setValue(m_settings.m_lpfBW / 1000);
ui->pwrmode->setCurrentIndex(m_settings.m_pwrmode);
ui->gain->setValue(m_settings.m_gain); ui->gain->setValue(m_settings.m_gain);
ui->gainText->setText(tr("%1").arg(m_settings.m_gain)); ui->gainText->setText(tr("%1").arg(m_settings.m_gain));