diff --git a/plugins/samplesource/limesdrinput/limesdrinputgui.ui b/plugins/samplesource/limesdrinput/limesdrinputgui.ui
new file mode 100644
index 000000000..e3fcebae2
--- /dev/null
+++ b/plugins/samplesource/limesdrinput/limesdrinputgui.ui
@@ -0,0 +1,633 @@
+
+
+ LimeSDRInputGui
+
+
+
+ 0
+ 0
+ 310
+ 265
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 310
+ 250
+
+
+
+
+ Sans Serif
+ 9
+
+
+
+ BladeRF
+
+
+
+ 3
+
+
+ 2
+
+
+ 2
+
+
+ 2
+
+
+ 2
+
+ -
+
+
-
+
+
-
+
+
-
+
+
+ start/stop acquisition
+
+
+
+
+
+
+ :/play.png
+ :/stop.png:/play.png
+
+
+
+ -
+
+
+ Toggle record I/Q samples from device
+
+
+
+
+
+
+ :/record_off.png
+ :/record_on.png:/record_off.png
+
+
+
+
+
+ -
+
+
-
+
+
+ I/Q sample rate kS/s
+
+
+ 00000k
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 32
+ 16
+
+
+
+
+ Monospace
+ 20
+
+
+
+ SizeVerCursor
+
+
+ Qt::StrongFocus
+
+
+ Tuner center frequency in kHz
+
+
+
+ -
+
+
+ kHz
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
-
+
+
+ S/s
+
+
+
+ -
+
+
+ Automatic IQ imbalance correction
+
+
+ IQ
+
+
+
+ -
+
+
+ Automatic DC offset removal
+
+
+ DC
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Auto
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 32
+ 16
+
+
+
+
+ Monospace
+ 12
+
+
+ samplerateUnit
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ SR
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ 2
+
+
+ 2
+
+
-
+
+
+ HWDec
+
+
+
+ -
+
+
+
+ 50
+ 16777215
+
+
+
+ 2
+
+
-
+
+ 1
+
+
+ -
+
+ 2
+
+
+ -
+
+ 4
+
+
+ -
+
+ 8
+
+
+ -
+
+ 16
+
+
+ -
+
+ 32
+
+
+
+
+ -
+
+
+ SWDec
+
+
+
+ -
+
+
+
+ 50
+ 16777215
+
+
+
+ Decimation factor
+
+
+ 0
+
+
-
+
+ 1
+
+
+ -
+
+ 2
+
+
+ -
+
+ 4
+
+
+ -
+
+ 8
+
+
+ -
+
+ 16
+
+
+ -
+
+ 32
+
+
+
+
+ -
+
+
+ Fp
+
+
+
+ -
+
+
+ Relative position of device center frequency
+
+
-
+
+ Inf
+
+
+ -
+
+ Sup
+
+
+ -
+
+ Cen
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ 6
+
+
+ 6
+
+
+ 6
+
+
+ 6
+
+
-
+
+
+ LP
+
+
+
+ -
+
+
+ Analog lowpass filter bandwidth (kHz)
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ 00000k
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Enable or disable the digital FIR lowpass filters
+
+
+ LPFIR
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 32
+ 16
+
+
+
+
+ Monospace
+ 12
+
+
+
+ Digital FIR lowpass filers bandwidth (Hz)
+
+
+
+ -
+
+
+ Hz
+
+
+
+
+
+ -
+
+
-
+
+
+ Gain
+
+
+
+ -
+
+
+ Global gain setting (dB)
+
+
+ 0
+
+
+ 70
+
+
+ 1
+
+
+ 20
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+ Global gain (dB)
+
+
+ 20dB
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+
+
+ -
+
+
-
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+
+
+
+
+ ValueDial
+ QWidget
+
+ 1
+
+
+ ButtonSwitch
+ QToolButton
+
+
+
+
+
+
+
+
diff --git a/plugins/samplesource/limesdrinput/limesdrinputsettings.cpp b/plugins/samplesource/limesdrinput/limesdrinputsettings.cpp
new file mode 100644
index 000000000..4478aa664
--- /dev/null
+++ b/plugins/samplesource/limesdrinput/limesdrinputsettings.cpp
@@ -0,0 +1,93 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2017 Edouard Griffiths, F4EXB //
+// //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation as version 3 of the License, or //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License V3 for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program. If not, see . //
+///////////////////////////////////////////////////////////////////////////////////
+
+#include "limesdrinputsettings.h"
+
+LimeSDRInputSettings::LimeSDRInputSettings()
+{
+ resetToDefaults();
+}
+
+void LimeSDRInputSettings::resetToDefaults()
+{
+ m_centerFrequency = 435000*1000;
+ m_devSampleRate = 3072000;
+ m_log2HardDecim = 2;
+ m_dcBlock = false;
+ m_iqCorrection = false;
+ m_log2SoftDecim = 0;
+ m_fcPos = FC_POS_CENTER;
+ m_lpfBW = 1.5e6f;
+ m_lpfFIREnable = false;
+ m_lpfFIRBW = 1.5e6f;
+ m_gain = 0;
+}
+
+QByteArray LimeSDRInputSettings::serialize() const
+{
+ SimpleSerializer s(1);
+
+ s.writeS32(1, m_devSampleRate);
+ s.writeU32(2, m_log2HardDecim);
+ s.writeBool(3, m_dcBlock);
+ s.writeBool(4, m_iqCorrection);
+ s.writeU32(5, m_log2SoftDecim);
+ s.writeS32(6, (int) m_fcPos);
+ s.writeFloat(7, m_lpfBW);
+ s.writeBool(8, m_lpfFIREnable);
+ s.writeFloat(9, m_lpfFIRBW);
+ s.writeU32(10, m_gain);
+
+ return s.final();
+}
+
+bool LimeSDRInputSettings::deserialize(const QByteArray& data)
+{
+ SimpleDeserializer d(data);
+
+ if (!d.isValid())
+ {
+ resetToDefaults();
+ return false;
+ }
+
+ if (d.getVersion() == 1)
+ {
+ int intval;
+
+ d.readS32(1, &m_devSampleRate, 3072000);
+ d.readU32(2, &m_log2HardDecim, 2);
+ d.readBool(3, &m_dcBlock, false);
+ d.readBool(4, &m_iqCorrection, false);
+ d.readU32(5, &m_log2SoftDecim, 0);
+ d.readS32(6, &intval, 0);
+ m_fcPos = (fcPos_t) intval;
+ d.readFloat(7, &m_lpfBW, 1.5e6);
+ d.readBool(8, &m_lpfFIREnable, false);
+ d.readFloat(9, &m_lpfFIRBW, 1.5e6);
+ d.readU32(10, &m_gain, 0);
+
+ return true;
+ }
+ else
+ {
+ resetToDefaults();
+ return false;
+ }
+
+}
+
+
diff --git a/plugins/samplesource/limesdrinput/limesdrinputsettings.h b/plugins/samplesource/limesdrinput/limesdrinputsettings.h
index e34956f93..3b5d0b4d6 100644
--- a/plugins/samplesource/limesdrinput/limesdrinputsettings.h
+++ b/plugins/samplesource/limesdrinput/limesdrinputsettings.h
@@ -17,9 +17,38 @@
#ifndef PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTSETTINGS_H_
#define PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTSETTINGS_H_
+#include
+
+/**
+ * These are the settings individual to each hardware channel or software Rx chain
+ * Plus the settings to be saved in the presets
+ */
struct LimeSDRInputSettings
{
+ typedef enum {
+ FC_POS_INFRA = 0,
+ FC_POS_SUPRA,
+ FC_POS_CENTER
+ } fcPos_t;
+ // global settings to be saved
+ quint64 m_centerFrequency;
+ qint32 m_devSampleRate;
+ uint32_t m_log2HardDecim;
+ // channel settings
+ bool m_dcBlock;
+ bool m_iqCorrection;
+ uint32_t m_log2SoftDecim;
+ fcPos_t m_fcPos;
+ float m_lpfBW; //!< LMS amalog lowpass filter bandwidth (Hz)
+ bool m_lpfFIREnable; //!< Enable LMS digital lowpass FIR filters
+ float m_lpfFIRBW; //!< LMS digital lowpass FIR filters bandwidth (Hz)
+ uint32_t m_gain; //!< Optimally distributed gain (dB)
+
+ LimeSDRInputSettings();
+ void resetToDefaults();
+ QByteArray serialize() const;
+ bool deserialize(const QByteArray& data);
};
#endif /* PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTSETTINGS_H_ */