diff --git a/plugins/channelmimo/interferometer/interferometer.cpp b/plugins/channelmimo/interferometer/interferometer.cpp
new file mode 100644
index 000000000..ff3717e0d
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometer.cpp
@@ -0,0 +1,79 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 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 //
+// (at your option) any later version. //
+// //
+// 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 "device/deviceapi.h"
+#include "dsp/downchannelizer.h"
+#include "dsp/threadedbasebandsamplesink.h"
+
+#include "interferometer.h"
+
+const QString Interferometer::m_channelIdURI = "sdrangel.channel.interferometer";
+const QString Interferometer::m_channelId = "Interferometer";
+
+Interferometer::Interferometer(DeviceAPI *deviceAPI) :
+ ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
+ m_deviceAPI(deviceAPI),
+ m_correlator(4096),
+ m_spectrumSink(nullptr),
+ m_scopeSink(nullptr)
+{
+ m_correlator.setCorrIndex(1);
+ connect(&m_correlator, SIGNAL(dataReady(int, int)), this, SLOT(handleData(int, int)));
+
+ for (int i = 0; i < m_deviceAPI->getNbSourceStreams(); i++)
+ {
+ m_sinks.push_back(InterferometerSink(&m_correlator));
+ m_channelizers.push_back(new DownChannelizer(&m_sinks.back()));
+ m_threadedBasebandSampleSinks.push_back(new ThreadedBasebandSampleSink(m_channelizers.back(), &m_sinks.back()));
+ m_deviceAPI->addChannelSink(m_threadedBasebandSampleSinks.back(), i);
+
+ if (i == 2) { // 2 way interferometer
+ break;
+ }
+ }
+
+ m_deviceAPI->addChannelSinkAPI(this);
+ m_sinks.back().setProcessingUnit(true); // The last one is processed last by the engine
+}
+
+Interferometer::~Interferometer()
+{
+ while (!m_threadedBasebandSampleSinks.empty())
+ {
+ m_deviceAPI->removeChannelSink(m_threadedBasebandSampleSinks.back());
+ delete m_threadedBasebandSampleSinks.back();
+ m_threadedBasebandSampleSinks.pop_back();
+ }
+
+ while (!m_channelizers.empty())
+ {
+ delete m_channelizers.back();
+ m_channelizers.pop_back();
+ }
+
+ m_deviceAPI->removeChannelSinkAPI(this);
+}
+
+void Interferometer::handleData(int start, int stop)
+{
+ if ((m_settings.m_correlationType == InterferometerSettings::CorrelationAdd)
+ || (m_settings.m_correlationType == InterferometerSettings::CorrelationMultiply))
+ {
+
+
+ }
+}
\ No newline at end of file
diff --git a/plugins/channelmimo/interferometer/interferometer.h b/plugins/channelmimo/interferometer/interferometer.h
new file mode 100644
index 000000000..58730d207
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometer.h
@@ -0,0 +1,56 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 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 //
+// (at your option) any later version. //
+// //
+// 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 . //
+///////////////////////////////////////////////////////////////////////////////////
+
+#ifndef INCLUDE_INTERFEROMETER_H
+#define INCLUDE_INTERFEROMETER_H
+
+#include
+
+#include "channel/channelapi.h"
+#include "interferometersink.h"
+#include "interferometercorr.h"
+
+class DeviceAPI;
+class DownChannelizer;
+class ThreadedBasebandSampleSink;
+
+class Interferometer: public QObject, ChannelAPI
+{
+ Q_OBJECT
+public:
+ Interferometer(DeviceAPI *deviceAPI);
+ virtual ~Interferometer();
+ virtual void destroy() { delete this; }
+
+ static const QString m_channelIdURI;
+ static const QString m_channelId;
+
+private:
+ DeviceAPI *m_deviceAPI;
+ InterferometerCorrelator m_correlator;
+ std::vector m_sinks;
+ std::vector m_channelizers;
+ std::vector m_threadedBasebandSampleSinks;
+ BasebandSampleSink* m_spectrumSink;
+ BasebandSampleSink* m_scopeSink;
+ InterferometerSettings m_settings;
+
+private slots:
+ void handleData(int start, int stop);
+};
+
+#endif // INCLUDE_INTERFEROMETER_H
diff --git a/plugins/channelmimo/interferometer/interferometercorr.cpp b/plugins/channelmimo/interferometer/interferometercorr.cpp
new file mode 100644
index 000000000..5091d560d
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometercorr.cpp
@@ -0,0 +1,210 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 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 //
+// (at your option) any later version. //
+// //
+// 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
+
+#include "dsp/fftengine.h"
+#include "interferometercorr.h"
+
+std::complex fcAdd(std::complex& a, const std::complex& b) {
+ return a + b;
+}
+
+std::complex fcMul(std::complex& a, const std::complex& b) {
+ return a * b;
+}
+
+Sample cf2sAdd(std::complex& a, const std::complex& b)
+{
+ std::complex c = a + b;
+ return Sample{c.real(), c.imag()};
+}
+
+Sample cf2sMul(std::complex& a, const std::complex& b)
+{
+ std::complex c = a * b;
+ return Sample{c.real(), c.imag()};
+}
+
+Sample cf2s(std::complex& a)
+{
+ return Sample{a.real(), a.imag()};
+}
+
+const unsigned int InterferometerCorrelator::m_nbFFTBlocks = 128;
+
+InterferometerCorrelator::InterferometerCorrelator(int fftSize) :
+ m_corrType(InterferometerSettings::CorrelationAdd),
+ m_fftSize(fftSize)
+{
+ for (int i = 0; i < 2; i++)
+ {
+ m_fft[i] = FFTEngine::create();
+ m_fft[i]->configure(2*fftSize, false); // internally twice the data FFT size
+ m_data[i] = new std::complex[fftSize*m_nbFFTBlocks];
+ m_dataIndex[i] = 0;
+ }
+
+ m_invFFT = FFTEngine::create();
+ m_invFFT->configure(2*fftSize, true);
+
+ m_dataj = new std::complex[2*fftSize]; // receives actual FFT result hence twice the data FFT size
+ m_scorr.resize(2*fftSize*m_nbFFTBlocks); // same size multiplied by the number of buffered FFT blocks
+ m_tcorr.resize(2*fftSize*m_nbFFTBlocks); // same size multiplied by the number of buffered FFT blocks
+}
+
+InterferometerCorrelator::~InterferometerCorrelator()
+{
+ for (int i = 0; i < 2; i++)
+ {
+ delete[] m_data[i];
+ delete[] m_fft[i];
+ }
+
+ delete[] m_dataj;
+}
+
+void InterferometerCorrelator::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int argIndex)
+{
+ if (argIndex > 1) {
+ return;
+ }
+
+ switch (m_corrType)
+ {
+ case InterferometerSettings::CorrelationAdd:
+ feedOp(begin, end, argIndex, cf2sAdd);
+ break;
+ case InterferometerSettings::CorrelationMultiply:
+ feedOp(begin, end, argIndex, cf2sMul);
+ break;
+ case InterferometerSettings::CorrelationCorrelation:
+ feedCorr(begin, end, argIndex);
+ break;
+ default:
+ break;
+ }
+}
+
+void InterferometerCorrelator::feedOp(
+ const SampleVector::const_iterator& begin,
+ const SampleVector::const_iterator& end,
+ unsigned int argIndex,
+ Sample complexOp(std::complex& a, const std::complex& b)
+)
+{
+ int size = (end - begin);
+ int fill = m_fftSize*m_nbFFTBlocks - m_dataIndex[argIndex];
+ int first = std::min(fill, size);
+
+ std::transform(begin, begin + first, m_data[argIndex] + m_dataIndex[argIndex], [](const Sample& s) -> std::complex {
+ return std::complex{s.real() / SDR_RX_SCALEF, s.imag() / SDR_RX_SCALEF};
+ });
+
+ if (argIndex == 1)
+ {
+ std::transform(
+ m_data[0] + m_dataIndex[0], m_data[0] + m_dataIndex[0] + first, m_data[1] + m_dataIndex[1],
+ m_tcorr.begin() + m_dataIndex[0],
+ complexOp
+ );
+
+ emit dataReady(m_dataIndex[0], m_dataIndex[0] + first);
+ }
+
+ if (size > fill)
+ {
+ std::transform(begin, begin + size - fill , m_data[argIndex], [](const Sample& s) -> std::complex {
+ return std::complex{s.real() / SDR_RX_SCALEF, s.imag() / SDR_RX_SCALEF};
+ });
+
+ if (argIndex == 1)
+ {
+ std::transform(
+ m_data[0], m_data[0] + size - fill, m_data[1],
+ m_tcorr.begin(),
+ complexOp
+ );
+
+ emit dataReady(0, size - fill);
+ }
+
+ m_dataIndex[argIndex] = size - fill;
+ }
+ else
+ {
+ m_dataIndex[argIndex] += size;
+ }
+}
+
+void InterferometerCorrelator::feedCorr(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int argIndex)
+{
+ int size = (end - begin);
+ int fill = m_fftSize*m_nbFFTBlocks - m_dataIndex[argIndex];
+ int first = std::min(fill, size);
+
+ std::transform(begin, begin + first, m_data[argIndex] + m_dataIndex[argIndex], [](const Sample& s) -> std::complex {
+ return std::complex{s.real() / SDR_RX_SCALEF, s.imag() / SDR_RX_SCALEF};
+ });
+ processFFTBlocks(argIndex, m_dataIndex[argIndex], first);
+
+ if (size > fill)
+ {
+ std::transform(begin, begin + size - fill, m_data[argIndex], [](const Sample& s) -> std::complex {
+ return std::complex{s.real() / SDR_RX_SCALEF, s.imag() / SDR_RX_SCALEF};
+ });
+ processFFTBlocks(argIndex, 0, size - fill);
+ m_dataIndex[argIndex] = size - fill;
+ }
+ else
+ {
+ m_dataIndex[argIndex] += size;
+ }
+}
+
+void InterferometerCorrelator::processFFTBlocks(unsigned int argIndex, unsigned int dataIndex, int length)
+{
+ int start = dataIndex / m_fftSize;
+ int stop = (dataIndex + length) / m_fftSize;
+
+ for (int i = start; i < stop; i++)
+ {
+ m_window.apply(&m_data[argIndex][start*m_fftSize], m_fft[argIndex]->in());
+ std::fill(m_fft[argIndex]->in() + m_fftSize, m_fft[argIndex]->in() + 2*m_fftSize, std::complex{0,0});
+ m_fft[argIndex]->transform();
+
+ if (argIndex == m_corrIndex)
+ {
+ // conjugate
+ std::transform(m_fft[argIndex]->out(), m_fft[argIndex]->out()+2*m_fftSize, m_dataj, []
+ (const std::complex& c) -> std::complex { return std::conj(c); }
+ );
+ // product with FFT[0] store in inverse FFT input
+ std::transform(m_fft[0]->out(), m_fft[0]->out()+2*m_fftSize, m_dataj, m_invFFT->in(), []
+ (std::complex& a, const std::complex& b) -> std::complex { return a*b; }
+ );
+ // copy to correlation spectrum and do the inverse FFT to get time correlation
+ std::transform(m_invFFT->in(), m_invFFT->in() + 2*m_fftSize, m_scorr.begin() + 2*i*m_fftSize, cf2s);
+ m_invFFT->transform();
+ std::transform(m_invFFT->out(), m_invFFT->out() + 2*m_fftSize, m_tcorr.begin() + 2*i*m_fftSize, cf2s);
+ }
+ }
+
+ if (start != stop) {
+ emit dataReady(start, stop);
+ }
+}
\ No newline at end of file
diff --git a/plugins/channelmimo/interferometer/interferometercorr.h b/plugins/channelmimo/interferometer/interferometercorr.h
new file mode 100644
index 000000000..6abafc5b5
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometercorr.h
@@ -0,0 +1,71 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 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 //
+// (at your option) any later version. //
+// //
+// 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 . //
+///////////////////////////////////////////////////////////////////////////////////
+
+#ifndef INCLUDE_INTERFEROMETERCORR_H
+#define INCLUDE_INTERFEROMETERCORR_H
+
+#include
+#include
+
+#include "dsp/dsptypes.h"
+#include "dsp/fftwindow.h"
+#include "util/message.h"
+
+#include "interferometersettings.h"
+
+class FFTEngine;
+
+class InterferometerCorrelator : public QObject {
+ Q_OBJECT
+public:
+ InterferometerCorrelator(int fftSize);
+ ~InterferometerCorrelator();
+
+ void setCorrIndex(unsigned int corrIndex) { m_corrIndex = corrIndex; }
+ void setCorrType(InterferometerSettings::CorrelationType corrType) { m_corrType = corrType; }
+ void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int argIndex);
+
+ SampleVector m_scorr; //!< raw correlation result (spectrum) - Sample vector expected
+ SampleVector m_tcorr; //!< correlation result (time or spectrum inverse FFT) - Sample vector expected
+
+signals:
+ void dataReady(int start, int stop);
+
+private:
+ void feedOp(
+ const SampleVector::const_iterator& begin,
+ const SampleVector::const_iterator& end,
+ unsigned int argIndex,
+ Sample complexOp(std::complex& a, const std::complex& b)
+ );
+ void feedCorr(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int argIndex);
+ void processFFTBlocks(unsigned int argIndex, unsigned int dataIndex, int length);
+ void processFFT(unsigned int argIndex, int blockIndex);
+
+ InterferometerSettings::CorrelationType m_corrType;
+ int m_fftSize; //!< FFT length
+ FFTEngine *m_fft[2]; //!< FFT engines
+ FFTEngine *m_invFFT; //!< Inverse FFT engine
+ FFTWindow m_window; //!< FFT window
+ std::complex *m_data[2]; //!< from input
+ std::complex *m_dataj; //!< conjuate of FFT transform
+ unsigned int m_dataIndex[2]; //!< Current sample index in A
+ unsigned int m_corrIndex; //!< Input index on which correlation is actioned
+ static const unsigned int m_nbFFTBlocks; //!< number of buffered FFT blocks
+};
+
+#endif // INCLUDE_INTERFEROMETERCORR_H
diff --git a/plugins/channelmimo/interferometer/interferometergui.ui b/plugins/channelmimo/interferometer/interferometergui.ui
new file mode 100644
index 000000000..011650e80
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometergui.ui
@@ -0,0 +1,520 @@
+
+
+ ChannelAnalyzerGUI
+
+
+
+ 0
+ 0
+ 739
+ 778
+
+
+
+
+ 720
+ 0
+
+
+
+
+ Liberation Sans
+ 9
+
+
+
+ Interferometer
+
+
+
+
+ 0
+ 10
+ 631
+ 81
+
+
+
+ Settings
+
+
+
+ 3
+
+
+ 2
+
+
+ 2
+
+
+ 2
+
+
+ 2
+
+ -
+
+
+ 2
+
+
-
+
+
-
+
+
+
+ 16
+ 0
+
+
+
+ Df
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 32
+ 16
+
+
+
+
+ Liberation Mono
+ 12
+
+
+
+ PointingHandCursor
+
+
+ Qt::StrongFocus
+
+
+ Demod shift frequency from center in Hz
+
+
+
+ -
+
+
+
+
+
+
+
+ 26
+ 26
+ 26
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+
+
+ 26
+ 26
+ 26
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+
+
+ 118
+ 118
+ 117
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+
+ Hz
+
+
+
+
+
+ -
+
+
-
+
+
+
+ 50
+ 16777215
+
+
+
+ Channel decimation
+
+
-
+
+ 1
+
+
+ -
+
+ 2
+
+
+ -
+
+ 4
+
+
+ -
+
+ 8
+
+
+ -
+
+ 16
+
+
+ -
+
+ 32
+
+
+ -
+
+ 64
+
+
+
+
+ -
+
+
+
+ 80
+ 0
+
+
+
+ Channel final sample rate
+
+
+ 00000.0 kS/s
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Select input signal
+
+
-
+
+ Sig
+
+
+ -
+
+ Lock
+
+
+ -
+
+ ACorr
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 52
+ 0
+
+
+
+ Channel power
+
+
+ Qt::LeftToRight
+
+
+ -100.0 dB
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+
+
+ -
+
+
-
+
+
+
+ 15
+ 0
+
+
+
+ BP
+
+
+
+ -
+
+
+ Lowpass filter cutoff frequency
+
+
+ -60
+
+
+ 60
+
+
+ 1
+
+
+ 30
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+
+ 50
+ 0
+
+
+
+ 3.0k
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+
+
+
+
+
+
+
+ 0
+ 98
+ 720
+ 284
+
+
+
+
+ 716
+ 0
+
+
+
+ Channel Spectrum
+
+
+
+ 2
+
+
+ 2
+
+
+ 2
+
+
+ 2
+
+
+ 2
+
+ -
+
+
+
+ 200
+ 250
+
+
+
+
+ Liberation Mono
+ 8
+
+
+
+
+ -
+
+
+
+
+
+
+
+ 0
+ 390
+ 720
+ 334
+
+
+
+
+ 716
+ 0
+
+
+
+ Channel Scope
+
+
+
+ 2
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+ -
+
+
+
+ 200
+ 300
+
+
+
+
+ Liberation Mono
+ 8
+
+
+
+
+ -
+
+
+
+
+
+
+
+ RollupWidget
+ QWidget
+
+ 1
+
+
+ GLSpectrum
+ QWidget
+
+ 1
+
+
+ GLSpectrumGUI
+ QWidget
+
+ 1
+
+
+ ValueDialZ
+ QWidget
+
+ 1
+
+
+ GLScope
+ QWidget
+
+ 1
+
+
+ GLScopeGUI
+ QWidget
+
+ 1
+
+
+
+
+
+
+
diff --git a/plugins/channelmimo/interferometer/interferometersettings.cpp b/plugins/channelmimo/interferometer/interferometersettings.cpp
new file mode 100644
index 000000000..da033a1c7
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometersettings.cpp
@@ -0,0 +1,105 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 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 //
+// (at your option) any later version. //
+// //
+// 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
+
+#include "dsp/dspengine.h"
+#include "util/simpleserializer.h"
+#include "settings/serializable.h"
+
+#include "interferometersettings.h"
+
+InterferometerSettings::InterferometerSettings() :
+ m_channelMarker(nullptr),
+ m_spectrumGUI(nullptr),
+ m_scopeGUI(nullptr)
+{
+ resetToDefaults();
+}
+
+void InterferometerSettings::resetToDefaults()
+{
+ m_inputFrequencyOffset = 0;
+ m_correlationType = CorrelationAdd;
+ m_rgbColor = QColor(128, 128, 128).rgb();
+ m_title = "Interferometer";
+}
+
+QByteArray InterferometerSettings::serialize() const
+{
+ SimpleSerializer s(1);
+
+ s.writeS32(1, m_inputFrequencyOffset);
+ s.writeS32(2, (int) m_correlationType);
+ s.writeU32(3, m_rgbColor);
+ s.writeString(4, m_title);
+
+ if (m_spectrumGUI) {
+ s.writeBlob(20, m_spectrumGUI->serialize());
+ }
+ if (m_scopeGUI) {
+ s.writeBlob(21, m_scopeGUI->serialize());
+ }
+ if (m_channelMarker) {
+ s.writeBlob(22, m_channelMarker->serialize());
+ }
+}
+
+bool InterferometerSettings::deserialize(const QByteArray& data)
+{
+ SimpleDeserializer d(data);
+
+ if(!d.isValid())
+ {
+ resetToDefaults();
+ return false;
+ }
+
+ if(d.getVersion() == 1)
+ {
+ QByteArray bytetmp;
+ int tmp;
+
+ d.readS32(1, &m_inputFrequencyOffset, 0);
+ d.readS32(2, &tmp, 0);
+ m_correlationType = (CorrelationType) tmp;
+ d.readU32(3, &m_rgbColor);
+ d.readString(4, &m_title, "Interpolator");
+
+ if (m_spectrumGUI) {
+ d.readBlob(20, &bytetmp);
+ m_spectrumGUI->deserialize(bytetmp);
+ }
+
+ if (m_scopeGUI) {
+ d.readBlob(21, &bytetmp);
+ m_scopeGUI->deserialize(bytetmp);
+ }
+
+ if (m_channelMarker) {
+ d.readBlob(21, &bytetmp);
+ m_channelMarker->deserialize(bytetmp);
+ }
+
+ return true;
+ }
+ else
+ {
+ resetToDefaults();
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/plugins/channelmimo/interferometer/interferometersettings.h b/plugins/channelmimo/interferometer/interferometersettings.h
new file mode 100644
index 000000000..d071cb3bb
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometersettings.h
@@ -0,0 +1,52 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 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 //
+// (at your option) any later version. //
+// //
+// 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 . //
+///////////////////////////////////////////////////////////////////////////////////
+
+#ifndef INCLUDE_INTERFEROMETERSETTINGS_H
+#define INCLUDE_INTERFEROMETERSETTINGS_H
+
+#include
+#include
+
+class Serializable;
+
+struct InterferometerSettings
+{
+ enum CorrelationType
+ {
+ CorrelationAdd,
+ CorrelationMultiply,
+ CorrelationCorrelation
+ };
+
+ qint32 m_inputFrequencyOffset;
+ CorrelationType m_correlationType;
+ quint32 m_rgbColor;
+ QString m_title;
+ Serializable *m_channelMarker;
+ Serializable *m_spectrumGUI;
+ Serializable *m_scopeGUI;
+
+ InterferometerSettings();
+ void resetToDefaults();
+ void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; }
+ void setSpectrumGUI(Serializable *spectrumGUI) { m_spectrumGUI = spectrumGUI; }
+ void setScopeGUI(Serializable *scopeGUI) { m_scopeGUI = scopeGUI; }
+ QByteArray serialize() const;
+ bool deserialize(const QByteArray& data);
+};
+
+#endif // INCLUDE_INTERFEROMETERSETTINGS_H
\ No newline at end of file
diff --git a/plugins/channelmimo/interferometer/interferometersink.cpp b/plugins/channelmimo/interferometer/interferometersink.cpp
new file mode 100644
index 000000000..3775a8b91
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometersink.cpp
@@ -0,0 +1,45 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 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 //
+// (at your option) any later version. //
+// //
+// 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 "interferometersink.h"
+
+InterferometerSink::InterferometerSink(InterferometerCorrelator *correlator) :
+ m_processingUnit(false),
+ m_correlator(correlator)
+{}
+
+InterferometerSink::~InterferometerSink()
+{}
+
+void InterferometerSink::start()
+{}
+
+void InterferometerSink::stop()
+{}
+
+void InterferometerSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly)
+{
+ (void) positiveOnly;
+ (void) begin;
+ (void) end;
+}
+
+bool InterferometerSink::handleMessage(const Message& cmd)
+{
+ (void) cmd;
+ return false;
+}
\ No newline at end of file
diff --git a/plugins/channelmimo/interferometer/interferometersink.h b/plugins/channelmimo/interferometer/interferometersink.h
new file mode 100644
index 000000000..da929b76d
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometersink.h
@@ -0,0 +1,44 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 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 //
+// (at your option) any later version. //
+// //
+// 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 . //
+///////////////////////////////////////////////////////////////////////////////////
+
+#ifndef INCLUDE_INTERFEROMETERSINK_H
+#define INCLUDE_INTERFEROMETERSINK_H
+
+#include "dsp/basebandsamplesink.h"
+
+class InterferometerCorrelator;
+
+class InterferometerSink : public BasebandSampleSink
+{
+public:
+ InterferometerSink(InterferometerCorrelator *correlator);
+ virtual ~InterferometerSink();
+
+ virtual void start();
+ virtual void stop();
+ virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly);
+ virtual bool handleMessage(const Message& cmd);
+
+ void setProcessingUnit(bool) { m_processingUnit = m_processingUnit; }
+ bool isProcessingUnit() const { return m_processingUnit; }
+
+private:
+ bool m_processingUnit; //!< True if it is responsible of starting the correlation process
+ InterferometerCorrelator *m_correlator;
+};
+
+#endif // INCLUDE_INTERFEROMETERSINK_H
diff --git a/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp b/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp
new file mode 100644
index 000000000..5c0ab8fe4
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp
@@ -0,0 +1,389 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 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 //
+// (at your option) any later version. //
+// //
+// 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
+
+#include "SWGChannelSettings.h"
+#include "interferometerwebapiadapter.h"
+
+InterferometerWebAPIAdapter::InterferometerWebAPIAdapter()
+{
+ m_settings.setScopeGUI(&m_glScopeSettings);
+ m_settings.setSpectrumGUI(&m_glSpectrumSettings);
+}
+
+InterferometerWebAPIAdapter::~InterferometerWebAPIAdapter()
+{}
+
+int InterferometerWebAPIAdapter::webapiSettingsGet(
+ SWGSDRangel::SWGChannelSettings& response,
+ QString& errorMessage)
+{
+ (void) errorMessage;
+ response.setInterferometerSettings(new SWGSDRangel::SWGInterferometerSettings());
+ response.getInterferometerSettings()->init();
+ webapiFormatChannelSettings(response, m_settings, m_glScopeSettings, m_glSpectrumSettings);
+ return 200;
+}
+
+void InterferometerWebAPIAdapter::webapiFormatChannelSettings(
+ SWGSDRangel::SWGChannelSettings& response,
+ const InterferometerSettings& settings,
+ const GLScopeSettings& scopeSettings,
+ const GLSpectrumSettings& spectrumSettings)
+{
+ response.getInterferometerSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
+ response.getInterferometerSettings()->setCorrelationType((int) settings.m_correlationType);
+ response.getInterferometerSettings()->setRgbColor(settings.m_rgbColor);
+ response.getInterferometerSettings()->setTitle(new QString(settings.m_title));
+
+ // scope
+ SWGSDRangel::SWGGLScope *swgScope = new SWGSDRangel::SWGGLScope();
+ swgScope->init();
+ response.getInterferometerSettings()->setScopeConfig(swgScope);
+ swgScope->setDisplayMode(scopeSettings.m_displayMode);
+ swgScope->setGridIntensity(scopeSettings.m_gridIntensity);
+ swgScope->setTime(scopeSettings.m_time);
+ swgScope->setTimeOfs(scopeSettings.m_timeOfs);
+ swgScope->setTraceIntensity(scopeSettings.m_traceIntensity);
+ swgScope->setTraceLen(scopeSettings.m_traceLen);
+ swgScope->setTrigPre(scopeSettings.m_trigPre);
+
+ // array of traces
+ swgScope->setTracesData(new QList);
+ std::vector::const_iterator traceIt = scopeSettings.m_tracesData.begin();
+
+ for (; traceIt != scopeSettings.m_tracesData.end(); ++traceIt)
+ {
+ swgScope->getTracesData()->append(new SWGSDRangel::SWGTraceData);
+ swgScope->getTracesData()->back()->setAmp(traceIt->m_amp);
+ swgScope->getTracesData()->back()->setAmpIndex(traceIt->m_ampIndex);
+ swgScope->getTracesData()->back()->setHasTextOverlay(traceIt->m_hasTextOverlay ? 1 : 0);
+ swgScope->getTracesData()->back()->setInputIndex(traceIt->m_inputIndex);
+ swgScope->getTracesData()->back()->setOfs(traceIt->m_ofs);
+ swgScope->getTracesData()->back()->setOfsCoarse(traceIt->m_ofsCoarse);
+ swgScope->getTracesData()->back()->setOfsFine(traceIt->m_ofsFine);
+ swgScope->getTracesData()->back()->setProjectionType((int) traceIt->m_projectionType);
+ swgScope->getTracesData()->back()->setTextOverlay(new QString(traceIt->m_textOverlay));
+ swgScope->getTracesData()->back()->setTraceColor(qColorToInt(traceIt->m_traceColor));
+ swgScope->getTracesData()->back()->setTraceColorB(traceIt->m_traceColorB);
+ swgScope->getTracesData()->back()->setTraceColorG(traceIt->m_traceColorG);
+ swgScope->getTracesData()->back()->setTraceColorR(traceIt->m_traceColorR);
+ swgScope->getTracesData()->back()->setTraceDelay(traceIt->m_traceDelay);
+ swgScope->getTracesData()->back()->setTraceDelayCoarse(traceIt->m_traceDelayCoarse);
+ swgScope->getTracesData()->back()->setTraceDelayFine(traceIt->m_traceDelayFine);
+ swgScope->getTracesData()->back()->setTriggerDisplayLevel(traceIt->m_triggerDisplayLevel);
+ swgScope->getTracesData()->back()->setViewTrace(traceIt->m_viewTrace ? 1 : 0);
+ }
+
+ // array of triggers
+ swgScope->setTriggersData(new QList);
+ std::vector::const_iterator triggerIt = scopeSettings.m_triggersData.begin();
+
+ for (; triggerIt != scopeSettings.m_triggersData.end(); ++triggerIt)
+ {
+ swgScope->getTriggersData()->append(new SWGSDRangel::SWGTriggerData);
+ swgScope->getTriggersData()->back()->setInputIndex(triggerIt->m_inputIndex);
+ swgScope->getTriggersData()->back()->setProjectionType((int) triggerIt->m_projectionType);
+ swgScope->getTriggersData()->back()->setTriggerBothEdges(triggerIt->m_triggerBothEdges ? 1 : 0);
+ swgScope->getTriggersData()->back()->setTriggerColor(qColorToInt(triggerIt->m_triggerColor));
+ swgScope->getTriggersData()->back()->setTriggerColorB(triggerIt->m_triggerColorB);
+ swgScope->getTriggersData()->back()->setTriggerColorG(triggerIt->m_triggerColorG);
+ swgScope->getTriggersData()->back()->setTriggerColorR(triggerIt->m_triggerColorR);
+ swgScope->getTriggersData()->back()->setTriggerDelay(triggerIt->m_triggerDelay);
+ swgScope->getTriggersData()->back()->setTriggerDelayCoarse(triggerIt->m_triggerDelayCoarse);
+ swgScope->getTriggersData()->back()->setTriggerDelayFine(triggerIt->m_triggerDelayFine);
+ swgScope->getTriggersData()->back()->setTriggerDelayMult(triggerIt->m_triggerDelayMult);
+ swgScope->getTriggersData()->back()->setTriggerHoldoff(triggerIt->m_triggerHoldoff ? 1 : 0);
+ swgScope->getTriggersData()->back()->setTriggerLevel(triggerIt->m_triggerLevel);
+ swgScope->getTriggersData()->back()->setTriggerLevelCoarse(triggerIt->m_triggerLevelCoarse);
+ swgScope->getTriggersData()->back()->setTriggerLevelFine(triggerIt->m_triggerLevelFine);
+ swgScope->getTriggersData()->back()->setTriggerPositiveEdge(triggerIt->m_triggerPositiveEdge ? 1 : 0);
+ swgScope->getTriggersData()->back()->setTriggerRepeat(triggerIt->m_triggerRepeat);
+ }
+
+ // spectrum
+ SWGSDRangel::SWGGLSpectrum *swgSpectrum = new SWGSDRangel::SWGGLSpectrum();
+ swgSpectrum->init();
+ response.getInterferometerSettings()->setSpectrumConfig(swgSpectrum);
+ swgSpectrum->setAveragingMode((int) spectrumSettings.m_averagingMode);
+ swgSpectrum->setAveragingValue(spectrumSettings.m_averagingNb);
+ swgSpectrum->setDecay(spectrumSettings.m_decay);
+ swgSpectrum->setDecayDivisor(spectrumSettings.m_decayDivisor);
+ swgSpectrum->setDisplayCurrent(spectrumSettings.m_displayCurrent ? 1 : 0);
+ swgSpectrum->setDisplayGrid(spectrumSettings.m_displayGrid ? 1 : 0);
+ swgSpectrum->setDisplayGridIntensity(spectrumSettings.m_displayGridIntensity);
+ swgSpectrum->setDisplayHistogram(spectrumSettings.m_displayHistogram ? 1 : 0);
+ swgSpectrum->setDisplayMaxHold(spectrumSettings.m_displayMaxHold ? 1 : 0);
+ swgSpectrum->setDisplayTraceIntensity(spectrumSettings.m_displayTraceIntensity);
+ swgSpectrum->setDisplayWaterfall(spectrumSettings.m_displayWaterfall ? 1 : 0);
+ swgSpectrum->setFftOverlap(spectrumSettings.m_fftOverlap);
+ swgSpectrum->setFftSize(spectrumSettings.m_fftSize);
+}
+
+int InterferometerWebAPIAdapter::webapiSettingsPutPatch(
+ bool force,
+ const QStringList& channelSettingsKeys,
+ SWGSDRangel::SWGChannelSettings& response,
+ QString& errorMessage)
+{
+ (void) force;
+ (void) errorMessage;
+ webapiUpdateChannelSettings(m_settings, m_glScopeSettings, m_glSpectrumSettings, channelSettingsKeys, response);
+ return 200;
+}
+
+void InterferometerWebAPIAdapter::webapiUpdateChannelSettings(
+ InterferometerSettings& settings,
+ GLScopeSettings& scopeSettings,
+ GLSpectrumSettings& spectrumSettings,
+ const QStringList& channelSettingsKeys,
+ SWGSDRangel::SWGChannelSettings& response)
+{
+ if (channelSettingsKeys.contains("inputFrequencyOffset")) {
+ settings.m_inputFrequencyOffset = response.getInterferometerSettings()->getInputFrequencyOffset();
+ }
+ if (channelSettingsKeys.contains("correlationType")) {
+ settings.m_correlationType = (InterferometerSettings::CorrelationType) response.getInterferometerSettings()->getCorrelationType();
+ }
+ if (channelSettingsKeys.contains("rgbColor")) {
+ settings.m_rgbColor = response.getInterferometerSettings()->getRgbColor();
+ }
+ if (channelSettingsKeys.contains("title")) {
+ settings.m_title = *response.getInterferometerSettings()->getTitle();
+ }
+ // scope
+ if (channelSettingsKeys.contains("scopeConfig"))
+ {
+ if (channelSettingsKeys.contains("scopeConfig.displayMode")) {
+ scopeSettings.m_displayMode = (GLScopeSettings::DisplayMode) response.getInterferometerSettings()->getScopeConfig()->getDisplayMode();
+ }
+ if (channelSettingsKeys.contains("scopeConfig.gridIntensity")) {
+ scopeSettings.m_gridIntensity = response.getInterferometerSettings()->getScopeConfig()->getGridIntensity();
+ }
+ if (channelSettingsKeys.contains("scopeConfig.time")) {
+ scopeSettings.m_time = response.getInterferometerSettings()->getScopeConfig()->getTime();
+ }
+ if (channelSettingsKeys.contains("scopeConfig.timeOfs")) {
+ scopeSettings.m_timeOfs = response.getInterferometerSettings()->getScopeConfig()->getTimeOfs();
+ }
+ if (channelSettingsKeys.contains("scopeConfig.traceIntensity")) {
+ scopeSettings.m_traceIntensity = response.getInterferometerSettings()->getScopeConfig()->getTraceIntensity();
+ }
+ if (channelSettingsKeys.contains("scopeConfig.traceLen")) {
+ scopeSettings.m_traceLen = response.getInterferometerSettings()->getScopeConfig()->getTraceLen();
+ }
+ if (channelSettingsKeys.contains("scopeConfig.trigPre")) {
+ scopeSettings.m_trigPre = response.getInterferometerSettings()->getScopeConfig()->getTrigPre();
+ }
+ // traces
+ if (channelSettingsKeys.contains("scopeConfig.tracesData"))
+ {
+ QList *tracesData = response.getInterferometerSettings()->getScopeConfig()->getTracesData();
+ scopeSettings.m_tracesData.clear();
+
+ for (int i = 0; i < 10; i++) // no more than 10 traces anyway
+ {
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1]").arg(i)))
+ {
+ SWGSDRangel::SWGTraceData *traceData = tracesData->at(i);
+ scopeSettings.m_tracesData.push_back(GLScopeSettings::TraceData());
+
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].amp").arg(i))) {
+ scopeSettings.m_tracesData.back().m_amp = traceData->getAmp();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].ampIndex").arg(i))) {
+ scopeSettings.m_tracesData.back().m_ampIndex = traceData->getAmpIndex();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].hasTextOverlay").arg(i))) {
+ scopeSettings.m_tracesData.back().m_hasTextOverlay = traceData->getHasTextOverlay() != 0;
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].inputIndex").arg(i))) {
+ scopeSettings.m_tracesData.back().m_inputIndex = traceData->getInputIndex();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].ofs").arg(i))) {
+ scopeSettings.m_tracesData.back().m_ofs = traceData->getOfs();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].ofsCoarse").arg(i))) {
+ scopeSettings.m_tracesData.back().m_ofsCoarse = traceData->getOfsCoarse();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].ofsFine").arg(i))) {
+ scopeSettings.m_tracesData.back().m_ofsFine = traceData->getOfsFine();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].projectionType").arg(i))) {
+ scopeSettings.m_tracesData.back().m_projectionType = (Projector::ProjectionType) traceData->getProjectionType();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceColor").arg(i))) {
+ scopeSettings.m_tracesData.back().m_traceColor = intToQColor(traceData->getTraceColor());
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceColorB").arg(i))) {
+ scopeSettings.m_tracesData.back().m_traceColorB = traceData->getTraceColorB();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceColorG").arg(i))) {
+ scopeSettings.m_tracesData.back().m_traceColorG = traceData->getTraceColorG();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceColorR").arg(i))) {
+ scopeSettings.m_tracesData.back().m_traceColorR = traceData->getTraceColorR();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceDelay").arg(i))) {
+ scopeSettings.m_tracesData.back().m_traceDelay = traceData->getTraceDelay();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceDelayCoarse").arg(i))) {
+ scopeSettings.m_tracesData.back().m_traceDelayCoarse = traceData->getTraceDelayCoarse();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].traceDelayFine").arg(i))) {
+ scopeSettings.m_tracesData.back().m_traceDelayFine = traceData->getTraceDelayFine();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].triggerDisplayLevel").arg(i))) {
+ scopeSettings.m_tracesData.back().m_triggerDisplayLevel = traceData->getTriggerDisplayLevel();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].viewTrace").arg(i))) {
+ scopeSettings.m_tracesData.back().m_viewTrace = traceData->getViewTrace() != 0;
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ // triggers
+ if (channelSettingsKeys.contains("scopeConfig.triggersData"))
+ {
+ QList *triggersData = response.getInterferometerSettings()->getScopeConfig()->getTriggersData();
+ scopeSettings.m_triggersData.clear();
+
+ for (int i = 0; i < 10; i++) // no more than 10 triggers anyway
+ {
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1]").arg(i)))
+ {
+ SWGSDRangel::SWGTriggerData *triggerData = triggersData->at(i);
+ scopeSettings.m_triggersData.push_back(GLScopeSettings::TriggerData());
+
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].inputIndex").arg(i))) {
+ scopeSettings.m_triggersData.back().m_inputIndex = triggerData->getInputIndex();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].projectionType").arg(i))) {
+ scopeSettings.m_triggersData.back().m_projectionType = (Projector::ProjectionType) triggerData->getProjectionType();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerBothEdges").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerBothEdges = triggerData->getTriggerBothEdges() != 0;
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.tracesData[%1].triggerColor").arg(i))) {
+ scopeSettings.m_tracesData.back().m_traceColor = intToQColor(triggerData->getTriggerColor());
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerColorB").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerColorB = triggerData->getTriggerColorB();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerColorG").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerColorG = triggerData->getTriggerColorG();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerColorR").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerColorR = triggerData->getTriggerColorR();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerDelay").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerDelay = triggerData->getTriggerDelay();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerDelayCoarse").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerDelayCoarse = triggerData->getTriggerDelayCoarse();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerDelayFine").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerDelayFine = triggerData->getTriggerDelayFine();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerDelayMult").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerDelayMult = triggerData->getTriggerDelayMult();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerHoldoff").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerHoldoff = triggerData->getTriggerHoldoff();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerLevel").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerLevel = triggerData->getTriggerLevel();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerLevelCoarse").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerLevelCoarse = triggerData->getTriggerLevelCoarse();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerLevelFine").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerLevelFine = triggerData->getTriggerLevelFine();
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerPositiveEdge").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerPositiveEdge = triggerData->getTriggerPositiveEdge() != 0;
+ }
+ if (channelSettingsKeys.contains(QString("scopeConfig.triggersData[%1].triggerRepeat").arg(i))) {
+ scopeSettings.m_triggersData.back().m_triggerRepeat = triggerData->getTriggerRepeat() != 0;
+ }
+ }
+ }
+ }
+ }
+ // spectrum
+ if (channelSettingsKeys.contains("spectrumConfig"))
+ {
+ if (channelSettingsKeys.contains("spectrumConfig.averagingMode")) {
+ spectrumSettings.m_averagingMode = (GLSpectrumSettings::AveragingMode) response.getInterferometerSettings()->getSpectrumConfig()->getAveragingMode();
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.averagingValue")) {
+ spectrumSettings.m_averagingNb = response.getInterferometerSettings()->getSpectrumConfig()->getAveragingValue();
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.decay")) {
+ spectrumSettings.m_decay = response.getInterferometerSettings()->getSpectrumConfig()->getDecay();
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.decayDivisor")) {
+ spectrumSettings.m_decayDivisor = response.getInterferometerSettings()->getSpectrumConfig()->getDecayDivisor();
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.displayCurrent")) {
+ spectrumSettings.m_displayCurrent = response.getInterferometerSettings()->getSpectrumConfig()->getDisplayCurrent() != 0;
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.displayGrid")) {
+ spectrumSettings.m_displayGrid = response.getInterferometerSettings()->getSpectrumConfig()->getDisplayGrid() != 0;
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.displayGridIntensity")) {
+ spectrumSettings.m_displayGridIntensity = response.getInterferometerSettings()->getSpectrumConfig()->getDisplayGridIntensity();
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.displayHistogram")) {
+ spectrumSettings.m_displayHistogram = response.getInterferometerSettings()->getSpectrumConfig()->getDisplayHistogram() != 0;
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.displayMaxHold")) {
+ spectrumSettings.m_displayMaxHold = response.getInterferometerSettings()->getSpectrumConfig()->getDisplayMaxHold() != 0;
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.displayTraceIntensity")) {
+ spectrumSettings.m_displayTraceIntensity = response.getInterferometerSettings()->getSpectrumConfig()->getDisplayTraceIntensity();
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.displayWaterfall")) {
+ spectrumSettings.m_displayWaterfall = response.getInterferometerSettings()->getSpectrumConfig()->getDisplayWaterfall() != 0;
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.fftOverlap")) {
+ spectrumSettings.m_fftOverlap = response.getInterferometerSettings()->getSpectrumConfig()->getFftOverlap();
+ }
+ if (channelSettingsKeys.contains("spectrumConfig.fftSize")) {
+ spectrumSettings.m_fftSize = response.getInterferometerSettings()->getSpectrumConfig()->getFftSize();
+ }
+ }
+}
+
+int InterferometerWebAPIAdapter::qColorToInt(const QColor& color)
+{
+ return 256*256*color.blue() + 256*color.green() + color.red();
+}
+
+QColor InterferometerWebAPIAdapter::intToQColor(int intColor)
+{
+ int r = intColor % 256;
+ int bg = intColor / 256;
+ int g = bg % 256;
+ int b = bg / 256;
+ return QColor(r, g, b);
+}
\ No newline at end of file
diff --git a/plugins/channelmimo/interferometer/interferometerwebapiadapter.h b/plugins/channelmimo/interferometer/interferometerwebapiadapter.h
new file mode 100644
index 000000000..03d0c9cb5
--- /dev/null
+++ b/plugins/channelmimo/interferometer/interferometerwebapiadapter.h
@@ -0,0 +1,69 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 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 //
+// (at your option) any later version. //
+// //
+// 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 . //
+///////////////////////////////////////////////////////////////////////////////////
+
+#ifndef INCLUDE_INTERFEROMETER_WEBAPIADAPTER_H
+#define INCLUDE_INTERFEROMETER_WEBAPIADAPTER_H
+
+#include "channel/channelwebapiadapter.h"
+#include "dsp/glscopesettings.h"
+#include "dsp/glspectrumsettings.h"
+#include "interferometersettings.h"
+
+/**
+ * Standalone API adapter only for the settings
+ */
+class InterferometerWebAPIAdapter : public ChannelWebAPIAdapter {
+public:
+ InterferometerWebAPIAdapter();
+ virtual ~InterferometerWebAPIAdapter();
+
+ virtual QByteArray serialize() const { return m_settings.serialize(); }
+ virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); }
+
+ virtual int webapiSettingsGet(
+ SWGSDRangel::SWGChannelSettings& response,
+ QString& errorMessage);
+
+ virtual int webapiSettingsPutPatch(
+ bool force,
+ const QStringList& channelSettingsKeys,
+ SWGSDRangel::SWGChannelSettings& response,
+ QString& errorMessage);
+
+ static void webapiFormatChannelSettings(
+ SWGSDRangel::SWGChannelSettings& response,
+ const InterferometerSettings& settings,
+ const GLScopeSettings& scopeSettings,
+ const GLSpectrumSettings& spectrumSettings);
+
+ static void webapiUpdateChannelSettings(
+ InterferometerSettings& settings,
+ GLScopeSettings& scopeSettings,
+ GLSpectrumSettings& spectrumSettings,
+ const QStringList& channelSettingsKeys,
+ SWGSDRangel::SWGChannelSettings& response);
+
+private:
+ InterferometerSettings m_settings;
+ GLScopeSettings m_glScopeSettings;
+ GLSpectrumSettings m_glSpectrumSettings;
+
+ static int qColorToInt(const QColor& color);
+ static QColor intToQColor(int intColor);
+};
+
+#endif // INCLUDE_INTERFEROMETER_WEBAPIADAPTER_H
diff --git a/sdrbase/resources/webapi.qrc b/sdrbase/resources/webapi.qrc
index 1b86b2eb3..0ecb4a5ef 100644
--- a/sdrbase/resources/webapi.qrc
+++ b/sdrbase/resources/webapi.qrc
@@ -30,6 +30,7 @@
webapi/doc/swagger/include/GLScope.yaml
webapi/doc/swagger/include/GLSpectrum.yaml
webapi/doc/swagger/include/HackRF.yaml
+ webapi/doc/swagger/include/Interferometer.yaml
webapi/doc/swagger/include/LimeSdr.yaml
webapi/doc/swagger/include/KiwiSDR.yaml
webapi/doc/swagger/include/LocalInput.yaml
diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html
index b01f858f1..c73a52c0c 100644
--- a/sdrbase/resources/webapi/doc/html2/index.html
+++ b/sdrbase/resources/webapi/doc/html2/index.html
@@ -2226,6 +2226,9 @@ margin-bottom: 20px;
"FreqTrackerSettings" : {
"$ref" : "#/definitions/FreqTrackerSettings"
},
+ "InterferometerSettings" : {
+ "$ref" : "#/definitions/InterferometerSettings"
+ },
"NFMDemodSettings" : {
"$ref" : "#/definitions/NFMDemodSettings"
},
@@ -3856,6 +3859,30 @@ margin-bottom: 20px;
}
},
"description" : "Summarized information about this SDRangel instance"
+};
+ defs.InterferometerSettings = {
+ "properties" : {
+ "inputFrequencyOffset" : {
+ "type" : "integer"
+ },
+ "correlationType" : {
+ "type" : "integer",
+ "description" : "see InterferometerSettings::CorrelationType"
+ },
+ "rgbColor" : {
+ "type" : "integer"
+ },
+ "title" : {
+ "type" : "string"
+ },
+ "spectrumConfig" : {
+ "$ref" : "#/definitions/GLSpectrum"
+ },
+ "scopeConfig" : {
+ "$ref" : "#/definitions/GLScope"
+ }
+ },
+ "description" : "Interferometer"
};
defs.KiwiSDRReport = {
"properties" : {
diff --git a/sdrbase/resources/webapi/doc/swagger/include/ChannelSettings.yaml b/sdrbase/resources/webapi/doc/swagger/include/ChannelSettings.yaml
index ab097133d..79321de5b 100644
--- a/sdrbase/resources/webapi/doc/swagger/include/ChannelSettings.yaml
+++ b/sdrbase/resources/webapi/doc/swagger/include/ChannelSettings.yaml
@@ -41,6 +41,8 @@ ChannelSettings:
$ref: "/doc/swagger/include/FreeDVMod.yaml#/FreeDVModSettings"
FreqTrackerSettings:
$ref: "/doc/swagger/include/FreqTracker.yaml#/FreqTrackerSettings"
+ InterferometerSettings:
+ $ref: "/doc/swagger/include/Interferometer.yaml#/InterferometerSettings"
NFMDemodSettings:
$ref: "/doc/swagger/include/NFMDemod.yaml#/NFMDemodSettings"
NFMModSettings:
diff --git a/sdrbase/resources/webapi/doc/swagger/include/Interferometer.yaml b/sdrbase/resources/webapi/doc/swagger/include/Interferometer.yaml
new file mode 100644
index 000000000..6bc6a56f4
--- /dev/null
+++ b/sdrbase/resources/webapi/doc/swagger/include/Interferometer.yaml
@@ -0,0 +1,16 @@
+InterferometerSettings:
+ description: Interferometer
+ properties:
+ inputFrequencyOffset:
+ type: integer
+ correlationType:
+ description: see InterferometerSettings::CorrelationType
+ type: integer
+ rgbColor:
+ type: integer
+ title:
+ type: string
+ spectrumConfig:
+ $ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrum"
+ scopeConfig:
+ $ref: "/doc/swagger/include/GLScope.yaml#/GLScope"
diff --git a/swagger/sdrangel/api/swagger/include/ChannelSettings.yaml b/swagger/sdrangel/api/swagger/include/ChannelSettings.yaml
index 666ad9466..f38023d87 100644
--- a/swagger/sdrangel/api/swagger/include/ChannelSettings.yaml
+++ b/swagger/sdrangel/api/swagger/include/ChannelSettings.yaml
@@ -41,6 +41,8 @@ ChannelSettings:
$ref: "http://localhost:8081/api/swagger/include/FreeDVMod.yaml#/FreeDVModSettings"
FreqTrackerSettings:
$ref: "http://localhost:8081/api/swagger/include/FreqTracker.yaml#/FreqTrackerSettings"
+ InterferometerSettings:
+ $ref: "http://localhost:8081/api/swagger/include/Interferometer.yaml#/InterferometerSettings"
NFMDemodSettings:
$ref: "http://localhost:8081/api/swagger/include/NFMDemod.yaml#/NFMDemodSettings"
NFMModSettings:
diff --git a/swagger/sdrangel/api/swagger/include/Interferometer.yaml b/swagger/sdrangel/api/swagger/include/Interferometer.yaml
new file mode 100644
index 000000000..1134198c6
--- /dev/null
+++ b/swagger/sdrangel/api/swagger/include/Interferometer.yaml
@@ -0,0 +1,16 @@
+InterferometerSettings:
+ description: Interferometer
+ properties:
+ inputFrequencyOffset:
+ type: integer
+ correlationType:
+ description: see InterferometerSettings::CorrelationType
+ type: integer
+ rgbColor:
+ type: integer
+ title:
+ type: string
+ spectrumConfig:
+ $ref: "http://localhost:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrum"
+ scopeConfig:
+ $ref: "http://localhost:8081/api/swagger/include/GLScope.yaml#/GLScope"
diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html
index b01f858f1..c73a52c0c 100644
--- a/swagger/sdrangel/code/html2/index.html
+++ b/swagger/sdrangel/code/html2/index.html
@@ -2226,6 +2226,9 @@ margin-bottom: 20px;
"FreqTrackerSettings" : {
"$ref" : "#/definitions/FreqTrackerSettings"
},
+ "InterferometerSettings" : {
+ "$ref" : "#/definitions/InterferometerSettings"
+ },
"NFMDemodSettings" : {
"$ref" : "#/definitions/NFMDemodSettings"
},
@@ -3856,6 +3859,30 @@ margin-bottom: 20px;
}
},
"description" : "Summarized information about this SDRangel instance"
+};
+ defs.InterferometerSettings = {
+ "properties" : {
+ "inputFrequencyOffset" : {
+ "type" : "integer"
+ },
+ "correlationType" : {
+ "type" : "integer",
+ "description" : "see InterferometerSettings::CorrelationType"
+ },
+ "rgbColor" : {
+ "type" : "integer"
+ },
+ "title" : {
+ "type" : "string"
+ },
+ "spectrumConfig" : {
+ "$ref" : "#/definitions/GLSpectrum"
+ },
+ "scopeConfig" : {
+ "$ref" : "#/definitions/GLScope"
+ }
+ },
+ "description" : "Interferometer"
};
defs.KiwiSDRReport = {
"properties" : {
diff --git a/swagger/sdrangel/code/qt5/client/SWGChannelSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGChannelSettings.cpp
index 1eba68794..bf1b55260 100644
--- a/swagger/sdrangel/code/qt5/client/SWGChannelSettings.cpp
+++ b/swagger/sdrangel/code/qt5/client/SWGChannelSettings.cpp
@@ -60,6 +60,8 @@ SWGChannelSettings::SWGChannelSettings() {
m_free_dv_mod_settings_isSet = false;
freq_tracker_settings = nullptr;
m_freq_tracker_settings_isSet = false;
+ interferometer_settings = nullptr;
+ m_interferometer_settings_isSet = false;
nfm_demod_settings = nullptr;
m_nfm_demod_settings_isSet = false;
nfm_mod_settings = nullptr;
@@ -124,6 +126,8 @@ SWGChannelSettings::init() {
m_free_dv_mod_settings_isSet = false;
freq_tracker_settings = new SWGFreqTrackerSettings();
m_freq_tracker_settings_isSet = false;
+ interferometer_settings = new SWGInterferometerSettings();
+ m_interferometer_settings_isSet = false;
nfm_demod_settings = new SWGNFMDemodSettings();
m_nfm_demod_settings_isSet = false;
nfm_mod_settings = new SWGNFMModSettings();
@@ -194,6 +198,9 @@ SWGChannelSettings::cleanup() {
if(freq_tracker_settings != nullptr) {
delete freq_tracker_settings;
}
+ if(interferometer_settings != nullptr) {
+ delete interferometer_settings;
+ }
if(nfm_demod_settings != nullptr) {
delete nfm_demod_settings;
}
@@ -275,6 +282,8 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&freq_tracker_settings, pJson["FreqTrackerSettings"], "SWGFreqTrackerSettings", "SWGFreqTrackerSettings");
+ ::SWGSDRangel::setValue(&interferometer_settings, pJson["InterferometerSettings"], "SWGInterferometerSettings", "SWGInterferometerSettings");
+
::SWGSDRangel::setValue(&nfm_demod_settings, pJson["NFMDemodSettings"], "SWGNFMDemodSettings", "SWGNFMDemodSettings");
::SWGSDRangel::setValue(&nfm_mod_settings, pJson["NFMModSettings"], "SWGNFMModSettings", "SWGNFMModSettings");
@@ -363,6 +372,9 @@ SWGChannelSettings::asJsonObject() {
if((freq_tracker_settings != nullptr) && (freq_tracker_settings->isSet())){
toJsonValue(QString("FreqTrackerSettings"), freq_tracker_settings, obj, QString("SWGFreqTrackerSettings"));
}
+ if((interferometer_settings != nullptr) && (interferometer_settings->isSet())){
+ toJsonValue(QString("InterferometerSettings"), interferometer_settings, obj, QString("SWGInterferometerSettings"));
+ }
if((nfm_demod_settings != nullptr) && (nfm_demod_settings->isSet())){
toJsonValue(QString("NFMDemodSettings"), nfm_demod_settings, obj, QString("SWGNFMDemodSettings"));
}
@@ -563,6 +575,16 @@ SWGChannelSettings::setFreqTrackerSettings(SWGFreqTrackerSettings* freq_tracker_
this->m_freq_tracker_settings_isSet = true;
}
+SWGInterferometerSettings*
+SWGChannelSettings::getInterferometerSettings() {
+ return interferometer_settings;
+}
+void
+SWGChannelSettings::setInterferometerSettings(SWGInterferometerSettings* interferometer_settings) {
+ this->interferometer_settings = interferometer_settings;
+ this->m_interferometer_settings_isSet = true;
+}
+
SWGNFMDemodSettings*
SWGChannelSettings::getNfmDemodSettings() {
return nfm_demod_settings;
@@ -736,6 +758,9 @@ SWGChannelSettings::isSet(){
if(freq_tracker_settings && freq_tracker_settings->isSet()){
isObjectUpdated = true; break;
}
+ if(interferometer_settings && interferometer_settings->isSet()){
+ isObjectUpdated = true; break;
+ }
if(nfm_demod_settings && nfm_demod_settings->isSet()){
isObjectUpdated = true; break;
}
diff --git a/swagger/sdrangel/code/qt5/client/SWGChannelSettings.h b/swagger/sdrangel/code/qt5/client/SWGChannelSettings.h
index 724f9c501..c5c09d576 100644
--- a/swagger/sdrangel/code/qt5/client/SWGChannelSettings.h
+++ b/swagger/sdrangel/code/qt5/client/SWGChannelSettings.h
@@ -34,6 +34,7 @@
#include "SWGFreeDVDemodSettings.h"
#include "SWGFreeDVModSettings.h"
#include "SWGFreqTrackerSettings.h"
+#include "SWGInterferometerSettings.h"
#include "SWGLocalSinkSettings.h"
#include "SWGLocalSourceSettings.h"
#include "SWGNFMDemodSettings.h"
@@ -114,6 +115,9 @@ public:
SWGFreqTrackerSettings* getFreqTrackerSettings();
void setFreqTrackerSettings(SWGFreqTrackerSettings* freq_tracker_settings);
+ SWGInterferometerSettings* getInterferometerSettings();
+ void setInterferometerSettings(SWGInterferometerSettings* interferometer_settings);
+
SWGNFMDemodSettings* getNfmDemodSettings();
void setNfmDemodSettings(SWGNFMDemodSettings* nfm_demod_settings);
@@ -202,6 +206,9 @@ private:
SWGFreqTrackerSettings* freq_tracker_settings;
bool m_freq_tracker_settings_isSet;
+ SWGInterferometerSettings* interferometer_settings;
+ bool m_interferometer_settings_isSet;
+
SWGNFMDemodSettings* nfm_demod_settings;
bool m_nfm_demod_settings_isSet;
diff --git a/swagger/sdrangel/code/qt5/client/SWGInterferometerSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGInterferometerSettings.cpp
new file mode 100644
index 000000000..dac3959df
--- /dev/null
+++ b/swagger/sdrangel/code/qt5/client/SWGInterferometerSettings.cpp
@@ -0,0 +1,229 @@
+/**
+ * SDRangel
+ * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
+ *
+ * OpenAPI spec version: 4.11.6
+ * Contact: f4exb06@gmail.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+
+#include "SWGInterferometerSettings.h"
+
+#include "SWGHelpers.h"
+
+#include
+#include
+#include
+#include
+
+namespace SWGSDRangel {
+
+SWGInterferometerSettings::SWGInterferometerSettings(QString* json) {
+ init();
+ this->fromJson(*json);
+}
+
+SWGInterferometerSettings::SWGInterferometerSettings() {
+ input_frequency_offset = 0;
+ m_input_frequency_offset_isSet = false;
+ correlation_type = 0;
+ m_correlation_type_isSet = false;
+ rgb_color = 0;
+ m_rgb_color_isSet = false;
+ title = nullptr;
+ m_title_isSet = false;
+ spectrum_config = nullptr;
+ m_spectrum_config_isSet = false;
+ scope_config = nullptr;
+ m_scope_config_isSet = false;
+}
+
+SWGInterferometerSettings::~SWGInterferometerSettings() {
+ this->cleanup();
+}
+
+void
+SWGInterferometerSettings::init() {
+ input_frequency_offset = 0;
+ m_input_frequency_offset_isSet = false;
+ correlation_type = 0;
+ m_correlation_type_isSet = false;
+ rgb_color = 0;
+ m_rgb_color_isSet = false;
+ title = new QString("");
+ m_title_isSet = false;
+ spectrum_config = new SWGGLSpectrum();
+ m_spectrum_config_isSet = false;
+ scope_config = new SWGGLScope();
+ m_scope_config_isSet = false;
+}
+
+void
+SWGInterferometerSettings::cleanup() {
+
+
+
+ if(title != nullptr) {
+ delete title;
+ }
+ if(spectrum_config != nullptr) {
+ delete spectrum_config;
+ }
+ if(scope_config != nullptr) {
+ delete scope_config;
+ }
+}
+
+SWGInterferometerSettings*
+SWGInterferometerSettings::fromJson(QString &json) {
+ QByteArray array (json.toStdString().c_str());
+ QJsonDocument doc = QJsonDocument::fromJson(array);
+ QJsonObject jsonObject = doc.object();
+ this->fromJsonObject(jsonObject);
+ return this;
+}
+
+void
+SWGInterferometerSettings::fromJsonObject(QJsonObject &pJson) {
+ ::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint32", "");
+
+ ::SWGSDRangel::setValue(&correlation_type, pJson["correlationType"], "qint32", "");
+
+ ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
+
+ ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
+
+ ::SWGSDRangel::setValue(&spectrum_config, pJson["spectrumConfig"], "SWGGLSpectrum", "SWGGLSpectrum");
+
+ ::SWGSDRangel::setValue(&scope_config, pJson["scopeConfig"], "SWGGLScope", "SWGGLScope");
+
+}
+
+QString
+SWGInterferometerSettings::asJson ()
+{
+ QJsonObject* obj = this->asJsonObject();
+
+ QJsonDocument doc(*obj);
+ QByteArray bytes = doc.toJson();
+ delete obj;
+ return QString(bytes);
+}
+
+QJsonObject*
+SWGInterferometerSettings::asJsonObject() {
+ QJsonObject* obj = new QJsonObject();
+ if(m_input_frequency_offset_isSet){
+ obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
+ }
+ if(m_correlation_type_isSet){
+ obj->insert("correlationType", QJsonValue(correlation_type));
+ }
+ if(m_rgb_color_isSet){
+ obj->insert("rgbColor", QJsonValue(rgb_color));
+ }
+ if(title != nullptr && *title != QString("")){
+ toJsonValue(QString("title"), title, obj, QString("QString"));
+ }
+ if((spectrum_config != nullptr) && (spectrum_config->isSet())){
+ toJsonValue(QString("spectrumConfig"), spectrum_config, obj, QString("SWGGLSpectrum"));
+ }
+ if((scope_config != nullptr) && (scope_config->isSet())){
+ toJsonValue(QString("scopeConfig"), scope_config, obj, QString("SWGGLScope"));
+ }
+
+ return obj;
+}
+
+qint32
+SWGInterferometerSettings::getInputFrequencyOffset() {
+ return input_frequency_offset;
+}
+void
+SWGInterferometerSettings::setInputFrequencyOffset(qint32 input_frequency_offset) {
+ this->input_frequency_offset = input_frequency_offset;
+ this->m_input_frequency_offset_isSet = true;
+}
+
+qint32
+SWGInterferometerSettings::getCorrelationType() {
+ return correlation_type;
+}
+void
+SWGInterferometerSettings::setCorrelationType(qint32 correlation_type) {
+ this->correlation_type = correlation_type;
+ this->m_correlation_type_isSet = true;
+}
+
+qint32
+SWGInterferometerSettings::getRgbColor() {
+ return rgb_color;
+}
+void
+SWGInterferometerSettings::setRgbColor(qint32 rgb_color) {
+ this->rgb_color = rgb_color;
+ this->m_rgb_color_isSet = true;
+}
+
+QString*
+SWGInterferometerSettings::getTitle() {
+ return title;
+}
+void
+SWGInterferometerSettings::setTitle(QString* title) {
+ this->title = title;
+ this->m_title_isSet = true;
+}
+
+SWGGLSpectrum*
+SWGInterferometerSettings::getSpectrumConfig() {
+ return spectrum_config;
+}
+void
+SWGInterferometerSettings::setSpectrumConfig(SWGGLSpectrum* spectrum_config) {
+ this->spectrum_config = spectrum_config;
+ this->m_spectrum_config_isSet = true;
+}
+
+SWGGLScope*
+SWGInterferometerSettings::getScopeConfig() {
+ return scope_config;
+}
+void
+SWGInterferometerSettings::setScopeConfig(SWGGLScope* scope_config) {
+ this->scope_config = scope_config;
+ this->m_scope_config_isSet = true;
+}
+
+
+bool
+SWGInterferometerSettings::isSet(){
+ bool isObjectUpdated = false;
+ do{
+ if(m_input_frequency_offset_isSet){
+ isObjectUpdated = true; break;
+ }
+ if(m_correlation_type_isSet){
+ isObjectUpdated = true; break;
+ }
+ if(m_rgb_color_isSet){
+ isObjectUpdated = true; break;
+ }
+ if(title && *title != QString("")){
+ isObjectUpdated = true; break;
+ }
+ if(spectrum_config && spectrum_config->isSet()){
+ isObjectUpdated = true; break;
+ }
+ if(scope_config && scope_config->isSet()){
+ isObjectUpdated = true; break;
+ }
+ }while(false);
+ return isObjectUpdated;
+}
+}
+
diff --git a/swagger/sdrangel/code/qt5/client/SWGInterferometerSettings.h b/swagger/sdrangel/code/qt5/client/SWGInterferometerSettings.h
new file mode 100644
index 000000000..b9fc0363e
--- /dev/null
+++ b/swagger/sdrangel/code/qt5/client/SWGInterferometerSettings.h
@@ -0,0 +1,91 @@
+/**
+ * SDRangel
+ * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
+ *
+ * OpenAPI spec version: 4.11.6
+ * Contact: f4exb06@gmail.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+/*
+ * SWGInterferometerSettings.h
+ *
+ * Interferometer
+ */
+
+#ifndef SWGInterferometerSettings_H_
+#define SWGInterferometerSettings_H_
+
+#include
+
+
+#include "SWGGLScope.h"
+#include "SWGGLSpectrum.h"
+#include
+
+#include "SWGObject.h"
+#include "export.h"
+
+namespace SWGSDRangel {
+
+class SWG_API SWGInterferometerSettings: public SWGObject {
+public:
+ SWGInterferometerSettings();
+ SWGInterferometerSettings(QString* json);
+ virtual ~SWGInterferometerSettings();
+ void init();
+ void cleanup();
+
+ virtual QString asJson () override;
+ virtual QJsonObject* asJsonObject() override;
+ virtual void fromJsonObject(QJsonObject &json) override;
+ virtual SWGInterferometerSettings* fromJson(QString &jsonString) override;
+
+ qint32 getInputFrequencyOffset();
+ void setInputFrequencyOffset(qint32 input_frequency_offset);
+
+ qint32 getCorrelationType();
+ void setCorrelationType(qint32 correlation_type);
+
+ qint32 getRgbColor();
+ void setRgbColor(qint32 rgb_color);
+
+ QString* getTitle();
+ void setTitle(QString* title);
+
+ SWGGLSpectrum* getSpectrumConfig();
+ void setSpectrumConfig(SWGGLSpectrum* spectrum_config);
+
+ SWGGLScope* getScopeConfig();
+ void setScopeConfig(SWGGLScope* scope_config);
+
+
+ virtual bool isSet() override;
+
+private:
+ qint32 input_frequency_offset;
+ bool m_input_frequency_offset_isSet;
+
+ qint32 correlation_type;
+ bool m_correlation_type_isSet;
+
+ qint32 rgb_color;
+ bool m_rgb_color_isSet;
+
+ QString* title;
+ bool m_title_isSet;
+
+ SWGGLSpectrum* spectrum_config;
+ bool m_spectrum_config_isSet;
+
+ SWGGLScope* scope_config;
+ bool m_scope_config_isSet;
+
+};
+
+}
+
+#endif /* SWGInterferometerSettings_H_ */
diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h
index d8ba07199..6fb279d60 100644
--- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h
+++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h
@@ -89,6 +89,7 @@
#include "SWGInstanceConfigResponse.h"
#include "SWGInstanceDevicesResponse.h"
#include "SWGInstanceSummaryResponse.h"
+#include "SWGInterferometerSettings.h"
#include "SWGKiwiSDRReport.h"
#include "SWGKiwiSDRSettings.h"
#include "SWGLimeSdrInputReport.h"
@@ -396,6 +397,9 @@ namespace SWGSDRangel {
if(QString("SWGInstanceSummaryResponse").compare(type) == 0) {
return new SWGInstanceSummaryResponse();
}
+ if(QString("SWGInterferometerSettings").compare(type) == 0) {
+ return new SWGInterferometerSettings();
+ }
if(QString("SWGKiwiSDRReport").compare(type) == 0) {
return new SWGKiwiSDRReport();
}