1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-23 00:18:37 -05:00

LimeSDR: cosmetic changes

This commit is contained in:
f4exb 2020-04-09 06:45:31 +02:00
parent 03d39f8483
commit 0d094f4aa7
3 changed files with 31 additions and 32 deletions

View File

@ -401,7 +401,7 @@ void LimeSDROutput::stop()
{ {
qDebug("LimeSDROutput::stop"); qDebug("LimeSDROutput::stop");
if (m_limeSDROutputThread != 0) if (m_limeSDROutputThread)
{ {
m_limeSDROutputThread->stopWork(); m_limeSDROutputThread->stopWork();
delete m_limeSDROutputThread; delete m_limeSDROutputThread;
@ -769,7 +769,7 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
{ {
reverseAPIKeys.append("gain"); reverseAPIKeys.append("gain");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (LMS_SetGaindB(m_deviceShared.m_deviceParams->getDevice(), if (LMS_SetGaindB(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_TX, LMS_CH_TX,
@ -793,7 +793,7 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
reverseAPIKeys.append("log2HardInterp"); reverseAPIKeys.append("log2HardInterp");
forwardChangeAllDSP = true; //m_settings.m_devSampleRate != settings.m_devSampleRate; forwardChangeAllDSP = true; //m_settings.m_devSampleRate != settings.m_devSampleRate;
if (m_deviceShared.m_deviceParams->getDevice() != 0) if (m_deviceShared.m_deviceParams->getDevice())
{ {
if (LMS_SetSampleRateDir(m_deviceShared.m_deviceParams->getDevice(), if (LMS_SetSampleRateDir(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_TX, LMS_CH_TX,
@ -839,7 +839,7 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
{ {
reverseAPIKeys.append("lpfBW"); reverseAPIKeys.append("lpfBW");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
doLPCalibration = true; doLPCalibration = true;
} }
@ -851,7 +851,7 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
reverseAPIKeys.append("lpfFIRBW"); reverseAPIKeys.append("lpfFIRBW");
reverseAPIKeys.append("lpfFIREnable"); reverseAPIKeys.append("lpfFIREnable");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (LMS_SetGFIRLPF(m_deviceShared.m_deviceParams->getDevice(), if (LMS_SetGFIRLPF(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_TX, LMS_CH_TX,
@ -880,7 +880,7 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
reverseAPIKeys.append("ncoEnable"); reverseAPIKeys.append("ncoEnable");
forwardChangeOwnDSP = true; forwardChangeOwnDSP = true;
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (DeviceLimeSDR::setNCOFrequency(m_deviceShared.m_deviceParams->getDevice(), if (DeviceLimeSDR::setNCOFrequency(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_TX, LMS_CH_TX,
@ -909,10 +909,10 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
forwardChangeOwnDSP = true; forwardChangeOwnDSP = true;
m_deviceShared.m_log2Soft = settings.m_log2SoftInterp; // for buddies m_deviceShared.m_log2Soft = settings.m_log2SoftInterp; // for buddies
if (m_limeSDROutputThread != 0) if (m_limeSDROutputThread)
{ {
m_limeSDROutputThread->setLog2Interpolation(settings.m_log2SoftInterp); m_limeSDROutputThread->setLog2Interpolation(settings.m_log2SoftInterp);
qDebug() << "LimeSDROutput::applySettings: set soft decimation to " << (1<<settings.m_log2SoftInterp); qDebug() << "LimeSDROutput::applySettings: set soft interpolation to " << (1<<settings.m_log2SoftInterp);
} }
} }
@ -920,7 +920,7 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
{ {
reverseAPIKeys.append("antennaPath"); reverseAPIKeys.append("antennaPath");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (DeviceLimeSDR::setTxAntennaPath(m_deviceShared.m_deviceParams->getDevice(), if (DeviceLimeSDR::setTxAntennaPath(m_deviceShared.m_deviceParams->getDevice(),
m_deviceShared.m_channel, m_deviceShared.m_channel,
@ -948,7 +948,7 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
reverseAPIKeys.append("transverterDeltaFrequency"); reverseAPIKeys.append("transverterDeltaFrequency");
forwardChangeTxDSP = true; forwardChangeTxDSP = true;
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (LMS_SetClockFreq(m_deviceShared.m_deviceParams->getDevice(), LMS_CLOCK_SXT, deviceCenterFrequency) < 0) if (LMS_SetClockFreq(m_deviceShared.m_deviceParams->getDevice(), LMS_CLOCK_SXT, deviceCenterFrequency) < 0)
{ {

View File

@ -435,7 +435,7 @@ void LimeSDRInput::stop()
{ {
qDebug("LimeSDRInput::stop"); qDebug("LimeSDRInput::stop");
if (m_limeSDRInputThread != 0) if (m_limeSDRInputThread)
{ {
m_limeSDRInputThread->stopWork(); m_limeSDRInputThread->stopWork();
delete m_limeSDRInputThread; delete m_limeSDRInputThread;
@ -806,7 +806,6 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
bool ownThreadWasRunning = false; bool ownThreadWasRunning = false;
bool doCalibration = false; bool doCalibration = false;
bool doLPCalibration = false; bool doLPCalibration = false;
bool setAntennaAuto = false;
double clockGenFreq = 0.0; double clockGenFreq = 0.0;
QList<QString> reverseAPIKeys; QList<QString> reverseAPIKeys;
@ -845,7 +844,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
if (settings.m_gainMode == LimeSDRInputSettings::GAIN_AUTO) if (settings.m_gainMode == LimeSDRInputSettings::GAIN_AUTO)
{ {
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (LMS_SetGaindB(m_deviceShared.m_deviceParams->getDevice(), if (LMS_SetGaindB(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_RX, LMS_CH_RX,
@ -863,7 +862,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
} }
else else
{ {
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (DeviceLimeSDR::SetRFELNA_dB(m_deviceShared.m_deviceParams->getDevice(), if (DeviceLimeSDR::SetRFELNA_dB(m_deviceShared.m_deviceParams->getDevice(),
m_deviceShared.m_channel, m_deviceShared.m_channel,
@ -908,7 +907,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
{ {
reverseAPIKeys.append("gain"); reverseAPIKeys.append("gain");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (LMS_SetGaindB(m_deviceShared.m_deviceParams->getDevice(), if (LMS_SetGaindB(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_RX, LMS_CH_RX,
@ -929,7 +928,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
{ {
reverseAPIKeys.append("lnaGain"); reverseAPIKeys.append("lnaGain");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (DeviceLimeSDR::SetRFELNA_dB(m_deviceShared.m_deviceParams->getDevice(), if (DeviceLimeSDR::SetRFELNA_dB(m_deviceShared.m_deviceParams->getDevice(),
m_deviceShared.m_channel, m_deviceShared.m_channel,
@ -949,7 +948,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
{ {
reverseAPIKeys.append("tiaGain"); reverseAPIKeys.append("tiaGain");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (DeviceLimeSDR::SetRFETIA_dB(m_deviceShared.m_deviceParams->getDevice(), if (DeviceLimeSDR::SetRFETIA_dB(m_deviceShared.m_deviceParams->getDevice(),
m_deviceShared.m_channel, m_deviceShared.m_channel,
@ -969,7 +968,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
{ {
reverseAPIKeys.append("pgaGain"); reverseAPIKeys.append("pgaGain");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (DeviceLimeSDR::SetRBBPGA_dB(m_deviceShared.m_deviceParams->getDevice(), if (DeviceLimeSDR::SetRBBPGA_dB(m_deviceShared.m_deviceParams->getDevice(),
m_deviceShared.m_channel, m_deviceShared.m_channel,
@ -992,7 +991,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
reverseAPIKeys.append("log2HardDecim"); reverseAPIKeys.append("log2HardDecim");
forwardChangeAllDSP = true; //m_settings.m_devSampleRate != settings.m_devSampleRate; forwardChangeAllDSP = true; //m_settings.m_devSampleRate != settings.m_devSampleRate;
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (LMS_SetSampleRateDir(m_deviceShared.m_deviceParams->getDevice(), if (LMS_SetSampleRateDir(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_RX, LMS_CH_RX,
@ -1020,7 +1019,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
{ {
reverseAPIKeys.append("lpfBW"); reverseAPIKeys.append("lpfBW");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
doLPCalibration = true; doLPCalibration = true;
} }
@ -1032,7 +1031,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
reverseAPIKeys.append("lpfFIRBW"); reverseAPIKeys.append("lpfFIRBW");
reverseAPIKeys.append("lpfFIREnable"); reverseAPIKeys.append("lpfFIREnable");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (LMS_SetGFIRLPF(m_deviceShared.m_deviceParams->getDevice(), if (LMS_SetGFIRLPF(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_RX, LMS_CH_RX,
@ -1061,7 +1060,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
reverseAPIKeys.append("ncoEnable"); reverseAPIKeys.append("ncoEnable");
forwardChangeOwnDSP = true; forwardChangeOwnDSP = true;
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (DeviceLimeSDR::setNCOFrequency(m_deviceShared.m_deviceParams->getDevice(), if (DeviceLimeSDR::setNCOFrequency(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_RX, LMS_CH_RX,
@ -1090,7 +1089,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
forwardChangeOwnDSP = true; forwardChangeOwnDSP = true;
m_deviceShared.m_log2Soft = settings.m_log2SoftDecim; // for buddies m_deviceShared.m_log2Soft = settings.m_log2SoftDecim; // for buddies
if (m_limeSDRInputThread != 0) if (m_limeSDRInputThread)
{ {
m_limeSDRInputThread->setLog2Decimation(settings.m_log2SoftDecim); m_limeSDRInputThread->setLog2Decimation(settings.m_log2SoftDecim);
qDebug() << "LimeSDRInput::applySettings: set soft decimation to " << (1<<settings.m_log2SoftDecim); qDebug() << "LimeSDRInput::applySettings: set soft decimation to " << (1<<settings.m_log2SoftDecim);
@ -1101,14 +1100,13 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
{ {
reverseAPIKeys.append("antennaPath"); reverseAPIKeys.append("antennaPath");
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (DeviceLimeSDR::setRxAntennaPath(m_deviceShared.m_deviceParams->getDevice(), if (DeviceLimeSDR::setRxAntennaPath(m_deviceShared.m_deviceParams->getDevice(),
m_deviceShared.m_channel, m_deviceShared.m_channel,
settings.m_antennaPath)) settings.m_antennaPath))
{ {
doCalibration = true; doCalibration = true;
//setAntennaAuto = (settings.m_antennaPath == 0);
qDebug("LimeSDRInput::applySettings: set antenna path to %d on channel %d", qDebug("LimeSDRInput::applySettings: set antenna path to %d on channel %d",
(int) settings.m_antennaPath, (int) settings.m_antennaPath,
m_deviceShared.m_channel); m_deviceShared.m_channel);
@ -1124,14 +1122,14 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
if ((m_settings.m_centerFrequency != settings.m_centerFrequency) if ((m_settings.m_centerFrequency != settings.m_centerFrequency)
|| (m_settings.m_transverterMode != settings.m_transverterMode) || (m_settings.m_transverterMode != settings.m_transverterMode)
|| (m_settings.m_transverterDeltaFrequency != settings.m_transverterDeltaFrequency) || (m_settings.m_transverterDeltaFrequency != settings.m_transverterDeltaFrequency)
|| setAntennaAuto || force) || force)
{ {
reverseAPIKeys.append("centerFrequency"); reverseAPIKeys.append("centerFrequency");
reverseAPIKeys.append("transverterMode"); reverseAPIKeys.append("transverterMode");
reverseAPIKeys.append("transverterDeltaFrequency"); reverseAPIKeys.append("transverterDeltaFrequency");
forwardChangeRxDSP = true; forwardChangeRxDSP = true;
if (m_deviceShared.m_deviceParams->getDevice() != 0 && m_channelAcquired) if (m_deviceShared.m_deviceParams->getDevice() && m_channelAcquired)
{ {
if (LMS_SetClockFreq(m_deviceShared.m_deviceParams->getDevice(), LMS_CLOCK_SXR, deviceCenterFrequency) < 0) if (LMS_SetClockFreq(m_deviceShared.m_deviceParams->getDevice(), LMS_CLOCK_SXR, deviceCenterFrequency) < 0)
{ {
@ -1179,12 +1177,12 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
if (LMS_GPIODirWrite(m_deviceShared.m_deviceParams->getDevice(), &settings.m_gpioDir, 1) != 0) if (LMS_GPIODirWrite(m_deviceShared.m_deviceParams->getDevice(), &settings.m_gpioDir, 1) != 0)
{ {
qCritical("LimeSDROutput::applySettings: could not set GPIO directions to %u", settings.m_gpioDir); qCritical("LimeSDRInput::applySettings: could not set GPIO directions to %u", settings.m_gpioDir);
} }
else else
{ {
forwardGPIOChange = true; forwardGPIOChange = true;
qDebug("LimeSDROutput::applySettings: GPIO directions set to %u", settings.m_gpioDir); qDebug("LimeSDRInput::applySettings: GPIO directions set to %u", settings.m_gpioDir);
} }
} }
@ -1194,12 +1192,12 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
if (LMS_GPIOWrite(m_deviceShared.m_deviceParams->getDevice(), &settings.m_gpioPins, 1) != 0) if (LMS_GPIOWrite(m_deviceShared.m_deviceParams->getDevice(), &settings.m_gpioPins, 1) != 0)
{ {
qCritical("LimeSDROutput::applySettings: could not set GPIO pins to %u", settings.m_gpioPins); qCritical("LimeSDRInput::applySettings: could not set GPIO pins to %u", settings.m_gpioPins);
} }
else else
{ {
forwardGPIOChange = true; forwardGPIOChange = true;
qDebug("LimeSDROutput::applySettings: GPIO pins set to %u", settings.m_gpioPins); qDebug("LimeSDRInput::applySettings: GPIO pins set to %u", settings.m_gpioPins);
} }
} }
} }

View File

@ -620,7 +620,8 @@ void LimeSDRInputGUI::on_sampleRate_changed(quint64 value)
updateADCRate(); updateADCRate();
setNCODisplay(); setNCODisplay();
sendSettings();} sendSettings();
}
void LimeSDRInputGUI::on_hwDecim_currentIndexChanged(int index) void LimeSDRInputGUI::on_hwDecim_currentIndexChanged(int index)
{ {