diff --git a/plugins/channeltx/daemonsrc/daemonsrc.cpp b/plugins/channeltx/daemonsrc/daemonsrc.cpp index c30117492..e5e949307 100644 --- a/plugins/channeltx/daemonsrc/daemonsrc.cpp +++ b/plugins/channeltx/daemonsrc/daemonsrc.cpp @@ -349,7 +349,6 @@ int DaemonSrc::webapiSettingsPutPatch( if (channelSettingsKeys.contains("dataAddress")) { settings.m_dataAddress = *response.getSdrDaemonChannelSourceSettings()->getDataAddress(); } - if (channelSettingsKeys.contains("dataPort")) { int dataPort = response.getSdrDaemonChannelSourceSettings()->getDataPort(); @@ -360,6 +359,12 @@ int DaemonSrc::webapiSettingsPutPatch( settings.m_dataPort = dataPort; } } + if (channelSettingsKeys.contains("rgbColor")) { + settings.m_rgbColor = response.getSdrDaemonChannelSourceSettings()->getRgbColor(); + } + if (channelSettingsKeys.contains("title")) { + settings.m_title = *response.getSdrDaemonChannelSourceSettings()->getTitle(); + } MsgConfigureDaemonSrc *msg = MsgConfigureDaemonSrc::create(settings, force); m_inputMessageQueue.push(msg); @@ -395,6 +400,13 @@ void DaemonSrc::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res } response.getSdrDaemonChannelSourceSettings()->setDataPort(settings.m_dataPort); + response.getSdrDaemonChannelSourceSettings()->setRgbColor(settings.m_rgbColor); + + if (response.getSdrDaemonChannelSourceSettings()->getTitle()) { + *response.getSdrDaemonChannelSourceSettings()->getTitle() = settings.m_title; + } else { + response.getSdrDaemonChannelSourceSettings()->setTitle(new QString(settings.m_title)); + } } void DaemonSrc::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) diff --git a/plugins/channeltx/daemonsrc/daemonsrcgui.cpp b/plugins/channeltx/daemonsrc/daemonsrcgui.cpp index 9d2212ed9..a351b763e 100644 --- a/plugins/channeltx/daemonsrc/daemonsrcgui.cpp +++ b/plugins/channeltx/daemonsrc/daemonsrcgui.cpp @@ -82,9 +82,21 @@ bool DaemonSrcGUI::handleMessage(const Message& message) { DaemonSrc::MsgSampleRateNotification& notif = (DaemonSrc::MsgSampleRateNotification&) message; m_channelMarker.setBandwidth(notif.getSampleRate()); + return true; + } + else if (DaemonSrc::MsgConfigureDaemonSrc::match(message)) + { + const DaemonSrc::MsgConfigureDaemonSrc& cfg = (DaemonSrc::MsgConfigureDaemonSrc&) message; + m_settings = cfg.getSettings(); + blockApplySettings(true); + displaySettings(); + blockApplySettings(false); + return true; + } + else + { + return false; } - - return false; } DaemonSrcGUI::DaemonSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx __attribute__((unused)), QWidget* parent) : diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 406dab88e..5168c5ff7 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -3215,6 +3215,12 @@ margin-bottom: 20px; "dataPort" : { "type" : "integer", "description" : "Remote USB data port" + }, + "rgbColor" : { + "type" : "integer" + }, + "title" : { + "type" : "string" } }, "description" : "Data handling details for SDRDaemon" @@ -28688,7 +28694,7 @@ except ApiException as e:
- Generated 2018-08-31T08:45:52.974+02:00 + Generated 2018-09-01T05:45:40.779+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/SDRDaemonChannelSource.yaml b/sdrbase/resources/webapi/doc/swagger/include/SDRDaemonChannelSource.yaml index bed33bf1a..686c577c9 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/SDRDaemonChannelSource.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/SDRDaemonChannelSource.yaml @@ -7,6 +7,10 @@ SDRDaemonChannelSourceSettings: dataPort: description: "Remote USB data port" type: integer + rgbColor: + type: integer + title: + type: string SDRDaemonChannelSourceReport: description: "SDRDaemon channel source report" diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index d58fcd22d..493472907 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -2146,14 +2146,14 @@ bool WebAPIRequestMapper::validateChannelSettings( return false; } } - else if (*channelType == "SDRDaemonChannelSink") + else if (*channelType == "DaemonSrc") { - if (channelSettings.getTx() == 0) + if (channelSettings.getTx() != 0) { - QJsonObject sdrDaemonChannelSinkSettingsJsonObject = jsonObject["SDRDaemonChannelSinkSettings"].toObject(); - channelSettingsKeys = sdrDaemonChannelSinkSettingsJsonObject.keys(); - channelSettings.setSdrDaemonChannelSinkSettings(new SWGSDRangel::SWGSDRDaemonChannelSinkSettings()); - channelSettings.getSdrDaemonChannelSinkSettings()->fromJsonObject(sdrDaemonChannelSinkSettingsJsonObject); + QJsonObject daemonChannelSourceSettingsJsonObject = jsonObject["SDRDaemonChannelSourceSettings"].toObject(); + channelSettingsKeys = daemonChannelSourceSettingsJsonObject.keys(); + channelSettings.setSdrDaemonChannelSourceSettings(new SWGSDRangel::SWGSDRDaemonChannelSourceSettings()); + channelSettings.getSdrDaemonChannelSourceSettings()->fromJsonObject(daemonChannelSourceSettingsJsonObject); return true; } else { diff --git a/swagger/sdrangel/api/swagger/include/SDRDaemonChannelSource.yaml b/swagger/sdrangel/api/swagger/include/SDRDaemonChannelSource.yaml index bed33bf1a..686c577c9 100644 --- a/swagger/sdrangel/api/swagger/include/SDRDaemonChannelSource.yaml +++ b/swagger/sdrangel/api/swagger/include/SDRDaemonChannelSource.yaml @@ -7,6 +7,10 @@ SDRDaemonChannelSourceSettings: dataPort: description: "Remote USB data port" type: integer + rgbColor: + type: integer + title: + type: string SDRDaemonChannelSourceReport: description: "SDRDaemon channel source report" diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 406dab88e..5168c5ff7 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -3215,6 +3215,12 @@ margin-bottom: 20px; "dataPort" : { "type" : "integer", "description" : "Remote USB data port" + }, + "rgbColor" : { + "type" : "integer" + }, + "title" : { + "type" : "string" } }, "description" : "Data handling details for SDRDaemon" @@ -28688,7 +28694,7 @@ except ApiException as e:
- Generated 2018-08-31T08:45:52.974+02:00 + Generated 2018-09-01T05:45:40.779+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSourceSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSourceSettings.cpp index 5a39bd498..a9da57775 100644 --- a/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSourceSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSourceSettings.cpp @@ -32,6 +32,10 @@ SWGSDRDaemonChannelSourceSettings::SWGSDRDaemonChannelSourceSettings() { m_data_address_isSet = false; data_port = 0; m_data_port_isSet = false; + rgb_color = 0; + m_rgb_color_isSet = false; + title = nullptr; + m_title_isSet = false; } SWGSDRDaemonChannelSourceSettings::~SWGSDRDaemonChannelSourceSettings() { @@ -44,6 +48,10 @@ SWGSDRDaemonChannelSourceSettings::init() { m_data_address_isSet = false; data_port = 0; m_data_port_isSet = false; + rgb_color = 0; + m_rgb_color_isSet = false; + title = new QString(""); + m_title_isSet = false; } void @@ -52,6 +60,10 @@ SWGSDRDaemonChannelSourceSettings::cleanup() { delete data_address; } + + if(title != nullptr) { + delete title; + } } SWGSDRDaemonChannelSourceSettings* @@ -69,6 +81,10 @@ SWGSDRDaemonChannelSourceSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&data_port, pJson["dataPort"], "qint32", ""); + ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", ""); + + ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); + } QString @@ -91,6 +107,12 @@ SWGSDRDaemonChannelSourceSettings::asJsonObject() { if(m_data_port_isSet){ obj->insert("dataPort", QJsonValue(data_port)); } + if(m_rgb_color_isSet){ + obj->insert("rgbColor", QJsonValue(rgb_color)); + } + if(title != nullptr && *title != QString("")){ + toJsonValue(QString("title"), title, obj, QString("QString")); + } return obj; } @@ -115,6 +137,26 @@ SWGSDRDaemonChannelSourceSettings::setDataPort(qint32 data_port) { this->m_data_port_isSet = true; } +qint32 +SWGSDRDaemonChannelSourceSettings::getRgbColor() { + return rgb_color; +} +void +SWGSDRDaemonChannelSourceSettings::setRgbColor(qint32 rgb_color) { + this->rgb_color = rgb_color; + this->m_rgb_color_isSet = true; +} + +QString* +SWGSDRDaemonChannelSourceSettings::getTitle() { + return title; +} +void +SWGSDRDaemonChannelSourceSettings::setTitle(QString* title) { + this->title = title; + this->m_title_isSet = true; +} + bool SWGSDRDaemonChannelSourceSettings::isSet(){ @@ -122,6 +164,8 @@ SWGSDRDaemonChannelSourceSettings::isSet(){ do{ if(data_address != nullptr && *data_address != QString("")){ isObjectUpdated = true; break;} if(m_data_port_isSet){ isObjectUpdated = true; break;} + if(m_rgb_color_isSet){ isObjectUpdated = true; break;} + if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;} }while(false); return isObjectUpdated; } diff --git a/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSourceSettings.h b/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSourceSettings.h index 123e1956e..fc881baea 100644 --- a/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSourceSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSourceSettings.h @@ -48,6 +48,12 @@ public: qint32 getDataPort(); void setDataPort(qint32 data_port); + qint32 getRgbColor(); + void setRgbColor(qint32 rgb_color); + + QString* getTitle(); + void setTitle(QString* title); + virtual bool isSet() override; @@ -58,6 +64,12 @@ private: qint32 data_port; bool m_data_port_isSet; + qint32 rgb_color; + bool m_rgb_color_isSet; + + QString* title; + bool m_title_isSet; + }; }