From f7c5c98550ff5d73eb4ee8747699ab50c694b187 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 20 Apr 2020 00:53:37 +0200 Subject: [PATCH] XTRX MIMO: implemented REST API --- plugins/samplemimo/xtrxmimo/xtrxmimo.cpp | 568 ++++++++- plugins/samplemimo/xtrxmimo/xtrxmimo.h | 42 +- .../xtrxmimo/xtrxmimowebapiadapter.cpp | 14 +- sdrbase/resources/webapi/doc/html2/index.html | 220 +++- .../doc/swagger/include/DeviceSettings.yaml | 2 + .../webapi/doc/swagger/include/Xtrx.yaml | 171 ++- .../resources/webapi/doc/swagger/swagger.yaml | 2 + .../api/swagger/include/DeviceSettings.yaml | 2 + .../sdrangel/api/swagger/include/Xtrx.yaml | 171 ++- swagger/sdrangel/api/swagger/swagger.yaml | 2 + swagger/sdrangel/code/html2/index.html | 220 +++- .../code/qt5/client/SWGDeviceReport.cpp | 25 + .../code/qt5/client/SWGDeviceReport.h | 7 + .../code/qt5/client/SWGDeviceSettings.cpp | 25 + .../code/qt5/client/SWGDeviceSettings.h | 7 + .../code/qt5/client/SWGModelFactory.h | 8 + .../code/qt5/client/SWGXtrxMIMOReport.cpp | 292 +++++ .../code/qt5/client/SWGXtrxMIMOReport.h | 106 ++ .../code/qt5/client/SWGXtrxMIMOSettings.cpp | 1124 +++++++++++++++++ .../code/qt5/client/SWGXtrxMIMOSettings.h | 323 +++++ 20 files changed, 3294 insertions(+), 37 deletions(-) create mode 100644 swagger/sdrangel/code/qt5/client/SWGXtrxMIMOReport.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGXtrxMIMOReport.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGXtrxMIMOSettings.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGXtrxMIMOSettings.h diff --git a/plugins/samplemimo/xtrxmimo/xtrxmimo.cpp b/plugins/samplemimo/xtrxmimo/xtrxmimo.cpp index d870fbff2..ae60e3aa0 100644 --- a/plugins/samplemimo/xtrxmimo/xtrxmimo.cpp +++ b/plugins/samplemimo/xtrxmimo/xtrxmimo.cpp @@ -20,6 +20,13 @@ #include #include +#include "SWGDeviceSettings.h" +#include "SWGXtrxMIMOSettings.h" +#include "SWGDeviceState.h" +#include "SWGDeviceReport.h" +#include "SWGDeviceActions.h" +#include "SWGXtrxMIMOReport.h" + #include "device/deviceapi.h" #include "dsp/dspcommands.h" #include "dsp/dspengine.h" @@ -1310,13 +1317,38 @@ void XTRXMIMO::setTxDeviceCenterFrequency(xtrx_dev *dev, quint64 freq_hz, int lo } } -void XTRXMIMO::webapiFormatDeviceSettings( +int XTRXMIMO::webapiSettingsGet( SWGSDRangel::SWGDeviceSettings& response, - const XTRXMIMOSettings& settings) + QString& errorMessage) { - // TODO - (void) response; - (void) settings; + (void) errorMessage; + response.setXtrxMimoSettings(new SWGSDRangel::SWGXtrxMIMOSettings()); + response.getXtrxMimoSettings()->init(); + webapiFormatDeviceSettings(response, m_settings); + return 200; +} + +int XTRXMIMO::webapiSettingsPutPatch( + bool force, + const QStringList& deviceSettingsKeys, + SWGSDRangel::SWGDeviceSettings& response, // query + response + QString& errorMessage) +{ + (void) errorMessage; + XTRXMIMOSettings settings = m_settings; + webapiUpdateDeviceSettings(settings, deviceSettingsKeys, response); + + MsgConfigureXTRXMIMO *msg = MsgConfigureXTRXMIMO::create(settings, force); + m_inputMessageQueue.push(msg); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureXTRXMIMO *msgToGUI = MsgConfigureXTRXMIMO::create(settings, force); + m_guiMessageQueue->push(msgToGUI); + } + + webapiFormatDeviceSettings(response, settings); + return 200; } void XTRXMIMO::webapiUpdateDeviceSettings( @@ -1324,8 +1356,526 @@ void XTRXMIMO::webapiUpdateDeviceSettings( const QStringList& deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings& response) { - // TODO - (void) settings; - (void) deviceSettingsKeys; - (void) response; + // common + if (deviceSettingsKeys.contains("extClock")) { + settings.m_extClock = response.getXtrxMimoSettings()->getExtClock() != 0; + } + if (deviceSettingsKeys.contains("extClockFreq")) { + settings.m_extClockFreq = response.getXtrxMimoSettings()->getExtClockFreq(); + } + if (deviceSettingsKeys.contains("fileRecordName")) { + settings.m_fileRecordName = *response.getXtrxMimoSettings()->getFileRecordName(); + } + if (deviceSettingsKeys.contains("gpioDir")) { + settings.m_gpioDir = response.getXtrxMimoSettings()->getGpioDir(); + } + if (deviceSettingsKeys.contains("gpioPins")) { + settings.m_gpioPins = response.getXtrxMimoSettings()->getGpioPins(); + } + if (deviceSettingsKeys.contains("useReverseAPI")) { + settings.m_useReverseAPI = response.getXtrxInputSettings()->getUseReverseApi() != 0; + } + if (deviceSettingsKeys.contains("reverseAPIAddress")) { + settings.m_reverseAPIAddress = *response.getXtrxInputSettings()->getReverseApiAddress(); + } + if (deviceSettingsKeys.contains("reverseAPIPort")) { + settings.m_reverseAPIPort = response.getXtrxInputSettings()->getReverseApiPort(); + } + if (deviceSettingsKeys.contains("reverseAPIDeviceIndex")) { + settings.m_reverseAPIDeviceIndex = response.getXtrxInputSettings()->getReverseApiDeviceIndex(); + } + // Rx + if (deviceSettingsKeys.contains("rxDevSampleRate")) { + settings.m_rxDevSampleRate = response.getXtrxMimoSettings()->getRxDevSampleRate(); + } + if (deviceSettingsKeys.contains("log2HardDecim")) { + settings.m_log2HardDecim = response.getXtrxMimoSettings()->getLog2HardDecim(); + } + if (deviceSettingsKeys.contains("log2SoftDecim")) { + settings.m_log2SoftDecim = response.getXtrxMimoSettings()->getLog2SoftDecim(); + } + if (deviceSettingsKeys.contains("rxCenterFrequency")) { + settings.m_rxCenterFrequency = response.getXtrxMimoSettings()->getRxCenterFrequency(); + } + if (deviceSettingsKeys.contains("dcBlock")) { + settings.m_dcBlock = response.getXtrxMimoSettings()->getDcBlock() != 0; + } + if (deviceSettingsKeys.contains("iqCorrection")) { + settings.m_iqCorrection = response.getXtrxMimoSettings()->getIqCorrection() != 0; + } + if (deviceSettingsKeys.contains("ncoEnableRx")) { + settings.m_ncoEnableRx = response.getXtrxMimoSettings()->getNcoEnableRx() != 0; + } + if (deviceSettingsKeys.contains("ncoFrequencyRx")) { + settings.m_ncoFrequencyRx = response.getXtrxMimoSettings()->getNcoFrequencyRx(); + } + if (deviceSettingsKeys.contains("antennaPathRx")) { + settings.m_antennaPathRx = (XTRXMIMOSettings::RxAntenna) response.getXtrxMimoSettings()->getAntennaPathRx(); + } + // Rx0 + if (deviceSettingsKeys.contains("lpfBWRx0")) { + settings.m_lpfBWRx0 = response.getXtrxMimoSettings()->getLpfBwRx0(); + } + if (deviceSettingsKeys.contains("gainRx0")) { + settings.m_gainRx0 = response.getXtrxMimoSettings()->getGainRx0(); + } + if (deviceSettingsKeys.contains("gainModeRx0")) { + settings.m_gainModeRx0 = (XTRXMIMOSettings::GainMode) response.getXtrxMimoSettings()->getGainModeRx0(); + } + if (deviceSettingsKeys.contains("lnaGainRx0")) { + settings.m_lnaGainRx0 = response.getXtrxMimoSettings()->getLnaGainRx0(); + } + if (deviceSettingsKeys.contains("tiaGainRx0")) { + settings.m_tiaGainRx0 = response.getXtrxMimoSettings()->getTiaGainRx0(); + } + if (deviceSettingsKeys.contains("pgaGainRx0")) { + settings.m_pgaGainRx0 = response.getXtrxMimoSettings()->getPgaGainRx0(); + } + if (deviceSettingsKeys.contains("pwrmodeRx0")) { + settings.m_pwrmodeRx0 = response.getXtrxMimoSettings()->getPwrmodeRx0(); + } + // Rx1 + if (deviceSettingsKeys.contains("lpfBWRx1")) { + settings.m_lpfBWRx1 = response.getXtrxMimoSettings()->getLpfBwRx1(); + } + if (deviceSettingsKeys.contains("gainRx1")) { + settings.m_gainRx1 = response.getXtrxMimoSettings()->getGainRx1(); + } + if (deviceSettingsKeys.contains("gainModeRx1")) { + settings.m_gainModeRx1 = (XTRXMIMOSettings::GainMode) response.getXtrxMimoSettings()->getGainModeRx1(); + } + if (deviceSettingsKeys.contains("lnaGainRx1")) { + settings.m_lnaGainRx1 = response.getXtrxMimoSettings()->getLnaGainRx1(); + } + if (deviceSettingsKeys.contains("tiaGainRx1")) { + settings.m_tiaGainRx1 = response.getXtrxMimoSettings()->getTiaGainRx1(); + } + if (deviceSettingsKeys.contains("pgaGainRx1")) { + settings.m_pgaGainRx1 = response.getXtrxMimoSettings()->getPgaGainRx1(); + } + if (deviceSettingsKeys.contains("pwrmodeRx1")) { + settings.m_pwrmodeRx1 = response.getXtrxMimoSettings()->getPwrmodeRx1(); + } + // Tx + if (deviceSettingsKeys.contains("txDevSampleRate")) { + settings.m_txDevSampleRate = response.getXtrxMimoSettings()->getTxDevSampleRate(); + } + if (deviceSettingsKeys.contains("log2HardInterp")) { + settings.m_log2HardInterp = response.getXtrxMimoSettings()->getLog2HardInterp(); + } + if (deviceSettingsKeys.contains("log2SoftInterp")) { + settings.m_log2SoftInterp = response.getXtrxMimoSettings()->getLog2SoftInterp(); + } + if (deviceSettingsKeys.contains("txCenterFrequency")) { + settings.m_txCenterFrequency = response.getXtrxMimoSettings()->getTxCenterFrequency(); + } + if (deviceSettingsKeys.contains("ncoEnableTx")) { + settings.m_ncoEnableTx = response.getXtrxMimoSettings()->getNcoEnableTx() != 0; + } + if (deviceSettingsKeys.contains("ncoFrequencyTx")) { + settings.m_ncoFrequencyTx = response.getXtrxMimoSettings()->getNcoFrequencyTx(); + } + if (deviceSettingsKeys.contains("antennaPathTx")) { + settings.m_antennaPathTx = (XTRXMIMOSettings::TxAntenna) response.getXtrxMimoSettings()->getAntennaPathTx(); + } + // Tx0 + if (deviceSettingsKeys.contains("lpfBWTx0")) { + settings.m_lpfBWTx0 = response.getXtrxMimoSettings()->getLpfBwTx0(); + } + if (deviceSettingsKeys.contains("gainTx0")) { + settings.m_gainTx0 = response.getXtrxMimoSettings()->getGainTx0(); + } + if (deviceSettingsKeys.contains("pwrmodeTx0")) { + settings.m_pwrmodeRx0 = response.getXtrxMimoSettings()->getPwrmodeTx0(); + } + // Tx1 + if (deviceSettingsKeys.contains("lpfBWTx1")) { + settings.m_lpfBWTx1 = response.getXtrxMimoSettings()->getLpfBwTx1(); + } + if (deviceSettingsKeys.contains("gainTx1")) { + settings.m_gainTx1 = response.getXtrxMimoSettings()->getGainTx1(); + } + if (deviceSettingsKeys.contains("pwrmodeTx1")) { + settings.m_pwrmodeRx1 = response.getXtrxMimoSettings()->getPwrmodeTx1(); + } +} + +void XTRXMIMO::webapiFormatDeviceSettings( + SWGSDRangel::SWGDeviceSettings& response, + const XTRXMIMOSettings& settings) +{ + // common + response.getXtrxMimoSettings()->setExtClock(settings.m_extClock ? 1 : 0); + response.getXtrxMimoSettings()->setExtClockFreq(settings.m_extClockFreq); + + if (response.getXtrxMimoSettings()->getFileRecordName()) { + *response.getXtrxMimoSettings()->getFileRecordName() = settings.m_fileRecordName; + } else { + response.getXtrxMimoSettings()->setFileRecordName(new QString(settings.m_fileRecordName)); + } + + response.getXtrxMimoSettings()->setGpioDir(settings.m_gpioDir & 0xFF); + response.getXtrxMimoSettings()->setGpioPins(settings.m_gpioPins & 0xFF); + response.getXtrxMimoSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); + + if (response.getXtrxMimoSettings()->getReverseApiAddress()) { + *response.getXtrxMimoSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress; + } else { + response.getXtrxMimoSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress)); + } + + response.getXtrxMimoSettings()->setReverseApiPort(settings.m_reverseAPIPort); + response.getXtrxMimoSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); + // Rx + response.getXtrxMimoSettings()->setRxDevSampleRate(settings.m_rxDevSampleRate); + response.getXtrxMimoSettings()->setLog2HardDecim(settings.m_log2HardDecim); + response.getXtrxMimoSettings()->setLog2SoftDecim(settings.m_log2SoftDecim); + response.getXtrxMimoSettings()->setRxCenterFrequency(settings.m_rxCenterFrequency); + response.getXtrxMimoSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0); + response.getXtrxMimoSettings()->setIqCorrection(settings.m_iqCorrection ? 1 : 0); + response.getXtrxMimoSettings()->setNcoEnableRx(settings.m_ncoEnableRx ? 1 : 0); + response.getXtrxMimoSettings()->setNcoFrequencyRx(settings.m_ncoFrequencyRx); + response.getXtrxMimoSettings()->setAntennaPathRx((int) settings.m_antennaPathRx); + // Rx0 + response.getXtrxMimoSettings()->setLpfBwRx0(settings.m_lpfBWRx0); + response.getXtrxMimoSettings()->setGainRx0(settings.m_gainRx0); + response.getXtrxMimoSettings()->setGainModeRx0((int) settings.m_gainModeRx0); + response.getXtrxMimoSettings()->setLnaGainRx0(settings.m_lnaGainRx0); + response.getXtrxMimoSettings()->setTiaGainRx0(settings.m_tiaGainRx0); + response.getXtrxMimoSettings()->setPgaGainRx0(settings.m_pgaGainRx0); + response.getXtrxMimoSettings()->setPwrmodeRx0(settings.m_pwrmodeRx0); + // Rx1 + response.getXtrxMimoSettings()->setLpfBwRx1(settings.m_lpfBWRx1); + response.getXtrxMimoSettings()->setGainRx1(settings.m_gainRx1); + response.getXtrxMimoSettings()->setGainModeRx1((int) settings.m_gainModeRx1); + response.getXtrxMimoSettings()->setLnaGainRx1(settings.m_lnaGainRx1); + response.getXtrxMimoSettings()->setTiaGainRx1(settings.m_tiaGainRx1); + response.getXtrxMimoSettings()->setPgaGainRx1(settings.m_pgaGainRx1); + response.getXtrxMimoSettings()->setPwrmodeRx1(settings.m_pwrmodeRx1); + // Tx + response.getXtrxMimoSettings()->setTxDevSampleRate(settings.m_txDevSampleRate); + response.getXtrxMimoSettings()->setLog2HardInterp(settings.m_log2HardInterp); + response.getXtrxMimoSettings()->setLog2SoftInterp(settings.m_log2SoftInterp); + response.getXtrxMimoSettings()->setTxCenterFrequency(settings.m_txCenterFrequency); + response.getXtrxMimoSettings()->setNcoEnableTx(settings.m_ncoEnableTx ? 1 : 0); + response.getXtrxMimoSettings()->setNcoFrequencyTx(settings.m_ncoFrequencyTx); + response.getXtrxMimoSettings()->setAntennaPathTx((int) settings.m_antennaPathTx); + // Tx0 + response.getXtrxMimoSettings()->setLpfBwTx0(settings.m_lpfBWTx0); + response.getXtrxMimoSettings()->setGainTx0(settings.m_gainTx0); + response.getXtrxMimoSettings()->setPwrmodeTx0(settings.m_pwrmodeTx0); + // Tx1 + response.getXtrxMimoSettings()->setLpfBwTx1(settings.m_lpfBWTx1); + response.getXtrxMimoSettings()->setGainTx1(settings.m_gainTx1); + response.getXtrxMimoSettings()->setPwrmodeTx1(settings.m_pwrmodeTx1); +} + +int XTRXMIMO::webapiReportGet( + SWGSDRangel::SWGDeviceReport& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setXtrxInputReport(new SWGSDRangel::SWGXtrxInputReport()); + response.getXtrxInputReport()->init(); + webapiFormatDeviceReport(response); + return 200; +} + +int XTRXMIMO::webapiRunGet( + int subsystemIndex, + SWGSDRangel::SWGDeviceState& response, + QString& errorMessage) +{ + if ((subsystemIndex == 0) || (subsystemIndex == 1)) + { + m_deviceAPI->getDeviceEngineStateStr(*response.getState(), subsystemIndex); + return 200; + } + else + { + errorMessage = QString("Subsystem invalid: must be 0 (Rx) or 1 (Tx)"); + return 404; + } + +} + +int XTRXMIMO::webapiRun( + bool run, + int subsystemIndex, + SWGSDRangel::SWGDeviceState& response, + QString& errorMessage) +{ + if ((subsystemIndex == 0) || (subsystemIndex == 1)) + { + m_deviceAPI->getDeviceEngineStateStr(*response.getState(), subsystemIndex); + MsgStartStop *message = MsgStartStop::create(run, subsystemIndex == 0); + m_inputMessageQueue.push(message); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgStartStop *msgToGUI = MsgStartStop::create(run, subsystemIndex == 0); + m_guiMessageQueue->push(msgToGUI); + } + + return 200; + } + else + { + errorMessage = QString("Subsystem invalid: must be 0 (Rx) or 1 (Tx)"); + return 404; + } +} + +void XTRXMIMO::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response) +{ + bool success = false; + double temp = 0.0; + bool gpsStatus = false; + uint64_t fifolevelRx = 0; + uint64_t fifolevelTx = 0; + uint32_t fifosize = 1<<16; + + if (m_deviceShared.m_dev->getDevice()) + { + int ret = xtrx_val_get(m_deviceShared.m_dev->getDevice(), + XTRX_RX, XTRX_CH_AB, XTRX_PERF_LLFIFO, &fifolevelRx); + + success = (ret >= 0); + + ret = xtrx_val_get(m_deviceShared.m_dev->getDevice(), + XTRX_TX, XTRX_CH_AB, XTRX_PERF_LLFIFO, &fifolevelTx); + + success = success & (ret >= 0); + temp = m_deviceShared.get_board_temperature() / 256.0; + gpsStatus = m_deviceShared.get_gps_status(); + } + + response.getXtrxMimoReport()->setSuccess(success ? 1 : 0); + response.getXtrxMimoReport()->setFifoSize(fifosize); + response.getXtrxMimoReport()->setFifoFillRx(fifolevelRx); + response.getXtrxMimoReport()->setFifoFillTx(fifolevelTx); + response.getXtrxMimoReport()->setTemperature(temp); + response.getXtrxMimoReport()->setGpsLock(gpsStatus ? 1 : 0); +} + +void XTRXMIMO::webapiReverseSendSettings(QList& deviceSettingsKeys, const XTRXMIMOSettings& settings, bool force) +{ + SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings(); + swgDeviceSettings->setDirection(2); // MIMO + swgDeviceSettings->setOriginatorIndex(m_deviceAPI->getDeviceSetIndex()); + swgDeviceSettings->setDeviceHwType(new QString("XTRX")); + swgDeviceSettings->setXtrxMimoSettings(new SWGSDRangel::SWGXtrxMIMOSettings()); + SWGSDRangel::SWGXtrxMIMOSettings *swgXTRXMIMOSettings = swgDeviceSettings->getXtrxMimoSettings(); + + // transfer data that has been modified. When force is on transfer all data except reverse API data + + // common + if (deviceSettingsKeys.contains("extClock") || force) { + swgXTRXMIMOSettings->setExtClock(settings.m_extClock ? 1 : 0); + } + if (deviceSettingsKeys.contains("extClock") || force) { + swgXTRXMIMOSettings->setExtClockFreq(settings.m_extClockFreq); + } + if (deviceSettingsKeys.contains("extClock") || force) { + swgXTRXMIMOSettings->setFileRecordName(new QString(settings.m_fileRecordName)); + } + if (deviceSettingsKeys.contains("gpioDir") || force) { + swgXTRXMIMOSettings->setGpioDir(settings.m_gpioDir & 0xFF); + } + if (deviceSettingsKeys.contains("gpioPins") || force) { + swgXTRXMIMOSettings->setGpioPins(settings.m_gpioPins & 0xFF); + } + // Rx + if (deviceSettingsKeys.contains("rxDevSampleRate") || force) { + swgXTRXMIMOSettings->setRxDevSampleRate(settings.m_rxDevSampleRate); + } + if (deviceSettingsKeys.contains("log2HardDecim") || force) { + swgXTRXMIMOSettings->setLog2HardDecim(settings.m_log2HardDecim); + } + if (deviceSettingsKeys.contains("log2SoftDecim") || force) { + swgXTRXMIMOSettings->setLog2SoftDecim(settings.m_log2SoftDecim); + } + if (deviceSettingsKeys.contains("rxCenterFrequency") || force) { + swgXTRXMIMOSettings->setRxCenterFrequency(settings.m_rxCenterFrequency); + } + if (deviceSettingsKeys.contains("dcBlock") || force) { + swgXTRXMIMOSettings->setDcBlock(settings.m_dcBlock ? 1 : 0); + } + if (deviceSettingsKeys.contains("iqCorrection") || force) { + swgXTRXMIMOSettings->setIqCorrection(settings.m_iqCorrection ? 1 : 0); + } + if (deviceSettingsKeys.contains("ncoEnableRx") || force) { + swgXTRXMIMOSettings->setNcoEnableRx(settings.m_ncoEnableRx ? 1 : 0); + } + if (deviceSettingsKeys.contains("ncoFrequencyRx") || force) { + swgXTRXMIMOSettings->setNcoFrequencyRx(settings.m_ncoFrequencyRx); + } + if (deviceSettingsKeys.contains("antennaPathRx") || force) { + swgXTRXMIMOSettings->setAntennaPathRx((int) settings.m_antennaPathRx); + } + // Rx0 + if (deviceSettingsKeys.contains("lpfBWRx0") || force) { + swgXTRXMIMOSettings->setLpfBwRx0(settings.m_lpfBWRx0); + } + if (deviceSettingsKeys.contains("gainRx0") || force) { + swgXTRXMIMOSettings->setGainRx0(settings.m_gainRx0); + } + if (deviceSettingsKeys.contains("gainModeRx0") || force) { + swgXTRXMIMOSettings->setGainModeRx0((int) settings.m_gainModeRx0); + } + if (deviceSettingsKeys.contains("lnaGainRx0") || force) { + swgXTRXMIMOSettings->setLnaGainRx0(settings.m_lnaGainRx0); + } + if (deviceSettingsKeys.contains("tiaGainRx0") || force) { + swgXTRXMIMOSettings->setTiaGainRx0(settings.m_tiaGainRx0); + } + if (deviceSettingsKeys.contains("pgaGainRx0") || force) { + swgXTRXMIMOSettings->setPgaGainRx0(settings.m_pgaGainRx0); + } + if (deviceSettingsKeys.contains("pwrmodeRx0") || force) { + swgXTRXMIMOSettings->setPwrmodeRx0(settings.m_pwrmodeRx0); + } + // Rx1 + if (deviceSettingsKeys.contains("lpfBWRx1") || force) { + swgXTRXMIMOSettings->setLpfBwRx1(settings.m_lpfBWRx1); + } + if (deviceSettingsKeys.contains("gainRx1") || force) { + swgXTRXMIMOSettings->setGainRx1(settings.m_gainRx1); + } + if (deviceSettingsKeys.contains("gainModeRx1") || force) { + swgXTRXMIMOSettings->setGainModeRx1((int) settings.m_gainModeRx1); + } + if (deviceSettingsKeys.contains("lnaGainRx1") || force) { + swgXTRXMIMOSettings->setLnaGainRx1(settings.m_lnaGainRx1); + } + if (deviceSettingsKeys.contains("tiaGainRx1") || force) { + swgXTRXMIMOSettings->setTiaGainRx1(settings.m_tiaGainRx1); + } + if (deviceSettingsKeys.contains("pgaGainRx1") || force) { + swgXTRXMIMOSettings->setPgaGainRx1(settings.m_pgaGainRx1); + } + if (deviceSettingsKeys.contains("pwrmodeRx1") || force) { + swgXTRXMIMOSettings->setPwrmodeRx1(settings.m_pwrmodeRx1); + } + // Tx + if (deviceSettingsKeys.contains("txDevSampleRate") || force) { + swgXTRXMIMOSettings->setTxDevSampleRate(settings.m_txDevSampleRate); + } + if (deviceSettingsKeys.contains("log2HardInterp") || force) { + swgXTRXMIMOSettings->setLog2HardInterp(settings.m_log2HardInterp); + } + if (deviceSettingsKeys.contains("log2SoftInterp") || force) { + swgXTRXMIMOSettings->setLog2SoftInterp(settings.m_log2SoftInterp); + } + if (deviceSettingsKeys.contains("txCenterFrequency") || force) { + swgXTRXMIMOSettings->setTxCenterFrequency(settings.m_txCenterFrequency); + } + if (deviceSettingsKeys.contains("ncoEnableTx") || force) { + swgXTRXMIMOSettings->setNcoEnableTx(settings.m_ncoEnableTx ? 1 : 0); + } + if (deviceSettingsKeys.contains("ncoFrequencyTx") || force) { + swgXTRXMIMOSettings->setNcoFrequencyTx(settings.m_ncoFrequencyTx); + } + if (deviceSettingsKeys.contains("antennaPathTx") || force) { + swgXTRXMIMOSettings->setAntennaPathTx((int) settings.m_antennaPathTx); + } + // Tx0 + if (deviceSettingsKeys.contains("lpfBWTx0") || force) { + swgXTRXMIMOSettings->setLpfBwTx0(settings.m_lpfBWTx0); + } + if (deviceSettingsKeys.contains("gainTx0") || force) { + swgXTRXMIMOSettings->setGainTx0(settings.m_gainTx0); + } + if (deviceSettingsKeys.contains("pwrmodeTx0") || force) { + swgXTRXMIMOSettings->setPwrmodeTx0(settings.m_pwrmodeTx0); + } + // Tx0 + if (deviceSettingsKeys.contains("lpfBWTx0") || force) { + swgXTRXMIMOSettings->setLpfBwTx0(settings.m_lpfBWTx0); + } + if (deviceSettingsKeys.contains("gainTx0") || force) { + swgXTRXMIMOSettings->setGainTx0(settings.m_gainTx0); + } + if (deviceSettingsKeys.contains("pwrmodeTx0") || force) { + swgXTRXMIMOSettings->setPwrmodeTx0(settings.m_pwrmodeTx0); + } + // Tx1 + if (deviceSettingsKeys.contains("lpfBWTx1") || force) { + swgXTRXMIMOSettings->setLpfBwTx1(settings.m_lpfBWTx1); + } + if (deviceSettingsKeys.contains("gainTx1") || force) { + swgXTRXMIMOSettings->setGainTx1(settings.m_gainTx1); + } + if (deviceSettingsKeys.contains("pwrmodeTx1") || force) { + swgXTRXMIMOSettings->setPwrmodeTx1(settings.m_pwrmodeTx1); + } + + QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings") + .arg(settings.m_reverseAPIAddress) + .arg(settings.m_reverseAPIPort) + .arg(settings.m_reverseAPIDeviceIndex); + m_networkRequest.setUrl(QUrl(deviceSettingsURL)); + m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + QBuffer *buffer = new QBuffer(); + buffer->open((QBuffer::ReadWrite)); + buffer->write(swgDeviceSettings->asJson().toUtf8()); + buffer->seek(0); + + // Always use PATCH to avoid passing reverse API settings + QNetworkReply *reply = m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer); + buffer->setParent(reply); + + delete swgDeviceSettings; +} + +void XTRXMIMO::webapiReverseSendStartStop(bool start) +{ + SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings(); + swgDeviceSettings->setDirection(2); // MIMO + swgDeviceSettings->setOriginatorIndex(m_deviceAPI->getDeviceSetIndex()); + swgDeviceSettings->setDeviceHwType(new QString("XTRX")); + + QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/run") + .arg(m_settings.m_reverseAPIAddress) + .arg(m_settings.m_reverseAPIPort) + .arg(m_settings.m_reverseAPIDeviceIndex); + m_networkRequest.setUrl(QUrl(deviceSettingsURL)); + m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + QBuffer *buffer = new QBuffer(); + buffer->open((QBuffer::ReadWrite)); + buffer->write(swgDeviceSettings->asJson().toUtf8()); + buffer->seek(0); + QNetworkReply *reply; + + if (start) { + reply = m_networkManager->sendCustomRequest(m_networkRequest, "POST", buffer); + } else { + reply = m_networkManager->sendCustomRequest(m_networkRequest, "DELETE", buffer); + } + + buffer->setParent(reply); + delete swgDeviceSettings; +} + +void XTRXMIMO::networkManagerFinished(QNetworkReply *reply) +{ + QNetworkReply::NetworkError replyError = reply->error(); + + if (replyError) + { + qWarning() << "XTRXMIMO::networkManagerFinished:" + << " error(" << (int) replyError + << "): " << replyError + << ": " << reply->errorString(); + } + else + { + QString answer = reply->readAll(); + answer.chop(1); // remove last \n + qDebug("XTRXMIMO::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); + } + + reply->deleteLater(); } diff --git a/plugins/samplemimo/xtrxmimo/xtrxmimo.h b/plugins/samplemimo/xtrxmimo/xtrxmimo.h index d8b4c84b7..3b8a77c8b 100644 --- a/plugins/samplemimo/xtrxmimo/xtrxmimo.h +++ b/plugins/samplemimo/xtrxmimo/xtrxmimo.h @@ -241,27 +241,31 @@ public: uint32_t getLog2HardInterp() const; double getClockGen() const; - // TODO - // virtual int webapiSettingsGet( - // SWGSDRangel::SWGDeviceSettings& response, - // QString& errorMessage); + virtual int webapiSettingsGet( + SWGSDRangel::SWGDeviceSettings& response, + QString& errorMessage); - // virtual int webapiSettingsPutPatch( - // bool force, - // const QStringList& deviceSettingsKeys, - // SWGSDRangel::SWGDeviceSettings& response, // query + response - // QString& errorMessage); + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& deviceSettingsKeys, + SWGSDRangel::SWGDeviceSettings& response, // query + response + QString& errorMessage); - // virtual int webapiRunGet( - // int subsystemIndex, - // SWGSDRangel::SWGDeviceState& response, - // QString& errorMessage); + virtual int webapiReportGet( + SWGSDRangel::SWGDeviceReport& response, + QString& errorMessage); - // virtual int webapiRun( - // bool run, - // int subsystemIndex, - // SWGSDRangel::SWGDeviceState& response, - // QString& errorMessage); + + virtual int webapiRunGet( + int subsystemIndex, + SWGSDRangel::SWGDeviceState& response, + QString& errorMessage); + + virtual int webapiRun( + bool run, + int subsystemIndex, + SWGSDRangel::SWGDeviceState& response, + QString& errorMessage); static void webapiFormatDeviceSettings( SWGSDRangel::SWGDeviceSettings& response, @@ -272,6 +276,8 @@ public: const QStringList& deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings& response); + void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response); + bool isRecording(unsigned int istream) const { (void) istream; return false; } bool getRxRunning() const { return m_runningRx; } diff --git a/plugins/samplemimo/xtrxmimo/xtrxmimowebapiadapter.cpp b/plugins/samplemimo/xtrxmimo/xtrxmimowebapiadapter.cpp index 081089057..2657f29c2 100644 --- a/plugins/samplemimo/xtrxmimo/xtrxmimowebapiadapter.cpp +++ b/plugins/samplemimo/xtrxmimo/xtrxmimowebapiadapter.cpp @@ -19,6 +19,7 @@ /////////////////////////////////////////////////////////////////////////////////// #include "SWGDeviceSettings.h" +#include "xtrxmimo.h" #include "xtrxmimowebapiadapter.h" XTRXMIMOWebAPIAdapter::XTRXMIMOWebAPIAdapter() @@ -32,8 +33,10 @@ int XTRXMIMOWebAPIAdapter::webapiSettingsGet( QString& errorMessage) { (void) errorMessage; - (void) response; - return 501; + response.setXtrxMimoSettings(new SWGSDRangel::SWGXtrxMIMOSettings()); + response.getXtrxMimoSettings()->init(); + XTRXMIMO::webapiFormatDeviceSettings(response, m_settings); + return 200; } int XTRXMIMOWebAPIAdapter::webapiSettingsPutPatch( @@ -42,9 +45,8 @@ int XTRXMIMOWebAPIAdapter::webapiSettingsPutPatch( SWGSDRangel::SWGDeviceSettings& response, // query + response QString& errorMessage) { - (void) errorMessage; (void) force; - (void) deviceSettingsKeys; - (void) response; - return 501; + (void) errorMessage; + XTRXMIMO::webapiUpdateDeviceSettings(m_settings, deviceSettingsKeys, response); + return 200; } diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 54555f53d..71f8393e2 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -3282,6 +3282,9 @@ margin-bottom: 20px; }, "xtrxOutputReport" : { "$ref" : "#/definitions/XtrxOutputReport" + }, + "xtrxMIMOReport" : { + "$ref" : "#/definitions/XtrxMIMOReport" } }, "description" : "Base device report. Only the device report corresponding to the device specified in the deviceHwType is or should be present." @@ -3434,6 +3437,9 @@ margin-bottom: 20px; }, "xtrxOutputSettings" : { "$ref" : "#/definitions/XtrxOutputSettings" + }, + "xtrxMIMOSettings" : { + "$ref" : "#/definitions/XtrxMIMOSettings" } }, "description" : "Base device settings. Only the device settings corresponding to the device specified in the deviceHwType field is or should be present." @@ -7876,6 +7882,218 @@ margin-bottom: 20px; } }, "description" : "XTRX" +}; + defs.XtrxMIMOReport = { + "properties" : { + "success" : { + "type" : "integer", + "description" : "1 if info was successfully retrieved else 0" + }, + "fifoSize" : { + "type" : "integer" + }, + "fifoFillRx" : { + "type" : "integer" + }, + "fifoFillTx" : { + "type" : "integer" + }, + "temperature" : { + "type" : "number", + "format" : "float" + }, + "gpsLock" : { + "type" : "integer", + "description" : "1 if GPSDO is locked else 0" + }, + "actualInputRate" : { + "type" : "integer" + }, + "actualOutputRate" : { + "type" : "integer" + }, + "clockGenRate" : { + "type" : "integer" + } + }, + "description" : "XTRX" +}; + defs.XtrxMIMOSettings = { + "properties" : { + "extClock" : { + "type" : "integer", + "description" : "Boolean 1 if external clock source else 0" + }, + "extClockFreq" : { + "type" : "integer", + "description" : "Frequency (Hz) of external clock source" + }, + "fileRecordName" : { + "type" : "string" + }, + "gpioDir" : { + "type" : "integer", + "description" : "8 bit GPIO pin direction LSB first 0 input, 1 output" + }, + "gpioPins" : { + "type" : "integer", + "description" : "8 bit GPIO pins to write LSB first" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Boolean 1 use 0 do not use reverse API" + }, + "reverseAPIAddress" : { + "type" : "string", + "description" : "IPv4 address" + }, + "reverseAPIPort" : { + "type" : "integer", + "description" : "Network port from 1024 to 65535" + }, + "reverseAPIDeviceIndex" : { + "type" : "integer" + }, + "rxDevSampleRate" : { + "type" : "integer" + }, + "log2HardDecim" : { + "type" : "integer", + "description" : "0 is automatic then 1 to 6 is log2 of hardware decimation" + }, + "log2SoftDecim" : { + "type" : "integer", + "description" : "log2 of software decimation factor from 0 to 6" + }, + "rxCenterFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "dcBlock" : { + "type" : "integer", + "description" : "Software DC blocking (1 for yes, 0 for no)" + }, + "iqCorrection" : { + "type" : "integer", + "description" : "Software IQ imbalance correction (1 for yes, 0 for no)" + }, + "ncoEnableRx" : { + "type" : "integer", + "description" : "Enable TSP NCO Rx on both channels and mixing (1 for yes, 0 for no)" + }, + "ncoFrequencyRx" : { + "type" : "integer", + "description" : "Rx frequency shift from LO for both channels" + }, + "antennaPathRx" : { + "type" : "integer", + "description" : "Antenna selected (enum value from XTRXMIMOSettings::RxAntenna):\n * 0 - RXANT_LO low range\n * 1 - RXANT_WI wide range\n * 2 - RXANT_HI high range\n" + }, + "lpfBWRx0" : { + "type" : "integer", + "description" : "LMS analog lowpass filter bandwidth (Hz) for Rx channel 0" + }, + "gainRx0" : { + "type" : "integer", + "description" : "Optimally distributed gain (dB) for Rx channel 0" + }, + "gainModeRx0" : { + "type" : "integer", + "description" : "Gain mode (XTRXMIMOSettings::GainMode) for Rx channel 0:\n * 0 - GAIN_AUTO automatic\n * 1 - GAIN_MANUAL manual\n" + }, + "lnaGainRx0" : { + "type" : "integer", + "description" : "Manual LNA gain (dB) for Rx channel 0" + }, + "tiaGainRx0" : { + "type" : "integer", + "description" : "Manual TIA gain (dB) for Rx channel 0" + }, + "pgaGainRx0" : { + "type" : "integer", + "description" : "Manual PGA gain (dB) for Rx channel 0" + }, + "pwrmodeRx0" : { + "type" : "integer" + }, + "lpfBWRx1" : { + "type" : "integer", + "description" : "LMS analog lowpass filter bandwidth (Hz) for Rx channel 1" + }, + "gainRx1" : { + "type" : "integer", + "description" : "Optimally distributed gain (dB) for Rx channel 1" + }, + "gainModeRx1" : { + "type" : "integer", + "description" : "Gain mode (XTRXMIMOSettings::GainMode) for Rx channel 1:\n * 0 - GAIN_AUTO automatic\n * 1 - GAIN_MANUAL manual\n" + }, + "lnaGainRx1" : { + "type" : "integer", + "description" : "Manual LNA gain (dB) for Rx channel 1" + }, + "tiaGainRx1" : { + "type" : "integer", + "description" : "Manual TIA gain (dB) for Rx channel 1" + }, + "pgaGainRx1" : { + "type" : "integer", + "description" : "Manual PGA gain (dB) for Rx channel 1" + }, + "pwrmodeRx1" : { + "type" : "integer" + }, + "txDevSampleRate" : { + "type" : "integer" + }, + "log2HardInterp" : { + "type" : "integer", + "description" : "0 is automatic then 1 to 6 is log2 of hardware interpolation" + }, + "log2SoftInterp" : { + "type" : "integer", + "description" : "log2 of software interpolation factor from 0 to 6" + }, + "txCenterFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "ncoEnableTx" : { + "type" : "integer", + "description" : "Enable TSP NCO Tx on both channels and mixing (1 for yes, 0 for no)" + }, + "ncoFrequencyTx" : { + "type" : "integer", + "description" : "Tx frequency shift from LO for both channels" + }, + "antennaPathTx" : { + "type" : "integer", + "description" : "Antenna selected (enum value from XTRXMIMOSettings::TxAntenna):\n * 0 - TXANT_HI high range\n * 1 - TXANT_WI wide range\n" + }, + "lpfBWTx0" : { + "type" : "integer", + "description" : "LMS analog lowpass filter bandwidth (Hz) for Tx channel 0" + }, + "gainTx0" : { + "type" : "integer", + "description" : "Optimally distributed gain (dB) for Tx channel 0" + }, + "pwrmodeTx0" : { + "type" : "integer" + }, + "lpfBWTx1" : { + "type" : "integer", + "description" : "LMS analog lowpass filter bandwidth (Hz) for Tx channel 1" + }, + "gainTx1" : { + "type" : "integer", + "description" : "Optimally distributed gain (dB) for Tx channel 1" + }, + "pwrmodeTx1" : { + "type" : "integer" + } + }, + "description" : "XTRX" }; defs.XtrxOutputReport = { "properties" : { @@ -33963,7 +34181,7 @@ except ApiException as e:
- Generated 2020-03-30T19:38:33.193+02:00 + Generated 2020-04-19T21:52:24.714+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/DeviceSettings.yaml b/sdrbase/resources/webapi/doc/swagger/include/DeviceSettings.yaml index faef35a6f..0cad39193 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/DeviceSettings.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/DeviceSettings.yaml @@ -76,3 +76,5 @@ DeviceSettings: $ref: "/doc/swagger/include/Xtrx.yaml#/XtrxInputSettings" xtrxOutputSettings: $ref: "/doc/swagger/include/Xtrx.yaml#/XtrxOutputSettings" + xtrxMIMOSettings: + $ref: "/doc/swagger/include/Xtrx.yaml#/XtrxMIMOSettings" diff --git a/sdrbase/resources/webapi/doc/swagger/include/Xtrx.yaml b/sdrbase/resources/webapi/doc/swagger/include/Xtrx.yaml index abaea7388..e6568827a 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/Xtrx.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/Xtrx.yaml @@ -152,4 +152,173 @@ XtrxOutputReport: format: float gpsLock: description: 1 if GPSDO is locked else 0 - type: integer \ No newline at end of file + type: integer + +XtrxMIMOSettings: + description: XTRX + properties: + extClock: + description: Boolean 1 if external clock source else 0 + type: integer + extClockFreq: + description: Frequency (Hz) of external clock source + type: integer + fileRecordName: + type: string + gpioDir: + description: 8 bit GPIO pin direction LSB first 0 input, 1 output + type: integer + gpioPins: + description: 8 bit GPIO pins to write LSB first + type: integer + useReverseAPI: + description: Boolean 1 use 0 do not use reverse API + type: integer + reverseAPIAddress: + description: IPv4 address + type: string + reverseAPIPort: + description: Network port from 1024 to 65535 + type: integer + reverseAPIDeviceIndex: + type: integer + rxDevSampleRate: + type: integer + log2HardDecim: + description: 0 is automatic then 1 to 6 is log2 of hardware decimation + type: integer + log2SoftDecim: + description: log2 of software decimation factor from 0 to 6 + type: integer + rxCenterFrequency: + type: integer + format: int64 + dcBlock: + description: Software DC blocking (1 for yes, 0 for no) + type: integer + iqCorrection: + description: Software IQ imbalance correction (1 for yes, 0 for no) + type: integer + ncoEnableRx: + description: Enable TSP NCO Rx on both channels and mixing (1 for yes, 0 for no) + type: integer + ncoFrequencyRx: + description: Rx frequency shift from LO for both channels + type: integer + antennaPathRx: + type: integer + description: > + Antenna selected (enum value from XTRXMIMOSettings::RxAntenna): + * 0 - RXANT_LO low range + * 1 - RXANT_WI wide range + * 2 - RXANT_HI high range + lpfBWRx0: + description: LMS analog lowpass filter bandwidth (Hz) for Rx channel 0 + type: integer + gainRx0: + description: Optimally distributed gain (dB) for Rx channel 0 + type: integer + gainModeRx0: + type: integer + description: > + Gain mode (XTRXMIMOSettings::GainMode) for Rx channel 0: + * 0 - GAIN_AUTO automatic + * 1 - GAIN_MANUAL manual + lnaGainRx0: + description: Manual LNA gain (dB) for Rx channel 0 + type: integer + tiaGainRx0: + description: Manual TIA gain (dB) for Rx channel 0 + type: integer + pgaGainRx0: + description: Manual PGA gain (dB) for Rx channel 0 + type: integer + pwrmodeRx0: + type: integer + lpfBWRx1: + description: LMS analog lowpass filter bandwidth (Hz) for Rx channel 1 + type: integer + gainRx1: + description: Optimally distributed gain (dB) for Rx channel 1 + type: integer + gainModeRx1: + type: integer + description: > + Gain mode (XTRXMIMOSettings::GainMode) for Rx channel 1: + * 0 - GAIN_AUTO automatic + * 1 - GAIN_MANUAL manual + lnaGainRx1: + description: Manual LNA gain (dB) for Rx channel 1 + type: integer + tiaGainRx1: + description: Manual TIA gain (dB) for Rx channel 1 + type: integer + pgaGainRx1: + description: Manual PGA gain (dB) for Rx channel 1 + type: integer + pwrmodeRx1: + type: integer + txDevSampleRate: + type: integer + log2HardInterp: + description: 0 is automatic then 1 to 6 is log2 of hardware interpolation + type: integer + log2SoftInterp: + description: log2 of software interpolation factor from 0 to 6 + type: integer + txCenterFrequency: + type: integer + format: int64 + ncoEnableTx: + description: Enable TSP NCO Tx on both channels and mixing (1 for yes, 0 for no) + type: integer + ncoFrequencyTx: + description: Tx frequency shift from LO for both channels + type: integer + antennaPathTx: + type: integer + description: > + Antenna selected (enum value from XTRXMIMOSettings::TxAntenna): + * 0 - TXANT_HI high range + * 1 - TXANT_WI wide range + lpfBWTx0: + description: LMS analog lowpass filter bandwidth (Hz) for Tx channel 0 + type: integer + gainTx0: + description: Optimally distributed gain (dB) for Tx channel 0 + type: integer + pwrmodeTx0: + type: integer + lpfBWTx1: + description: LMS analog lowpass filter bandwidth (Hz) for Tx channel 1 + type: integer + gainTx1: + description: Optimally distributed gain (dB) for Tx channel 1 + type: integer + pwrmodeTx1: + type: integer + +XtrxMIMOReport: + description: XTRX + properties: + success: + description: 1 if info was successfully retrieved else 0 + type: integer + fifoSize: + type: integer + fifoFillRx: + type: integer + fifoFillTx: + type: integer + temperature: + type: number + format: float + gpsLock: + description: 1 if GPSDO is locked else 0 + type: integer + actualInputRate: + type: integer + actualOutputRate: + type: integer + clockGenRate: + type: integer diff --git a/sdrbase/resources/webapi/doc/swagger/swagger.yaml b/sdrbase/resources/webapi/doc/swagger/swagger.yaml index b64b1331a..28337b447 100644 --- a/sdrbase/resources/webapi/doc/swagger/swagger.yaml +++ b/sdrbase/resources/webapi/doc/swagger/swagger.yaml @@ -2321,6 +2321,8 @@ definitions: $ref: "/doc/swagger/include/Xtrx.yaml#/XtrxInputReport" xtrxOutputReport: $ref: "/doc/swagger/include/Xtrx.yaml#/XtrxOutputReport" + xtrxMIMOReport: + $ref: "/doc/swagger/include/Xtrx.yaml#/XtrxMIMOReport" ChannelReport: description: Base channel report. Only the channel report corresponding to the channel specified in the channelType field is or should be present. diff --git a/swagger/sdrangel/api/swagger/include/DeviceSettings.yaml b/swagger/sdrangel/api/swagger/include/DeviceSettings.yaml index ee9bdf8b1..e18b8f479 100644 --- a/swagger/sdrangel/api/swagger/include/DeviceSettings.yaml +++ b/swagger/sdrangel/api/swagger/include/DeviceSettings.yaml @@ -76,3 +76,5 @@ DeviceSettings: $ref: "http://localhost:8081/api/swagger/include/Xtrx.yaml#/XtrxInputSettings" xtrxOutputSettings: $ref: "http://localhost:8081/api/swagger/include/Xtrx.yaml#/XtrxOutputSettings" + xtrxMIMOSettings: + $ref: "http://localhost:8081/api/swagger/include/Xtrx.yaml#/XtrxMIMOSettings" diff --git a/swagger/sdrangel/api/swagger/include/Xtrx.yaml b/swagger/sdrangel/api/swagger/include/Xtrx.yaml index abaea7388..e6568827a 100644 --- a/swagger/sdrangel/api/swagger/include/Xtrx.yaml +++ b/swagger/sdrangel/api/swagger/include/Xtrx.yaml @@ -152,4 +152,173 @@ XtrxOutputReport: format: float gpsLock: description: 1 if GPSDO is locked else 0 - type: integer \ No newline at end of file + type: integer + +XtrxMIMOSettings: + description: XTRX + properties: + extClock: + description: Boolean 1 if external clock source else 0 + type: integer + extClockFreq: + description: Frequency (Hz) of external clock source + type: integer + fileRecordName: + type: string + gpioDir: + description: 8 bit GPIO pin direction LSB first 0 input, 1 output + type: integer + gpioPins: + description: 8 bit GPIO pins to write LSB first + type: integer + useReverseAPI: + description: Boolean 1 use 0 do not use reverse API + type: integer + reverseAPIAddress: + description: IPv4 address + type: string + reverseAPIPort: + description: Network port from 1024 to 65535 + type: integer + reverseAPIDeviceIndex: + type: integer + rxDevSampleRate: + type: integer + log2HardDecim: + description: 0 is automatic then 1 to 6 is log2 of hardware decimation + type: integer + log2SoftDecim: + description: log2 of software decimation factor from 0 to 6 + type: integer + rxCenterFrequency: + type: integer + format: int64 + dcBlock: + description: Software DC blocking (1 for yes, 0 for no) + type: integer + iqCorrection: + description: Software IQ imbalance correction (1 for yes, 0 for no) + type: integer + ncoEnableRx: + description: Enable TSP NCO Rx on both channels and mixing (1 for yes, 0 for no) + type: integer + ncoFrequencyRx: + description: Rx frequency shift from LO for both channels + type: integer + antennaPathRx: + type: integer + description: > + Antenna selected (enum value from XTRXMIMOSettings::RxAntenna): + * 0 - RXANT_LO low range + * 1 - RXANT_WI wide range + * 2 - RXANT_HI high range + lpfBWRx0: + description: LMS analog lowpass filter bandwidth (Hz) for Rx channel 0 + type: integer + gainRx0: + description: Optimally distributed gain (dB) for Rx channel 0 + type: integer + gainModeRx0: + type: integer + description: > + Gain mode (XTRXMIMOSettings::GainMode) for Rx channel 0: + * 0 - GAIN_AUTO automatic + * 1 - GAIN_MANUAL manual + lnaGainRx0: + description: Manual LNA gain (dB) for Rx channel 0 + type: integer + tiaGainRx0: + description: Manual TIA gain (dB) for Rx channel 0 + type: integer + pgaGainRx0: + description: Manual PGA gain (dB) for Rx channel 0 + type: integer + pwrmodeRx0: + type: integer + lpfBWRx1: + description: LMS analog lowpass filter bandwidth (Hz) for Rx channel 1 + type: integer + gainRx1: + description: Optimally distributed gain (dB) for Rx channel 1 + type: integer + gainModeRx1: + type: integer + description: > + Gain mode (XTRXMIMOSettings::GainMode) for Rx channel 1: + * 0 - GAIN_AUTO automatic + * 1 - GAIN_MANUAL manual + lnaGainRx1: + description: Manual LNA gain (dB) for Rx channel 1 + type: integer + tiaGainRx1: + description: Manual TIA gain (dB) for Rx channel 1 + type: integer + pgaGainRx1: + description: Manual PGA gain (dB) for Rx channel 1 + type: integer + pwrmodeRx1: + type: integer + txDevSampleRate: + type: integer + log2HardInterp: + description: 0 is automatic then 1 to 6 is log2 of hardware interpolation + type: integer + log2SoftInterp: + description: log2 of software interpolation factor from 0 to 6 + type: integer + txCenterFrequency: + type: integer + format: int64 + ncoEnableTx: + description: Enable TSP NCO Tx on both channels and mixing (1 for yes, 0 for no) + type: integer + ncoFrequencyTx: + description: Tx frequency shift from LO for both channels + type: integer + antennaPathTx: + type: integer + description: > + Antenna selected (enum value from XTRXMIMOSettings::TxAntenna): + * 0 - TXANT_HI high range + * 1 - TXANT_WI wide range + lpfBWTx0: + description: LMS analog lowpass filter bandwidth (Hz) for Tx channel 0 + type: integer + gainTx0: + description: Optimally distributed gain (dB) for Tx channel 0 + type: integer + pwrmodeTx0: + type: integer + lpfBWTx1: + description: LMS analog lowpass filter bandwidth (Hz) for Tx channel 1 + type: integer + gainTx1: + description: Optimally distributed gain (dB) for Tx channel 1 + type: integer + pwrmodeTx1: + type: integer + +XtrxMIMOReport: + description: XTRX + properties: + success: + description: 1 if info was successfully retrieved else 0 + type: integer + fifoSize: + type: integer + fifoFillRx: + type: integer + fifoFillTx: + type: integer + temperature: + type: number + format: float + gpsLock: + description: 1 if GPSDO is locked else 0 + type: integer + actualInputRate: + type: integer + actualOutputRate: + type: integer + clockGenRate: + type: integer diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index 95c9950d1..bdbe68908 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -2321,6 +2321,8 @@ definitions: $ref: "http://localhost:8081/api/swagger/include/Xtrx.yaml#/XtrxInputReport" xtrxOutputReport: $ref: "http://localhost:8081/api/swagger/include/Xtrx.yaml#/XtrxOutputReport" + xtrxMIMOReport: + $ref: "http://localhost:8081/api/swagger/include/Xtrx.yaml#/XtrxMIMOReport" ChannelReport: description: Base channel report. Only the channel report corresponding to the channel specified in the channelType field is or should be present. diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 54555f53d..71f8393e2 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -3282,6 +3282,9 @@ margin-bottom: 20px; }, "xtrxOutputReport" : { "$ref" : "#/definitions/XtrxOutputReport" + }, + "xtrxMIMOReport" : { + "$ref" : "#/definitions/XtrxMIMOReport" } }, "description" : "Base device report. Only the device report corresponding to the device specified in the deviceHwType is or should be present." @@ -3434,6 +3437,9 @@ margin-bottom: 20px; }, "xtrxOutputSettings" : { "$ref" : "#/definitions/XtrxOutputSettings" + }, + "xtrxMIMOSettings" : { + "$ref" : "#/definitions/XtrxMIMOSettings" } }, "description" : "Base device settings. Only the device settings corresponding to the device specified in the deviceHwType field is or should be present." @@ -7876,6 +7882,218 @@ margin-bottom: 20px; } }, "description" : "XTRX" +}; + defs.XtrxMIMOReport = { + "properties" : { + "success" : { + "type" : "integer", + "description" : "1 if info was successfully retrieved else 0" + }, + "fifoSize" : { + "type" : "integer" + }, + "fifoFillRx" : { + "type" : "integer" + }, + "fifoFillTx" : { + "type" : "integer" + }, + "temperature" : { + "type" : "number", + "format" : "float" + }, + "gpsLock" : { + "type" : "integer", + "description" : "1 if GPSDO is locked else 0" + }, + "actualInputRate" : { + "type" : "integer" + }, + "actualOutputRate" : { + "type" : "integer" + }, + "clockGenRate" : { + "type" : "integer" + } + }, + "description" : "XTRX" +}; + defs.XtrxMIMOSettings = { + "properties" : { + "extClock" : { + "type" : "integer", + "description" : "Boolean 1 if external clock source else 0" + }, + "extClockFreq" : { + "type" : "integer", + "description" : "Frequency (Hz) of external clock source" + }, + "fileRecordName" : { + "type" : "string" + }, + "gpioDir" : { + "type" : "integer", + "description" : "8 bit GPIO pin direction LSB first 0 input, 1 output" + }, + "gpioPins" : { + "type" : "integer", + "description" : "8 bit GPIO pins to write LSB first" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Boolean 1 use 0 do not use reverse API" + }, + "reverseAPIAddress" : { + "type" : "string", + "description" : "IPv4 address" + }, + "reverseAPIPort" : { + "type" : "integer", + "description" : "Network port from 1024 to 65535" + }, + "reverseAPIDeviceIndex" : { + "type" : "integer" + }, + "rxDevSampleRate" : { + "type" : "integer" + }, + "log2HardDecim" : { + "type" : "integer", + "description" : "0 is automatic then 1 to 6 is log2 of hardware decimation" + }, + "log2SoftDecim" : { + "type" : "integer", + "description" : "log2 of software decimation factor from 0 to 6" + }, + "rxCenterFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "dcBlock" : { + "type" : "integer", + "description" : "Software DC blocking (1 for yes, 0 for no)" + }, + "iqCorrection" : { + "type" : "integer", + "description" : "Software IQ imbalance correction (1 for yes, 0 for no)" + }, + "ncoEnableRx" : { + "type" : "integer", + "description" : "Enable TSP NCO Rx on both channels and mixing (1 for yes, 0 for no)" + }, + "ncoFrequencyRx" : { + "type" : "integer", + "description" : "Rx frequency shift from LO for both channels" + }, + "antennaPathRx" : { + "type" : "integer", + "description" : "Antenna selected (enum value from XTRXMIMOSettings::RxAntenna):\n * 0 - RXANT_LO low range\n * 1 - RXANT_WI wide range\n * 2 - RXANT_HI high range\n" + }, + "lpfBWRx0" : { + "type" : "integer", + "description" : "LMS analog lowpass filter bandwidth (Hz) for Rx channel 0" + }, + "gainRx0" : { + "type" : "integer", + "description" : "Optimally distributed gain (dB) for Rx channel 0" + }, + "gainModeRx0" : { + "type" : "integer", + "description" : "Gain mode (XTRXMIMOSettings::GainMode) for Rx channel 0:\n * 0 - GAIN_AUTO automatic\n * 1 - GAIN_MANUAL manual\n" + }, + "lnaGainRx0" : { + "type" : "integer", + "description" : "Manual LNA gain (dB) for Rx channel 0" + }, + "tiaGainRx0" : { + "type" : "integer", + "description" : "Manual TIA gain (dB) for Rx channel 0" + }, + "pgaGainRx0" : { + "type" : "integer", + "description" : "Manual PGA gain (dB) for Rx channel 0" + }, + "pwrmodeRx0" : { + "type" : "integer" + }, + "lpfBWRx1" : { + "type" : "integer", + "description" : "LMS analog lowpass filter bandwidth (Hz) for Rx channel 1" + }, + "gainRx1" : { + "type" : "integer", + "description" : "Optimally distributed gain (dB) for Rx channel 1" + }, + "gainModeRx1" : { + "type" : "integer", + "description" : "Gain mode (XTRXMIMOSettings::GainMode) for Rx channel 1:\n * 0 - GAIN_AUTO automatic\n * 1 - GAIN_MANUAL manual\n" + }, + "lnaGainRx1" : { + "type" : "integer", + "description" : "Manual LNA gain (dB) for Rx channel 1" + }, + "tiaGainRx1" : { + "type" : "integer", + "description" : "Manual TIA gain (dB) for Rx channel 1" + }, + "pgaGainRx1" : { + "type" : "integer", + "description" : "Manual PGA gain (dB) for Rx channel 1" + }, + "pwrmodeRx1" : { + "type" : "integer" + }, + "txDevSampleRate" : { + "type" : "integer" + }, + "log2HardInterp" : { + "type" : "integer", + "description" : "0 is automatic then 1 to 6 is log2 of hardware interpolation" + }, + "log2SoftInterp" : { + "type" : "integer", + "description" : "log2 of software interpolation factor from 0 to 6" + }, + "txCenterFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "ncoEnableTx" : { + "type" : "integer", + "description" : "Enable TSP NCO Tx on both channels and mixing (1 for yes, 0 for no)" + }, + "ncoFrequencyTx" : { + "type" : "integer", + "description" : "Tx frequency shift from LO for both channels" + }, + "antennaPathTx" : { + "type" : "integer", + "description" : "Antenna selected (enum value from XTRXMIMOSettings::TxAntenna):\n * 0 - TXANT_HI high range\n * 1 - TXANT_WI wide range\n" + }, + "lpfBWTx0" : { + "type" : "integer", + "description" : "LMS analog lowpass filter bandwidth (Hz) for Tx channel 0" + }, + "gainTx0" : { + "type" : "integer", + "description" : "Optimally distributed gain (dB) for Tx channel 0" + }, + "pwrmodeTx0" : { + "type" : "integer" + }, + "lpfBWTx1" : { + "type" : "integer", + "description" : "LMS analog lowpass filter bandwidth (Hz) for Tx channel 1" + }, + "gainTx1" : { + "type" : "integer", + "description" : "Optimally distributed gain (dB) for Tx channel 1" + }, + "pwrmodeTx1" : { + "type" : "integer" + } + }, + "description" : "XTRX" }; defs.XtrxOutputReport = { "properties" : { @@ -33963,7 +34181,7 @@ except ApiException as e:
- Generated 2020-03-30T19:38:33.193+02:00 + Generated 2020-04-19T21:52:24.714+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceReport.cpp b/swagger/sdrangel/code/qt5/client/SWGDeviceReport.cpp index 2f9862999..e51be354f 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceReport.cpp @@ -74,6 +74,8 @@ SWGDeviceReport::SWGDeviceReport() { m_xtrx_input_report_isSet = false; xtrx_output_report = nullptr; m_xtrx_output_report_isSet = false; + xtrx_mimo_report = nullptr; + m_xtrx_mimo_report_isSet = false; } SWGDeviceReport::~SWGDeviceReport() { @@ -128,6 +130,8 @@ SWGDeviceReport::init() { m_xtrx_input_report_isSet = false; xtrx_output_report = new SWGXtrxOutputReport(); m_xtrx_output_report_isSet = false; + xtrx_mimo_report = new SWGXtrxMIMOReport(); + m_xtrx_mimo_report_isSet = false; } void @@ -199,6 +203,9 @@ SWGDeviceReport::cleanup() { if(xtrx_output_report != nullptr) { delete xtrx_output_report; } + if(xtrx_mimo_report != nullptr) { + delete xtrx_mimo_report; + } } SWGDeviceReport* @@ -258,6 +265,8 @@ SWGDeviceReport::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&xtrx_output_report, pJson["xtrxOutputReport"], "SWGXtrxOutputReport", "SWGXtrxOutputReport"); + ::SWGSDRangel::setValue(&xtrx_mimo_report, pJson["xtrxMIMOReport"], "SWGXtrxMIMOReport", "SWGXtrxMIMOReport"); + } QString @@ -343,6 +352,9 @@ SWGDeviceReport::asJsonObject() { if((xtrx_output_report != nullptr) && (xtrx_output_report->isSet())){ toJsonValue(QString("xtrxOutputReport"), xtrx_output_report, obj, QString("SWGXtrxOutputReport")); } + if((xtrx_mimo_report != nullptr) && (xtrx_mimo_report->isSet())){ + toJsonValue(QString("xtrxMIMOReport"), xtrx_mimo_report, obj, QString("SWGXtrxMIMOReport")); + } return obj; } @@ -577,6 +589,16 @@ SWGDeviceReport::setXtrxOutputReport(SWGXtrxOutputReport* xtrx_output_report) { this->m_xtrx_output_report_isSet = true; } +SWGXtrxMIMOReport* +SWGDeviceReport::getXtrxMimoReport() { + return xtrx_mimo_report; +} +void +SWGDeviceReport::setXtrxMimoReport(SWGXtrxMIMOReport* xtrx_mimo_report) { + this->xtrx_mimo_report = xtrx_mimo_report; + this->m_xtrx_mimo_report_isSet = true; +} + bool SWGDeviceReport::isSet(){ @@ -651,6 +673,9 @@ SWGDeviceReport::isSet(){ if(xtrx_output_report && xtrx_output_report->isSet()){ isObjectUpdated = true; break; } + if(xtrx_mimo_report && xtrx_mimo_report->isSet()){ + isObjectUpdated = true; break; + } }while(false); return isObjectUpdated; } diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceReport.h b/swagger/sdrangel/code/qt5/client/SWGDeviceReport.h index 1cba94e8f..d00fd7f9e 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceReport.h @@ -41,6 +41,7 @@ #include "SWGSDRPlayReport.h" #include "SWGSoapySDRReport.h" #include "SWGXtrxInputReport.h" +#include "SWGXtrxMIMOReport.h" #include "SWGXtrxOutputReport.h" #include @@ -131,6 +132,9 @@ public: SWGXtrxOutputReport* getXtrxOutputReport(); void setXtrxOutputReport(SWGXtrxOutputReport* xtrx_output_report); + SWGXtrxMIMOReport* getXtrxMimoReport(); + void setXtrxMimoReport(SWGXtrxMIMOReport* xtrx_mimo_report); + virtual bool isSet() override; @@ -204,6 +208,9 @@ private: SWGXtrxOutputReport* xtrx_output_report; bool m_xtrx_output_report_isSet; + SWGXtrxMIMOReport* xtrx_mimo_report; + bool m_xtrx_mimo_report_isSet; + }; } diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp index 4c06c91c9..ef1bc4390 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp @@ -96,6 +96,8 @@ SWGDeviceSettings::SWGDeviceSettings() { m_xtrx_input_settings_isSet = false; xtrx_output_settings = nullptr; m_xtrx_output_settings_isSet = false; + xtrx_mimo_settings = nullptr; + m_xtrx_mimo_settings_isSet = false; } SWGDeviceSettings::~SWGDeviceSettings() { @@ -172,6 +174,8 @@ SWGDeviceSettings::init() { m_xtrx_input_settings_isSet = false; xtrx_output_settings = new SWGXtrxOutputSettings(); m_xtrx_output_settings_isSet = false; + xtrx_mimo_settings = new SWGXtrxMIMOSettings(); + m_xtrx_mimo_settings_isSet = false; } void @@ -274,6 +278,9 @@ SWGDeviceSettings::cleanup() { if(xtrx_output_settings != nullptr) { delete xtrx_output_settings; } + if(xtrx_mimo_settings != nullptr) { + delete xtrx_mimo_settings; + } } SWGDeviceSettings* @@ -355,6 +362,8 @@ SWGDeviceSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&xtrx_output_settings, pJson["xtrxOutputSettings"], "SWGXtrxOutputSettings", "SWGXtrxOutputSettings"); + ::SWGSDRangel::setValue(&xtrx_mimo_settings, pJson["xtrxMIMOSettings"], "SWGXtrxMIMOSettings", "SWGXtrxMIMOSettings"); + } QString @@ -473,6 +482,9 @@ SWGDeviceSettings::asJsonObject() { if((xtrx_output_settings != nullptr) && (xtrx_output_settings->isSet())){ toJsonValue(QString("xtrxOutputSettings"), xtrx_output_settings, obj, QString("SWGXtrxOutputSettings")); } + if((xtrx_mimo_settings != nullptr) && (xtrx_mimo_settings->isSet())){ + toJsonValue(QString("xtrxMIMOSettings"), xtrx_mimo_settings, obj, QString("SWGXtrxMIMOSettings")); + } return obj; } @@ -817,6 +829,16 @@ SWGDeviceSettings::setXtrxOutputSettings(SWGXtrxOutputSettings* xtrx_output_sett this->m_xtrx_output_settings_isSet = true; } +SWGXtrxMIMOSettings* +SWGDeviceSettings::getXtrxMimoSettings() { + return xtrx_mimo_settings; +} +void +SWGDeviceSettings::setXtrxMimoSettings(SWGXtrxMIMOSettings* xtrx_mimo_settings) { + this->xtrx_mimo_settings = xtrx_mimo_settings; + this->m_xtrx_mimo_settings_isSet = true; +} + bool SWGDeviceSettings::isSet(){ @@ -924,6 +946,9 @@ SWGDeviceSettings::isSet(){ if(xtrx_output_settings && xtrx_output_settings->isSet()){ isObjectUpdated = true; break; } + if(xtrx_mimo_settings && xtrx_mimo_settings->isSet()){ + isObjectUpdated = true; break; + } }while(false); return isObjectUpdated; } diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h index bf5171e2f..2d84d089f 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h @@ -52,6 +52,7 @@ #include "SWGTestMOSyncSettings.h" #include "SWGTestSourceSettings.h" #include "SWGXtrxInputSettings.h" +#include "SWGXtrxMIMOSettings.h" #include "SWGXtrxOutputSettings.h" #include @@ -175,6 +176,9 @@ public: SWGXtrxOutputSettings* getXtrxOutputSettings(); void setXtrxOutputSettings(SWGXtrxOutputSettings* xtrx_output_settings); + SWGXtrxMIMOSettings* getXtrxMimoSettings(); + void setXtrxMimoSettings(SWGXtrxMIMOSettings* xtrx_mimo_settings); + virtual bool isSet() override; @@ -281,6 +285,9 @@ private: SWGXtrxOutputSettings* xtrx_output_settings; bool m_xtrx_output_settings_isSet; + SWGXtrxMIMOSettings* xtrx_mimo_settings; + bool m_xtrx_mimo_settings_isSet; + }; } diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 1ea218419..6b5d90e8f 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -197,6 +197,8 @@ #include "SWGXtrxInputActions.h" #include "SWGXtrxInputReport.h" #include "SWGXtrxInputSettings.h" +#include "SWGXtrxMIMOReport.h" +#include "SWGXtrxMIMOSettings.h" #include "SWGXtrxOutputReport.h" #include "SWGXtrxOutputSettings.h" @@ -752,6 +754,12 @@ namespace SWGSDRangel { if(QString("SWGXtrxInputSettings").compare(type) == 0) { return new SWGXtrxInputSettings(); } + if(QString("SWGXtrxMIMOReport").compare(type) == 0) { + return new SWGXtrxMIMOReport(); + } + if(QString("SWGXtrxMIMOSettings").compare(type) == 0) { + return new SWGXtrxMIMOSettings(); + } if(QString("SWGXtrxOutputReport").compare(type) == 0) { return new SWGXtrxOutputReport(); } diff --git a/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOReport.cpp b/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOReport.cpp new file mode 100644 index 000000000..69af375b7 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOReport.cpp @@ -0,0 +1,292 @@ +/** + * 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: 5.3.0 + * 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 "SWGXtrxMIMOReport.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGXtrxMIMOReport::SWGXtrxMIMOReport(QString* json) { + init(); + this->fromJson(*json); +} + +SWGXtrxMIMOReport::SWGXtrxMIMOReport() { + success = 0; + m_success_isSet = false; + fifo_size = 0; + m_fifo_size_isSet = false; + fifo_fill_rx = 0; + m_fifo_fill_rx_isSet = false; + fifo_fill_tx = 0; + m_fifo_fill_tx_isSet = false; + temperature = 0.0f; + m_temperature_isSet = false; + gps_lock = 0; + m_gps_lock_isSet = false; + actual_input_rate = 0; + m_actual_input_rate_isSet = false; + actual_output_rate = 0; + m_actual_output_rate_isSet = false; + clock_gen_rate = 0; + m_clock_gen_rate_isSet = false; +} + +SWGXtrxMIMOReport::~SWGXtrxMIMOReport() { + this->cleanup(); +} + +void +SWGXtrxMIMOReport::init() { + success = 0; + m_success_isSet = false; + fifo_size = 0; + m_fifo_size_isSet = false; + fifo_fill_rx = 0; + m_fifo_fill_rx_isSet = false; + fifo_fill_tx = 0; + m_fifo_fill_tx_isSet = false; + temperature = 0.0f; + m_temperature_isSet = false; + gps_lock = 0; + m_gps_lock_isSet = false; + actual_input_rate = 0; + m_actual_input_rate_isSet = false; + actual_output_rate = 0; + m_actual_output_rate_isSet = false; + clock_gen_rate = 0; + m_clock_gen_rate_isSet = false; +} + +void +SWGXtrxMIMOReport::cleanup() { + + + + + + + + + +} + +SWGXtrxMIMOReport* +SWGXtrxMIMOReport::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGXtrxMIMOReport::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&success, pJson["success"], "qint32", ""); + + ::SWGSDRangel::setValue(&fifo_size, pJson["fifoSize"], "qint32", ""); + + ::SWGSDRangel::setValue(&fifo_fill_rx, pJson["fifoFillRx"], "qint32", ""); + + ::SWGSDRangel::setValue(&fifo_fill_tx, pJson["fifoFillTx"], "qint32", ""); + + ::SWGSDRangel::setValue(&temperature, pJson["temperature"], "float", ""); + + ::SWGSDRangel::setValue(&gps_lock, pJson["gpsLock"], "qint32", ""); + + ::SWGSDRangel::setValue(&actual_input_rate, pJson["actualInputRate"], "qint32", ""); + + ::SWGSDRangel::setValue(&actual_output_rate, pJson["actualOutputRate"], "qint32", ""); + + ::SWGSDRangel::setValue(&clock_gen_rate, pJson["clockGenRate"], "qint32", ""); + +} + +QString +SWGXtrxMIMOReport::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGXtrxMIMOReport::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_success_isSet){ + obj->insert("success", QJsonValue(success)); + } + if(m_fifo_size_isSet){ + obj->insert("fifoSize", QJsonValue(fifo_size)); + } + if(m_fifo_fill_rx_isSet){ + obj->insert("fifoFillRx", QJsonValue(fifo_fill_rx)); + } + if(m_fifo_fill_tx_isSet){ + obj->insert("fifoFillTx", QJsonValue(fifo_fill_tx)); + } + if(m_temperature_isSet){ + obj->insert("temperature", QJsonValue(temperature)); + } + if(m_gps_lock_isSet){ + obj->insert("gpsLock", QJsonValue(gps_lock)); + } + if(m_actual_input_rate_isSet){ + obj->insert("actualInputRate", QJsonValue(actual_input_rate)); + } + if(m_actual_output_rate_isSet){ + obj->insert("actualOutputRate", QJsonValue(actual_output_rate)); + } + if(m_clock_gen_rate_isSet){ + obj->insert("clockGenRate", QJsonValue(clock_gen_rate)); + } + + return obj; +} + +qint32 +SWGXtrxMIMOReport::getSuccess() { + return success; +} +void +SWGXtrxMIMOReport::setSuccess(qint32 success) { + this->success = success; + this->m_success_isSet = true; +} + +qint32 +SWGXtrxMIMOReport::getFifoSize() { + return fifo_size; +} +void +SWGXtrxMIMOReport::setFifoSize(qint32 fifo_size) { + this->fifo_size = fifo_size; + this->m_fifo_size_isSet = true; +} + +qint32 +SWGXtrxMIMOReport::getFifoFillRx() { + return fifo_fill_rx; +} +void +SWGXtrxMIMOReport::setFifoFillRx(qint32 fifo_fill_rx) { + this->fifo_fill_rx = fifo_fill_rx; + this->m_fifo_fill_rx_isSet = true; +} + +qint32 +SWGXtrxMIMOReport::getFifoFillTx() { + return fifo_fill_tx; +} +void +SWGXtrxMIMOReport::setFifoFillTx(qint32 fifo_fill_tx) { + this->fifo_fill_tx = fifo_fill_tx; + this->m_fifo_fill_tx_isSet = true; +} + +float +SWGXtrxMIMOReport::getTemperature() { + return temperature; +} +void +SWGXtrxMIMOReport::setTemperature(float temperature) { + this->temperature = temperature; + this->m_temperature_isSet = true; +} + +qint32 +SWGXtrxMIMOReport::getGpsLock() { + return gps_lock; +} +void +SWGXtrxMIMOReport::setGpsLock(qint32 gps_lock) { + this->gps_lock = gps_lock; + this->m_gps_lock_isSet = true; +} + +qint32 +SWGXtrxMIMOReport::getActualInputRate() { + return actual_input_rate; +} +void +SWGXtrxMIMOReport::setActualInputRate(qint32 actual_input_rate) { + this->actual_input_rate = actual_input_rate; + this->m_actual_input_rate_isSet = true; +} + +qint32 +SWGXtrxMIMOReport::getActualOutputRate() { + return actual_output_rate; +} +void +SWGXtrxMIMOReport::setActualOutputRate(qint32 actual_output_rate) { + this->actual_output_rate = actual_output_rate; + this->m_actual_output_rate_isSet = true; +} + +qint32 +SWGXtrxMIMOReport::getClockGenRate() { + return clock_gen_rate; +} +void +SWGXtrxMIMOReport::setClockGenRate(qint32 clock_gen_rate) { + this->clock_gen_rate = clock_gen_rate; + this->m_clock_gen_rate_isSet = true; +} + + +bool +SWGXtrxMIMOReport::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_success_isSet){ + isObjectUpdated = true; break; + } + if(m_fifo_size_isSet){ + isObjectUpdated = true; break; + } + if(m_fifo_fill_rx_isSet){ + isObjectUpdated = true; break; + } + if(m_fifo_fill_tx_isSet){ + isObjectUpdated = true; break; + } + if(m_temperature_isSet){ + isObjectUpdated = true; break; + } + if(m_gps_lock_isSet){ + isObjectUpdated = true; break; + } + if(m_actual_input_rate_isSet){ + isObjectUpdated = true; break; + } + if(m_actual_output_rate_isSet){ + isObjectUpdated = true; break; + } + if(m_clock_gen_rate_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOReport.h b/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOReport.h new file mode 100644 index 000000000..3daf22120 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOReport.h @@ -0,0 +1,106 @@ +/** + * 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: 5.3.0 + * 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. + */ + +/* + * SWGXtrxMIMOReport.h + * + * XTRX + */ + +#ifndef SWGXtrxMIMOReport_H_ +#define SWGXtrxMIMOReport_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGXtrxMIMOReport: public SWGObject { +public: + SWGXtrxMIMOReport(); + SWGXtrxMIMOReport(QString* json); + virtual ~SWGXtrxMIMOReport(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGXtrxMIMOReport* fromJson(QString &jsonString) override; + + qint32 getSuccess(); + void setSuccess(qint32 success); + + qint32 getFifoSize(); + void setFifoSize(qint32 fifo_size); + + qint32 getFifoFillRx(); + void setFifoFillRx(qint32 fifo_fill_rx); + + qint32 getFifoFillTx(); + void setFifoFillTx(qint32 fifo_fill_tx); + + float getTemperature(); + void setTemperature(float temperature); + + qint32 getGpsLock(); + void setGpsLock(qint32 gps_lock); + + qint32 getActualInputRate(); + void setActualInputRate(qint32 actual_input_rate); + + qint32 getActualOutputRate(); + void setActualOutputRate(qint32 actual_output_rate); + + qint32 getClockGenRate(); + void setClockGenRate(qint32 clock_gen_rate); + + + virtual bool isSet() override; + +private: + qint32 success; + bool m_success_isSet; + + qint32 fifo_size; + bool m_fifo_size_isSet; + + qint32 fifo_fill_rx; + bool m_fifo_fill_rx_isSet; + + qint32 fifo_fill_tx; + bool m_fifo_fill_tx_isSet; + + float temperature; + bool m_temperature_isSet; + + qint32 gps_lock; + bool m_gps_lock_isSet; + + qint32 actual_input_rate; + bool m_actual_input_rate_isSet; + + qint32 actual_output_rate; + bool m_actual_output_rate_isSet; + + qint32 clock_gen_rate; + bool m_clock_gen_rate_isSet; + +}; + +} + +#endif /* SWGXtrxMIMOReport_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOSettings.cpp new file mode 100644 index 000000000..5211ea841 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOSettings.cpp @@ -0,0 +1,1124 @@ +/** + * 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: 5.3.0 + * 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 "SWGXtrxMIMOSettings.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGXtrxMIMOSettings::SWGXtrxMIMOSettings(QString* json) { + init(); + this->fromJson(*json); +} + +SWGXtrxMIMOSettings::SWGXtrxMIMOSettings() { + ext_clock = 0; + m_ext_clock_isSet = false; + ext_clock_freq = 0; + m_ext_clock_freq_isSet = false; + file_record_name = nullptr; + m_file_record_name_isSet = false; + gpio_dir = 0; + m_gpio_dir_isSet = false; + gpio_pins = 0; + m_gpio_pins_isSet = false; + use_reverse_api = 0; + m_use_reverse_api_isSet = false; + reverse_api_address = nullptr; + m_reverse_api_address_isSet = false; + reverse_api_port = 0; + m_reverse_api_port_isSet = false; + reverse_api_device_index = 0; + m_reverse_api_device_index_isSet = false; + rx_dev_sample_rate = 0; + m_rx_dev_sample_rate_isSet = false; + log2_hard_decim = 0; + m_log2_hard_decim_isSet = false; + log2_soft_decim = 0; + m_log2_soft_decim_isSet = false; + rx_center_frequency = 0L; + m_rx_center_frequency_isSet = false; + dc_block = 0; + m_dc_block_isSet = false; + iq_correction = 0; + m_iq_correction_isSet = false; + nco_enable_rx = 0; + m_nco_enable_rx_isSet = false; + nco_frequency_rx = 0; + m_nco_frequency_rx_isSet = false; + antenna_path_rx = 0; + m_antenna_path_rx_isSet = false; + lpf_bw_rx0 = 0; + m_lpf_bw_rx0_isSet = false; + gain_rx0 = 0; + m_gain_rx0_isSet = false; + gain_mode_rx0 = 0; + m_gain_mode_rx0_isSet = false; + lna_gain_rx0 = 0; + m_lna_gain_rx0_isSet = false; + tia_gain_rx0 = 0; + m_tia_gain_rx0_isSet = false; + pga_gain_rx0 = 0; + m_pga_gain_rx0_isSet = false; + pwrmode_rx0 = 0; + m_pwrmode_rx0_isSet = false; + lpf_bw_rx1 = 0; + m_lpf_bw_rx1_isSet = false; + gain_rx1 = 0; + m_gain_rx1_isSet = false; + gain_mode_rx1 = 0; + m_gain_mode_rx1_isSet = false; + lna_gain_rx1 = 0; + m_lna_gain_rx1_isSet = false; + tia_gain_rx1 = 0; + m_tia_gain_rx1_isSet = false; + pga_gain_rx1 = 0; + m_pga_gain_rx1_isSet = false; + pwrmode_rx1 = 0; + m_pwrmode_rx1_isSet = false; + tx_dev_sample_rate = 0; + m_tx_dev_sample_rate_isSet = false; + log2_hard_interp = 0; + m_log2_hard_interp_isSet = false; + log2_soft_interp = 0; + m_log2_soft_interp_isSet = false; + tx_center_frequency = 0L; + m_tx_center_frequency_isSet = false; + nco_enable_tx = 0; + m_nco_enable_tx_isSet = false; + nco_frequency_tx = 0; + m_nco_frequency_tx_isSet = false; + antenna_path_tx = 0; + m_antenna_path_tx_isSet = false; + lpf_bw_tx0 = 0; + m_lpf_bw_tx0_isSet = false; + gain_tx0 = 0; + m_gain_tx0_isSet = false; + pwrmode_tx0 = 0; + m_pwrmode_tx0_isSet = false; + lpf_bw_tx1 = 0; + m_lpf_bw_tx1_isSet = false; + gain_tx1 = 0; + m_gain_tx1_isSet = false; + pwrmode_tx1 = 0; + m_pwrmode_tx1_isSet = false; +} + +SWGXtrxMIMOSettings::~SWGXtrxMIMOSettings() { + this->cleanup(); +} + +void +SWGXtrxMIMOSettings::init() { + ext_clock = 0; + m_ext_clock_isSet = false; + ext_clock_freq = 0; + m_ext_clock_freq_isSet = false; + file_record_name = new QString(""); + m_file_record_name_isSet = false; + gpio_dir = 0; + m_gpio_dir_isSet = false; + gpio_pins = 0; + m_gpio_pins_isSet = false; + use_reverse_api = 0; + m_use_reverse_api_isSet = false; + reverse_api_address = new QString(""); + m_reverse_api_address_isSet = false; + reverse_api_port = 0; + m_reverse_api_port_isSet = false; + reverse_api_device_index = 0; + m_reverse_api_device_index_isSet = false; + rx_dev_sample_rate = 0; + m_rx_dev_sample_rate_isSet = false; + log2_hard_decim = 0; + m_log2_hard_decim_isSet = false; + log2_soft_decim = 0; + m_log2_soft_decim_isSet = false; + rx_center_frequency = 0L; + m_rx_center_frequency_isSet = false; + dc_block = 0; + m_dc_block_isSet = false; + iq_correction = 0; + m_iq_correction_isSet = false; + nco_enable_rx = 0; + m_nco_enable_rx_isSet = false; + nco_frequency_rx = 0; + m_nco_frequency_rx_isSet = false; + antenna_path_rx = 0; + m_antenna_path_rx_isSet = false; + lpf_bw_rx0 = 0; + m_lpf_bw_rx0_isSet = false; + gain_rx0 = 0; + m_gain_rx0_isSet = false; + gain_mode_rx0 = 0; + m_gain_mode_rx0_isSet = false; + lna_gain_rx0 = 0; + m_lna_gain_rx0_isSet = false; + tia_gain_rx0 = 0; + m_tia_gain_rx0_isSet = false; + pga_gain_rx0 = 0; + m_pga_gain_rx0_isSet = false; + pwrmode_rx0 = 0; + m_pwrmode_rx0_isSet = false; + lpf_bw_rx1 = 0; + m_lpf_bw_rx1_isSet = false; + gain_rx1 = 0; + m_gain_rx1_isSet = false; + gain_mode_rx1 = 0; + m_gain_mode_rx1_isSet = false; + lna_gain_rx1 = 0; + m_lna_gain_rx1_isSet = false; + tia_gain_rx1 = 0; + m_tia_gain_rx1_isSet = false; + pga_gain_rx1 = 0; + m_pga_gain_rx1_isSet = false; + pwrmode_rx1 = 0; + m_pwrmode_rx1_isSet = false; + tx_dev_sample_rate = 0; + m_tx_dev_sample_rate_isSet = false; + log2_hard_interp = 0; + m_log2_hard_interp_isSet = false; + log2_soft_interp = 0; + m_log2_soft_interp_isSet = false; + tx_center_frequency = 0L; + m_tx_center_frequency_isSet = false; + nco_enable_tx = 0; + m_nco_enable_tx_isSet = false; + nco_frequency_tx = 0; + m_nco_frequency_tx_isSet = false; + antenna_path_tx = 0; + m_antenna_path_tx_isSet = false; + lpf_bw_tx0 = 0; + m_lpf_bw_tx0_isSet = false; + gain_tx0 = 0; + m_gain_tx0_isSet = false; + pwrmode_tx0 = 0; + m_pwrmode_tx0_isSet = false; + lpf_bw_tx1 = 0; + m_lpf_bw_tx1_isSet = false; + gain_tx1 = 0; + m_gain_tx1_isSet = false; + pwrmode_tx1 = 0; + m_pwrmode_tx1_isSet = false; +} + +void +SWGXtrxMIMOSettings::cleanup() { + + + if(file_record_name != nullptr) { + delete file_record_name; + } + + + + if(reverse_api_address != nullptr) { + delete reverse_api_address; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} + +SWGXtrxMIMOSettings* +SWGXtrxMIMOSettings::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGXtrxMIMOSettings::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&ext_clock, pJson["extClock"], "qint32", ""); + + ::SWGSDRangel::setValue(&ext_clock_freq, pJson["extClockFreq"], "qint32", ""); + + ::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString"); + + ::SWGSDRangel::setValue(&gpio_dir, pJson["gpioDir"], "qint32", ""); + + ::SWGSDRangel::setValue(&gpio_pins, pJson["gpioPins"], "qint32", ""); + + ::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString"); + + ::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&rx_dev_sample_rate, pJson["rxDevSampleRate"], "qint32", ""); + + ::SWGSDRangel::setValue(&log2_hard_decim, pJson["log2HardDecim"], "qint32", ""); + + ::SWGSDRangel::setValue(&log2_soft_decim, pJson["log2SoftDecim"], "qint32", ""); + + ::SWGSDRangel::setValue(&rx_center_frequency, pJson["rxCenterFrequency"], "qint64", ""); + + ::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", ""); + + ::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", ""); + + ::SWGSDRangel::setValue(&nco_enable_rx, pJson["ncoEnableRx"], "qint32", ""); + + ::SWGSDRangel::setValue(&nco_frequency_rx, pJson["ncoFrequencyRx"], "qint32", ""); + + ::SWGSDRangel::setValue(&antenna_path_rx, pJson["antennaPathRx"], "qint32", ""); + + ::SWGSDRangel::setValue(&lpf_bw_rx0, pJson["lpfBWRx0"], "qint32", ""); + + ::SWGSDRangel::setValue(&gain_rx0, pJson["gainRx0"], "qint32", ""); + + ::SWGSDRangel::setValue(&gain_mode_rx0, pJson["gainModeRx0"], "qint32", ""); + + ::SWGSDRangel::setValue(&lna_gain_rx0, pJson["lnaGainRx0"], "qint32", ""); + + ::SWGSDRangel::setValue(&tia_gain_rx0, pJson["tiaGainRx0"], "qint32", ""); + + ::SWGSDRangel::setValue(&pga_gain_rx0, pJson["pgaGainRx0"], "qint32", ""); + + ::SWGSDRangel::setValue(&pwrmode_rx0, pJson["pwrmodeRx0"], "qint32", ""); + + ::SWGSDRangel::setValue(&lpf_bw_rx1, pJson["lpfBWRx1"], "qint32", ""); + + ::SWGSDRangel::setValue(&gain_rx1, pJson["gainRx1"], "qint32", ""); + + ::SWGSDRangel::setValue(&gain_mode_rx1, pJson["gainModeRx1"], "qint32", ""); + + ::SWGSDRangel::setValue(&lna_gain_rx1, pJson["lnaGainRx1"], "qint32", ""); + + ::SWGSDRangel::setValue(&tia_gain_rx1, pJson["tiaGainRx1"], "qint32", ""); + + ::SWGSDRangel::setValue(&pga_gain_rx1, pJson["pgaGainRx1"], "qint32", ""); + + ::SWGSDRangel::setValue(&pwrmode_rx1, pJson["pwrmodeRx1"], "qint32", ""); + + ::SWGSDRangel::setValue(&tx_dev_sample_rate, pJson["txDevSampleRate"], "qint32", ""); + + ::SWGSDRangel::setValue(&log2_hard_interp, pJson["log2HardInterp"], "qint32", ""); + + ::SWGSDRangel::setValue(&log2_soft_interp, pJson["log2SoftInterp"], "qint32", ""); + + ::SWGSDRangel::setValue(&tx_center_frequency, pJson["txCenterFrequency"], "qint64", ""); + + ::SWGSDRangel::setValue(&nco_enable_tx, pJson["ncoEnableTx"], "qint32", ""); + + ::SWGSDRangel::setValue(&nco_frequency_tx, pJson["ncoFrequencyTx"], "qint32", ""); + + ::SWGSDRangel::setValue(&antenna_path_tx, pJson["antennaPathTx"], "qint32", ""); + + ::SWGSDRangel::setValue(&lpf_bw_tx0, pJson["lpfBWTx0"], "qint32", ""); + + ::SWGSDRangel::setValue(&gain_tx0, pJson["gainTx0"], "qint32", ""); + + ::SWGSDRangel::setValue(&pwrmode_tx0, pJson["pwrmodeTx0"], "qint32", ""); + + ::SWGSDRangel::setValue(&lpf_bw_tx1, pJson["lpfBWTx1"], "qint32", ""); + + ::SWGSDRangel::setValue(&gain_tx1, pJson["gainTx1"], "qint32", ""); + + ::SWGSDRangel::setValue(&pwrmode_tx1, pJson["pwrmodeTx1"], "qint32", ""); + +} + +QString +SWGXtrxMIMOSettings::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGXtrxMIMOSettings::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_ext_clock_isSet){ + obj->insert("extClock", QJsonValue(ext_clock)); + } + if(m_ext_clock_freq_isSet){ + obj->insert("extClockFreq", QJsonValue(ext_clock_freq)); + } + if(file_record_name != nullptr && *file_record_name != QString("")){ + toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString")); + } + if(m_gpio_dir_isSet){ + obj->insert("gpioDir", QJsonValue(gpio_dir)); + } + if(m_gpio_pins_isSet){ + obj->insert("gpioPins", QJsonValue(gpio_pins)); + } + if(m_use_reverse_api_isSet){ + obj->insert("useReverseAPI", QJsonValue(use_reverse_api)); + } + if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ + toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString")); + } + if(m_reverse_api_port_isSet){ + obj->insert("reverseAPIPort", QJsonValue(reverse_api_port)); + } + if(m_reverse_api_device_index_isSet){ + obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index)); + } + if(m_rx_dev_sample_rate_isSet){ + obj->insert("rxDevSampleRate", QJsonValue(rx_dev_sample_rate)); + } + if(m_log2_hard_decim_isSet){ + obj->insert("log2HardDecim", QJsonValue(log2_hard_decim)); + } + if(m_log2_soft_decim_isSet){ + obj->insert("log2SoftDecim", QJsonValue(log2_soft_decim)); + } + if(m_rx_center_frequency_isSet){ + obj->insert("rxCenterFrequency", QJsonValue(rx_center_frequency)); + } + if(m_dc_block_isSet){ + obj->insert("dcBlock", QJsonValue(dc_block)); + } + if(m_iq_correction_isSet){ + obj->insert("iqCorrection", QJsonValue(iq_correction)); + } + if(m_nco_enable_rx_isSet){ + obj->insert("ncoEnableRx", QJsonValue(nco_enable_rx)); + } + if(m_nco_frequency_rx_isSet){ + obj->insert("ncoFrequencyRx", QJsonValue(nco_frequency_rx)); + } + if(m_antenna_path_rx_isSet){ + obj->insert("antennaPathRx", QJsonValue(antenna_path_rx)); + } + if(m_lpf_bw_rx0_isSet){ + obj->insert("lpfBWRx0", QJsonValue(lpf_bw_rx0)); + } + if(m_gain_rx0_isSet){ + obj->insert("gainRx0", QJsonValue(gain_rx0)); + } + if(m_gain_mode_rx0_isSet){ + obj->insert("gainModeRx0", QJsonValue(gain_mode_rx0)); + } + if(m_lna_gain_rx0_isSet){ + obj->insert("lnaGainRx0", QJsonValue(lna_gain_rx0)); + } + if(m_tia_gain_rx0_isSet){ + obj->insert("tiaGainRx0", QJsonValue(tia_gain_rx0)); + } + if(m_pga_gain_rx0_isSet){ + obj->insert("pgaGainRx0", QJsonValue(pga_gain_rx0)); + } + if(m_pwrmode_rx0_isSet){ + obj->insert("pwrmodeRx0", QJsonValue(pwrmode_rx0)); + } + if(m_lpf_bw_rx1_isSet){ + obj->insert("lpfBWRx1", QJsonValue(lpf_bw_rx1)); + } + if(m_gain_rx1_isSet){ + obj->insert("gainRx1", QJsonValue(gain_rx1)); + } + if(m_gain_mode_rx1_isSet){ + obj->insert("gainModeRx1", QJsonValue(gain_mode_rx1)); + } + if(m_lna_gain_rx1_isSet){ + obj->insert("lnaGainRx1", QJsonValue(lna_gain_rx1)); + } + if(m_tia_gain_rx1_isSet){ + obj->insert("tiaGainRx1", QJsonValue(tia_gain_rx1)); + } + if(m_pga_gain_rx1_isSet){ + obj->insert("pgaGainRx1", QJsonValue(pga_gain_rx1)); + } + if(m_pwrmode_rx1_isSet){ + obj->insert("pwrmodeRx1", QJsonValue(pwrmode_rx1)); + } + if(m_tx_dev_sample_rate_isSet){ + obj->insert("txDevSampleRate", QJsonValue(tx_dev_sample_rate)); + } + if(m_log2_hard_interp_isSet){ + obj->insert("log2HardInterp", QJsonValue(log2_hard_interp)); + } + if(m_log2_soft_interp_isSet){ + obj->insert("log2SoftInterp", QJsonValue(log2_soft_interp)); + } + if(m_tx_center_frequency_isSet){ + obj->insert("txCenterFrequency", QJsonValue(tx_center_frequency)); + } + if(m_nco_enable_tx_isSet){ + obj->insert("ncoEnableTx", QJsonValue(nco_enable_tx)); + } + if(m_nco_frequency_tx_isSet){ + obj->insert("ncoFrequencyTx", QJsonValue(nco_frequency_tx)); + } + if(m_antenna_path_tx_isSet){ + obj->insert("antennaPathTx", QJsonValue(antenna_path_tx)); + } + if(m_lpf_bw_tx0_isSet){ + obj->insert("lpfBWTx0", QJsonValue(lpf_bw_tx0)); + } + if(m_gain_tx0_isSet){ + obj->insert("gainTx0", QJsonValue(gain_tx0)); + } + if(m_pwrmode_tx0_isSet){ + obj->insert("pwrmodeTx0", QJsonValue(pwrmode_tx0)); + } + if(m_lpf_bw_tx1_isSet){ + obj->insert("lpfBWTx1", QJsonValue(lpf_bw_tx1)); + } + if(m_gain_tx1_isSet){ + obj->insert("gainTx1", QJsonValue(gain_tx1)); + } + if(m_pwrmode_tx1_isSet){ + obj->insert("pwrmodeTx1", QJsonValue(pwrmode_tx1)); + } + + return obj; +} + +qint32 +SWGXtrxMIMOSettings::getExtClock() { + return ext_clock; +} +void +SWGXtrxMIMOSettings::setExtClock(qint32 ext_clock) { + this->ext_clock = ext_clock; + this->m_ext_clock_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getExtClockFreq() { + return ext_clock_freq; +} +void +SWGXtrxMIMOSettings::setExtClockFreq(qint32 ext_clock_freq) { + this->ext_clock_freq = ext_clock_freq; + this->m_ext_clock_freq_isSet = true; +} + +QString* +SWGXtrxMIMOSettings::getFileRecordName() { + return file_record_name; +} +void +SWGXtrxMIMOSettings::setFileRecordName(QString* file_record_name) { + this->file_record_name = file_record_name; + this->m_file_record_name_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getGpioDir() { + return gpio_dir; +} +void +SWGXtrxMIMOSettings::setGpioDir(qint32 gpio_dir) { + this->gpio_dir = gpio_dir; + this->m_gpio_dir_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getGpioPins() { + return gpio_pins; +} +void +SWGXtrxMIMOSettings::setGpioPins(qint32 gpio_pins) { + this->gpio_pins = gpio_pins; + this->m_gpio_pins_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getUseReverseApi() { + return use_reverse_api; +} +void +SWGXtrxMIMOSettings::setUseReverseApi(qint32 use_reverse_api) { + this->use_reverse_api = use_reverse_api; + this->m_use_reverse_api_isSet = true; +} + +QString* +SWGXtrxMIMOSettings::getReverseApiAddress() { + return reverse_api_address; +} +void +SWGXtrxMIMOSettings::setReverseApiAddress(QString* reverse_api_address) { + this->reverse_api_address = reverse_api_address; + this->m_reverse_api_address_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getReverseApiPort() { + return reverse_api_port; +} +void +SWGXtrxMIMOSettings::setReverseApiPort(qint32 reverse_api_port) { + this->reverse_api_port = reverse_api_port; + this->m_reverse_api_port_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getReverseApiDeviceIndex() { + return reverse_api_device_index; +} +void +SWGXtrxMIMOSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) { + this->reverse_api_device_index = reverse_api_device_index; + this->m_reverse_api_device_index_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getRxDevSampleRate() { + return rx_dev_sample_rate; +} +void +SWGXtrxMIMOSettings::setRxDevSampleRate(qint32 rx_dev_sample_rate) { + this->rx_dev_sample_rate = rx_dev_sample_rate; + this->m_rx_dev_sample_rate_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getLog2HardDecim() { + return log2_hard_decim; +} +void +SWGXtrxMIMOSettings::setLog2HardDecim(qint32 log2_hard_decim) { + this->log2_hard_decim = log2_hard_decim; + this->m_log2_hard_decim_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getLog2SoftDecim() { + return log2_soft_decim; +} +void +SWGXtrxMIMOSettings::setLog2SoftDecim(qint32 log2_soft_decim) { + this->log2_soft_decim = log2_soft_decim; + this->m_log2_soft_decim_isSet = true; +} + +qint64 +SWGXtrxMIMOSettings::getRxCenterFrequency() { + return rx_center_frequency; +} +void +SWGXtrxMIMOSettings::setRxCenterFrequency(qint64 rx_center_frequency) { + this->rx_center_frequency = rx_center_frequency; + this->m_rx_center_frequency_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getDcBlock() { + return dc_block; +} +void +SWGXtrxMIMOSettings::setDcBlock(qint32 dc_block) { + this->dc_block = dc_block; + this->m_dc_block_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getIqCorrection() { + return iq_correction; +} +void +SWGXtrxMIMOSettings::setIqCorrection(qint32 iq_correction) { + this->iq_correction = iq_correction; + this->m_iq_correction_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getNcoEnableRx() { + return nco_enable_rx; +} +void +SWGXtrxMIMOSettings::setNcoEnableRx(qint32 nco_enable_rx) { + this->nco_enable_rx = nco_enable_rx; + this->m_nco_enable_rx_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getNcoFrequencyRx() { + return nco_frequency_rx; +} +void +SWGXtrxMIMOSettings::setNcoFrequencyRx(qint32 nco_frequency_rx) { + this->nco_frequency_rx = nco_frequency_rx; + this->m_nco_frequency_rx_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getAntennaPathRx() { + return antenna_path_rx; +} +void +SWGXtrxMIMOSettings::setAntennaPathRx(qint32 antenna_path_rx) { + this->antenna_path_rx = antenna_path_rx; + this->m_antenna_path_rx_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getLpfBwRx0() { + return lpf_bw_rx0; +} +void +SWGXtrxMIMOSettings::setLpfBwRx0(qint32 lpf_bw_rx0) { + this->lpf_bw_rx0 = lpf_bw_rx0; + this->m_lpf_bw_rx0_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getGainRx0() { + return gain_rx0; +} +void +SWGXtrxMIMOSettings::setGainRx0(qint32 gain_rx0) { + this->gain_rx0 = gain_rx0; + this->m_gain_rx0_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getGainModeRx0() { + return gain_mode_rx0; +} +void +SWGXtrxMIMOSettings::setGainModeRx0(qint32 gain_mode_rx0) { + this->gain_mode_rx0 = gain_mode_rx0; + this->m_gain_mode_rx0_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getLnaGainRx0() { + return lna_gain_rx0; +} +void +SWGXtrxMIMOSettings::setLnaGainRx0(qint32 lna_gain_rx0) { + this->lna_gain_rx0 = lna_gain_rx0; + this->m_lna_gain_rx0_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getTiaGainRx0() { + return tia_gain_rx0; +} +void +SWGXtrxMIMOSettings::setTiaGainRx0(qint32 tia_gain_rx0) { + this->tia_gain_rx0 = tia_gain_rx0; + this->m_tia_gain_rx0_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getPgaGainRx0() { + return pga_gain_rx0; +} +void +SWGXtrxMIMOSettings::setPgaGainRx0(qint32 pga_gain_rx0) { + this->pga_gain_rx0 = pga_gain_rx0; + this->m_pga_gain_rx0_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getPwrmodeRx0() { + return pwrmode_rx0; +} +void +SWGXtrxMIMOSettings::setPwrmodeRx0(qint32 pwrmode_rx0) { + this->pwrmode_rx0 = pwrmode_rx0; + this->m_pwrmode_rx0_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getLpfBwRx1() { + return lpf_bw_rx1; +} +void +SWGXtrxMIMOSettings::setLpfBwRx1(qint32 lpf_bw_rx1) { + this->lpf_bw_rx1 = lpf_bw_rx1; + this->m_lpf_bw_rx1_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getGainRx1() { + return gain_rx1; +} +void +SWGXtrxMIMOSettings::setGainRx1(qint32 gain_rx1) { + this->gain_rx1 = gain_rx1; + this->m_gain_rx1_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getGainModeRx1() { + return gain_mode_rx1; +} +void +SWGXtrxMIMOSettings::setGainModeRx1(qint32 gain_mode_rx1) { + this->gain_mode_rx1 = gain_mode_rx1; + this->m_gain_mode_rx1_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getLnaGainRx1() { + return lna_gain_rx1; +} +void +SWGXtrxMIMOSettings::setLnaGainRx1(qint32 lna_gain_rx1) { + this->lna_gain_rx1 = lna_gain_rx1; + this->m_lna_gain_rx1_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getTiaGainRx1() { + return tia_gain_rx1; +} +void +SWGXtrxMIMOSettings::setTiaGainRx1(qint32 tia_gain_rx1) { + this->tia_gain_rx1 = tia_gain_rx1; + this->m_tia_gain_rx1_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getPgaGainRx1() { + return pga_gain_rx1; +} +void +SWGXtrxMIMOSettings::setPgaGainRx1(qint32 pga_gain_rx1) { + this->pga_gain_rx1 = pga_gain_rx1; + this->m_pga_gain_rx1_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getPwrmodeRx1() { + return pwrmode_rx1; +} +void +SWGXtrxMIMOSettings::setPwrmodeRx1(qint32 pwrmode_rx1) { + this->pwrmode_rx1 = pwrmode_rx1; + this->m_pwrmode_rx1_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getTxDevSampleRate() { + return tx_dev_sample_rate; +} +void +SWGXtrxMIMOSettings::setTxDevSampleRate(qint32 tx_dev_sample_rate) { + this->tx_dev_sample_rate = tx_dev_sample_rate; + this->m_tx_dev_sample_rate_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getLog2HardInterp() { + return log2_hard_interp; +} +void +SWGXtrxMIMOSettings::setLog2HardInterp(qint32 log2_hard_interp) { + this->log2_hard_interp = log2_hard_interp; + this->m_log2_hard_interp_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getLog2SoftInterp() { + return log2_soft_interp; +} +void +SWGXtrxMIMOSettings::setLog2SoftInterp(qint32 log2_soft_interp) { + this->log2_soft_interp = log2_soft_interp; + this->m_log2_soft_interp_isSet = true; +} + +qint64 +SWGXtrxMIMOSettings::getTxCenterFrequency() { + return tx_center_frequency; +} +void +SWGXtrxMIMOSettings::setTxCenterFrequency(qint64 tx_center_frequency) { + this->tx_center_frequency = tx_center_frequency; + this->m_tx_center_frequency_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getNcoEnableTx() { + return nco_enable_tx; +} +void +SWGXtrxMIMOSettings::setNcoEnableTx(qint32 nco_enable_tx) { + this->nco_enable_tx = nco_enable_tx; + this->m_nco_enable_tx_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getNcoFrequencyTx() { + return nco_frequency_tx; +} +void +SWGXtrxMIMOSettings::setNcoFrequencyTx(qint32 nco_frequency_tx) { + this->nco_frequency_tx = nco_frequency_tx; + this->m_nco_frequency_tx_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getAntennaPathTx() { + return antenna_path_tx; +} +void +SWGXtrxMIMOSettings::setAntennaPathTx(qint32 antenna_path_tx) { + this->antenna_path_tx = antenna_path_tx; + this->m_antenna_path_tx_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getLpfBwTx0() { + return lpf_bw_tx0; +} +void +SWGXtrxMIMOSettings::setLpfBwTx0(qint32 lpf_bw_tx0) { + this->lpf_bw_tx0 = lpf_bw_tx0; + this->m_lpf_bw_tx0_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getGainTx0() { + return gain_tx0; +} +void +SWGXtrxMIMOSettings::setGainTx0(qint32 gain_tx0) { + this->gain_tx0 = gain_tx0; + this->m_gain_tx0_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getPwrmodeTx0() { + return pwrmode_tx0; +} +void +SWGXtrxMIMOSettings::setPwrmodeTx0(qint32 pwrmode_tx0) { + this->pwrmode_tx0 = pwrmode_tx0; + this->m_pwrmode_tx0_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getLpfBwTx1() { + return lpf_bw_tx1; +} +void +SWGXtrxMIMOSettings::setLpfBwTx1(qint32 lpf_bw_tx1) { + this->lpf_bw_tx1 = lpf_bw_tx1; + this->m_lpf_bw_tx1_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getGainTx1() { + return gain_tx1; +} +void +SWGXtrxMIMOSettings::setGainTx1(qint32 gain_tx1) { + this->gain_tx1 = gain_tx1; + this->m_gain_tx1_isSet = true; +} + +qint32 +SWGXtrxMIMOSettings::getPwrmodeTx1() { + return pwrmode_tx1; +} +void +SWGXtrxMIMOSettings::setPwrmodeTx1(qint32 pwrmode_tx1) { + this->pwrmode_tx1 = pwrmode_tx1; + this->m_pwrmode_tx1_isSet = true; +} + + +bool +SWGXtrxMIMOSettings::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_ext_clock_isSet){ + isObjectUpdated = true; break; + } + if(m_ext_clock_freq_isSet){ + isObjectUpdated = true; break; + } + if(file_record_name && *file_record_name != QString("")){ + isObjectUpdated = true; break; + } + if(m_gpio_dir_isSet){ + isObjectUpdated = true; break; + } + if(m_gpio_pins_isSet){ + isObjectUpdated = true; break; + } + if(m_use_reverse_api_isSet){ + isObjectUpdated = true; break; + } + if(reverse_api_address && *reverse_api_address != QString("")){ + isObjectUpdated = true; break; + } + if(m_reverse_api_port_isSet){ + isObjectUpdated = true; break; + } + if(m_reverse_api_device_index_isSet){ + isObjectUpdated = true; break; + } + if(m_rx_dev_sample_rate_isSet){ + isObjectUpdated = true; break; + } + if(m_log2_hard_decim_isSet){ + isObjectUpdated = true; break; + } + if(m_log2_soft_decim_isSet){ + isObjectUpdated = true; break; + } + if(m_rx_center_frequency_isSet){ + isObjectUpdated = true; break; + } + if(m_dc_block_isSet){ + isObjectUpdated = true; break; + } + if(m_iq_correction_isSet){ + isObjectUpdated = true; break; + } + if(m_nco_enable_rx_isSet){ + isObjectUpdated = true; break; + } + if(m_nco_frequency_rx_isSet){ + isObjectUpdated = true; break; + } + if(m_antenna_path_rx_isSet){ + isObjectUpdated = true; break; + } + if(m_lpf_bw_rx0_isSet){ + isObjectUpdated = true; break; + } + if(m_gain_rx0_isSet){ + isObjectUpdated = true; break; + } + if(m_gain_mode_rx0_isSet){ + isObjectUpdated = true; break; + } + if(m_lna_gain_rx0_isSet){ + isObjectUpdated = true; break; + } + if(m_tia_gain_rx0_isSet){ + isObjectUpdated = true; break; + } + if(m_pga_gain_rx0_isSet){ + isObjectUpdated = true; break; + } + if(m_pwrmode_rx0_isSet){ + isObjectUpdated = true; break; + } + if(m_lpf_bw_rx1_isSet){ + isObjectUpdated = true; break; + } + if(m_gain_rx1_isSet){ + isObjectUpdated = true; break; + } + if(m_gain_mode_rx1_isSet){ + isObjectUpdated = true; break; + } + if(m_lna_gain_rx1_isSet){ + isObjectUpdated = true; break; + } + if(m_tia_gain_rx1_isSet){ + isObjectUpdated = true; break; + } + if(m_pga_gain_rx1_isSet){ + isObjectUpdated = true; break; + } + if(m_pwrmode_rx1_isSet){ + isObjectUpdated = true; break; + } + if(m_tx_dev_sample_rate_isSet){ + isObjectUpdated = true; break; + } + if(m_log2_hard_interp_isSet){ + isObjectUpdated = true; break; + } + if(m_log2_soft_interp_isSet){ + isObjectUpdated = true; break; + } + if(m_tx_center_frequency_isSet){ + isObjectUpdated = true; break; + } + if(m_nco_enable_tx_isSet){ + isObjectUpdated = true; break; + } + if(m_nco_frequency_tx_isSet){ + isObjectUpdated = true; break; + } + if(m_antenna_path_tx_isSet){ + isObjectUpdated = true; break; + } + if(m_lpf_bw_tx0_isSet){ + isObjectUpdated = true; break; + } + if(m_gain_tx0_isSet){ + isObjectUpdated = true; break; + } + if(m_pwrmode_tx0_isSet){ + isObjectUpdated = true; break; + } + if(m_lpf_bw_tx1_isSet){ + isObjectUpdated = true; break; + } + if(m_gain_tx1_isSet){ + isObjectUpdated = true; break; + } + if(m_pwrmode_tx1_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOSettings.h b/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOSettings.h new file mode 100644 index 000000000..34f075d3d --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGXtrxMIMOSettings.h @@ -0,0 +1,323 @@ +/** + * 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: 5.3.0 + * 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. + */ + +/* + * SWGXtrxMIMOSettings.h + * + * XTRX + */ + +#ifndef SWGXtrxMIMOSettings_H_ +#define SWGXtrxMIMOSettings_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGXtrxMIMOSettings: public SWGObject { +public: + SWGXtrxMIMOSettings(); + SWGXtrxMIMOSettings(QString* json); + virtual ~SWGXtrxMIMOSettings(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGXtrxMIMOSettings* fromJson(QString &jsonString) override; + + qint32 getExtClock(); + void setExtClock(qint32 ext_clock); + + qint32 getExtClockFreq(); + void setExtClockFreq(qint32 ext_clock_freq); + + QString* getFileRecordName(); + void setFileRecordName(QString* file_record_name); + + qint32 getGpioDir(); + void setGpioDir(qint32 gpio_dir); + + qint32 getGpioPins(); + void setGpioPins(qint32 gpio_pins); + + qint32 getUseReverseApi(); + void setUseReverseApi(qint32 use_reverse_api); + + QString* getReverseApiAddress(); + void setReverseApiAddress(QString* reverse_api_address); + + qint32 getReverseApiPort(); + void setReverseApiPort(qint32 reverse_api_port); + + qint32 getReverseApiDeviceIndex(); + void setReverseApiDeviceIndex(qint32 reverse_api_device_index); + + qint32 getRxDevSampleRate(); + void setRxDevSampleRate(qint32 rx_dev_sample_rate); + + qint32 getLog2HardDecim(); + void setLog2HardDecim(qint32 log2_hard_decim); + + qint32 getLog2SoftDecim(); + void setLog2SoftDecim(qint32 log2_soft_decim); + + qint64 getRxCenterFrequency(); + void setRxCenterFrequency(qint64 rx_center_frequency); + + qint32 getDcBlock(); + void setDcBlock(qint32 dc_block); + + qint32 getIqCorrection(); + void setIqCorrection(qint32 iq_correction); + + qint32 getNcoEnableRx(); + void setNcoEnableRx(qint32 nco_enable_rx); + + qint32 getNcoFrequencyRx(); + void setNcoFrequencyRx(qint32 nco_frequency_rx); + + qint32 getAntennaPathRx(); + void setAntennaPathRx(qint32 antenna_path_rx); + + qint32 getLpfBwRx0(); + void setLpfBwRx0(qint32 lpf_bw_rx0); + + qint32 getGainRx0(); + void setGainRx0(qint32 gain_rx0); + + qint32 getGainModeRx0(); + void setGainModeRx0(qint32 gain_mode_rx0); + + qint32 getLnaGainRx0(); + void setLnaGainRx0(qint32 lna_gain_rx0); + + qint32 getTiaGainRx0(); + void setTiaGainRx0(qint32 tia_gain_rx0); + + qint32 getPgaGainRx0(); + void setPgaGainRx0(qint32 pga_gain_rx0); + + qint32 getPwrmodeRx0(); + void setPwrmodeRx0(qint32 pwrmode_rx0); + + qint32 getLpfBwRx1(); + void setLpfBwRx1(qint32 lpf_bw_rx1); + + qint32 getGainRx1(); + void setGainRx1(qint32 gain_rx1); + + qint32 getGainModeRx1(); + void setGainModeRx1(qint32 gain_mode_rx1); + + qint32 getLnaGainRx1(); + void setLnaGainRx1(qint32 lna_gain_rx1); + + qint32 getTiaGainRx1(); + void setTiaGainRx1(qint32 tia_gain_rx1); + + qint32 getPgaGainRx1(); + void setPgaGainRx1(qint32 pga_gain_rx1); + + qint32 getPwrmodeRx1(); + void setPwrmodeRx1(qint32 pwrmode_rx1); + + qint32 getTxDevSampleRate(); + void setTxDevSampleRate(qint32 tx_dev_sample_rate); + + qint32 getLog2HardInterp(); + void setLog2HardInterp(qint32 log2_hard_interp); + + qint32 getLog2SoftInterp(); + void setLog2SoftInterp(qint32 log2_soft_interp); + + qint64 getTxCenterFrequency(); + void setTxCenterFrequency(qint64 tx_center_frequency); + + qint32 getNcoEnableTx(); + void setNcoEnableTx(qint32 nco_enable_tx); + + qint32 getNcoFrequencyTx(); + void setNcoFrequencyTx(qint32 nco_frequency_tx); + + qint32 getAntennaPathTx(); + void setAntennaPathTx(qint32 antenna_path_tx); + + qint32 getLpfBwTx0(); + void setLpfBwTx0(qint32 lpf_bw_tx0); + + qint32 getGainTx0(); + void setGainTx0(qint32 gain_tx0); + + qint32 getPwrmodeTx0(); + void setPwrmodeTx0(qint32 pwrmode_tx0); + + qint32 getLpfBwTx1(); + void setLpfBwTx1(qint32 lpf_bw_tx1); + + qint32 getGainTx1(); + void setGainTx1(qint32 gain_tx1); + + qint32 getPwrmodeTx1(); + void setPwrmodeTx1(qint32 pwrmode_tx1); + + + virtual bool isSet() override; + +private: + qint32 ext_clock; + bool m_ext_clock_isSet; + + qint32 ext_clock_freq; + bool m_ext_clock_freq_isSet; + + QString* file_record_name; + bool m_file_record_name_isSet; + + qint32 gpio_dir; + bool m_gpio_dir_isSet; + + qint32 gpio_pins; + bool m_gpio_pins_isSet; + + qint32 use_reverse_api; + bool m_use_reverse_api_isSet; + + QString* reverse_api_address; + bool m_reverse_api_address_isSet; + + qint32 reverse_api_port; + bool m_reverse_api_port_isSet; + + qint32 reverse_api_device_index; + bool m_reverse_api_device_index_isSet; + + qint32 rx_dev_sample_rate; + bool m_rx_dev_sample_rate_isSet; + + qint32 log2_hard_decim; + bool m_log2_hard_decim_isSet; + + qint32 log2_soft_decim; + bool m_log2_soft_decim_isSet; + + qint64 rx_center_frequency; + bool m_rx_center_frequency_isSet; + + qint32 dc_block; + bool m_dc_block_isSet; + + qint32 iq_correction; + bool m_iq_correction_isSet; + + qint32 nco_enable_rx; + bool m_nco_enable_rx_isSet; + + qint32 nco_frequency_rx; + bool m_nco_frequency_rx_isSet; + + qint32 antenna_path_rx; + bool m_antenna_path_rx_isSet; + + qint32 lpf_bw_rx0; + bool m_lpf_bw_rx0_isSet; + + qint32 gain_rx0; + bool m_gain_rx0_isSet; + + qint32 gain_mode_rx0; + bool m_gain_mode_rx0_isSet; + + qint32 lna_gain_rx0; + bool m_lna_gain_rx0_isSet; + + qint32 tia_gain_rx0; + bool m_tia_gain_rx0_isSet; + + qint32 pga_gain_rx0; + bool m_pga_gain_rx0_isSet; + + qint32 pwrmode_rx0; + bool m_pwrmode_rx0_isSet; + + qint32 lpf_bw_rx1; + bool m_lpf_bw_rx1_isSet; + + qint32 gain_rx1; + bool m_gain_rx1_isSet; + + qint32 gain_mode_rx1; + bool m_gain_mode_rx1_isSet; + + qint32 lna_gain_rx1; + bool m_lna_gain_rx1_isSet; + + qint32 tia_gain_rx1; + bool m_tia_gain_rx1_isSet; + + qint32 pga_gain_rx1; + bool m_pga_gain_rx1_isSet; + + qint32 pwrmode_rx1; + bool m_pwrmode_rx1_isSet; + + qint32 tx_dev_sample_rate; + bool m_tx_dev_sample_rate_isSet; + + qint32 log2_hard_interp; + bool m_log2_hard_interp_isSet; + + qint32 log2_soft_interp; + bool m_log2_soft_interp_isSet; + + qint64 tx_center_frequency; + bool m_tx_center_frequency_isSet; + + qint32 nco_enable_tx; + bool m_nco_enable_tx_isSet; + + qint32 nco_frequency_tx; + bool m_nco_frequency_tx_isSet; + + qint32 antenna_path_tx; + bool m_antenna_path_tx_isSet; + + qint32 lpf_bw_tx0; + bool m_lpf_bw_tx0_isSet; + + qint32 gain_tx0; + bool m_gain_tx0_isSet; + + qint32 pwrmode_tx0; + bool m_pwrmode_tx0_isSet; + + qint32 lpf_bw_tx1; + bool m_lpf_bw_tx1_isSet; + + qint32 gain_tx1; + bool m_gain_tx1_isSet; + + qint32 pwrmode_tx1; + bool m_pwrmode_tx1_isSet; + +}; + +} + +#endif /* SWGXtrxMIMOSettings_H_ */