1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-17 23:28:50 -05:00

MIMO: implemented add/remove MIMO device set in main GUI

This commit is contained in:
f4exb 2019-05-18 11:59:56 +02:00
parent ddde7a925f
commit 75ee688ac2
27 changed files with 523 additions and 211 deletions

View File

@ -483,8 +483,8 @@ int TestMI::webapiSettingsGet(
QString& errorMessage)
{
(void) errorMessage;
response.setTestSourceMiSettings(new SWGSDRangel::SWGTestSourceMISettings());
response.getTestSourceMiSettings()->init();
response.setTestMiSettings(new SWGSDRangel::SWGTestMISettings());
response.getTestMiSettings()->init();
webapiFormatDeviceSettings(response, m_settings);
return 200;
}
@ -499,75 +499,75 @@ int TestMI::webapiSettingsPutPatch(
TestMISettings settings = m_settings;
if (deviceSettingsKeys.contains("centerFrequency")) {
settings.m_centerFrequency = response.getTestSourceMiSettings()->getCenterFrequency();
settings.m_centerFrequency = response.getTestMiSettings()->getCenterFrequency();
}
if (deviceSettingsKeys.contains("frequencyShift")) {
settings.m_frequencyShift = response.getTestSourceMiSettings()->getFrequencyShift();
settings.m_frequencyShift = response.getTestMiSettings()->getFrequencyShift();
}
if (deviceSettingsKeys.contains("sampleRate")) {
settings.m_sampleRate = response.getTestSourceMiSettings()->getSampleRate();
settings.m_sampleRate = response.getTestMiSettings()->getSampleRate();
}
if (deviceSettingsKeys.contains("log2Decim")) {
settings.m_log2Decim = response.getTestSourceMiSettings()->getLog2Decim();
settings.m_log2Decim = response.getTestMiSettings()->getLog2Decim();
}
if (deviceSettingsKeys.contains("fcPos")) {
int fcPos = response.getTestSourceMiSettings()->getFcPos();
int fcPos = response.getTestMiSettings()->getFcPos();
fcPos = fcPos < 0 ? 0 : fcPos > 2 ? 2 : fcPos;
settings.m_fcPos = (TestMISettings::fcPos_t) fcPos;
}
if (deviceSettingsKeys.contains("sampleSizeIndex")) {
int sampleSizeIndex = response.getTestSourceMiSettings()->getSampleSizeIndex();
int sampleSizeIndex = response.getTestMiSettings()->getSampleSizeIndex();
sampleSizeIndex = sampleSizeIndex < 0 ? 0 : sampleSizeIndex > 1 ? 2 : sampleSizeIndex;
settings.m_sampleSizeIndex = sampleSizeIndex;
}
if (deviceSettingsKeys.contains("amplitudeBits")) {
settings.m_amplitudeBits = response.getTestSourceMiSettings()->getAmplitudeBits();
settings.m_amplitudeBits = response.getTestMiSettings()->getAmplitudeBits();
}
if (deviceSettingsKeys.contains("autoCorrOptions")) {
int autoCorrOptions = response.getTestSourceMiSettings()->getAutoCorrOptions();
int autoCorrOptions = response.getTestMiSettings()->getAutoCorrOptions();
autoCorrOptions = autoCorrOptions < 0 ? 0 : autoCorrOptions >= TestMISettings::AutoCorrLast ? TestMISettings::AutoCorrLast-1 : autoCorrOptions;
settings.m_sampleSizeIndex = (TestMISettings::AutoCorrOptions) autoCorrOptions;
}
if (deviceSettingsKeys.contains("modulation")) {
int modulation = response.getTestSourceMiSettings()->getModulation();
int modulation = response.getTestMiSettings()->getModulation();
modulation = modulation < 0 ? 0 : modulation >= TestMISettings::ModulationLast ? TestMISettings::ModulationLast-1 : modulation;
settings.m_modulation = (TestMISettings::Modulation) modulation;
}
if (deviceSettingsKeys.contains("modulationTone")) {
settings.m_modulationTone = response.getTestSourceMiSettings()->getModulationTone();
settings.m_modulationTone = response.getTestMiSettings()->getModulationTone();
}
if (deviceSettingsKeys.contains("amModulation")) {
settings.m_amModulation = response.getTestSourceMiSettings()->getAmModulation();
settings.m_amModulation = response.getTestMiSettings()->getAmModulation();
};
if (deviceSettingsKeys.contains("fmDeviation")) {
settings.m_fmDeviation = response.getTestSourceMiSettings()->getFmDeviation();
settings.m_fmDeviation = response.getTestMiSettings()->getFmDeviation();
};
if (deviceSettingsKeys.contains("dcFactor")) {
settings.m_dcFactor = response.getTestSourceMiSettings()->getDcFactor();
settings.m_dcFactor = response.getTestMiSettings()->getDcFactor();
};
if (deviceSettingsKeys.contains("iFactor")) {
settings.m_iFactor = response.getTestSourceMiSettings()->getIFactor();
settings.m_iFactor = response.getTestMiSettings()->getIFactor();
};
if (deviceSettingsKeys.contains("qFactor")) {
settings.m_qFactor = response.getTestSourceMiSettings()->getQFactor();
settings.m_qFactor = response.getTestMiSettings()->getQFactor();
};
if (deviceSettingsKeys.contains("phaseImbalance")) {
settings.m_phaseImbalance = response.getTestSourceMiSettings()->getPhaseImbalance();
settings.m_phaseImbalance = response.getTestMiSettings()->getPhaseImbalance();
};
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getTestSourceMiSettings()->getFileRecordName();
settings.m_fileRecordName = *response.getTestMiSettings()->getFileRecordName();
}
if (deviceSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getTestSourceMiSettings()->getUseReverseApi() != 0;
settings.m_useReverseAPI = response.getTestMiSettings()->getUseReverseApi() != 0;
}
if (deviceSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getTestSourceMiSettings()->getReverseApiAddress();
settings.m_reverseAPIAddress = *response.getTestMiSettings()->getReverseApiAddress();
}
if (deviceSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getTestSourceMiSettings()->getReverseApiPort();
settings.m_reverseAPIPort = response.getTestMiSettings()->getReverseApiPort();
}
if (deviceSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getTestSourceMiSettings()->getReverseApiDeviceIndex();
settings.m_reverseAPIDeviceIndex = response.getTestMiSettings()->getReverseApiDeviceIndex();
}
MsgConfigureTestSource *msg = MsgConfigureTestSource::create(settings, force);
@ -585,39 +585,39 @@ int TestMI::webapiSettingsPutPatch(
void TestMI::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const TestMISettings& settings)
{
response.getTestSourceMiSettings()->setCenterFrequency(settings.m_centerFrequency);
response.getTestSourceMiSettings()->setFrequencyShift(settings.m_frequencyShift);
response.getTestSourceMiSettings()->setSampleRate(settings.m_sampleRate);
response.getTestSourceMiSettings()->setLog2Decim(settings.m_log2Decim);
response.getTestSourceMiSettings()->setFcPos((int) settings.m_fcPos);
response.getTestSourceMiSettings()->setSampleSizeIndex((int) settings.m_sampleSizeIndex);
response.getTestSourceMiSettings()->setAmplitudeBits(settings.m_amplitudeBits);
response.getTestSourceMiSettings()->setAutoCorrOptions((int) settings.m_autoCorrOptions);
response.getTestSourceMiSettings()->setModulation((int) settings.m_modulation);
response.getTestSourceMiSettings()->setModulationTone(settings.m_modulationTone);
response.getTestSourceMiSettings()->setAmModulation(settings.m_amModulation);
response.getTestSourceMiSettings()->setFmDeviation(settings.m_fmDeviation);
response.getTestSourceMiSettings()->setDcFactor(settings.m_dcFactor);
response.getTestSourceMiSettings()->setIFactor(settings.m_iFactor);
response.getTestSourceMiSettings()->setQFactor(settings.m_qFactor);
response.getTestSourceMiSettings()->setPhaseImbalance(settings.m_phaseImbalance);
response.getTestMiSettings()->setCenterFrequency(settings.m_centerFrequency);
response.getTestMiSettings()->setFrequencyShift(settings.m_frequencyShift);
response.getTestMiSettings()->setSampleRate(settings.m_sampleRate);
response.getTestMiSettings()->setLog2Decim(settings.m_log2Decim);
response.getTestMiSettings()->setFcPos((int) settings.m_fcPos);
response.getTestMiSettings()->setSampleSizeIndex((int) settings.m_sampleSizeIndex);
response.getTestMiSettings()->setAmplitudeBits(settings.m_amplitudeBits);
response.getTestMiSettings()->setAutoCorrOptions((int) settings.m_autoCorrOptions);
response.getTestMiSettings()->setModulation((int) settings.m_modulation);
response.getTestMiSettings()->setModulationTone(settings.m_modulationTone);
response.getTestMiSettings()->setAmModulation(settings.m_amModulation);
response.getTestMiSettings()->setFmDeviation(settings.m_fmDeviation);
response.getTestMiSettings()->setDcFactor(settings.m_dcFactor);
response.getTestMiSettings()->setIFactor(settings.m_iFactor);
response.getTestMiSettings()->setQFactor(settings.m_qFactor);
response.getTestMiSettings()->setPhaseImbalance(settings.m_phaseImbalance);
if (response.getTestSourceMiSettings()->getFileRecordName()) {
*response.getTestSourceMiSettings()->getFileRecordName() = settings.m_fileRecordName;
if (response.getTestMiSettings()->getFileRecordName()) {
*response.getTestMiSettings()->getFileRecordName() = settings.m_fileRecordName;
} else {
response.getTestSourceMiSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
response.getTestMiSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
response.getTestSourceMiSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
response.getTestMiSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getTestSourceMiSettings()->getReverseApiAddress()) {
*response.getTestSourceMiSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
if (response.getTestMiSettings()->getReverseApiAddress()) {
*response.getTestMiSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getTestSourceMiSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
response.getTestMiSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getTestSourceMiSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getTestSourceMiSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getTestMiSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getTestMiSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
}
void TestMI::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const TestMISettings& settings, bool force)
@ -626,61 +626,61 @@ void TestMI::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const
swgDeviceSettings->setDirection(0); // single Rx
swgDeviceSettings->setOriginatorIndex(m_deviceAPI->getDeviceSetIndex());
swgDeviceSettings->setDeviceHwType(new QString("TestSource"));
swgDeviceSettings->setTestSourceMiSettings(new SWGSDRangel::SWGTestSourceMISettings());
SWGSDRangel::SWGTestSourceMISettings *swgTestSourceMISettings = swgDeviceSettings->getTestSourceMiSettings();
swgDeviceSettings->setTestMiSettings(new SWGSDRangel::SWGTestMISettings());
SWGSDRangel::SWGTestMISettings *swgTestMISettings = swgDeviceSettings->getTestMiSettings();
// transfer data that has been modified. When force is on transfer all data except reverse API data
if (deviceSettingsKeys.contains("centerFrequency") || force) {
swgTestSourceMISettings->setCenterFrequency(settings.m_centerFrequency);
swgTestMISettings->setCenterFrequency(settings.m_centerFrequency);
}
if (deviceSettingsKeys.contains("frequencyShift") || force) {
swgTestSourceMISettings->setFrequencyShift(settings.m_frequencyShift);
swgTestMISettings->setFrequencyShift(settings.m_frequencyShift);
}
if (deviceSettingsKeys.contains("sampleRate") || force) {
swgTestSourceMISettings->setSampleRate(settings.m_sampleRate);
swgTestMISettings->setSampleRate(settings.m_sampleRate);
}
if (deviceSettingsKeys.contains("log2Decim") || force) {
swgTestSourceMISettings->setLog2Decim(settings.m_log2Decim);
swgTestMISettings->setLog2Decim(settings.m_log2Decim);
}
if (deviceSettingsKeys.contains("fcPos") || force) {
swgTestSourceMISettings->setFcPos((int) settings.m_fcPos);
swgTestMISettings->setFcPos((int) settings.m_fcPos);
}
if (deviceSettingsKeys.contains("sampleSizeIndex") || force) {
swgTestSourceMISettings->setSampleSizeIndex(settings.m_sampleSizeIndex);
swgTestMISettings->setSampleSizeIndex(settings.m_sampleSizeIndex);
}
if (deviceSettingsKeys.contains("amplitudeBits") || force) {
swgTestSourceMISettings->setAmplitudeBits(settings.m_amplitudeBits);
swgTestMISettings->setAmplitudeBits(settings.m_amplitudeBits);
}
if (deviceSettingsKeys.contains("autoCorrOptions") || force) {
swgTestSourceMISettings->setAutoCorrOptions((int) settings.m_sampleSizeIndex);
swgTestMISettings->setAutoCorrOptions((int) settings.m_sampleSizeIndex);
}
if (deviceSettingsKeys.contains("modulation") || force) {
swgTestSourceMISettings->setModulation((int) settings.m_modulation);
swgTestMISettings->setModulation((int) settings.m_modulation);
}
if (deviceSettingsKeys.contains("modulationTone")) {
swgTestSourceMISettings->setModulationTone(settings.m_modulationTone);
swgTestMISettings->setModulationTone(settings.m_modulationTone);
}
if (deviceSettingsKeys.contains("amModulation") || force) {
swgTestSourceMISettings->setAmModulation(settings.m_amModulation);
swgTestMISettings->setAmModulation(settings.m_amModulation);
};
if (deviceSettingsKeys.contains("fmDeviation") || force) {
swgTestSourceMISettings->setFmDeviation(settings.m_fmDeviation);
swgTestMISettings->setFmDeviation(settings.m_fmDeviation);
};
if (deviceSettingsKeys.contains("dcFactor") || force) {
swgTestSourceMISettings->setDcFactor(settings.m_dcFactor);
swgTestMISettings->setDcFactor(settings.m_dcFactor);
};
if (deviceSettingsKeys.contains("iFactor") || force) {
swgTestSourceMISettings->setIFactor(settings.m_iFactor);
swgTestMISettings->setIFactor(settings.m_iFactor);
};
if (deviceSettingsKeys.contains("qFactor") || force) {
swgTestSourceMISettings->setQFactor(settings.m_qFactor);
swgTestMISettings->setQFactor(settings.m_qFactor);
};
if (deviceSettingsKeys.contains("phaseImbalance") || force) {
swgTestSourceMISettings->setPhaseImbalance(settings.m_phaseImbalance);
swgTestMISettings->setPhaseImbalance(settings.m_phaseImbalance);
};
if (deviceSettingsKeys.contains("fileRecordName") || force) {
swgTestSourceMISettings->setFileRecordName(new QString(settings.m_fileRecordName));
swgTestMISettings->setFileRecordName(new QString(settings.m_fileRecordName));
}
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")

View File

@ -86,12 +86,12 @@ PluginInstanceGUI* TestMIPlugin::createSampleMIMOPluginInstanceGUI(
QWidget **widget,
DeviceUISet *deviceUISet)
{
if(sourceId == m_deviceTypeID) {
if (sourceId == m_deviceTypeID) {
TestMIGui* gui = new TestMIGui(deviceUISet);
*widget = gui;
return gui;
} else {
return 0;
return nullptr;
}
}
#endif

View File

@ -233,6 +233,18 @@ int DeviceEnumerator::getFileSinkDeviceIndex() const
return -1;
}
int DeviceEnumerator::getTestMIMODeviceIndex() const
{
for (DevicesEnumeration::const_iterator it = m_mimoEnumeration.begin(); it != m_mimoEnumeration.end(); ++it)
{
if (it->m_samplingDevice.id == PluginManager::getTestMIMODeviceId()) {
return it->m_index;
}
}
return -1;
}
int DeviceEnumerator::getRxSamplingDeviceIndex(const QString& deviceId, int sequence)
{
for (DevicesEnumeration::iterator it = m_rxEnumeration.begin(); it != m_rxEnumeration.end(); ++it)

View File

@ -54,8 +54,9 @@ public:
PluginInterface *getRxPluginInterface(int deviceIndex) { return m_rxEnumeration[deviceIndex].m_pluginInterface; }
PluginInterface *getTxPluginInterface(int deviceIndex) { return m_txEnumeration[deviceIndex].m_pluginInterface; }
PluginInterface *getMIMOPluginInterface(int deviceIndex) { return m_mimoEnumeration[deviceIndex].m_pluginInterface; }
int getFileSourceDeviceIndex() const;
int getFileSinkDeviceIndex() const;
int getFileSourceDeviceIndex() const; //!< Get Rx default device
int getFileSinkDeviceIndex() const; //!< Get Tx default device
int getTestMIMODeviceIndex() const; //!< Get MIMO default device
int getRxSamplingDeviceIndex(const QString& deviceId, int sequence);
int getTxSamplingDeviceIndex(const QString& deviceId, int sequence);
int getMIMOSamplingDeviceIndex(const QString& deviceId, int sequence);

View File

@ -42,7 +42,8 @@ MESSAGE_CLASS_DEFINITION(DSPDeviceMIMOEngine::SignalNotification, Message)
DSPDeviceMIMOEngine::DSPDeviceMIMOEngine(uint32_t uid, QObject* parent) :
QThread(parent),
m_uid(uid),
m_state(StNotStarted)
m_state(StNotStarted),
m_deviceSampleMIMO(nullptr)
{
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
connect(&m_syncMessenger, SIGNAL(messageSent()), this, SLOT(handleSynchronousMessages()), Qt::QueuedConnection);
@ -103,7 +104,7 @@ void DSPDeviceMIMOEngine::stopProcess()
void DSPDeviceMIMOEngine::setMIMO(DeviceSampleMIMO* mimo)
{
qDebug() << "DSPDeviceMIMOEngine::setSink";
qDebug() << "DSPDeviceMIMOEngine::setMIMO";
SetSampleMIMO cmd(mimo);
m_syncMessenger.sendWait(cmd);
}
@ -306,8 +307,7 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoIdle()
break;
}
if (m_deviceSampleMIMO == 0)
{
if (!m_deviceSampleMIMO) {
return StIdle;
}
@ -358,7 +358,7 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoInit()
break;
}
if (m_deviceSampleMIMO == 0) {
if (!m_deviceSampleMIMO) {
return gotoError("No sample MIMO configured");
}
@ -448,8 +448,7 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoRunning()
// Start everything
if (!m_deviceSampleMIMO->start())
{
if (!m_deviceSampleMIMO->start()) {
return gotoError("Could not start sample source");
}
@ -500,6 +499,8 @@ void DSPDeviceMIMOEngine::handleData()
void DSPDeviceMIMOEngine::handleSetMIMO(DeviceSampleMIMO* mimo)
{
m_deviceSampleMIMO = mimo;
if (mimo && (mimo->getNbSinkFifos() > 0))
{
// if there is at least one Rx then the first Rx drives the FIFOs

View File

@ -33,10 +33,10 @@ DSPDeviceSinkEngine::DSPDeviceSinkEngine(uint32_t uid, QObject* parent) :
QThread(parent),
m_uid(uid),
m_state(StNotStarted),
m_deviceSampleSink(0),
m_deviceSampleSink(nullptr),
m_sampleSinkSequence(0),
m_basebandSampleSources(),
m_spectrumSink(0),
m_spectrumSink(nullptr),
m_sampleRate(0),
m_centerFrequency(0),
m_multipleSourcesDivisionFactor(1)
@ -391,12 +391,9 @@ void DSPDeviceSinkEngine::handleSetSink(DeviceSampleSink* sink)
m_deviceSampleSink = sink;
if(m_deviceSampleSink != 0)
{
if(m_deviceSampleSink != 0) {
qDebug("DSPDeviceSinkEngine::handleSetSink: set %s", qPrintable(sink->getDeviceDescription()));
}
else
{
} else {
qDebug("DSPDeviceSinkEngine::handleSetSource: set none");
}
}

View File

@ -32,7 +32,7 @@ DSPDeviceSourceEngine::DSPDeviceSourceEngine(uint uid, QObject* parent) :
QThread(parent),
m_uid(uid),
m_state(StNotStarted),
m_deviceSampleSource(0),
m_deviceSampleSource(nullptr),
m_sampleSourceSequence(0),
m_basebandSampleSinks(),
m_sampleRate(0),

View File

@ -22,11 +22,12 @@
#include "dsp/dspengine.h"
#include "dsp/dspdevicesourceengine.h"
#include "dsp/dspdevicesinkengine.h"
#include "dsp/dspdevicemimoengine.h"
DSPEngine::DSPEngine() :
m_deviceSourceEnginesUIDSequence(0),
m_deviceSinkEnginesUIDSequence(0),
m_deviceMIMOEnginesUIDSequence(0),
m_audioInputDeviceIndex(-1), // default device
m_audioOutputDeviceIndex(-1) // default device
{
@ -88,21 +89,38 @@ void DSPEngine::removeLastDeviceSinkEngine()
}
}
DSPDeviceMIMOEngine *DSPEngine::addDeviceMIMOEngine()
{
m_deviceMIMOEngines.push_back(new DSPDeviceMIMOEngine(m_deviceMIMOEnginesUIDSequence));
m_deviceMIMOEnginesUIDSequence++;
return m_deviceMIMOEngines.back();
}
void DSPEngine::removeLastDeviceMIMOEngine()
{
if (m_deviceMIMOEngines.size() > 0)
{
DSPDeviceMIMOEngine *lastDeviceEngine = m_deviceMIMOEngines.back();
delete lastDeviceEngine;
m_deviceMIMOEngines.pop_back();
m_deviceMIMOEnginesUIDSequence--;
}
}
DSPDeviceSourceEngine *DSPEngine::getDeviceSourceEngineByUID(uint uid)
{
std::vector<DSPDeviceSourceEngine*>::iterator it = m_deviceSourceEngines.begin();
while (it != m_deviceSourceEngines.end())
{
if ((*it)->getUID() == uid)
{
if ((*it)->getUID() == uid) {
return *it;
}
++it;
}
return 0;
return nullptr;
}
DSPDeviceSinkEngine *DSPEngine::getDeviceSinkEngineByUID(uint uid)
@ -111,15 +129,30 @@ DSPDeviceSinkEngine *DSPEngine::getDeviceSinkEngineByUID(uint uid)
while (it != m_deviceSinkEngines.end())
{
if ((*it)->getUID() == uid)
{
if ((*it)->getUID() == uid) {
return *it;
}
++it;
}
return 0;
return nullptr;
}
DSPDeviceMIMOEngine *DSPEngine::getDeviceMIMOEngineByUID(uint uid)
{
std::vector<DSPDeviceMIMOEngine*>::iterator it = m_deviceMIMOEngines.begin();
while (it != m_deviceMIMOEngines.end())
{
if ((*it)->getUID() == uid) {
return *it;
}
++it;
}
return nullptr;
}
#ifdef DSD_USE_SERIALDV

View File

@ -33,6 +33,7 @@
class DSPDeviceSourceEngine;
class DSPDeviceSinkEngine;
class DSPDeviceMIMOEngine;
class SDRBASE_API DSPEngine : public QObject {
Q_OBJECT
@ -50,6 +51,9 @@ public:
DSPDeviceSinkEngine *addDeviceSinkEngine();
void removeLastDeviceSinkEngine();
DSPDeviceMIMOEngine *addDeviceMIMOEngine();
void removeLastDeviceMIMOEngine();
AudioDeviceManager *getAudioDeviceManager() { return &m_audioDeviceManager; }
uint32_t getDeviceSourceEnginesNumber() const { return m_deviceSourceEngines.size(); }
@ -60,6 +64,10 @@ public:
DSPDeviceSinkEngine *getDeviceSinkEngineByIndex(uint deviceIndex) { return m_deviceSinkEngines[deviceIndex]; }
DSPDeviceSinkEngine *getDeviceSinkEngineByUID(uint uid);
uint32_t getDeviceMIMOEnginesNumber() const { return m_deviceMIMOEngines.size(); }
DSPDeviceMIMOEngine *getDeviceMIMOEngineByIndex(uint deviceIndex) { return m_deviceMIMOEngines[deviceIndex]; }
DSPDeviceMIMOEngine *getDeviceMIMOEngineByUID(uint uid);
// Serial DV methods:
bool hasDVSerialSupport();
@ -83,6 +91,8 @@ private:
uint m_deviceSourceEnginesUIDSequence;
std::vector<DSPDeviceSinkEngine*> m_deviceSinkEngines;
uint m_deviceSinkEnginesUIDSequence;
std::vector<DSPDeviceMIMOEngine*> m_deviceMIMOEngines;
uint m_deviceMIMOEnginesUIDSequence;
AudioDeviceManager m_audioDeviceManager;
int m_audioInputDeviceIndex;
int m_audioOutputDeviceIndex;

View File

@ -44,6 +44,9 @@ const QString PluginManager::m_remoteOutputDeviceTypeID = "sdrangel.samplesink.r
const QString PluginManager::m_fileSinkHardwareID = "FileSink";
const QString PluginManager::m_fileSinkDeviceTypeID = "sdrangel.samplesink.filesink";
const QString PluginManager::m_testMIMOHardwareID = "TestMI";
const QString PluginManager::m_testMIMODeviceTypeID = "sdrangel.samplemimo.testmi";
PluginManager::PluginManager(QObject* parent) :
QObject(parent),
m_pluginAPI(this)

View File

@ -84,6 +84,7 @@ public:
static const QString& getFileSourceDeviceId() { return m_fileSourceDeviceTypeID; }
static const QString& getFileSinkDeviceId() { return m_fileSinkDeviceTypeID; }
static const QString& getTestMIMODeviceId() { return m_testMIMODeviceTypeID; }
private:
struct SamplingDevice { //!< This is the device registration
@ -138,6 +139,10 @@ private:
static const QString m_fileSinkHardwareID; //!< FileSource source hardware ID
static const QString m_fileSinkDeviceTypeID; //!< FileSink sink plugin ID
// "Local" sample MIMO device IDs
static const QString m_testMIMOHardwareID; //!< Test MIMO hardware ID
static const QString m_testMIMODeviceTypeID; //!< Test MIMO plugin ID
void loadPluginsDir(const QDir& dir);
};

View File

@ -39,6 +39,7 @@
<file>webapi/doc/swagger/include/SSBMod.yaml</file>
<file>webapi/doc/swagger/include/Structs.yaml</file>
<file>webapi/doc/swagger/include/TestSource.yaml</file>
<file>webapi/doc/swagger/include/TestMI.yaml</file>
<file>webapi/doc/swagger/include/UDPSource.yaml</file>
<file>webapi/doc/swagger/include/UDPSink.yaml</file>
<file>webapi/doc/swagger/include/WFMDemod.yaml</file>

View File

@ -2335,8 +2335,8 @@ margin-bottom: 20px;
"testSourceSettings" : {
"$ref" : "#/definitions/TestSourceSettings"
},
"testSourceMISettings" : {
"$ref" : "#/definitions/TestSourceMISettings"
"testMISettings" : {
"$ref" : "#/definitions/TestMISettings"
},
"xtrxInputSettings" : {
"$ref" : "#/definitions/XtrxInputSettings"
@ -5210,7 +5210,7 @@ margin-bottom: 20px;
}
}
};
defs.TestSourceMISettings = {
defs.TestMISettings = {
"properties" : {
"centerFrequency" : {
"type" : "integer",
@ -25080,7 +25080,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2019-05-18T03:33:39.922+02:00
Generated 2019-05-18T10:36:57.027+02:00
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
TestSourceMISettings:
TestMISettings:
description: TestSourceMI
properties:
centerFrequency:

View File

@ -1830,8 +1830,8 @@ definitions:
$ref: "/doc/swagger/include/SoapySDR.yaml#/SoapySDROutputSettings"
testSourceSettings:
$ref: "/doc/swagger/include/TestSource.yaml#/TestSourceSettings"
testSourceMISettings:
$ref: "/doc/swagger/include/TestSourceMI.yaml#/TestSourceMISettings"
testMISettings:
$ref: "/doc/swagger/include/TestMI.yaml#/TestMISettings"
xtrxInputSettings:
$ref: "/doc/swagger/include/Xtrx.yaml#/XtrxInputSettings"
xtrxOutputSettings:

View File

@ -364,7 +364,6 @@ void WebAPIRequestMapper::instanceAudioService(qtwebapp::HttpRequest& request, q
void WebAPIRequestMapper::instanceAudioInputParametersService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
// TODO
SWGSDRangel::SWGErrorResponse errorResponse;
response.setHeader("Content-Type", "application/json");
response.setHeader("Access-Control-Allow-Origin", "*");

View File

@ -55,8 +55,10 @@
#include "dsp/dspcommands.h"
#include "dsp/devicesamplesource.h"
#include "dsp/devicesamplesink.h"
#include "dsp/devicesamplemimo.h"
#include "dsp/dspdevicesourceengine.h"
#include "dsp/dspdevicesinkengine.h"
#include "dsp/dspdevicemimoengine.h"
#include "plugin/pluginapi.h"
#include "gui/glspectrum.h"
#include "gui/glspectrumgui.h"
@ -219,6 +221,7 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse
qWarning("MainWindow::MainWindow: could not register resource file %s/%s", qPrintable(applicationDirPath), "sdrbase.rcc");
}
m_mimoEnabled = parser.getMIMOSupport();
m_apiAdapter = new WebAPIAdapterGUI(*this);
m_requestMapper = new WebAPIRequestMapper(this);
m_requestMapper->setAdapter(m_apiAdapter);
@ -399,6 +402,86 @@ void MainWindow::addSinkDevice()
setDeviceGUI(deviceTabIndex, gui, m_deviceUIs.back()->m_deviceAPI->getSamplingDeviceDisplayName(), false);
}
void MainWindow::addMIMODevice()
{
DSPDeviceMIMOEngine *dspDeviceMIMOEngine = m_dspEngine->addDeviceMIMOEngine();
dspDeviceMIMOEngine->start();
uint dspDeviceMIMOEngineUID = dspDeviceMIMOEngine->getUID();
char uidCStr[16];
sprintf(uidCStr, "UID:%d", dspDeviceMIMOEngineUID);
int deviceTabIndex = m_deviceUIs.size();
m_deviceUIs.push_back(new DeviceUISet(deviceTabIndex, 2, m_masterTimer));
m_deviceUIs.back()->m_deviceSourceEngine = nullptr;
m_deviceUIs.back()->m_deviceSinkEngine = nullptr;
m_deviceUIs.back()->m_deviceMIMOEngine = dspDeviceMIMOEngine;
char tabNameCStr[16];
sprintf(tabNameCStr, "M%d", deviceTabIndex);
DeviceAPI *deviceAPI = new DeviceAPI(DeviceAPI::StreamSingleTx, deviceTabIndex, nullptr, nullptr, dspDeviceMIMOEngine);
m_deviceUIs.back()->m_deviceAPI = deviceAPI;
m_deviceUIs.back()->m_samplingDeviceControl->setPluginManager(m_pluginManager);
QComboBox *channelSelector = m_deviceUIs.back()->m_samplingDeviceControl->getChannelSelector();
// Add Rx channels
QList<QString> rxChannelNames;
m_pluginManager->listRxChannels(rxChannelNames);
QStringList rxChannelNamesList(rxChannelNames);
channelSelector->addItems(rxChannelNamesList);
channelSelector->insertSeparator(channelSelector->count());
// Add Tx channels
QList<QString> txChannelNames;
m_pluginManager->listTxChannels(txChannelNames);
QStringList txChannelNamesList(txChannelNames);
channelSelector->addItems(txChannelNamesList);
// TODO: add MIMO channels
connect(m_deviceUIs.back()->m_samplingDeviceControl->getAddChannelButton(), SIGNAL(clicked(bool)), this, SLOT(channelAddClicked(bool)));
dspDeviceMIMOEngine->addSpectrumSink(m_deviceUIs.back()->m_spectrumVis);
ui->tabSpectra->addTab(m_deviceUIs.back()->m_spectrum, tabNameCStr);
ui->tabSpectraGUI->addTab(m_deviceUIs.back()->m_spectrumGUI, tabNameCStr);
ui->tabChannels->addTab(m_deviceUIs.back()->m_channelWindow, tabNameCStr);
connect(m_deviceUIs.back()->m_samplingDeviceControl, SIGNAL(changed()), this, SLOT(sampleMIMOChanged()));
ui->tabInputsSelect->addTab(m_deviceUIs.back()->m_samplingDeviceControl, tabNameCStr);
ui->tabInputsSelect->setTabToolTip(deviceTabIndex, QString(uidCStr));
// create a test MIMO by default
int testMIMODeviceIndex = DeviceEnumerator::instance()->getTestMIMODeviceIndex();
const PluginInterface::SamplingDevice *samplingDevice = DeviceEnumerator::instance()->getMIMOSamplingDevice(testMIMODeviceIndex);
m_deviceUIs.back()->m_deviceAPI->setSamplingDeviceSequence(samplingDevice->sequence);
m_deviceUIs.back()->m_deviceAPI->setNbItems(samplingDevice->deviceNbItems);
m_deviceUIs.back()->m_deviceAPI->setItemIndex(samplingDevice->deviceItemIndex);
m_deviceUIs.back()->m_deviceAPI->setHardwareId(samplingDevice->hardwareId);
m_deviceUIs.back()->m_deviceAPI->setSamplingDeviceId(samplingDevice->id);
m_deviceUIs.back()->m_deviceAPI->setSamplingDeviceSerial(samplingDevice->serial);
m_deviceUIs.back()->m_deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName);
m_deviceUIs.back()->m_deviceAPI->setSamplingDevicePluginInterface(DeviceEnumerator::instance()->getMIMOPluginInterface(testMIMODeviceIndex));
m_deviceUIs.back()->m_samplingDeviceControl->setSelectedDeviceIndex(testMIMODeviceIndex);
// delete previous plugin GUI if it exists
m_deviceUIs.back()->m_deviceAPI->getPluginInterface()->deleteSampleSourcePluginInstanceGUI(
m_deviceUIs.back()->m_deviceAPI->getSamplingDevicePluginInstanceGUI());
DeviceSampleMIMO *mimo = m_deviceUIs.back()->m_deviceAPI->getPluginInterface()->createSampleMIMOPluginInstanceMIMO(
m_deviceUIs.back()->m_deviceAPI->getSamplingDeviceId(), m_deviceUIs.back()->m_deviceAPI);
m_deviceUIs.back()->m_deviceAPI->setSampleMIMO(mimo);
QWidget *gui;
PluginInstanceGUI *pluginUI = m_deviceUIs.back()->m_deviceAPI->getPluginInterface()->createSampleMIMOPluginInstanceGUI(
m_deviceUIs.back()->m_deviceAPI->getSamplingDeviceId(),
&gui,
m_deviceUIs.back());
m_deviceUIs.back()->m_deviceAPI->getSampleMIMO()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
m_deviceUIs.back()->m_deviceAPI->setSamplingDevicePluginInstanceGUI(pluginUI);
m_deviceUIs.back()->m_deviceAPI->getSampleMIMO()->init();
setDeviceGUI(deviceTabIndex, gui, m_deviceUIs.back()->m_deviceAPI->getSamplingDeviceDisplayName(), 2);
}
void MainWindow::removeLastDevice()
{
if (m_deviceUIs.back()->m_deviceSourceEngine) // source tab
@ -485,6 +568,47 @@ void MainWindow::removeLastDevice()
delete sinkAPI;
}
else if (m_deviceUIs.back()->m_deviceMIMOEngine) // MIMO tab
{
DSPDeviceMIMOEngine *lastDeviceEngine = m_deviceUIs.back()->m_deviceMIMOEngine;
lastDeviceEngine->stopProcess();
lastDeviceEngine->removeSpectrumSink(m_deviceUIs.back()->m_spectrumVis);
ui->tabSpectraGUI->removeTab(ui->tabSpectraGUI->count() - 1);
ui->tabSpectra->removeTab(ui->tabSpectra->count() - 1);
// deletes old UI and output object
m_deviceUIs.back()->freeRxChannels();
m_deviceUIs.back()->freeTxChannels();
m_deviceUIs.back()->m_deviceAPI->getSampleMIMO()->setMessageQueueToGUI(nullptr); // have sink stop sending messages to the GUI
m_deviceUIs.back()->m_deviceAPI->getPluginInterface()->deleteSampleMIMOPluginInstanceGUI(
m_deviceUIs.back()->m_deviceAPI->getSamplingDevicePluginInstanceGUI());
m_deviceUIs.back()->m_deviceAPI->resetSamplingDeviceId();
m_deviceUIs.back()->m_deviceAPI->getPluginInterface()->deleteSampleMIMOPluginInstanceMIMO(
m_deviceUIs.back()->m_deviceAPI->getSampleMIMO());
m_deviceUIs.back()->m_samplingDeviceControl->removeSelectedDeviceIndex(); // This releases the device in the device list
ui->tabChannels->removeTab(ui->tabChannels->count() - 1);
ui->tabInputsSelect->removeTab(ui->tabInputsSelect->count() - 1);
m_deviceWidgetTabs.removeLast();
ui->tabInputsView->clear();
for (int i = 0; i < m_deviceWidgetTabs.size(); i++)
{
qDebug("MainWindow::removeLastDevice: adding back tab for %s", m_deviceWidgetTabs[i].displayName.toStdString().c_str());
ui->tabInputsView->addTab(m_deviceWidgetTabs[i].gui, m_deviceWidgetTabs[i].tabName);
ui->tabInputsView->setTabToolTip(i, m_deviceWidgetTabs[i].displayName);
}
DeviceAPI *mimoAPI = m_deviceUIs.back()->m_deviceAPI;
delete m_deviceUIs.back();
lastDeviceEngine->stop();
m_dspEngine->removeLastDeviceMIMOEngine();
delete mimoAPI;
}
m_deviceUIs.pop_back();
}
@ -522,27 +646,23 @@ void MainWindow::addViewAction(QAction* action)
ui->menu_Window->addAction(action);
}
void MainWindow::setDeviceGUI(int deviceTabIndex, QWidget* gui, const QString& deviceDisplayName, bool sourceDevice)
void MainWindow::setDeviceGUI(int deviceTabIndex, QWidget* gui, const QString& deviceDisplayName, int deviceType)
{
char tabNameCStr[16];
if (sourceDevice)
{
if (deviceType == 0) {
sprintf(tabNameCStr, "R%d", deviceTabIndex);
}
else
{
} else if (deviceType == 1) {
sprintf(tabNameCStr, "T%d", deviceTabIndex);
} else if (deviceType == 2) {
sprintf(tabNameCStr, "M%d", deviceTabIndex);
}
qDebug("MainWindow::setDeviceGUI: insert %s tab at %d", sourceDevice ? "Rx" : "Tx", deviceTabIndex);
qDebug("MainWindow::setDeviceGUI: insert device type %d tab at %d", deviceType, deviceTabIndex);
if (deviceTabIndex < m_deviceWidgetTabs.size())
{
if (deviceTabIndex < m_deviceWidgetTabs.size()) {
m_deviceWidgetTabs[deviceTabIndex] = {gui, deviceDisplayName, QString(tabNameCStr)};
}
else
{
} else {
m_deviceWidgetTabs.append({gui, deviceDisplayName, QString(tabNameCStr)});
}
@ -821,7 +941,9 @@ bool MainWindow::handleMessage(const Message& cmd)
addSinkDevice();
} else if (direction == 0) { // Single stream Rx
addSourceDevice(-1); // create with file source device by default
} // other device types not (yet) supported
} else if (direction == 2) { // MIMO
addMIMODevice();
}
return true;
}
@ -844,7 +966,9 @@ bool MainWindow::handleMessage(const Message& cmd)
sampleSinkChanged();
} else if (notif.getDeviceType() == 0) {
sampleSourceChanged();
} // TODO: for MIMO
} else if (notif.getDeviceType() == 2) {
sampleMIMOChanged();
}
return true;
}
@ -1672,13 +1796,63 @@ void MainWindow::sampleSinkChanged()
deviceUI);
deviceUI->m_deviceAPI->getSampleSink()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
deviceUI->m_deviceAPI->setSamplingDevicePluginInstanceGUI(pluginUI);
setDeviceGUI(currentSinkTabIndex, gui, deviceUI->m_deviceAPI->getSamplingDeviceDisplayName(), false);
setDeviceGUI(currentSinkTabIndex, gui, deviceUI->m_deviceAPI->getSamplingDeviceDisplayName(), 1);
m_deviceUIs.back()->m_deviceAPI->getSampleSink()->init();
deviceUI->m_deviceAPI->loadSamplingDeviceSettings(m_settings.getWorkingPreset()); // load new API settings
}
}
void MainWindow::sampleMIMOChanged()
{
// Do it in the currently selected source tab
int currentMIMOTabIndex = ui->tabInputsSelect->currentIndex();
if (currentMIMOTabIndex >= 0)
{
qDebug("MainWindow::sampleMIMOChanged: tab at %d", currentMIMOTabIndex);
DeviceUISet *deviceUI = m_deviceUIs[currentMIMOTabIndex];
deviceUI->m_deviceAPI->saveSamplingDeviceSettings(m_settings.getWorkingPreset()); // save old API settings
deviceUI->m_deviceAPI->stopDeviceEngine();
// deletes old UI and output object
deviceUI->m_deviceAPI->getSampleMIMO()->setMessageQueueToGUI(nullptr); // have sink stop sending messages to the GUI
deviceUI->m_deviceAPI->getPluginInterface()->deleteSampleMIMOPluginInstanceGUI(
deviceUI->m_deviceAPI->getSamplingDevicePluginInstanceGUI());
deviceUI->m_deviceAPI->resetSamplingDeviceId();
deviceUI->m_deviceAPI->getPluginInterface()->deleteSampleMIMOPluginInstanceMIMO(
deviceUI->m_deviceAPI->getSampleMIMO());
const PluginInterface::SamplingDevice *samplingDevice = DeviceEnumerator::instance()->getMIMOSamplingDevice(
deviceUI->m_samplingDeviceControl->getSelectedDeviceIndex());
deviceUI->m_deviceAPI->setSamplingDeviceSequence(samplingDevice->sequence);
deviceUI->m_deviceAPI->setNbItems(samplingDevice->deviceNbItems);
deviceUI->m_deviceAPI->setItemIndex(samplingDevice->deviceItemIndex);
deviceUI->m_deviceAPI->setHardwareId(samplingDevice->hardwareId);
deviceUI->m_deviceAPI->setSamplingDeviceId(samplingDevice->id);
deviceUI->m_deviceAPI->setSamplingDeviceSerial(samplingDevice->serial);
deviceUI->m_deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName);
deviceUI->m_deviceAPI->setSamplingDevicePluginInterface(
DeviceEnumerator::instance()->getMIMOPluginInterface(deviceUI->m_samplingDeviceControl->getSelectedDeviceIndex()));
// constructs new GUI and output object
DeviceSampleMIMO *mimo = deviceUI->m_deviceAPI->getPluginInterface()->createSampleMIMOPluginInstanceMIMO(
deviceUI->m_deviceAPI->getSamplingDeviceId(), deviceUI->m_deviceAPI);
deviceUI->m_deviceAPI->setSampleMIMO(mimo);
QWidget *gui;
PluginInstanceGUI *pluginUI = deviceUI->m_deviceAPI->getPluginInterface()->createSampleMIMOPluginInstanceGUI(
deviceUI->m_deviceAPI->getSamplingDeviceId(),
&gui,
deviceUI);
deviceUI->m_deviceAPI->getSampleMIMO()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
deviceUI->m_deviceAPI->setSamplingDevicePluginInstanceGUI(pluginUI);
setDeviceGUI(currentMIMOTabIndex, gui, deviceUI->m_deviceAPI->getSamplingDeviceDisplayName(), 2);
m_deviceUIs.back()->m_deviceAPI->getSampleMIMO()->init();
deviceUI->m_deviceAPI->loadSamplingDeviceSettings(m_settings.getWorkingPreset()); // load new API settings
}
}
void MainWindow::channelAddClicked(bool checked)
{
(void) checked;
@ -1718,6 +1892,15 @@ void MainWindow::on_action_addSinkDevice_triggered()
addSinkDevice();
}
void MainWindow::on_action_addMIMODevice_triggered()
{
if (m_mimoEnabled) {
addMIMODevice();
} else {
QMessageBox::information(this, tr("Message"), tr("MIMO operation not supported yet"));
}
}
void MainWindow::on_action_removeLastDevice_triggered()
{
if (m_deviceUIs.size() > 1)

View File

@ -77,7 +77,7 @@ public:
void addViewAction(QAction* action);
void addChannelRollup(int deviceTabIndex, QWidget* widget);
void setDeviceGUI(int deviceTabIndex, QWidget* gui, const QString& deviceDisplayName, bool sourceDevice = true);
void setDeviceGUI(int deviceTabIndex, QWidget* gui, const QString& deviceDisplayName, int deviceType = 0);
const QTimer& getMasterTimer() const { return m_masterTimer; }
const MainSettings& getMainSettings() const { return m_settings; }
@ -330,6 +330,7 @@ private:
WebAPIAdapterGUI *m_apiAdapter;
QString m_apiHost;
int m_apiPort;
bool m_mimoEnabled;
CommandKeyReceiver *m_commandKeyReceiver;
@ -347,6 +348,7 @@ private:
void addSourceDevice(int deviceIndex);
void addSinkDevice();
void addMIMODevice();
void removeLastDevice();
void deleteChannel(int deviceSetIndex, int channelIndex);
@ -382,11 +384,13 @@ private slots:
void on_action_My_Position_triggered();
void sampleSourceChanged();
void sampleSinkChanged();
void sampleMIMOChanged();
void channelAddClicked(bool checked);
void on_action_Loaded_Plugins_triggered();
void on_action_About_triggered();
void on_action_addSourceDevice_triggered();
void on_action_addSinkDevice_triggered();
void on_action_addMIMODevice_triggered();
void on_action_removeLastDevice_triggered();
void on_action_Exit_triggered();
void tabInputViewIndexChanged();

View File

@ -64,7 +64,7 @@
<x>0</x>
<y>0</y>
<width>1012</width>
<height>19</height>
<height>20</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
@ -79,6 +79,7 @@
</property>
<addaction name="action_addSourceDevice"/>
<addaction name="action_addSinkDevice"/>
<addaction name="action_addMIMODevice"/>
<addaction name="action_removeLastDevice"/>
</widget>
<widget class="QMenu" name="menu_View">
@ -914,6 +915,17 @@
</font>
</property>
</action>
<action name="action_addMIMODevice">
<property name="text">
<string>Add MIMO device set</string>
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>9</pointsize>
</font>
</property>
</action>
<zorder>presetDock</zorder>
<zorder>channelDock</zorder>
<zorder>commandsDock</zorder>

View File

@ -0,0 +1,51 @@
TestMISettings:
description: TestSourceMI
properties:
centerFrequency:
type: integer
format: uint64
frequencyShift:
type: integer
sampleRate:
type: integer
log2Decim:
type: integer
fcPos:
type: integer
sampleSizeIndex:
type: integer
amplitudeBits:
type: integer
autoCorrOptions:
type: integer
modulation:
type: integer
modulationTone:
type: integer
amModulation:
type: integer
fmDeviation:
type: integer
dcFactor:
type: number
format: float
iFactor:
type: number
format: float
qFactor:
type: number
format: float
phaseImbalance:
type: number
format: float
fileRecordName:
type: string
useReverseAPI:
description: Synchronize with reverse API (1 for yes, 0 for no)
type: integer
reverseAPIAddress:
type: string
reverseAPIPort:
type: integer
reverseAPIDeviceIndex:
type: integer

View File

@ -1830,8 +1830,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/SoapySDR.yaml#/SoapySDROutputSettings"
testSourceSettings:
$ref: "http://localhost:8081/api/swagger/include/TestSource.yaml#/TestSourceSettings"
testSourceMISettings:
$ref: "http://localhost:8081/api/swagger/include/TestSourceMI.yaml#/TestSourceMISettings"
testMISettings:
$ref: "http://localhost:8081/api/swagger/include/TestMI.yaml#/TestMISettings"
xtrxInputSettings:
$ref: "http://localhost:8081/api/swagger/include/Xtrx.yaml#/XtrxInputSettings"
xtrxOutputSettings:

View File

@ -2335,8 +2335,8 @@ margin-bottom: 20px;
"testSourceSettings" : {
"$ref" : "#/definitions/TestSourceSettings"
},
"testSourceMISettings" : {
"$ref" : "#/definitions/TestSourceMISettings"
"testMISettings" : {
"$ref" : "#/definitions/TestMISettings"
},
"xtrxInputSettings" : {
"$ref" : "#/definitions/XtrxInputSettings"
@ -5210,7 +5210,7 @@ margin-bottom: 20px;
}
}
};
defs.TestSourceMISettings = {
defs.TestMISettings = {
"properties" : {
"centerFrequency" : {
"type" : "integer",
@ -25080,7 +25080,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2019-05-18T03:33:39.922+02:00
Generated 2019-05-18T10:36:57.027+02:00
</div>
</div>
</div>

View File

@ -84,8 +84,8 @@ SWGDeviceSettings::SWGDeviceSettings() {
m_soapy_sdr_output_settings_isSet = false;
test_source_settings = nullptr;
m_test_source_settings_isSet = false;
test_source_mi_settings = nullptr;
m_test_source_mi_settings_isSet = false;
test_mi_settings = nullptr;
m_test_mi_settings_isSet = false;
xtrx_input_settings = nullptr;
m_xtrx_input_settings_isSet = false;
xtrx_output_settings = nullptr;
@ -154,8 +154,8 @@ SWGDeviceSettings::init() {
m_soapy_sdr_output_settings_isSet = false;
test_source_settings = new SWGTestSourceSettings();
m_test_source_settings_isSet = false;
test_source_mi_settings = new SWGTestSourceMISettings();
m_test_source_mi_settings_isSet = false;
test_mi_settings = new SWGTestMISettings();
m_test_mi_settings_isSet = false;
xtrx_input_settings = new SWGXtrxInputSettings();
m_xtrx_input_settings_isSet = false;
xtrx_output_settings = new SWGXtrxOutputSettings();
@ -244,8 +244,8 @@ SWGDeviceSettings::cleanup() {
if(test_source_settings != nullptr) {
delete test_source_settings;
}
if(test_source_mi_settings != nullptr) {
delete test_source_mi_settings;
if(test_mi_settings != nullptr) {
delete test_mi_settings;
}
if(xtrx_input_settings != nullptr) {
delete xtrx_input_settings;
@ -322,7 +322,7 @@ SWGDeviceSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&test_source_settings, pJson["testSourceSettings"], "SWGTestSourceSettings", "SWGTestSourceSettings");
::SWGSDRangel::setValue(&test_source_mi_settings, pJson["testSourceMISettings"], "SWGTestSourceMISettings", "SWGTestSourceMISettings");
::SWGSDRangel::setValue(&test_mi_settings, pJson["testMISettings"], "SWGTestMISettings", "SWGTestMISettings");
::SWGSDRangel::setValue(&xtrx_input_settings, pJson["xtrxInputSettings"], "SWGXtrxInputSettings", "SWGXtrxInputSettings");
@ -428,8 +428,8 @@ SWGDeviceSettings::asJsonObject() {
if((test_source_settings != nullptr) && (test_source_settings->isSet())){
toJsonValue(QString("testSourceSettings"), test_source_settings, obj, QString("SWGTestSourceSettings"));
}
if((test_source_mi_settings != nullptr) && (test_source_mi_settings->isSet())){
toJsonValue(QString("testSourceMISettings"), test_source_mi_settings, obj, QString("SWGTestSourceMISettings"));
if((test_mi_settings != nullptr) && (test_mi_settings->isSet())){
toJsonValue(QString("testMISettings"), test_mi_settings, obj, QString("SWGTestMISettings"));
}
if((xtrx_input_settings != nullptr) && (xtrx_input_settings->isSet())){
toJsonValue(QString("xtrxInputSettings"), xtrx_input_settings, obj, QString("SWGXtrxInputSettings"));
@ -721,14 +721,14 @@ SWGDeviceSettings::setTestSourceSettings(SWGTestSourceSettings* test_source_sett
this->m_test_source_settings_isSet = true;
}
SWGTestSourceMISettings*
SWGDeviceSettings::getTestSourceMiSettings() {
return test_source_mi_settings;
SWGTestMISettings*
SWGDeviceSettings::getTestMiSettings() {
return test_mi_settings;
}
void
SWGDeviceSettings::setTestSourceMiSettings(SWGTestSourceMISettings* test_source_mi_settings) {
this->test_source_mi_settings = test_source_mi_settings;
this->m_test_source_mi_settings_isSet = true;
SWGDeviceSettings::setTestMiSettings(SWGTestMISettings* test_mi_settings) {
this->test_mi_settings = test_mi_settings;
this->m_test_mi_settings_isSet = true;
}
SWGXtrxInputSettings*
@ -784,7 +784,7 @@ SWGDeviceSettings::isSet(){
if(soapy_sdr_input_settings != nullptr && soapy_sdr_input_settings->isSet()){ isObjectUpdated = true; break;}
if(soapy_sdr_output_settings != nullptr && soapy_sdr_output_settings->isSet()){ isObjectUpdated = true; break;}
if(test_source_settings != nullptr && test_source_settings->isSet()){ isObjectUpdated = true; break;}
if(test_source_mi_settings != nullptr && test_source_mi_settings->isSet()){ isObjectUpdated = true; break;}
if(test_mi_settings != nullptr && test_mi_settings->isSet()){ isObjectUpdated = true; break;}
if(xtrx_input_settings != nullptr && xtrx_input_settings->isSet()){ isObjectUpdated = true; break;}
if(xtrx_output_settings != nullptr && xtrx_output_settings->isSet()){ isObjectUpdated = true; break;}
}while(false);

View File

@ -46,7 +46,7 @@
#include "SWGSDRPlaySettings.h"
#include "SWGSoapySDRInputSettings.h"
#include "SWGSoapySDROutputSettings.h"
#include "SWGTestSourceMISettings.h"
#include "SWGTestMISettings.h"
#include "SWGTestSourceSettings.h"
#include "SWGXtrxInputSettings.h"
#include "SWGXtrxOutputSettings.h"
@ -154,8 +154,8 @@ public:
SWGTestSourceSettings* getTestSourceSettings();
void setTestSourceSettings(SWGTestSourceSettings* test_source_settings);
SWGTestSourceMISettings* getTestSourceMiSettings();
void setTestSourceMiSettings(SWGTestSourceMISettings* test_source_mi_settings);
SWGTestMISettings* getTestMiSettings();
void setTestMiSettings(SWGTestMISettings* test_mi_settings);
SWGXtrxInputSettings* getXtrxInputSettings();
void setXtrxInputSettings(SWGXtrxInputSettings* xtrx_input_settings);
@ -251,8 +251,8 @@ private:
SWGTestSourceSettings* test_source_settings;
bool m_test_source_settings_isSet;
SWGTestSourceMISettings* test_source_mi_settings;
bool m_test_source_mi_settings_isSet;
SWGTestMISettings* test_mi_settings;
bool m_test_mi_settings_isSet;
SWGXtrxInputSettings* xtrx_input_settings;
bool m_xtrx_input_settings_isSet;

View File

@ -132,7 +132,7 @@
#include "SWGSoapySDROutputSettings.h"
#include "SWGSoapySDRReport.h"
#include "SWGSuccessResponse.h"
#include "SWGTestSourceMISettings.h"
#include "SWGTestMISettings.h"
#include "SWGTestSourceSettings.h"
#include "SWGUDPSinkReport.h"
#include "SWGUDPSinkSettings.h"
@ -504,8 +504,8 @@ namespace SWGSDRangel {
if(QString("SWGSuccessResponse").compare(type) == 0) {
return new SWGSuccessResponse();
}
if(QString("SWGTestSourceMISettings").compare(type) == 0) {
return new SWGTestSourceMISettings();
if(QString("SWGTestMISettings").compare(type) == 0) {
return new SWGTestMISettings();
}
if(QString("SWGTestSourceSettings").compare(type) == 0) {
return new SWGTestSourceSettings();

View File

@ -11,7 +11,7 @@
*/
#include "SWGTestSourceMISettings.h"
#include "SWGTestMISettings.h"
#include "SWGHelpers.h"
@ -22,12 +22,12 @@
namespace SWGSDRangel {
SWGTestSourceMISettings::SWGTestSourceMISettings(QString* json) {
SWGTestMISettings::SWGTestMISettings(QString* json) {
init();
this->fromJson(*json);
}
SWGTestSourceMISettings::SWGTestSourceMISettings() {
SWGTestMISettings::SWGTestMISettings() {
center_frequency = 0;
m_center_frequency_isSet = false;
frequency_shift = 0;
@ -72,12 +72,12 @@ SWGTestSourceMISettings::SWGTestSourceMISettings() {
m_reverse_api_device_index_isSet = false;
}
SWGTestSourceMISettings::~SWGTestSourceMISettings() {
SWGTestMISettings::~SWGTestMISettings() {
this->cleanup();
}
void
SWGTestSourceMISettings::init() {
SWGTestMISettings::init() {
center_frequency = 0;
m_center_frequency_isSet = false;
frequency_shift = 0;
@ -123,7 +123,7 @@ SWGTestSourceMISettings::init() {
}
void
SWGTestSourceMISettings::cleanup() {
SWGTestMISettings::cleanup() {
@ -151,8 +151,8 @@ SWGTestSourceMISettings::cleanup() {
}
SWGTestSourceMISettings*
SWGTestSourceMISettings::fromJson(QString &json) {
SWGTestMISettings*
SWGTestMISettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
@ -161,7 +161,7 @@ SWGTestSourceMISettings::fromJson(QString &json) {
}
void
SWGTestSourceMISettings::fromJsonObject(QJsonObject &pJson) {
SWGTestMISettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint32", "");
::SWGSDRangel::setValue(&frequency_shift, pJson["frequencyShift"], "qint32", "");
@ -207,7 +207,7 @@ SWGTestSourceMISettings::fromJsonObject(QJsonObject &pJson) {
}
QString
SWGTestSourceMISettings::asJson ()
SWGTestMISettings::asJson ()
{
QJsonObject* obj = this->asJsonObject();
@ -218,7 +218,7 @@ SWGTestSourceMISettings::asJson ()
}
QJsonObject*
SWGTestSourceMISettings::asJsonObject() {
SWGTestMISettings::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_center_frequency_isSet){
obj->insert("centerFrequency", QJsonValue(center_frequency));
@ -288,218 +288,218 @@ SWGTestSourceMISettings::asJsonObject() {
}
qint32
SWGTestSourceMISettings::getCenterFrequency() {
SWGTestMISettings::getCenterFrequency() {
return center_frequency;
}
void
SWGTestSourceMISettings::setCenterFrequency(qint32 center_frequency) {
SWGTestMISettings::setCenterFrequency(qint32 center_frequency) {
this->center_frequency = center_frequency;
this->m_center_frequency_isSet = true;
}
qint32
SWGTestSourceMISettings::getFrequencyShift() {
SWGTestMISettings::getFrequencyShift() {
return frequency_shift;
}
void
SWGTestSourceMISettings::setFrequencyShift(qint32 frequency_shift) {
SWGTestMISettings::setFrequencyShift(qint32 frequency_shift) {
this->frequency_shift = frequency_shift;
this->m_frequency_shift_isSet = true;
}
qint32
SWGTestSourceMISettings::getSampleRate() {
SWGTestMISettings::getSampleRate() {
return sample_rate;
}
void
SWGTestSourceMISettings::setSampleRate(qint32 sample_rate) {
SWGTestMISettings::setSampleRate(qint32 sample_rate) {
this->sample_rate = sample_rate;
this->m_sample_rate_isSet = true;
}
qint32
SWGTestSourceMISettings::getLog2Decim() {
SWGTestMISettings::getLog2Decim() {
return log2_decim;
}
void
SWGTestSourceMISettings::setLog2Decim(qint32 log2_decim) {
SWGTestMISettings::setLog2Decim(qint32 log2_decim) {
this->log2_decim = log2_decim;
this->m_log2_decim_isSet = true;
}
qint32
SWGTestSourceMISettings::getFcPos() {
SWGTestMISettings::getFcPos() {
return fc_pos;
}
void
SWGTestSourceMISettings::setFcPos(qint32 fc_pos) {
SWGTestMISettings::setFcPos(qint32 fc_pos) {
this->fc_pos = fc_pos;
this->m_fc_pos_isSet = true;
}
qint32
SWGTestSourceMISettings::getSampleSizeIndex() {
SWGTestMISettings::getSampleSizeIndex() {
return sample_size_index;
}
void
SWGTestSourceMISettings::setSampleSizeIndex(qint32 sample_size_index) {
SWGTestMISettings::setSampleSizeIndex(qint32 sample_size_index) {
this->sample_size_index = sample_size_index;
this->m_sample_size_index_isSet = true;
}
qint32
SWGTestSourceMISettings::getAmplitudeBits() {
SWGTestMISettings::getAmplitudeBits() {
return amplitude_bits;
}
void
SWGTestSourceMISettings::setAmplitudeBits(qint32 amplitude_bits) {
SWGTestMISettings::setAmplitudeBits(qint32 amplitude_bits) {
this->amplitude_bits = amplitude_bits;
this->m_amplitude_bits_isSet = true;
}
qint32
SWGTestSourceMISettings::getAutoCorrOptions() {
SWGTestMISettings::getAutoCorrOptions() {
return auto_corr_options;
}
void
SWGTestSourceMISettings::setAutoCorrOptions(qint32 auto_corr_options) {
SWGTestMISettings::setAutoCorrOptions(qint32 auto_corr_options) {
this->auto_corr_options = auto_corr_options;
this->m_auto_corr_options_isSet = true;
}
qint32
SWGTestSourceMISettings::getModulation() {
SWGTestMISettings::getModulation() {
return modulation;
}
void
SWGTestSourceMISettings::setModulation(qint32 modulation) {
SWGTestMISettings::setModulation(qint32 modulation) {
this->modulation = modulation;
this->m_modulation_isSet = true;
}
qint32
SWGTestSourceMISettings::getModulationTone() {
SWGTestMISettings::getModulationTone() {
return modulation_tone;
}
void
SWGTestSourceMISettings::setModulationTone(qint32 modulation_tone) {
SWGTestMISettings::setModulationTone(qint32 modulation_tone) {
this->modulation_tone = modulation_tone;
this->m_modulation_tone_isSet = true;
}
qint32
SWGTestSourceMISettings::getAmModulation() {
SWGTestMISettings::getAmModulation() {
return am_modulation;
}
void
SWGTestSourceMISettings::setAmModulation(qint32 am_modulation) {
SWGTestMISettings::setAmModulation(qint32 am_modulation) {
this->am_modulation = am_modulation;
this->m_am_modulation_isSet = true;
}
qint32
SWGTestSourceMISettings::getFmDeviation() {
SWGTestMISettings::getFmDeviation() {
return fm_deviation;
}
void
SWGTestSourceMISettings::setFmDeviation(qint32 fm_deviation) {
SWGTestMISettings::setFmDeviation(qint32 fm_deviation) {
this->fm_deviation = fm_deviation;
this->m_fm_deviation_isSet = true;
}
float
SWGTestSourceMISettings::getDcFactor() {
SWGTestMISettings::getDcFactor() {
return dc_factor;
}
void
SWGTestSourceMISettings::setDcFactor(float dc_factor) {
SWGTestMISettings::setDcFactor(float dc_factor) {
this->dc_factor = dc_factor;
this->m_dc_factor_isSet = true;
}
float
SWGTestSourceMISettings::getIFactor() {
SWGTestMISettings::getIFactor() {
return i_factor;
}
void
SWGTestSourceMISettings::setIFactor(float i_factor) {
SWGTestMISettings::setIFactor(float i_factor) {
this->i_factor = i_factor;
this->m_i_factor_isSet = true;
}
float
SWGTestSourceMISettings::getQFactor() {
SWGTestMISettings::getQFactor() {
return q_factor;
}
void
SWGTestSourceMISettings::setQFactor(float q_factor) {
SWGTestMISettings::setQFactor(float q_factor) {
this->q_factor = q_factor;
this->m_q_factor_isSet = true;
}
float
SWGTestSourceMISettings::getPhaseImbalance() {
SWGTestMISettings::getPhaseImbalance() {
return phase_imbalance;
}
void
SWGTestSourceMISettings::setPhaseImbalance(float phase_imbalance) {
SWGTestMISettings::setPhaseImbalance(float phase_imbalance) {
this->phase_imbalance = phase_imbalance;
this->m_phase_imbalance_isSet = true;
}
QString*
SWGTestSourceMISettings::getFileRecordName() {
SWGTestMISettings::getFileRecordName() {
return file_record_name;
}
void
SWGTestSourceMISettings::setFileRecordName(QString* file_record_name) {
SWGTestMISettings::setFileRecordName(QString* file_record_name) {
this->file_record_name = file_record_name;
this->m_file_record_name_isSet = true;
}
qint32
SWGTestSourceMISettings::getUseReverseApi() {
SWGTestMISettings::getUseReverseApi() {
return use_reverse_api;
}
void
SWGTestSourceMISettings::setUseReverseApi(qint32 use_reverse_api) {
SWGTestMISettings::setUseReverseApi(qint32 use_reverse_api) {
this->use_reverse_api = use_reverse_api;
this->m_use_reverse_api_isSet = true;
}
QString*
SWGTestSourceMISettings::getReverseApiAddress() {
SWGTestMISettings::getReverseApiAddress() {
return reverse_api_address;
}
void
SWGTestSourceMISettings::setReverseApiAddress(QString* reverse_api_address) {
SWGTestMISettings::setReverseApiAddress(QString* reverse_api_address) {
this->reverse_api_address = reverse_api_address;
this->m_reverse_api_address_isSet = true;
}
qint32
SWGTestSourceMISettings::getReverseApiPort() {
SWGTestMISettings::getReverseApiPort() {
return reverse_api_port;
}
void
SWGTestSourceMISettings::setReverseApiPort(qint32 reverse_api_port) {
SWGTestMISettings::setReverseApiPort(qint32 reverse_api_port) {
this->reverse_api_port = reverse_api_port;
this->m_reverse_api_port_isSet = true;
}
qint32
SWGTestSourceMISettings::getReverseApiDeviceIndex() {
SWGTestMISettings::getReverseApiDeviceIndex() {
return reverse_api_device_index;
}
void
SWGTestSourceMISettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
SWGTestMISettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
this->reverse_api_device_index = reverse_api_device_index;
this->m_reverse_api_device_index_isSet = true;
}
bool
SWGTestSourceMISettings::isSet(){
SWGTestMISettings::isSet(){
bool isObjectUpdated = false;
do{
if(m_center_frequency_isSet){ isObjectUpdated = true; break;}

View File

@ -11,13 +11,13 @@
*/
/*
* SWGTestSourceMISettings.h
* SWGTestMISettings.h
*
* TestSourceMI
*/
#ifndef SWGTestSourceMISettings_H_
#define SWGTestSourceMISettings_H_
#ifndef SWGTestMISettings_H_
#define SWGTestMISettings_H_
#include <QJsonObject>
@ -29,18 +29,18 @@
namespace SWGSDRangel {
class SWG_API SWGTestSourceMISettings: public SWGObject {
class SWG_API SWGTestMISettings: public SWGObject {
public:
SWGTestSourceMISettings();
SWGTestSourceMISettings(QString* json);
virtual ~SWGTestSourceMISettings();
SWGTestMISettings();
SWGTestMISettings(QString* json);
virtual ~SWGTestMISettings();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGTestSourceMISettings* fromJson(QString &jsonString) override;
virtual SWGTestMISettings* fromJson(QString &jsonString) override;
qint32 getCenterFrequency();
void setCenterFrequency(qint32 center_frequency);
@ -176,4 +176,4 @@ private:
}
#endif /* SWGTestSourceMISettings_H_ */
#endif /* SWGTestMISettings_H_ */