diff --git a/plugins/feature/gs232controller/gs232controller.cpp b/plugins/feature/gs232controller/gs232controller.cpp index d9cf785a1..565594cba 100644 --- a/plugins/feature/gs232controller/gs232controller.cpp +++ b/plugins/feature/gs232controller/gs232controller.cpp @@ -134,7 +134,7 @@ bool GS232Controller::handleMessage(const Message& cmd) } else if (MainCore::MsgTargetAzimuthElevation::match(cmd)) { - // New target from another plugin + // New source from another plugin if ((m_state == StRunning) && m_settings.m_track) { MainCore::MsgTargetAzimuthElevation& msg = (MainCore::MsgTargetAzimuthElevation&) cmd; @@ -148,7 +148,7 @@ bool GS232Controller::handleMessage(const Message& cmd) } else { - // No GUI, so save target - applySettings will propagate to worker + // No GUI, so save source - applySettings will propagate to worker SWGSDRangel::SWGTargetAzimuthElevation *swgTarget = msg.getSWGTargetAzimuthElevation(); m_settings.m_azimuth = swgTarget->getAzimuth(); m_settings.m_elevation = swgTarget->getElevation(); @@ -168,11 +168,12 @@ bool GS232Controller::handleMessage(const Message& cmd) void GS232Controller::updatePipes() { - QList availablePipes = updateAvailablePipeSources("target", GS232ControllerSettings::m_pipeTypes, GS232ControllerSettings::m_pipeURIs, this); + QList availablePipes = updateAvailablePipeSources("source", GS232ControllerSettings::m_pipeTypes, GS232ControllerSettings::m_pipeURIs, this); if (availablePipes != m_availablePipes) { m_availablePipes = availablePipes; + if (getMessageQueueToGUI()) { MsgReportPipes *msgToGUI = MsgReportPipes::create(); @@ -221,7 +222,7 @@ void GS232Controller::applySettings(const GS232ControllerSettings& settings, boo << " m_serialPort: " << settings.m_serialPort << " m_baudRate: " << settings.m_baudRate << " m_track: " << settings.m_track - << " m_target: " << settings.m_target + << " m_source: " << settings.m_source << " m_title: " << settings.m_title << " m_rgbColor: " << settings.m_rgbColor << " m_useReverseAPI: " << settings.m_useReverseAPI @@ -248,18 +249,20 @@ void GS232Controller::applySettings(const GS232ControllerSettings& settings, boo if ((m_settings.m_track != settings.m_track) || force) { reverseAPIKeys.append("track"); } - if ((m_settings.m_target != settings.m_target) - || (!settings.m_target.isEmpty() && (m_selectedPipe == nullptr)) // Change in available pipes + if ((m_settings.m_source != settings.m_source) + || (!settings.m_source.isEmpty() && (m_selectedPipe == nullptr)) // Change in available pipes || force) { - if (!settings.m_target.isEmpty()) + if (!settings.m_source.isEmpty()) { - m_selectedPipe = getPipeEndPoint(settings.m_target, m_availablePipes); - if (m_selectedPipe == nullptr) - qDebug() << "GS232Controller::applySettings: No plugin corresponding to target " << settings.m_target; + m_selectedPipe = getPipeEndPoint(settings.m_source, m_availablePipes); + + if (m_selectedPipe == nullptr) { + qDebug() << "GS232Controller::applySettings: No plugin corresponding to source " << settings.m_source; + } } - reverseAPIKeys.append("target"); + reverseAPIKeys.append("source"); } if ((m_settings.m_azimuthOffset != settings.m_azimuthOffset) || force) { reverseAPIKeys.append("azimuthOffset"); @@ -353,6 +356,17 @@ int GS232Controller::webapiSettingsPutPatch( return 200; } +int GS232Controller::webapiReportGet( + SWGSDRangel::SWGFeatureReport& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setGs232ControllerReport(new SWGSDRangel::SWGGS232ControllerReport()); + response.getGs232ControllerReport()->init(); + webapiFormatFeatureReport(response); + return 200; +} + void GS232Controller::webapiFormatFeatureSettings( SWGSDRangel::SWGFeatureSettings& response, const GS232ControllerSettings& settings) @@ -362,6 +376,7 @@ void GS232Controller::webapiFormatFeatureSettings( response.getGs232ControllerSettings()->setSerialPort(new QString(settings.m_serialPort)); response.getGs232ControllerSettings()->setBaudRate(settings.m_baudRate); response.getGs232ControllerSettings()->setTrack(settings.m_track); + response.getGs232ControllerSettings()->setSource(new QString(settings.m_source)); response.getGs232ControllerSettings()->setAzimuthOffset(settings.m_azimuthOffset); response.getGs232ControllerSettings()->setElevationOffset(settings.m_elevationOffset); response.getGs232ControllerSettings()->setAzimuthMin(settings.m_azimuthMin); @@ -409,8 +424,8 @@ void GS232Controller::webapiUpdateFeatureSettings( if (featureSettingsKeys.contains("track")) { settings.m_track = response.getGs232ControllerSettings()->getTrack() != 0; } - if (featureSettingsKeys.contains("target")) { - settings.m_target = *response.getGs232ControllerSettings()->getTarget(); + if (featureSettingsKeys.contains("source")) { + settings.m_source = *response.getGs232ControllerSettings()->getSource(); } if (featureSettingsKeys.contains("azimuthOffset")) { settings.m_azimuthOffset = response.getGs232ControllerSettings()->getAzimuthOffset(); @@ -479,8 +494,8 @@ void GS232Controller::webapiReverseSendSettings(QList& featureSettingsK if (featureSettingsKeys.contains("track") || force) { swgGS232ControllerSettings->setTrack(settings.m_track); } - if (featureSettingsKeys.contains("target") || force) { - swgGS232ControllerSettings->setTarget(new QString(settings.m_target)); + if (featureSettingsKeys.contains("source") || force) { + swgGS232ControllerSettings->setSource(new QString(settings.m_source)); } if (featureSettingsKeys.contains("azimuthOffset") || force) { swgGS232ControllerSettings->setAzimuthOffset(settings.m_azimuthOffset); @@ -533,6 +548,15 @@ void GS232Controller::webapiReverseSendSettings(QList& featureSettingsK delete swgFeatureSettings; } +void GS232Controller::webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response) +{ + response.getGs232ControllerReport()->setSources(new QList()); + + for (int i = 0; i < m_availablePipes.size(); i++) { + response.getGs232ControllerReport()->getSources()->append(new QString(m_availablePipes.at(i).getName())); + } +} + void GS232Controller::networkManagerFinished(QNetworkReply *reply) { QNetworkReply::NetworkError replyError = reply->error(); diff --git a/plugins/feature/gs232controller/gs232controller.h b/plugins/feature/gs232controller/gs232controller.h index 740aec52b..3d95294df 100644 --- a/plugins/feature/gs232controller/gs232controller.h +++ b/plugins/feature/gs232controller/gs232controller.h @@ -126,6 +126,10 @@ public: SWGSDRangel::SWGFeatureSettings& response, QString& errorMessage); + virtual int webapiReportGet( + SWGSDRangel::SWGFeatureReport& response, + QString& errorMessage); + static void webapiFormatFeatureSettings( SWGSDRangel::SWGFeatureSettings& response, const GS232ControllerSettings& settings); @@ -153,6 +157,7 @@ private: void stop(); void applySettings(const GS232ControllerSettings& settings, bool force = false); void webapiReverseSendSettings(QList& featureSettingsKeys, const GS232ControllerSettings& settings, bool force); + void webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response); private slots: void updatePipes(); diff --git a/plugins/feature/gs232controller/gs232controllergui.cpp b/plugins/feature/gs232controller/gs232controllergui.cpp index e0109d61c..b05fba5a8 100644 --- a/plugins/feature/gs232controller/gs232controllergui.cpp +++ b/plugins/feature/gs232controller/gs232controllergui.cpp @@ -184,7 +184,7 @@ void GS232ControllerGUI::displaySettings() ui->serialPort->lineEdit()->setText(m_settings.m_serialPort); ui->baudRate->setCurrentText(QString("%1").arg(m_settings.m_baudRate)); ui->track->setChecked(m_settings.m_track); - ui->targets->setCurrentIndex(ui->targets->findText(m_settings.m_target)); + ui->sources->setCurrentIndex(ui->sources->findText(m_settings.m_source)); ui->azimuthOffset->setValue(m_settings.m_azimuthOffset); ui->elevationOffset->setValue(m_settings.m_elevationOffset); ui->azimuthMin->setValue(m_settings.m_azimuthMin); @@ -208,29 +208,33 @@ void GS232ControllerGUI::updateSerialPortList() void GS232ControllerGUI::updatePipeList() { - QString currentText = ui->targets->currentText(); - ui->targets->blockSignals(true); - ui->targets->clear(); + QString currentText = ui->sources->currentText(); + ui->sources->blockSignals(true); + ui->sources->clear(); QList::const_iterator it = m_availablePipes.begin(); for (int i = 0; it != m_availablePipes.end(); ++it, i++) { - ui->targets->addItem(it->getName()); + ui->sources->addItem(it->getName()); } if (currentText.isEmpty()) { if (m_availablePipes.size() > 0) - ui->targets->setCurrentIndex(0); + ui->sources->setCurrentIndex(0); } else - ui->targets->setCurrentIndex(ui->targets->findText(currentText)); - ui->targets->blockSignals(false); + { + ui->sources->setCurrentIndex(ui->sources->findText(currentText)); + } + + ui->sources->blockSignals(false); + + QString newText = ui->sources->currentText(); - QString newText = ui->targets->currentText(); if (currentText != newText) { - m_settings.m_target = newText; + m_settings.m_source = newText; ui->targetName->setText(""); applySettings(); } @@ -381,15 +385,19 @@ void GS232ControllerGUI::on_track_stateChanged(int state) { m_settings.m_track = state == Qt::Checked; ui->targetsLabel->setEnabled(m_settings.m_track); - ui->targets->setEnabled(m_settings.m_track); - if (!m_settings.m_track) + ui->sources->setEnabled(m_settings.m_track); + + if (!m_settings.m_track) { ui->targetName->setText(""); + } + applySettings(); } -void GS232ControllerGUI::on_targets_currentTextChanged(const QString& text) +void GS232ControllerGUI::on_sources_currentTextChanged(const QString& text) { - m_settings.m_target = text; + qDebug("GS232ControllerGUI::on_sources_currentTextChanged: %s", qPrintable(text)); + m_settings.m_source = text; ui->targetName->setText(""); applySettings(); } diff --git a/plugins/feature/gs232controller/gs232controllergui.h b/plugins/feature/gs232controller/gs232controllergui.h index 9fbfa8dda..c0e2bd46f 100644 --- a/plugins/feature/gs232controller/gs232controllergui.h +++ b/plugins/feature/gs232controller/gs232controllergui.h @@ -83,7 +83,7 @@ private slots: void on_track_stateChanged(int state); void on_azimuth_valueChanged(double value); void on_elevation_valueChanged(double value); - void on_targets_currentTextChanged(const QString& text); + void on_sources_currentTextChanged(const QString& text); void on_azimuthOffset_valueChanged(int value); void on_elevationOffset_valueChanged(int value); void on_azimuthMin_valueChanged(int value); diff --git a/plugins/feature/gs232controller/gs232controllergui.ui b/plugins/feature/gs232controller/gs232controllergui.ui index 1ce95168a..7fc84dbbd 100644 --- a/plugins/feature/gs232controller/gs232controllergui.ui +++ b/plugins/feature/gs232controller/gs232controllergui.ui @@ -440,7 +440,7 @@ - + 150 diff --git a/plugins/feature/gs232controller/gs232controllersettings.cpp b/plugins/feature/gs232controller/gs232controllersettings.cpp index 12f01d643..a896964dd 100644 --- a/plugins/feature/gs232controller/gs232controllersettings.cpp +++ b/plugins/feature/gs232controller/gs232controllersettings.cpp @@ -49,7 +49,7 @@ void GS232ControllerSettings::resetToDefaults() m_serialPort = ""; m_baudRate = 9600; m_track = false; - m_target = ""; + m_source = ""; m_title = "GS-232 Rotator Controller"; m_rgbColor = QColor(225, 25, 99).rgb(); m_useReverseAPI = false; @@ -76,7 +76,7 @@ QByteArray GS232ControllerSettings::serialize() const s.writeString(3, m_serialPort); s.writeS32(4, m_baudRate); s.writeBool(5, m_track); - s.writeString(6, m_target); + s.writeString(6, m_source); s.writeString(8, m_title); s.writeU32(9, m_rgbColor); s.writeBool(10, m_useReverseAPI); @@ -117,7 +117,7 @@ bool GS232ControllerSettings::deserialize(const QByteArray& data) d.readString(3, &m_serialPort, ""); d.readS32(4, &m_baudRate, 9600); d.readBool(5, &m_track, false); - d.readString(6, &m_target, ""); + d.readString(6, &m_source, ""); d.readString(8, &m_title, "GS-232 Rotator Controller"); d.readU32(9, &m_rgbColor, QColor(225, 25, 99).rgb()); d.readBool(10, &m_useReverseAPI, false); diff --git a/plugins/feature/gs232controller/gs232controllersettings.h b/plugins/feature/gs232controller/gs232controllersettings.h index eebb31b2b..8f103d157 100644 --- a/plugins/feature/gs232controller/gs232controllersettings.h +++ b/plugins/feature/gs232controller/gs232controllersettings.h @@ -33,7 +33,7 @@ struct GS232ControllerSettings QString m_serialPort; int m_baudRate; bool m_track; - QString m_target; // Plugin to get az/el from. E.g: "R0:0 ADSBDemod". Use a string, so can be set via WebAPI + QString m_source; // Plugin to get az/el from. E.g: "R0:0 ADSBDemod". Use a string, so can be set via WebAPI int m_azimuthOffset; int m_elevationOffset; int m_azimuthMin; diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 37257ba7f..ee1379d11 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -4908,6 +4908,9 @@ margin-bottom: 20px; }, "SimplePTTReport" : { "$ref" : "#/definitions/SimplePTTReport" + }, + "GS232ControllerReport" : { + "$ref" : "#/definitions/GS232ControllerReport" } }, "description" : "Base feature report. Only the feature report corresponding to the feature specified in the featureType field is or should be present." @@ -5768,6 +5771,18 @@ margin-bottom: 20px; } }, "description" : "GLSpectrumGUI settings" +}; + defs.GS232ControllerReport = { + "properties" : { + "sources" : { + "type" : "array", + "description" : "Names of pipe sources", + "items" : { + "type" : "string" + } + } + }, + "description" : "GS-232 Controller report" }; defs.GS232ControllerSettings = { "properties" : { @@ -5793,9 +5808,9 @@ margin-bottom: 20px; "type" : "integer", "description" : "Track a target where azimuth and elevation are determined by another plugin (1 for yes, 0 for no)" }, - "target" : { + "source" : { "type" : "string", - "description" : "Identifier of the channel or feature plugin providing target azimuth and elevation (E.g. R0:0 ADSBDemod)" + "description" : "Identifier of the channel or feature plugin providing azimuth and elevation (E.g. R0:0 ADSBDemod)" }, "azimuthOffset" : { "type" : "integer", @@ -50580,7 +50595,7 @@ except ApiException as e:
- Generated 2021-10-03T09:59:26.222+02:00 + Generated 2021-10-03T22:30:03.018+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml b/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml index 9fd5a1f0d..130cd2335 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml @@ -11,3 +11,5 @@ FeatureReport: $ref: "/doc/swagger/include/AFC.yaml#/AFCReport" SimplePTTReport: $ref: "/doc/swagger/include/SimplePTT.yaml#/SimplePTTReport" + GS232ControllerReport: + $ref: "/doc/swagger/include/GS232Controller.yaml#/GS232ControllerReport" diff --git a/sdrbase/resources/webapi/doc/swagger/include/GS232Controller.yaml b/sdrbase/resources/webapi/doc/swagger/include/GS232Controller.yaml index 602671e3f..384d88dfe 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/GS232Controller.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/GS232Controller.yaml @@ -18,8 +18,8 @@ GS232ControllerSettings: track: description: Track a target where azimuth and elevation are determined by another plugin (1 for yes, 0 for no) type: integer - target: - description: "Identifier of the channel or feature plugin providing target azimuth and elevation (E.g. R0:0 ADSBDemod)" + source: + description: "Identifier of the channel or feature plugin providing azimuth and elevation (E.g. R0:0 ADSBDemod)" type: string azimuthOffset: description: Azimuth offset in degrees @@ -60,3 +60,12 @@ GS232ControllerSettings: type: integer reverseAPIFeatureIndex: type: integer + +GS232ControllerReport: + description: "GS-232 Controller report" + properties: + sources: + description: Names of pipe sources + type: array + items: + type: string diff --git a/swagger/sdrangel/api/swagger/include/FeatureReport.yaml b/swagger/sdrangel/api/swagger/include/FeatureReport.yaml index de58bdda8..e0cea63d4 100644 --- a/swagger/sdrangel/api/swagger/include/FeatureReport.yaml +++ b/swagger/sdrangel/api/swagger/include/FeatureReport.yaml @@ -11,3 +11,5 @@ FeatureReport: $ref: "http://swgserver:8081/api/swagger/include/AFC.yaml#/AFCReport" SimplePTTReport: $ref: "http://swgserver:8081/api/swagger/include/SimplePTT.yaml#/SimplePTTReport" + GS232ControllerReport: + $ref: "http://swgserver:8081/api/swagger/include/GS232Controller.yaml#/GS232ControllerReport" diff --git a/swagger/sdrangel/api/swagger/include/GS232Controller.yaml b/swagger/sdrangel/api/swagger/include/GS232Controller.yaml index 602671e3f..384d88dfe 100644 --- a/swagger/sdrangel/api/swagger/include/GS232Controller.yaml +++ b/swagger/sdrangel/api/swagger/include/GS232Controller.yaml @@ -18,8 +18,8 @@ GS232ControllerSettings: track: description: Track a target where azimuth and elevation are determined by another plugin (1 for yes, 0 for no) type: integer - target: - description: "Identifier of the channel or feature plugin providing target azimuth and elevation (E.g. R0:0 ADSBDemod)" + source: + description: "Identifier of the channel or feature plugin providing azimuth and elevation (E.g. R0:0 ADSBDemod)" type: string azimuthOffset: description: Azimuth offset in degrees @@ -60,3 +60,12 @@ GS232ControllerSettings: type: integer reverseAPIFeatureIndex: type: integer + +GS232ControllerReport: + description: "GS-232 Controller report" + properties: + sources: + description: Names of pipe sources + type: array + items: + type: string diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 37257ba7f..ee1379d11 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -4908,6 +4908,9 @@ margin-bottom: 20px; }, "SimplePTTReport" : { "$ref" : "#/definitions/SimplePTTReport" + }, + "GS232ControllerReport" : { + "$ref" : "#/definitions/GS232ControllerReport" } }, "description" : "Base feature report. Only the feature report corresponding to the feature specified in the featureType field is or should be present." @@ -5768,6 +5771,18 @@ margin-bottom: 20px; } }, "description" : "GLSpectrumGUI settings" +}; + defs.GS232ControllerReport = { + "properties" : { + "sources" : { + "type" : "array", + "description" : "Names of pipe sources", + "items" : { + "type" : "string" + } + } + }, + "description" : "GS-232 Controller report" }; defs.GS232ControllerSettings = { "properties" : { @@ -5793,9 +5808,9 @@ margin-bottom: 20px; "type" : "integer", "description" : "Track a target where azimuth and elevation are determined by another plugin (1 for yes, 0 for no)" }, - "target" : { + "source" : { "type" : "string", - "description" : "Identifier of the channel or feature plugin providing target azimuth and elevation (E.g. R0:0 ADSBDemod)" + "description" : "Identifier of the channel or feature plugin providing azimuth and elevation (E.g. R0:0 ADSBDemod)" }, "azimuthOffset" : { "type" : "integer", @@ -50580,7 +50595,7 @@ except ApiException as e:
- Generated 2021-10-03T09:59:26.222+02:00 + Generated 2021-10-03T22:30:03.018+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp index e3521f2e3..5e8e695c2 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp @@ -34,6 +34,8 @@ SWGFeatureReport::SWGFeatureReport() { m_afc_report_isSet = false; simple_ptt_report = nullptr; m_simple_ptt_report_isSet = false; + gs232_controller_report = nullptr; + m_gs232_controller_report_isSet = false; } SWGFeatureReport::~SWGFeatureReport() { @@ -48,6 +50,8 @@ SWGFeatureReport::init() { m_afc_report_isSet = false; simple_ptt_report = new SWGSimplePTTReport(); m_simple_ptt_report_isSet = false; + gs232_controller_report = new SWGGS232ControllerReport(); + m_gs232_controller_report_isSet = false; } void @@ -61,6 +65,9 @@ SWGFeatureReport::cleanup() { if(simple_ptt_report != nullptr) { delete simple_ptt_report; } + if(gs232_controller_report != nullptr) { + delete gs232_controller_report; + } } SWGFeatureReport* @@ -80,6 +87,8 @@ SWGFeatureReport::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&simple_ptt_report, pJson["SimplePTTReport"], "SWGSimplePTTReport", "SWGSimplePTTReport"); + ::SWGSDRangel::setValue(&gs232_controller_report, pJson["GS232ControllerReport"], "SWGGS232ControllerReport", "SWGGS232ControllerReport"); + } QString @@ -105,6 +114,9 @@ SWGFeatureReport::asJsonObject() { if((simple_ptt_report != nullptr) && (simple_ptt_report->isSet())){ toJsonValue(QString("SimplePTTReport"), simple_ptt_report, obj, QString("SWGSimplePTTReport")); } + if((gs232_controller_report != nullptr) && (gs232_controller_report->isSet())){ + toJsonValue(QString("GS232ControllerReport"), gs232_controller_report, obj, QString("SWGGS232ControllerReport")); + } return obj; } @@ -139,6 +151,16 @@ SWGFeatureReport::setSimplePttReport(SWGSimplePTTReport* simple_ptt_report) { this->m_simple_ptt_report_isSet = true; } +SWGGS232ControllerReport* +SWGFeatureReport::getGs232ControllerReport() { + return gs232_controller_report; +} +void +SWGFeatureReport::setGs232ControllerReport(SWGGS232ControllerReport* gs232_controller_report) { + this->gs232_controller_report = gs232_controller_report; + this->m_gs232_controller_report_isSet = true; +} + bool SWGFeatureReport::isSet(){ @@ -153,6 +175,9 @@ SWGFeatureReport::isSet(){ if(simple_ptt_report && simple_ptt_report->isSet()){ isObjectUpdated = true; break; } + if(gs232_controller_report && gs232_controller_report->isSet()){ + isObjectUpdated = true; break; + } }while(false); return isObjectUpdated; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.h b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.h index 7d9d0387c..b5cdea96f 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.h @@ -23,6 +23,7 @@ #include "SWGAFCReport.h" +#include "SWGGS232ControllerReport.h" #include "SWGSimplePTTReport.h" #include @@ -53,6 +54,9 @@ public: SWGSimplePTTReport* getSimplePttReport(); void setSimplePttReport(SWGSimplePTTReport* simple_ptt_report); + SWGGS232ControllerReport* getGs232ControllerReport(); + void setGs232ControllerReport(SWGGS232ControllerReport* gs232_controller_report); + virtual bool isSet() override; @@ -66,6 +70,9 @@ private: SWGSimplePTTReport* simple_ptt_report; bool m_simple_ptt_report_isSet; + SWGGS232ControllerReport* gs232_controller_report; + bool m_gs232_controller_report_isSet; + }; } diff --git a/swagger/sdrangel/code/qt5/client/SWGGS232ControllerReport.cpp b/swagger/sdrangel/code/qt5/client/SWGGS232ControllerReport.cpp new file mode 100644 index 000000000..39ef54830 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGGS232ControllerReport.cpp @@ -0,0 +1,114 @@ +/** + * 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: 6.0.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 "SWGGS232ControllerReport.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGGS232ControllerReport::SWGGS232ControllerReport(QString* json) { + init(); + this->fromJson(*json); +} + +SWGGS232ControllerReport::SWGGS232ControllerReport() { + sources = nullptr; + m_sources_isSet = false; +} + +SWGGS232ControllerReport::~SWGGS232ControllerReport() { + this->cleanup(); +} + +void +SWGGS232ControllerReport::init() { + sources = new QList(); + m_sources_isSet = false; +} + +void +SWGGS232ControllerReport::cleanup() { + if(sources != nullptr) { + auto arr = sources; + for(auto o: *arr) { + delete o; + } + delete sources; + } +} + +SWGGS232ControllerReport* +SWGGS232ControllerReport::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGGS232ControllerReport::fromJsonObject(QJsonObject &pJson) { + + ::SWGSDRangel::setValue(&sources, pJson["sources"], "QList", "QString"); +} + +QString +SWGGS232ControllerReport::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGGS232ControllerReport::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(sources && sources->size() > 0){ + toJsonArray((QList*)sources, obj, "sources", "QString"); + } + + return obj; +} + +QList* +SWGGS232ControllerReport::getSources() { + return sources; +} +void +SWGGS232ControllerReport::setSources(QList* sources) { + this->sources = sources; + this->m_sources_isSet = true; +} + + +bool +SWGGS232ControllerReport::isSet(){ + bool isObjectUpdated = false; + do{ + if(sources && (sources->size() > 0)){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGGS232ControllerReport.h b/swagger/sdrangel/code/qt5/client/SWGGS232ControllerReport.h new file mode 100644 index 000000000..1db20de97 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGGS232ControllerReport.h @@ -0,0 +1,60 @@ +/** + * 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: 6.0.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. + */ + +/* + * SWGGS232ControllerReport.h + * + * GS-232 Controller report + */ + +#ifndef SWGGS232ControllerReport_H_ +#define SWGGS232ControllerReport_H_ + +#include + + +#include +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGGS232ControllerReport: public SWGObject { +public: + SWGGS232ControllerReport(); + SWGGS232ControllerReport(QString* json); + virtual ~SWGGS232ControllerReport(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGGS232ControllerReport* fromJson(QString &jsonString) override; + + QList* getSources(); + void setSources(QList* sources); + + + virtual bool isSet() override; + +private: + QList* sources; + bool m_sources_isSet; + +}; + +} + +#endif /* SWGGS232ControllerReport_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGGS232ControllerSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGGS232ControllerSettings.cpp index 4e97f6e81..413234724 100644 --- a/swagger/sdrangel/code/qt5/client/SWGGS232ControllerSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGGS232ControllerSettings.cpp @@ -38,8 +38,8 @@ SWGGS232ControllerSettings::SWGGS232ControllerSettings() { m_baud_rate_isSet = false; track = 0; m_track_isSet = false; - target = nullptr; - m_target_isSet = false; + source = nullptr; + m_source_isSet = false; azimuth_offset = 0; m_azimuth_offset_isSet = false; elevation_offset = 0; @@ -88,8 +88,8 @@ SWGGS232ControllerSettings::init() { m_baud_rate_isSet = false; track = 0; m_track_isSet = false; - target = new QString(""); - m_target_isSet = false; + source = new QString(""); + m_source_isSet = false; azimuth_offset = 0; m_azimuth_offset_isSet = false; elevation_offset = 0; @@ -131,8 +131,8 @@ SWGGS232ControllerSettings::cleanup() { } - if(target != nullptr) { - delete target; + if(source != nullptr) { + delete source; } @@ -176,7 +176,7 @@ SWGGS232ControllerSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&track, pJson["track"], "qint32", ""); - ::SWGSDRangel::setValue(&target, pJson["target"], "QString", "QString"); + ::SWGSDRangel::setValue(&source, pJson["source"], "QString", "QString"); ::SWGSDRangel::setValue(&azimuth_offset, pJson["azimuthOffset"], "qint32", ""); @@ -239,8 +239,8 @@ SWGGS232ControllerSettings::asJsonObject() { if(m_track_isSet){ obj->insert("track", QJsonValue(track)); } - if(target != nullptr && *target != QString("")){ - toJsonValue(QString("target"), target, obj, QString("QString")); + if(source != nullptr && *source != QString("")){ + toJsonValue(QString("source"), source, obj, QString("QString")); } if(m_azimuth_offset_isSet){ obj->insert("azimuthOffset", QJsonValue(azimuth_offset)); @@ -342,13 +342,13 @@ SWGGS232ControllerSettings::setTrack(qint32 track) { } QString* -SWGGS232ControllerSettings::getTarget() { - return target; +SWGGS232ControllerSettings::getSource() { + return source; } void -SWGGS232ControllerSettings::setTarget(QString* target) { - this->target = target; - this->m_target_isSet = true; +SWGGS232ControllerSettings::setSource(QString* source) { + this->source = source; + this->m_source_isSet = true; } qint32 @@ -521,7 +521,7 @@ SWGGS232ControllerSettings::isSet(){ if(m_track_isSet){ isObjectUpdated = true; break; } - if(target && *target != QString("")){ + if(source && *source != QString("")){ isObjectUpdated = true; break; } if(m_azimuth_offset_isSet){ diff --git a/swagger/sdrangel/code/qt5/client/SWGGS232ControllerSettings.h b/swagger/sdrangel/code/qt5/client/SWGGS232ControllerSettings.h index 50efe1cb9..063ba8d9d 100644 --- a/swagger/sdrangel/code/qt5/client/SWGGS232ControllerSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGGS232ControllerSettings.h @@ -57,8 +57,8 @@ public: qint32 getTrack(); void setTrack(qint32 track); - QString* getTarget(); - void setTarget(QString* target); + QString* getSource(); + void setSource(QString* source); qint32 getAzimuthOffset(); void setAzimuthOffset(qint32 azimuth_offset); @@ -124,8 +124,8 @@ private: qint32 track; bool m_track_isSet; - QString* target; - bool m_target_isSet; + QString* source; + bool m_source_isSet; qint32 azimuth_offset; bool m_azimuth_offset_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index c7affe57e..7529bc53c 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -133,6 +133,7 @@ #include "SWGFrequencyRange.h" #include "SWGGLScope.h" #include "SWGGLSpectrum.h" +#include "SWGGS232ControllerReport.h" #include "SWGGS232ControllerSettings.h" #include "SWGGain.h" #include "SWGHackRFInputSettings.h" @@ -883,6 +884,11 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGGS232ControllerReport").compare(type) == 0) { + SWGGS232ControllerReport *obj = new SWGGS232ControllerReport(); + obj->init(); + return obj; + } if(QString("SWGGS232ControllerSettings").compare(type) == 0) { SWGGS232ControllerSettings *obj = new SWGGS232ControllerSettings(); obj->init();