From 1171d71c872a1bca33905f7895b4ca1ae273b5b4 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 18 Oct 2019 15:49:46 +0200 Subject: [PATCH] REST API: BladeRF2 fc pos reorg in MIMO part --- .../webapi/doc/swagger/include/BladeRF2.yaml | 5 +- .../api/swagger/include/BladeRF2.yaml | 5 +- .../qt5/client/SWGBladeRF2MIMOSettings.cpp | 49 ++++++++++++++----- .../code/qt5/client/SWGBladeRF2MIMOSettings.h | 14 ++++-- 4 files changed, 54 insertions(+), 19 deletions(-) diff --git a/sdrbase/resources/webapi/doc/swagger/include/BladeRF2.yaml b/sdrbase/resources/webapi/doc/swagger/include/BladeRF2.yaml index 77df11a72..3d2e65ff6 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/BladeRF2.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/BladeRF2.yaml @@ -114,7 +114,7 @@ BladeRF2MIMOSettings: format: int64 log2Decim: type: integer - fcPos: + fcPosRx: description: See BladeRF2MIMO::fcPos_t type: integer rxBandwidth: @@ -147,6 +147,9 @@ BladeRF2MIMOSettings: format: int64 log2Interp: type: integer + fcPosTx: + description: See BladeRF2MIMO::fcPos_t + type: integer txBandwidth: type: integer tx0GlobalGain: diff --git a/swagger/sdrangel/api/swagger/include/BladeRF2.yaml b/swagger/sdrangel/api/swagger/include/BladeRF2.yaml index d6bc003d7..23c9f7dac 100644 --- a/swagger/sdrangel/api/swagger/include/BladeRF2.yaml +++ b/swagger/sdrangel/api/swagger/include/BladeRF2.yaml @@ -114,7 +114,7 @@ BladeRF2MIMOSettings: format: int64 log2Decim: type: integer - fcPos: + fcPosRx: description: See BladeRF2MIMO::fcPos_t type: integer rxBandwidth: @@ -147,6 +147,9 @@ BladeRF2MIMOSettings: format: int64 log2Interp: type: integer + fcPosTx: + description: See BladeRF2MIMO::fcPos_t + type: integer txBandwidth: type: integer tx0GlobalGain: diff --git a/swagger/sdrangel/code/qt5/client/SWGBladeRF2MIMOSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGBladeRF2MIMOSettings.cpp index e03801b4b..e23296fd4 100644 --- a/swagger/sdrangel/code/qt5/client/SWGBladeRF2MIMOSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGBladeRF2MIMOSettings.cpp @@ -36,8 +36,8 @@ SWGBladeRF2MIMOSettings::SWGBladeRF2MIMOSettings() { m_rx_center_frequency_isSet = false; log2_decim = 0; m_log2_decim_isSet = false; - fc_pos = 0; - m_fc_pos_isSet = false; + fc_pos_rx = 0; + m_fc_pos_rx_isSet = false; rx_bandwidth = 0; m_rx_bandwidth_isSet = false; rx0_gain_mode = 0; @@ -62,6 +62,8 @@ SWGBladeRF2MIMOSettings::SWGBladeRF2MIMOSettings() { m_tx_center_frequency_isSet = false; log2_interp = 0; m_log2_interp_isSet = false; + fc_pos_tx = 0; + m_fc_pos_tx_isSet = false; tx_bandwidth = 0; m_tx_bandwidth_isSet = false; tx0_global_gain = 0; @@ -100,8 +102,8 @@ SWGBladeRF2MIMOSettings::init() { m_rx_center_frequency_isSet = false; log2_decim = 0; m_log2_decim_isSet = false; - fc_pos = 0; - m_fc_pos_isSet = false; + fc_pos_rx = 0; + m_fc_pos_rx_isSet = false; rx_bandwidth = 0; m_rx_bandwidth_isSet = false; rx0_gain_mode = 0; @@ -126,6 +128,8 @@ SWGBladeRF2MIMOSettings::init() { m_tx_center_frequency_isSet = false; log2_interp = 0; m_log2_interp_isSet = false; + fc_pos_tx = 0; + m_fc_pos_tx_isSet = false; tx_bandwidth = 0; m_tx_bandwidth_isSet = false; tx0_global_gain = 0; @@ -173,6 +177,7 @@ SWGBladeRF2MIMOSettings::cleanup() { + if(file_record_name != nullptr) { @@ -205,7 +210,7 @@ SWGBladeRF2MIMOSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&log2_decim, pJson["log2Decim"], "qint32", ""); - ::SWGSDRangel::setValue(&fc_pos, pJson["fcPos"], "qint32", ""); + ::SWGSDRangel::setValue(&fc_pos_rx, pJson["fcPosRx"], "qint32", ""); ::SWGSDRangel::setValue(&rx_bandwidth, pJson["rxBandwidth"], "qint32", ""); @@ -231,6 +236,8 @@ SWGBladeRF2MIMOSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&log2_interp, pJson["log2Interp"], "qint32", ""); + ::SWGSDRangel::setValue(&fc_pos_tx, pJson["fcPosTx"], "qint32", ""); + ::SWGSDRangel::setValue(&tx_bandwidth, pJson["txBandwidth"], "qint32", ""); ::SWGSDRangel::setValue(&tx0_global_gain, pJson["tx0GlobalGain"], "qint32", ""); @@ -281,8 +288,8 @@ SWGBladeRF2MIMOSettings::asJsonObject() { if(m_log2_decim_isSet){ obj->insert("log2Decim", QJsonValue(log2_decim)); } - if(m_fc_pos_isSet){ - obj->insert("fcPos", QJsonValue(fc_pos)); + if(m_fc_pos_rx_isSet){ + obj->insert("fcPosRx", QJsonValue(fc_pos_rx)); } if(m_rx_bandwidth_isSet){ obj->insert("rxBandwidth", QJsonValue(rx_bandwidth)); @@ -320,6 +327,9 @@ SWGBladeRF2MIMOSettings::asJsonObject() { if(m_log2_interp_isSet){ obj->insert("log2Interp", QJsonValue(log2_interp)); } + if(m_fc_pos_tx_isSet){ + obj->insert("fcPosTx", QJsonValue(fc_pos_tx)); + } if(m_tx_bandwidth_isSet){ obj->insert("txBandwidth", QJsonValue(tx_bandwidth)); } @@ -398,13 +408,13 @@ SWGBladeRF2MIMOSettings::setLog2Decim(qint32 log2_decim) { } qint32 -SWGBladeRF2MIMOSettings::getFcPos() { - return fc_pos; +SWGBladeRF2MIMOSettings::getFcPosRx() { + return fc_pos_rx; } void -SWGBladeRF2MIMOSettings::setFcPos(qint32 fc_pos) { - this->fc_pos = fc_pos; - this->m_fc_pos_isSet = true; +SWGBladeRF2MIMOSettings::setFcPosRx(qint32 fc_pos_rx) { + this->fc_pos_rx = fc_pos_rx; + this->m_fc_pos_rx_isSet = true; } qint32 @@ -527,6 +537,16 @@ SWGBladeRF2MIMOSettings::setLog2Interp(qint32 log2_interp) { this->m_log2_interp_isSet = true; } +qint32 +SWGBladeRF2MIMOSettings::getFcPosTx() { + return fc_pos_tx; +} +void +SWGBladeRF2MIMOSettings::setFcPosTx(qint32 fc_pos_tx) { + this->fc_pos_tx = fc_pos_tx; + this->m_fc_pos_tx_isSet = true; +} + qint32 SWGBladeRF2MIMOSettings::getTxBandwidth() { return tx_bandwidth; @@ -654,7 +674,7 @@ SWGBladeRF2MIMOSettings::isSet(){ if(m_log2_decim_isSet){ isObjectUpdated = true; break; } - if(m_fc_pos_isSet){ + if(m_fc_pos_rx_isSet){ isObjectUpdated = true; break; } if(m_rx_bandwidth_isSet){ @@ -693,6 +713,9 @@ SWGBladeRF2MIMOSettings::isSet(){ if(m_log2_interp_isSet){ isObjectUpdated = true; break; } + if(m_fc_pos_tx_isSet){ + isObjectUpdated = true; break; + } if(m_tx_bandwidth_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGBladeRF2MIMOSettings.h b/swagger/sdrangel/code/qt5/client/SWGBladeRF2MIMOSettings.h index 64bf409b5..95e4564a1 100644 --- a/swagger/sdrangel/code/qt5/client/SWGBladeRF2MIMOSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGBladeRF2MIMOSettings.h @@ -54,8 +54,8 @@ public: qint32 getLog2Decim(); void setLog2Decim(qint32 log2_decim); - qint32 getFcPos(); - void setFcPos(qint32 fc_pos); + qint32 getFcPosRx(); + void setFcPosRx(qint32 fc_pos_rx); qint32 getRxBandwidth(); void setRxBandwidth(qint32 rx_bandwidth); @@ -93,6 +93,9 @@ public: qint32 getLog2Interp(); void setLog2Interp(qint32 log2_interp); + qint32 getFcPosTx(); + void setFcPosTx(qint32 fc_pos_tx); + qint32 getTxBandwidth(); void setTxBandwidth(qint32 tx_bandwidth); @@ -142,8 +145,8 @@ private: qint32 log2_decim; bool m_log2_decim_isSet; - qint32 fc_pos; - bool m_fc_pos_isSet; + qint32 fc_pos_rx; + bool m_fc_pos_rx_isSet; qint32 rx_bandwidth; bool m_rx_bandwidth_isSet; @@ -181,6 +184,9 @@ private: qint32 log2_interp; bool m_log2_interp_isSet; + qint32 fc_pos_tx; + bool m_fc_pos_tx_isSet; + qint32 tx_bandwidth; bool m_tx_bandwidth_isSet;