diff --git a/devices/limesdr/devicelimesdr.cpp b/devices/limesdr/devicelimesdr.cpp index 90931fcad..b2c410034 100644 --- a/devices/limesdr/devicelimesdr.cpp +++ b/devices/limesdr/devicelimesdr.cpp @@ -18,7 +18,7 @@ #include #include "devicelimesdr.h" -bool DeviceLimeSDR::enableNCO(lms_device_t *device, bool dir_tx, std::size_t chan, float frequency, bool enable) +bool DeviceLimeSDR::enableNCO(lms_device_t *device, bool dir_tx, std::size_t chan, bool enable) { if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0) { @@ -55,8 +55,8 @@ bool DeviceLimeSDR::enableNCO(lms_device_t *device, bool dir_tx, std::size_t cha bool DeviceLimeSDR::setNCOFrequency(lms_device_t *device, bool dir_tx, std::size_t chan, float frequency) { bool positive; - float freqs[LMS_NCO_VAL_COUNT]; - float phos[LMS_NCO_VAL_COUNT]; + float_type freqs[LMS_NCO_VAL_COUNT]; + float_type phos[LMS_NCO_VAL_COUNT]; if (LMS_GetNCOFrequency(device, dir_tx, chan, freqs, phos) < 0) { @@ -75,7 +75,7 @@ bool DeviceLimeSDR::setNCOFrequency(lms_device_t *device, bool dir_tx, std::size freqs[0] = frequency; - if (LMS_SetNCOFrequency(device, dir_tx, chan, freqs, phos) < 0) + if (LMS_SetNCOFrequency(device, dir_tx, chan, freqs, 0.0f) < 0) { fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot set frequency to %f\n", frequency); return false; @@ -95,8 +95,8 @@ bool DeviceLimeSDR::setNCOFrequency(lms_device_t *device, bool dir_tx, std::size if (enable) { bool positive; - float freqs[LMS_NCO_VAL_COUNT]; - float phos[LMS_NCO_VAL_COUNT]; + float_type freqs[LMS_NCO_VAL_COUNT]; + float_type phos[LMS_NCO_VAL_COUNT]; if (LMS_GetNCOFrequency(device, dir_tx, chan, freqs, phos) < 0) { @@ -115,7 +115,7 @@ bool DeviceLimeSDR::setNCOFrequency(lms_device_t *device, bool dir_tx, std::size freqs[0] = frequency; - if (LMS_SetNCOFrequency(device, dir_tx, chan, freqs, phos) < 0) + if (LMS_SetNCOFrequency(device, dir_tx, chan, freqs, 0.0f) < 0) { fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot set frequency to %f\n", frequency); return false; diff --git a/plugins/samplesource/limesdrinput/limesdrinput.cpp b/plugins/samplesource/limesdrinput/limesdrinput.cpp index e3f6def3d..d66b96d08 100644 --- a/plugins/samplesource/limesdrinput/limesdrinput.cpp +++ b/plugins/samplesource/limesdrinput/limesdrinput.cpp @@ -666,13 +666,13 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc m_settings.m_ncoFrequency)) { doCalibration = true; - qDebug("LimeSDRInput::applySettings: %sd and set NCO to %f Hz", + qDebug("LimeSDRInput::applySettings: %sd and set NCO to %d Hz", m_settings.m_ncoEnable ? "enable" : "disable", m_settings.m_ncoFrequency); } else { - qCritical("LimeSDRInput::applySettings: could %s and set LPF FIR to %f Hz", + qCritical("LimeSDRInput::applySettings: could not %s and set NCO to %d Hz", m_settings.m_ncoEnable ? "enable" : "disable", m_settings.m_ncoFrequency); } diff --git a/plugins/samplesource/limesdrinput/limesdrinputgui.cpp b/plugins/samplesource/limesdrinput/limesdrinputgui.cpp index 87a366af2..bd1f3eea1 100644 --- a/plugins/samplesource/limesdrinput/limesdrinputgui.cpp +++ b/plugins/samplesource/limesdrinput/limesdrinputgui.cpp @@ -65,6 +65,9 @@ LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, QWidget* parent) : ui->channelNumberText->setText(tr("#%1").arg(m_limeSDRInput->getChannelIndex())); + ui->hwDecimLabel->setText(QString::fromUtf8("H\u2193")); + ui->swDecimLabel->setText(QString::fromUtf8("S\u2193")); + connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); @@ -251,7 +254,7 @@ void LimeSDRInputGUI::displaySettings() ui->ncoFrequency->setValueRange(7, (m_settings.m_centerFrequency - ncoHalfRange)/1000, (m_settings.m_centerFrequency + ncoHalfRange)/1000); // frequency dial is in kHz - ui->ncoFrequency->setValue(m_settings.m_centerFrequency + m_settings.m_ncoFrequency); + ui->ncoFrequency->setValue((m_settings.m_centerFrequency + m_settings.m_ncoFrequency)/1000); } void LimeSDRInputGUI::sendSettings() @@ -355,7 +358,8 @@ void LimeSDRInputGUI::on_centerFrequency_changed(quint64 value) void LimeSDRInputGUI::on_ncoFrequency_changed(quint64 value) { - m_settings.m_ncoFrequency = (int64_t) value - (int64_t) m_settings.m_centerFrequency; + m_settings.m_ncoFrequency = (int64_t) value - (int64_t) m_settings.m_centerFrequency/1000; + m_settings.m_ncoFrequency *= 1000; sendSettings(); } @@ -368,7 +372,7 @@ void LimeSDRInputGUI::on_ncoEnable_toggled(bool checked) void LimeSDRInputGUI::on_ncoReset_clicked(bool checked) { m_settings.m_ncoFrequency = 0; - ui->ncoFrequency->setValue(m_settings.m_centerFrequency); + ui->ncoFrequency->setValue(m_settings.m_centerFrequency/1000); sendSettings(); } diff --git a/plugins/samplesource/limesdrinput/limesdrinputgui.ui b/plugins/samplesource/limesdrinput/limesdrinputgui.ui index 7d7b825e2..405d530eb 100644 --- a/plugins/samplesource/limesdrinput/limesdrinputgui.ui +++ b/plugins/samplesource/limesdrinput/limesdrinputgui.ui @@ -6,8 +6,8 @@ 0 0 - 340 - 265 + 350 + 290 @@ -18,8 +18,8 @@ - 340 - 250 + 350 + 290 @@ -49,6 +49,9 @@ + + 2 + @@ -190,18 +193,12 @@ - - - 6 - + - 6 - - - 6 + 2 - 6 + 2 @@ -230,7 +227,7 @@ - + 0 @@ -261,6 +258,165 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Automatic DC offset removal + + + DC + + + + + + + Automatic IQ imbalance correction + + + IQ + + + + + + + + + Qt::Horizontal + + + + + + + 2 + + + 2 + + + + + Hw + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + 16777215 + + + + 2 + + + + 1 + + + + + 2 + + + + + 4 + + + + + 8 + + + + + 16 + + + + + 32 + + + + + + + + Sw + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + 16777215 + + + + Decimation factor + + + 0 + + + + 1 + + + + + 2 + + + + + 4 + + + + + 8 + + + + + 16 + + + + + 32 + + + + @@ -325,186 +481,13 @@ - - - - 2 - - - 2 - - - - - Auto - - - - - - - Automatic DC offset removal - - - DC - - - - - - - Automatic IQ imbalance correction - - - IQ - - - - - - - Qt::Vertical - - - - - - - HWDec - - - - - - - - 50 - 16777215 - - - - 2 - - - - 1 - - - - - 2 - - - - - 4 - - - - - 8 - - - - - 16 - - - - - 32 - - - - - - - - SWDec - - - - - - - - 50 - 16777215 - - - - Decimation factor - - - 0 - - - - 1 - - - - - 2 - - - - - 4 - - - - - 8 - - - - - 16 - - - - - 32 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Horizontal - - - - - 6 - - 6 - - - 6 + 2 - 6 + 2 @@ -602,15 +585,14 @@ - - - - Qt::Horizontal - - - + + 2 + + + 2 + @@ -670,17 +652,11 @@ - - 6 - - 6 - - - 6 + 2 - 6 + 2 @@ -829,6 +805,13 @@ QToolTip{background-color: white; color: black;} + + + + Qt::Horizontal + + + @@ -846,13 +829,6 @@ QToolTip{background-color: white; color: black;} - - - - Qt::Horizontal - - -