diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index 9ac12d3e9..803a949a9 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -489,6 +489,7 @@ int NFMMod::webapiSettingsGet( response.getNfmModSettings()->setCtcssOn(m_settings.m_ctcssOn ? 1 : 0); response.getNfmModSettings()->setFmDeviation(m_settings.m_fmDeviation); response.getNfmModSettings()->setInputFrequencyOffset(m_settings.m_inputFrequencyOffset); + response.getNfmModSettings()->setModAfInput((int) m_settings.m_modAFInput); response.getNfmModSettings()->setOutputSampleRate(m_settings.m_outputSampleRate); response.getNfmModSettings()->setPlayLoop(m_settings.m_playLoop ? 1 : 0); response.getNfmModSettings()->setRfBandwidth(m_settings.m_rfBandwidth); @@ -520,6 +521,7 @@ int NFMMod::webapiSettingsPutPatch( settings.m_ctcssOn = response.getNfmModSettings()->getCtcssOn() != 0; settings.m_fmDeviation = response.getNfmModSettings()->getFmDeviation(); settings.m_inputFrequencyOffset = response.getNfmModSettings()->getInputFrequencyOffset(); + settings.m_modAFInput = (NFMModSettings::NFMModInputAF) response.getNfmModSettings()->getModAfInput(); settings.m_outputSampleRate = response.getNfmModSettings()->getOutputSampleRate(); settings.m_playLoop = response.getNfmModSettings()->getPlayLoop() != 0; settings.m_rfBandwidth = response.getNfmModSettings()->getRfBandwidth(); diff --git a/plugins/channeltx/modnfm/nfmmodgui.cpp b/plugins/channeltx/modnfm/nfmmodgui.cpp index eeaabf345..7d4b3e7c4 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.cpp +++ b/plugins/channeltx/modnfm/nfmmodgui.cpp @@ -461,7 +461,7 @@ void NFMModGUI::tick() m_channelPowerDbAvg.feed(powDb); ui->channelPower->setText(tr("%1 dB").arg(m_channelPowerDbAvg.average(), 0, 'f', 1)); - if (((++m_tickCount & 0xf) == 0) && (m_settings.m_modAFInput == NFMMod::NFMModInputFile)) + if (((++m_tickCount & 0xf) == 0) && (m_settings.m_modAFInput == NFMModSettings::NFMModInputFile)) { NFMMod::MsgConfigureFileSourceStreamTiming* message = NFMMod::MsgConfigureFileSourceStreamTiming::create(); m_nfmMod->getInputMessageQueue()->push(message); diff --git a/sdrbase/resources/index.html b/sdrbase/resources/index.html index 0f7d6c19f..90bfb1166 100644 --- a/sdrbase/resources/index.html +++ b/sdrbase/resources/index.html @@ -1324,6 +1324,9 @@ margin-bottom: 20px; "title" : { "type" : "string" }, + "modAFInput" : { + "type" : "integer" + }, "cwKeyer" : { "$ref" : "#/definitions/CWKeyerSettings" } @@ -13764,7 +13767,7 @@ except ApiException as e:
- Generated 2017-12-10T18:03:56.008+01:00 + Generated 2017-12-12T23:11:28.100+01:00
diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index ecb06fe95..bd731e677 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -1175,6 +1175,10 @@ bool WebAPIRequestMapper::validateChannelSettings(SWGSDRangel::SWGChannelSetting return false; } } + else + { + return false; + } } void WebAPIRequestMapper::resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings) diff --git a/swagger/sdrangel/api/swagger/include/NFMMod.yaml b/swagger/sdrangel/api/swagger/include/NFMMod.yaml index 8fc76d92f..9dd4d5296 100644 --- a/swagger/sdrangel/api/swagger/include/NFMMod.yaml +++ b/swagger/sdrangel/api/swagger/include/NFMMod.yaml @@ -36,6 +36,8 @@ NFMModSettings: type: integer title: type: string + modAFInput: + type: integer cwKeyer: $ref: "http://localhost:8081/CWKeyer.yaml#/CWKeyerSettings" \ No newline at end of file diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 0f7d6c19f..90bfb1166 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1324,6 +1324,9 @@ margin-bottom: 20px; "title" : { "type" : "string" }, + "modAFInput" : { + "type" : "integer" + }, "cwKeyer" : { "$ref" : "#/definitions/CWKeyerSettings" } @@ -13764,7 +13767,7 @@ except ApiException as e:
- Generated 2017-12-10T18:03:56.008+01:00 + Generated 2017-12-12T23:11:28.100+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGNFMModSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGNFMModSettings.cpp index 996910a54..b301c7e76 100644 --- a/swagger/sdrangel/code/qt5/client/SWGNFMModSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGNFMModSettings.cpp @@ -52,6 +52,7 @@ SWGNFMModSettings::init() { ctcss_index = 0; rgb_color = 0; title = new QString(""); + mod_af_input = 0; cw_keyer = new SWGCWKeyerSettings(); } @@ -76,6 +77,7 @@ SWGNFMModSettings::cleanup() { delete title; } + if(cw_keyer != nullptr) { delete cw_keyer; } @@ -107,6 +109,7 @@ SWGNFMModSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&ctcss_index, pJson["ctcssIndex"], "qint32", ""); ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", ""); ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); + ::SWGSDRangel::setValue(&mod_af_input, pJson["modAFInput"], "qint32", ""); ::SWGSDRangel::setValue(&cw_keyer, pJson["cwKeyer"], "SWGCWKeyerSettings", "SWGCWKeyerSettings"); } @@ -154,6 +157,8 @@ SWGNFMModSettings::asJsonObject() { toJsonValue(QString("title"), title, obj, QString("QString")); + obj->insert("modAFInput", QJsonValue(mod_af_input)); + toJsonValue(QString("cwKeyer"), cw_keyer, obj, QString("SWGCWKeyerSettings")); return obj; @@ -294,6 +299,15 @@ SWGNFMModSettings::setTitle(QString* title) { this->title = title; } +qint32 +SWGNFMModSettings::getModAfInput() { + return mod_af_input; +} +void +SWGNFMModSettings::setModAfInput(qint32 mod_af_input) { + this->mod_af_input = mod_af_input; +} + SWGCWKeyerSettings* SWGNFMModSettings::getCwKeyer() { return cw_keyer; diff --git a/swagger/sdrangel/code/qt5/client/SWGNFMModSettings.h b/swagger/sdrangel/code/qt5/client/SWGNFMModSettings.h index dfc28348a..9bb99deac 100644 --- a/swagger/sdrangel/code/qt5/client/SWGNFMModSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGNFMModSettings.h @@ -88,6 +88,9 @@ public: QString* getTitle(); void setTitle(QString* title); + qint32 getModAfInput(); + void setModAfInput(qint32 mod_af_input); + SWGCWKeyerSettings* getCwKeyer(); void setCwKeyer(SWGCWKeyerSettings* cw_keyer); @@ -108,6 +111,7 @@ private: qint32 ctcss_index; qint32 rgb_color; QString* title; + qint32 mod_af_input; SWGCWKeyerSettings* cw_keyer; }; diff --git a/swagger/sdrangel/examples/nfm_test.py b/swagger/sdrangel/examples/nfm_test.py index 12fb8a8f8..8b174f673 100644 --- a/swagger/sdrangel/examples/nfm_test.py +++ b/swagger/sdrangel/examples/nfm_test.py @@ -80,6 +80,7 @@ def main(): settings["NFMModSettings"]["cwKeyer"]["text"] = "VVV DE F4EXB " settings["NFMModSettings"]["cwKeyer"]["loop"] = 1 settings["NFMModSettings"]["cwKeyer"]["mode"] = 1 # text + settings["NFMModSettings"]["modAFInput"] = 4 r = callAPI("/deviceset/1/channel/0/settings", "PATCH", None, settings, "Change NFM mod") if r is None: