From 8885864e7965008740cd9d54d9bd6569d6045230 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 24 May 2022 22:51:29 +0200 Subject: [PATCH] AMBE feature: implemented API --- plugins/feature/ambe/ambe.cpp | 264 +++++++++++++++++ plugins/feature/ambe/ambe.h | 50 ++++ plugins/feature/ambe/ambeengine.cpp | 68 +---- plugins/feature/ambe/ambeengine.h | 14 +- plugins/feature/ambe/ambegui.cpp | 42 ++- plugins/feature/ambe/ambegui.h | 1 + plugins/feature/ambe/ambegui.ui | 46 ++- plugins/feature/ambe/ambeplugin.cpp | 4 +- plugins/feature/ambe/ambewebapiadapter.cpp | 51 ++++ plugins/feature/ambe/ambewebapiadapter.h | 49 ++++ sdrbase/resources/webapi.qrc | 1 + sdrbase/resources/webapi/doc/html2/index.html | 123 +++++++- .../webapi/doc/swagger/include/AMBE.yaml | 88 ++++++ .../doc/swagger/include/FeatureActions.yaml | 2 + .../doc/swagger/include/FeatureReport.yaml | 2 + .../doc/swagger/include/FeatureSettings.yaml | 2 + sdrbase/webapi/webapirequestmapper.cpp | 5 + sdrbase/webapi/webapiutils.cpp | 3 + .../sdrangel/api/swagger/include/AMBE.yaml | 88 ++++++ .../api/swagger/include/FeatureActions.yaml | 2 + .../api/swagger/include/FeatureReport.yaml | 2 + .../api/swagger/include/FeatureSettings.yaml | 2 + swagger/sdrangel/code/html2/index.html | 123 +++++++- .../code/qt5/client/SWGAMBEActions.cpp | 133 +++++++++ .../sdrangel/code/qt5/client/SWGAMBEActions.h | 65 +++++ .../code/qt5/client/SWGAMBEDevice_2.cpp | 133 +++++++++ .../code/qt5/client/SWGAMBEDevice_2.h | 65 +++++ .../code/qt5/client/SWGAMBEDevices_2.cpp | 137 +++++++++ .../code/qt5/client/SWGAMBEDevices_2.h | 66 +++++ .../code/qt5/client/SWGAMBEReport.cpp | 135 +++++++++ .../sdrangel/code/qt5/client/SWGAMBEReport.h | 66 +++++ .../code/qt5/client/SWGAMBESettings.cpp | 275 ++++++++++++++++++ .../code/qt5/client/SWGAMBESettings.h | 102 +++++++ .../code/qt5/client/SWGDVSerialDevice_2.cpp | 110 +++++++ .../code/qt5/client/SWGDVSerialDevice_2.h | 59 ++++ .../code/qt5/client/SWGDVSerialDevices_2.cpp | 137 +++++++++ .../code/qt5/client/SWGDVSerialDevices_2.h | 66 +++++ .../code/qt5/client/SWGFeatureActions.cpp | 25 ++ .../code/qt5/client/SWGFeatureActions.h | 7 + .../code/qt5/client/SWGFeatureReport.cpp | 25 ++ .../code/qt5/client/SWGFeatureReport.h | 7 + .../code/qt5/client/SWGFeatureSettings.cpp | 25 ++ .../code/qt5/client/SWGFeatureSettings.h | 7 + .../code/qt5/client/SWGModelFactory.h | 42 +++ 44 files changed, 2619 insertions(+), 100 deletions(-) create mode 100644 plugins/feature/ambe/ambewebapiadapter.cpp create mode 100644 plugins/feature/ambe/ambewebapiadapter.h create mode 100644 sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml create mode 100644 swagger/sdrangel/api/swagger/include/AMBE.yaml create mode 100644 swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGAMBEActions.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGAMBEReport.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGAMBESettings.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGAMBESettings.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.h diff --git a/plugins/feature/ambe/ambe.cpp b/plugins/feature/ambe/ambe.cpp index 5a6bb90b4..f62e825f8 100644 --- a/plugins/feature/ambe/ambe.cpp +++ b/plugins/feature/ambe/ambe.cpp @@ -23,6 +23,9 @@ #include "SWGFeatureSettings.h" #include "SWGFeatureReport.h" #include "SWGFeatureActions.h" +#include "SWGDVSerialDevices.h" +#include "SWGDVSerialDevice.h" +#include "SWGAMBEDevices.h" #include "settings/serializable.h" #include "util/simpleserializer.h" @@ -31,6 +34,7 @@ #include "ambe.h" MESSAGE_CLASS_DEFINITION(AMBE::MsgConfigureAMBE, Message) +MESSAGE_CLASS_DEFINITION(AMBE::MsgReportDevices, Message) const char* const AMBE::m_featureIdURI = "sdrangel.feature.ambe"; const char* const AMBE::m_featureId = "AMBE"; @@ -168,3 +172,263 @@ void AMBE::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +int AMBE::webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setAmbeSettings(new SWGSDRangel::SWGAMBESettings()); + response.getAmbeSettings()->init(); + webapiFormatFeatureSettings(response, m_settings); + return 200; +} + +int AMBE::webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + AMBESettings settings = m_settings; + webapiUpdateFeatureSettings(settings, featureSettingsKeys, response); + + MsgConfigureAMBE *msg = MsgConfigureAMBE::create(settings, force); + m_inputMessageQueue.push(msg); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureAMBE *msgToGUI = MsgConfigureAMBE::create(settings, force); + m_guiMessageQueue->push(msgToGUI); + } + + webapiFormatFeatureSettings(response, settings); + + return 200; +} + +int AMBE::webapiReportGet( + SWGSDRangel::SWGFeatureReport& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setAmbeReport(new SWGSDRangel::SWGAMBEReport()); + response.getAmbeReport()->init(); + webapiFormatFeatureReport(response); + return 200; +} + +void AMBE::webapiFormatFeatureSettings( + SWGSDRangel::SWGFeatureSettings& response, + const AMBESettings& settings) +{ + if (response.getAmbeSettings()->getTitle()) { + *response.getAmbeSettings()->getTitle() = settings.m_title; + } else { + response.getAmbeSettings()->setTitle(new QString(settings.m_title)); + } + + response.getAmbeSettings()->setRgbColor(settings.m_rgbColor); + response.getAmbeSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); + + if (response.getAmbeSettings()->getReverseApiAddress()) { + *response.getAmbeSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress; + } else { + response.getAmbeSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress)); + } + + response.getAmbeSettings()->setReverseApiPort(settings.m_reverseAPIPort); + response.getAmbeSettings()->setReverseApiFeatureSetIndex(settings.m_reverseAPIFeatureSetIndex); + response.getAmbeSettings()->setReverseApiFeatureIndex(settings.m_reverseAPIFeatureIndex); + + if (settings.m_rollupState) + { + if (response.getAmbeSettings()->getRollupState()) + { + settings.m_rollupState->formatTo(response.getAmbeSettings()->getRollupState()); + } + else + { + SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState(); + settings.m_rollupState->formatTo(swgRollupState); + response.getAmbeSettings()->setRollupState(swgRollupState); + } + } +} + +void AMBE::webapiUpdateFeatureSettings( + AMBESettings& settings, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response) +{ + if (featureSettingsKeys.contains("title")) { + settings.m_title = *response.getAmbeSettings()->getTitle(); + } + if (featureSettingsKeys.contains("rgbColor")) { + settings.m_rgbColor = response.getAmbeSettings()->getRgbColor(); + } + if (featureSettingsKeys.contains("useReverseAPI")) { + settings.m_useReverseAPI = response.getAmbeSettings()->getUseReverseApi() != 0; + } + if (featureSettingsKeys.contains("reverseAPIAddress")) { + settings.m_reverseAPIAddress = *response.getAmbeSettings()->getReverseApiAddress(); + } + if (featureSettingsKeys.contains("reverseAPIPort")) { + settings.m_reverseAPIPort = response.getAmbeSettings()->getReverseApiPort(); + } + if (featureSettingsKeys.contains("reverseAPIFeatureSetIndex")) { + settings.m_reverseAPIFeatureSetIndex = response.getAmbeSettings()->getReverseApiFeatureSetIndex(); + } + if (featureSettingsKeys.contains("reverseAPIFeatureIndex")) { + settings.m_reverseAPIFeatureIndex = response.getAmbeSettings()->getReverseApiFeatureIndex(); + } + if (settings.m_rollupState && featureSettingsKeys.contains("rollupState")) { + settings.m_rollupState->updateFrom(featureSettingsKeys, response.getAmbeSettings()->getRollupState()); + } +} + +void AMBE::webapiReverseSendSettings(QList& featureSettingsKeys, const AMBESettings& settings, bool force) +{ + SWGSDRangel::SWGFeatureSettings *swgFeatureSettings = new SWGSDRangel::SWGFeatureSettings(); + // swgFeatureSettings->setOriginatorFeatureIndex(getIndexInDeviceSet()); + // swgFeatureSettings->setOriginatorFeatureSetIndex(getDeviceSetIndex()); + swgFeatureSettings->setFeatureType(new QString("AMBE")); + swgFeatureSettings->setAmbeSettings(new SWGSDRangel::SWGAMBESettings()); + SWGSDRangel::SWGAMBESettings *swgAMBESettings = swgFeatureSettings->getAmbeSettings(); + + // transfer data that has been modified. When force is on transfer all data except reverse API data + + if (featureSettingsKeys.contains("title") || force) { + swgAMBESettings->setTitle(new QString(settings.m_title)); + } + if (featureSettingsKeys.contains("rgbColor") || force) { + swgAMBESettings->setRgbColor(settings.m_rgbColor); + } + + QString channelSettingsURL = QString("http://%1:%2/sdrangel/featureset/%3/feature/%4/settings") + .arg(settings.m_reverseAPIAddress) + .arg(settings.m_reverseAPIPort) + .arg(settings.m_reverseAPIFeatureSetIndex) + .arg(settings.m_reverseAPIFeatureIndex); + m_networkRequest.setUrl(QUrl(channelSettingsURL)); + m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + QBuffer *buffer = new QBuffer(); + buffer->open((QBuffer::ReadWrite)); + buffer->write(swgFeatureSettings->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 swgFeatureSettings; +} + +void AMBE::webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response) +{ + // serial + + SWGSDRangel::SWGDVSerialDevices_2 *swgDVSerialDevices = response.getAmbeReport()->getSerial(); + swgDVSerialDevices->init(); + + QList qDeviceNames; + getAMBEEngine()->scan(qDeviceNames); + swgDVSerialDevices->setNbDevices((int) qDeviceNames.size()); + QList *serialDeviceNamesList = swgDVSerialDevices->getDvSerialDevices(); + + for (const auto& deviceName : qDeviceNames) + { + serialDeviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice); + serialDeviceNamesList->back()->init(); + *serialDeviceNamesList->back()->getDeviceName() = deviceName; + } + + // devices + + SWGSDRangel::SWGAMBEDevices_2 *swgAMBEDevices = response.getAmbeReport()->getDevices(); + swgAMBEDevices->init(); + + qDeviceNames.clear(); + getAMBEEngine()->getDeviceRefs(qDeviceNames); + swgAMBEDevices->setNbDevices((int) qDeviceNames.size()); + QList *ambeDeviceNamesList = swgAMBEDevices->getAmbeDevices(); + + for (const auto& deviceName : qDeviceNames) + { + ambeDeviceNamesList->append(new SWGSDRangel::SWGAMBEDevice); + ambeDeviceNamesList->back()->init(); + *ambeDeviceNamesList->back()->getDeviceRef() = deviceName; + ambeDeviceNamesList->back()->setDelete(0); + } +} + +int AMBE::webapiActionsPost( + const QStringList& featureActionsKeys, + SWGSDRangel::SWGFeatureActions& query, + QString& errorMessage) +{ + SWGSDRangel::SWGAMBEActions *swgAMBEActions = query.getAmbeActions(); + + if (swgAMBEActions) + { + bool unknownAction = true; + + if (featureActionsKeys.contains("removeAll") && (swgAMBEActions->getRemoveAll() != 0)) + { + unknownAction = false; + getAMBEEngine()->releaseAll(); + + if (getMessageQueueToGUI()) + { + MsgReportDevices *msg = MsgReportDevices::create(); + getAMBEEngine()->scan(msg->getAvailableDevices()); + getAMBEEngine()->getDeviceRefs(msg->getUsedDevices()); + getMessageQueueToGUI()->push(msg); + } + } + + if (featureActionsKeys.contains("updateDevices")) + { + unknownAction = false; + bool updated = false; + SWGSDRangel::SWGAMBEDevices_2 *swgAMBEDevices = swgAMBEActions->getUpdateDevices(); + QList *ambeList = swgAMBEDevices->getAmbeDevices(); + + for (QList::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it) + { + updated = true; + + if ((*it)->getDelete() != 0) { + getAMBEEngine()->releaseController((*it)->getDeviceRef()->toStdString()); + } else { + getAMBEEngine()->registerController((*it)->getDeviceRef()->toStdString()); + } + } + + if (updated && getMessageQueueToGUI()) + { + MsgReportDevices *msg = MsgReportDevices::create(); + getAMBEEngine()->scan(msg->getAvailableDevices()); + getAMBEEngine()->getDeviceRefs(msg->getUsedDevices()); + getMessageQueueToGUI()->push(msg); + } + } + + if (unknownAction) + { + errorMessage = "Unknown action"; + return 400; + } + else + { + return 202; + } + } + else + { + errorMessage = "Missing AMBEActions in query"; + return 400; + } +} diff --git a/plugins/feature/ambe/ambe.h b/plugins/feature/ambe/ambe.h index a456e4a34..6e049101c 100644 --- a/plugins/feature/ambe/ambe.h +++ b/plugins/feature/ambe/ambe.h @@ -57,6 +57,26 @@ public: { } }; + class MsgReportDevices : public Message { + MESSAGE_CLASS_DECLARATION + + public: + QList& getAvailableDevices() { return m_availableDevices; } + QList& getUsedDevices() { return m_usedDevices; } + + static MsgReportDevices* create() { + return new MsgReportDevices(); + } + + private: + QList m_availableDevices; + QList m_usedDevices; + + MsgReportDevices() : + Message() + {} + }; + AMBE(WebAPIAdapterInterface *webAPIAdapterInterface); virtual ~AMBE(); virtual void destroy() { delete this; } @@ -71,6 +91,34 @@ public: AMBEEngine *getAMBEEngine() { return &m_ambeEngine; } + virtual int webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiReportGet( + SWGSDRangel::SWGFeatureReport& response, + QString& errorMessage); + + virtual int webapiActionsPost( + const QStringList& featureActionsKeys, + SWGSDRangel::SWGFeatureActions& query, + QString& errorMessage); + + static void webapiFormatFeatureSettings( + SWGSDRangel::SWGFeatureSettings& response, + const AMBESettings& settings); + + static void webapiUpdateFeatureSettings( + AMBESettings& settings, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response); + static const char* const m_featureIdURI; static const char* const m_featureId; @@ -84,6 +132,8 @@ private: void start(); void stop(); void applySettings(const AMBESettings& settings, bool force = false); + void webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response); + void webapiReverseSendSettings(QList& featureSettingsKeys, const AMBESettings& settings, bool force); private slots: void networkManagerFinished(QNetworkReply *reply); diff --git a/plugins/feature/ambe/ambeengine.cpp b/plugins/feature/ambe/ambeengine.cpp index bc16a6c07..c77eade8a 100644 --- a/plugins/feature/ambe/ambeengine.cpp +++ b/plugins/feature/ambe/ambeengine.cpp @@ -54,6 +54,7 @@ AMBEEngine::~AMBEEngine() #if defined(_WIN32) void AMBEEngine::getComList() { + qDebug("AMBEEngine::getComList: Win"); m_comList.clear(); m_comList8250.clear(); char comCStr[16]; @@ -74,6 +75,7 @@ void AMBEEngine::scan(std::vector& ambeDevices) #elif defined(__APPLE__) void AMBEEngine::getComList() { + qDebug("AMBEEngine::getComList: Apple"); } void AMBEEngine::scan(std::vector& ambeDevices) { @@ -82,6 +84,7 @@ void AMBEEngine::scan(std::vector& ambeDevices) #else void AMBEEngine::getComList() { + qDebug("AMBEEngine::getComList: Linux"); int n; struct dirent **namelist; m_comList.clear(); @@ -197,9 +200,10 @@ std::string AMBEEngine::get_driver(const std::string& tty) return ""; } -void AMBEEngine::scan(std::vector& ambeDevices) +void AMBEEngine::scan(QList& ambeDevices) { - getComList(); + qDebug("AMBEEngine::scan"); + AMBEEngine::getComList(); std::vector::const_iterator it = m_comList.begin(); ambeDevices.clear(); @@ -287,7 +291,7 @@ void AMBEEngine::releaseAll() m_controllers.clear(); } -void AMBEEngine::getDeviceRefs(std::vector& deviceNames) +void AMBEEngine::getDeviceRefs(QList& deviceNames) { std::vector::const_iterator it = m_controllers.begin(); @@ -342,61 +346,3 @@ void AMBEEngine::pushMbeFrame( } } } - -QByteArray AMBEEngine::serialize() const -{ - qDebug("AMBEEngine::serialize"); - QStringList qDeviceList; - std::vector::const_iterator it = m_controllers.begin(); - - while (it != m_controllers.end()) - { - qDebug("AMBEEngine::serialize: %s", it->device.c_str()); - qDeviceList << QString(it->device.c_str()); - ++it; - } - - QByteArray data; - QDataStream *stream = new QDataStream(&data, QIODevice::WriteOnly); - (*stream) << qDeviceList; - delete stream; - - return data; -} - -bool AMBEEngine::deserialize(const QByteArray& data) -{ - if (data.size() <= 0) - { - qDebug("AMBEEngine::deserialize: invalid or no data"); - return false; - } - - QStringList qDeviceList; - QDataStream *stream = new QDataStream(data); - (*stream) >> qDeviceList; - delete stream; - - releaseAll(); - - for (int i = 0; i < qDeviceList.size(); ++i) - { - qDebug(" AMBEEngine::deserialize: %s", qDeviceList.at(i).toStdString().c_str()); - registerController(qDeviceList.at(i).toStdString()); - } - - return true; -} - -void AMBEEngine::formatTo(SWGSDRangel::SWGObject *swgObject) const -{ - (void) swgObject; - // TODO -} - -void AMBEEngine::updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject) -{ - (void) keys; - (void) swgObject; - // TODO -} diff --git a/plugins/feature/ambe/ambeengine.h b/plugins/feature/ambe/ambeengine.h index 897cefa71..9e9fd805b 100644 --- a/plugins/feature/ambe/ambeengine.h +++ b/plugins/feature/ambe/ambeengine.h @@ -25,26 +25,25 @@ #include #include #include +#include #include -#include "settings/serializable.h" - class QThread; class AMBEWorker; class AudioFifo; -class AMBEEngine : public QObject, public Serializable +class AMBEEngine : public QObject { Q_OBJECT public: AMBEEngine(); ~AMBEEngine(); - void scan(std::vector& ambeDevices); + void scan(QList& ambeDevices); void releaseAll(); int getNbDevices() const { return m_controllers.size(); } //!< number of devices used - void getDeviceRefs(std::vector& devicesRefs); //!< reference of the devices used (device path or url) + void getDeviceRefs(QList& devicesRefs); //!< reference of the devices used (device path or url) bool registerController(const std::string& deviceRef); //!< create a new controller for the device in reference void releaseController(const std::string& deviceRef); //!< release controller resources for the device in reference @@ -57,11 +56,6 @@ public: int upsampling, AudioFifo *audioFifo); - virtual QByteArray serialize() const; - virtual bool deserialize(const QByteArray& data); - virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const; //!< Serialize to API - virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject); //!< Deserialize from API - private: struct AMBEController { diff --git a/plugins/feature/ambe/ambegui.cpp b/plugins/feature/ambe/ambegui.cpp index 9c7eb425a..2db66558d 100644 --- a/plugins/feature/ambe/ambegui.cpp +++ b/plugins/feature/ambe/ambegui.cpp @@ -178,6 +178,25 @@ bool AMBEGUI::handleMessage(const Message& message) displaySettings(); return true; } + else if (AMBE::MsgReportDevices::match(message)) + { + qDebug("AMBEGUI::handleMessage: AMBE::MsgReportDevices"); + AMBE::MsgReportDevices& cfg = (AMBE::MsgReportDevices&) message; + ui->ambeSerialDevices->clear(); + ui->statusText->setText("Updated all devices lists"); + + for (const auto& ambeDevice : cfg.getAvailableDevices()) { + ui->ambeSerialDevices->addItem(ambeDevice); + } + + ui->ambeDeviceRefs->clear(); + + for (const auto& inUseDevice : cfg.getUsedDevices()) { + ui->ambeDeviceRefs->addItem(inUseDevice); + } + + return true; + } return false; } @@ -196,27 +215,25 @@ void AMBEGUI::handleInputMessages() void AMBEGUI::populateSerialList() { - std::vector ambeSerialDevices; + QList ambeSerialDevices; m_ambe->getAMBEEngine()->scan(ambeSerialDevices); ui->ambeSerialDevices->clear(); - std::vector::const_iterator it = ambeSerialDevices.begin(); - for (; it != ambeSerialDevices.end(); ++it) { - ui->ambeSerialDevices->addItem(QString(*it)); + for (const auto& ambeDevice : ambeSerialDevices) { + ui->ambeSerialDevices->addItem(ambeDevice); } } void AMBEGUI::refreshInUseList() { - std::vector inUseDevices; + QList inUseDevices; m_ambe->getAMBEEngine()->getDeviceRefs(inUseDevices); ui->ambeDeviceRefs->clear(); - std::vector::const_iterator it = inUseDevices.begin(); - for (; it != inUseDevices.end(); ++it) + for (const auto& inUseDevice : inUseDevices) { - qDebug("AMBEGUI::refreshInUseList: %s", qPrintable(*it)); - ui->ambeDeviceRefs->addItem(*it); + qDebug("AMBEGUI::refreshInUseList: %s", qPrintable(inUseDevice)); + ui->ambeDeviceRefs->addItem(inUseDevice); } } void AMBEGUI::on_importSerial_clicked() @@ -295,6 +312,12 @@ void AMBEGUI::on_refreshAmbeList_clicked() ui->statusText->setText("In use refreshed"); } +void AMBEGUI::on_refreshSerial_clicked() +{ + populateSerialList(); + ui->statusText->setText("Serial refreshed"); +} + void AMBEGUI::on_clearAmbeList_clicked() { if (ui->ambeDeviceRefs->count() == 0) @@ -338,6 +361,7 @@ void AMBEGUI::makeUIConnections() QObject::connect(ui->importAllSerial, &QPushButton::clicked, this, &AMBEGUI::on_importAllSerial_clicked); QObject::connect(ui->removeAmbeDevice, &QPushButton::clicked, this, &AMBEGUI::on_removeAmbeDevice_clicked); QObject::connect(ui->refreshAmbeList, &QPushButton::clicked, this, &AMBEGUI::on_refreshAmbeList_clicked); + QObject::connect(ui->refreshSerial, &QPushButton::clicked, this, &AMBEGUI::on_refreshSerial_clicked); QObject::connect(ui->clearAmbeList, &QPushButton::clicked, this, &AMBEGUI::on_clearAmbeList_clicked); QObject::connect(ui->importAddress, &QPushButton::clicked, this, &AMBEGUI::on_importAddress_clicked); } diff --git a/plugins/feature/ambe/ambegui.h b/plugins/feature/ambe/ambegui.h index f93dc16f2..838a887e9 100644 --- a/plugins/feature/ambe/ambegui.h +++ b/plugins/feature/ambe/ambegui.h @@ -85,6 +85,7 @@ private slots: void on_importAllSerial_clicked(); void on_removeAmbeDevice_clicked(); void on_refreshAmbeList_clicked(); + void on_refreshSerial_clicked(); void on_clearAmbeList_clicked(); void on_importAddress_clicked(); }; diff --git a/plugins/feature/ambe/ambegui.ui b/plugins/feature/ambe/ambegui.ui index 1db075df0..c225f95f2 100644 --- a/plugins/feature/ambe/ambegui.ui +++ b/plugins/feature/ambe/ambegui.ui @@ -116,7 +116,7 @@ - Release all devices and servers + Remove selected device or server @@ -127,20 +127,6 @@ - - - - Refresh list of devices and servers in use - - - - - - - :/recycle.png:/recycle.png - - - @@ -155,6 +141,20 @@ + + + + Refresh list of devices and servers in use + + + + + + + :/recycle.png:/recycle.png + + + @@ -224,6 +224,20 @@ + + + + Refresh AMBE serial devices list + + + + + + + :/recycle.png:/recycle.png + + + @@ -250,7 +264,7 @@ - List of available AMBE serial devices available + List of AMBE serial devices in the system diff --git a/plugins/feature/ambe/ambeplugin.cpp b/plugins/feature/ambe/ambeplugin.cpp index 7157cb2cd..7a2c46a05 100644 --- a/plugins/feature/ambe/ambeplugin.cpp +++ b/plugins/feature/ambe/ambeplugin.cpp @@ -24,7 +24,7 @@ #endif #include "ambe.h" #include "ambeplugin.h" -// #include "simplepttwebapiadapter.h" +#include "ambewebapiadapter.h" const PluginDescriptor AMBEPlugin::m_pluginDescriptor = { AMBE::m_featureId, @@ -76,5 +76,5 @@ Feature* AMBEPlugin::createFeature(WebAPIAdapterInterface* webAPIAdapterInterfac FeatureWebAPIAdapter* AMBEPlugin::createFeatureWebAPIAdapter() const { - return nullptr; // TODO new SimplePTTWebAPIAdapter(); + return new AMBEWebAPIAdapter(); } diff --git a/plugins/feature/ambe/ambewebapiadapter.cpp b/plugins/feature/ambe/ambewebapiadapter.cpp new file mode 100644 index 000000000..3d8c86ab1 --- /dev/null +++ b/plugins/feature/ambe/ambewebapiadapter.cpp @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include "SWGFeatureSettings.h" +#include "ambe.h" +#include "ambewebapiadapter.h" + +AMBEWebAPIAdapter::AMBEWebAPIAdapter() +{} + +AMBEWebAPIAdapter::~AMBEWebAPIAdapter() +{} + +int AMBEWebAPIAdapter::webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setAmbeSettings(new SWGSDRangel::SWGAMBESettings()); + response.getAmbeSettings()->init(); + AMBE::webapiFormatFeatureSettings(response, m_settings); + + return 200; +} + +int AMBEWebAPIAdapter::webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) force; // no action + (void) errorMessage; + AMBE::webapiUpdateFeatureSettings(m_settings, featureSettingsKeys, response); + + return 200; +} diff --git a/plugins/feature/ambe/ambewebapiadapter.h b/plugins/feature/ambe/ambewebapiadapter.h new file mode 100644 index 000000000..d053cb9b0 --- /dev/null +++ b/plugins/feature/ambe/ambewebapiadapter.h @@ -0,0 +1,49 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_AMBE_WEBAPIADAPTER_H +#define INCLUDE_AMBE_WEBAPIADAPTER_H + +#include "feature/featurewebapiadapter.h" +#include "ambesettings.h" + +/** + * Standalone API adapter only for the settings + */ +class AMBEWebAPIAdapter : public FeatureWebAPIAdapter { +public: + AMBEWebAPIAdapter(); + virtual ~AMBEWebAPIAdapter(); + + virtual QByteArray serialize() const { return m_settings.serialize(); } + virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); } + + virtual int webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + +private: + AMBESettings m_settings; +}; + +#endif // INCLUDE_AIS_WEBAPIADAPTER_H diff --git a/sdrbase/resources/webapi.qrc b/sdrbase/resources/webapi.qrc index 219ac5fc7..5c38b5c68 100644 --- a/sdrbase/resources/webapi.qrc +++ b/sdrbase/resources/webapi.qrc @@ -9,6 +9,7 @@ webapi/doc/swagger/include/AIS.yaml webapi/doc/swagger/include/AISDemod.yaml webapi/doc/swagger/include/AISMod.yaml + webapi/doc/swagger/include/AMBE.yaml webapi/doc/swagger/include/AMDemod.yaml webapi/doc/swagger/include/AMMod.yaml webapi/doc/swagger/include/AntennaTools.yaml diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index a74ba0c83..ea79bf8c3 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1248,6 +1248,19 @@ margin-bottom: 20px; } }, "description" : "AIS settings" +}; + defs.AMBEActions = { + "properties" : { + "updateDevices" : { + "description" : "Add or remove AMBE devices (serial or address) int the list to be used for AMBE frames processing", + "$ref" : "#/definitions/AMBEDevices_2" + }, + "removeAll" : { + "type" : "integer", + "description" : "Set to a non zero value to remove all AMBE devices from the list of used AMBE devices" + } + }, + "description" : "AMBE" }; defs.AMBEDevice = { "properties" : { @@ -1261,6 +1274,19 @@ margin-bottom: 20px; } }, "description" : "AMBE devices active in the system" +}; + defs.AMBEDevice_2 = { + "properties" : { + "deviceRef" : { + "type" : "string", + "description" : "Serial device name or server address" + }, + "delete" : { + "type" : "integer", + "description" : "1 if device is to be removed from active list" + } + }, + "description" : "AMBE devices active in the system" }; defs.AMBEDevices = { "required" : [ "nbDevices" ], @@ -1278,6 +1304,66 @@ margin-bottom: 20px; } }, "description" : "List of AMBE devices (serial or server address)" +}; + defs.AMBEDevices_2 = { + "required" : [ "nbDevices" ], + "properties" : { + "nbDevices" : { + "type" : "integer", + "description" : "Number of DV serial devices" + }, + "ambeDevices" : { + "type" : "array", + "description" : "List of AMBE devices", + "items" : { + "$ref" : "#/definitions/AMBEDevice" + } + } + }, + "description" : "List of AMBE devices (serial or server address)" +}; + defs.AMBEReport = { + "properties" : { + "serial" : { + "description" : "List of available DV serial devices", + "$ref" : "#/definitions/DVSerialDevices_2" + }, + "devices" : { + "description" : "List of AMBE devices (serial or address) used for AMBE frames processing", + "$ref" : "#/definitions/AMBEDevices_2" + } + }, + "description" : "AMBE" +}; + defs.AMBESettings = { + "properties" : { + "title" : { + "type" : "string" + }, + "rgbColor" : { + "type" : "integer" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIFeatureSetIndex" : { + "type" : "integer" + }, + "reverseAPIFeatureIndex" : { + "type" : "integer" + }, + "rollupState" : { + "$ref" : "#/definitions/RollupState" + } + }, + "description" : "AMBE" }; defs.AMDemodReport = { "properties" : { @@ -4625,6 +4711,15 @@ margin-bottom: 20px; } }, "description" : "DV serial device details" +}; + defs.DVSerialDevice_2 = { + "properties" : { + "deviceName" : { + "type" : "string", + "description" : "Name of the serial device in the system" + } + }, + "description" : "DV serial device details" }; defs.DVSerialDevices = { "required" : [ "nbDevices" ], @@ -4642,6 +4737,23 @@ margin-bottom: 20px; } }, "description" : "List of DV serial devices available in the system" +}; + defs.DVSerialDevices_2 = { + "required" : [ "nbDevices" ], + "properties" : { + "nbDevices" : { + "type" : "integer", + "description" : "Number of DV serial devices" + }, + "dvSerialDevices" : { + "type" : "array", + "description" : "Device names of DV serial devices", + "items" : { + "$ref" : "#/definitions/DVSerialDevice" + } + } + }, + "description" : "List of DV serial devices available in the system" }; defs.DemodAnalyzerSettings = { "properties" : { @@ -5278,6 +5390,9 @@ margin-bottom: 20px; "AFCActions" : { "$ref" : "#/definitions/AFCActions" }, + "AMBEActions" : { + "$ref" : "#/definitions/AMBEActions" + }, "GS232ControllerActions" : { "$ref" : "#/definitions/GS232ControllerActions" }, @@ -5417,6 +5532,9 @@ margin-bottom: 20px; "AFCReport" : { "$ref" : "#/definitions/AFCReport" }, + "AMBEReport" : { + "$ref" : "#/definitions/AMBEReport" + }, "GS232ControllerReport" : { "$ref" : "#/definitions/GS232ControllerReport" }, @@ -5503,6 +5621,9 @@ margin-bottom: 20px; "AISSettings" : { "$ref" : "#/definitions/AISSettings" }, + "AMBESettings" : { + "$ref" : "#/definitions/AMBESettings" + }, "AntennaToolsSettings" : { "$ref" : "#/definitions/AntennaToolsSettings" }, @@ -57769,7 +57890,7 @@ except ApiException as e:
- Generated 2022-05-24T15:35:23.001+02:00 + Generated 2022-05-24T21:52:35.030+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml b/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml new file mode 100644 index 000000000..9b4d070ef --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml @@ -0,0 +1,88 @@ +AMBESettings: + description: AMBE + properties: + title: + type: string + rgbColor: + type: integer + useReverseAPI: + description: Synchronize with reverse API (1 for yes, 0 for no) + type: integer + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIFeatureSetIndex: + type: integer + reverseAPIFeatureIndex: + type: integer + rollupState: + $ref: "/doc/swagger/include/RollupState.yaml#/RollupState" + +AMBEReport: + description: AMBE + properties: + serial: + description: List of available DV serial devices + $ref: "/doc/swagger/include/AMBE.yaml#/definitions/DVSerialDevices" + devices: + description: List of AMBE devices (serial or address) used for AMBE frames processing + $ref: "/doc/swagger/include/AMBE.yaml#/definitions/AMBEDevices" + +AMBEActions: + description: AMBE + properties: + updateDevices: + description: Add or remove AMBE devices (serial or address) int the list to be used for AMBE frames processing + $ref: "/doc/swagger/include/AMBE.yaml#/definitions/AMBEDevices" + removeAll: + type: integer + description: Set to a non zero value to remove all AMBE devices from the list of used AMBE devices + + +definitions: + + DVSerialDevices: + description: "List of DV serial devices available in the system" + required: + - nbDevices + properties: + nbDevices: + description: "Number of DV serial devices" + type: integer + dvSerialDevices: + description: "Device names of DV serial devices" + type: array + items: + $ref: "#/definitions/DVSerialDevice" + + DVSerialDevice: + description: "DV serial device details" + properties: + deviceName: + description: "Name of the serial device in the system" + type: string + + AMBEDevices: + description: "List of AMBE devices (serial or server address)" + required: + - nbDevices + properties: + nbDevices: + description: "Number of DV serial devices" + type: integer + ambeDevices: + description: "List of AMBE devices" + type: array + items: + $ref: "#/definitions/AMBEDevice" + + AMBEDevice: + description: "AMBE devices active in the system" + properties: + deviceRef: + description: "Serial device name or server address" + type: string + delete: + description: "1 if device is to be removed from active list" + type: integer diff --git a/sdrbase/resources/webapi/doc/swagger/include/FeatureActions.yaml b/sdrbase/resources/webapi/doc/swagger/include/FeatureActions.yaml index 1df31dfb0..bee05f5cf 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FeatureActions.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FeatureActions.yaml @@ -15,6 +15,8 @@ FeatureActions: type: integer AFCActions: $ref: "/doc/swagger/include/AFC.yaml#/AFCActions" + AMBEActions: + $ref: "/doc/swagger/include/AMBE.yaml#/AMBEActions" GS232ControllerActions: $ref: "/doc/swagger/include/GS232Controller.yaml#/GS232ControllerActions" LimeRFEActions: diff --git a/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml b/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml index ae6cd71ae..c4c63649e 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml @@ -9,6 +9,8 @@ FeatureReport: type: string AFCReport: $ref: "/doc/swagger/include/AFC.yaml#/AFCReport" + AMBEReport: + $ref: "/doc/swagger/include/AMBE.yaml#/AMBEReport" GS232ControllerReport: $ref: "/doc/swagger/include/GS232Controller.yaml#/GS232ControllerReport" LimeRFEReport: diff --git a/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml b/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml index 21245d2e5..2bef41e84 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml @@ -17,6 +17,8 @@ FeatureSettings: $ref: "/doc/swagger/include/AFC.yaml#/AFCSettings" AISSettings: $ref: "/doc/swagger/include/AIS.yaml#/AISSettings" + AMBESettings: + $ref: "/doc/swagger/include/AMBE.yaml#/AMBESettings" AntennaToolsSettings: $ref: "/doc/swagger/include/AntennaTools.yaml#/AntennaToolsSettings" APRSSettings: diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index a17083c6f..77ed69f22 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -5300,6 +5300,11 @@ bool WebAPIRequestMapper::getFeatureActions( featureActions->setAfcActions(new SWGSDRangel::SWGAFCActions()); featureActions->getAfcActions()->fromJsonObject(actionsJsonObject); } + else if (featureActionsKey == "AMBEActions") + { + featureActions->setAmbeActions(new SWGSDRangel::SWGAMBEActions()); + featureActions->getAmbeActions()->fromJsonObject(actionsJsonObject); + } else if (featureActionsKey == "GS232ControllerActions") { featureActions->setGs232ControllerActions(new SWGSDRangel::SWGGS232ControllerActions()); diff --git a/sdrbase/webapi/webapiutils.cpp b/sdrbase/webapi/webapiutils.cpp index 1ffbb1209..8708cf012 100644 --- a/sdrbase/webapi/webapiutils.cpp +++ b/sdrbase/webapi/webapiutils.cpp @@ -270,6 +270,7 @@ const QMap WebAPIUtils::m_mimoDeviceHwIdToActionsKey = { const QMap WebAPIUtils::m_featureTypeToSettingsKey = { {"AFC", "AFCSettings"}, {"AIS", "AISSettings"}, + {"AMBE", "AMBESettings"}, {"AntennaTools", "AntennaToolsSettings"}, {"APRS", "APRSSettings"}, {"DemodAnalyzer", "DemodAnalyzerSettings"}, @@ -288,6 +289,7 @@ const QMap WebAPIUtils::m_featureTypeToSettingsKey = { const QMap WebAPIUtils::m_featureTypeToActionsKey = { {"AFC", "AFCActions"}, + {"AMBE", "AMBEActions"}, {"GS232Controller", "GS232ControllerActions"}, {"LimeRFE", "LimeRFEActions"}, {"Map", "MapActions"}, @@ -302,6 +304,7 @@ const QMap WebAPIUtils::m_featureTypeToActionsKey = { const QMap WebAPIUtils::m_featureURIToSettingsKey = { {"sdrangel.feature.afc", "AFCSettings"}, {"sdrangel.feature.ais", "AISSSettings"}, + {"sdrangel.feature.ambe", "AMBESSettings"}, {"sdrangel.feature.antennatools", "AntennaToolsSettings"}, {"sdrangel.feature.aprs", "APRSSettings"}, {"sdrangel.feature.demodanalyzer", "DemodAnalyzerSettings"}, diff --git a/swagger/sdrangel/api/swagger/include/AMBE.yaml b/swagger/sdrangel/api/swagger/include/AMBE.yaml new file mode 100644 index 000000000..f4e9cef2c --- /dev/null +++ b/swagger/sdrangel/api/swagger/include/AMBE.yaml @@ -0,0 +1,88 @@ +AMBESettings: + description: AMBE + properties: + title: + type: string + rgbColor: + type: integer + useReverseAPI: + description: Synchronize with reverse API (1 for yes, 0 for no) + type: integer + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIFeatureSetIndex: + type: integer + reverseAPIFeatureIndex: + type: integer + rollupState: + $ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState" + +AMBEReport: + description: AMBE + properties: + serial: + description: List of AMBE serial devices in the system + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/definitions/DVSerialDevices" + devices: + description: List of AMBE devices or servers in use + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/definitions/AMBEDevices" + +AMBEActions: + description: AMBE + properties: + updateDevices: + description: Add or remove AMBE devices (serial or address) int the list to be used for AMBE frames processing + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/definitions/AMBEDevices" + removeAll: + type: integer + description: Set to a non zero value to remove all AMBE devices from the list of used AMBE devices + + +definitions: + + DVSerialDevices: + description: "List of DV serial devices available in the system" + required: + - nbDevices + properties: + nbDevices: + description: "Number of DV serial devices" + type: integer + dvSerialDevices: + description: "Device names of DV serial devices" + type: array + items: + $ref: "#/definitions/DVSerialDevice" + + DVSerialDevice: + description: "DV serial device details" + properties: + deviceName: + description: "Name of the serial device in the system" + type: string + + AMBEDevices: + description: "List of AMBE devices (serial or server address)" + required: + - nbDevices + properties: + nbDevices: + description: "Number of DV serial devices" + type: integer + ambeDevices: + description: "List of AMBE devices" + type: array + items: + $ref: "#/definitions/AMBEDevice" + + AMBEDevice: + description: "AMBE devices active in the system" + properties: + deviceRef: + description: "Serial device name or server address" + type: string + delete: + description: "1 if device is to be removed from active list" + type: integer diff --git a/swagger/sdrangel/api/swagger/include/FeatureActions.yaml b/swagger/sdrangel/api/swagger/include/FeatureActions.yaml index 3a47ffe96..4ba69ceaa 100644 --- a/swagger/sdrangel/api/swagger/include/FeatureActions.yaml +++ b/swagger/sdrangel/api/swagger/include/FeatureActions.yaml @@ -15,6 +15,8 @@ FeatureActions: type: integer AFCActions: $ref: "http://swgserver:8081/api/swagger/include/AFC.yaml#/AFCActions" + AMBEActions: + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/AMBEActions" GS232ControllerActions: $ref: "http://swgserver:8081/api/swagger/include/GS232Controller.yaml#/GS232ControllerActions" LimeRFEActions: diff --git a/swagger/sdrangel/api/swagger/include/FeatureReport.yaml b/swagger/sdrangel/api/swagger/include/FeatureReport.yaml index 1264a7387..95fdcea9e 100644 --- a/swagger/sdrangel/api/swagger/include/FeatureReport.yaml +++ b/swagger/sdrangel/api/swagger/include/FeatureReport.yaml @@ -9,6 +9,8 @@ FeatureReport: type: string AFCReport: $ref: "http://swgserver:8081/api/swagger/include/AFC.yaml#/AFCReport" + AMBEReport: + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/AMBEReport" GS232ControllerReport: $ref: "http://swgserver:8081/api/swagger/include/GS232Controller.yaml#/GS232ControllerReport" LimeRFEReport: diff --git a/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml b/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml index 0f0f0bf30..6832f8ab4 100644 --- a/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml +++ b/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml @@ -17,6 +17,8 @@ FeatureSettings: $ref: "http://swgserver:8081/api/swagger/include/AFC.yaml#/AFCSettings" AISSettings: $ref: "http://swgserver:8081/api/swagger/include/AIS.yaml#/AISSettings" + AMBESettings: + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/AMBESettings" AntennaToolsSettings: $ref: "http://swgserver:8081/api/swagger/include/AntennaTools.yaml#/AntennaToolsSettings" APRSSettings: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index a74ba0c83..ea79bf8c3 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1248,6 +1248,19 @@ margin-bottom: 20px; } }, "description" : "AIS settings" +}; + defs.AMBEActions = { + "properties" : { + "updateDevices" : { + "description" : "Add or remove AMBE devices (serial or address) int the list to be used for AMBE frames processing", + "$ref" : "#/definitions/AMBEDevices_2" + }, + "removeAll" : { + "type" : "integer", + "description" : "Set to a non zero value to remove all AMBE devices from the list of used AMBE devices" + } + }, + "description" : "AMBE" }; defs.AMBEDevice = { "properties" : { @@ -1261,6 +1274,19 @@ margin-bottom: 20px; } }, "description" : "AMBE devices active in the system" +}; + defs.AMBEDevice_2 = { + "properties" : { + "deviceRef" : { + "type" : "string", + "description" : "Serial device name or server address" + }, + "delete" : { + "type" : "integer", + "description" : "1 if device is to be removed from active list" + } + }, + "description" : "AMBE devices active in the system" }; defs.AMBEDevices = { "required" : [ "nbDevices" ], @@ -1278,6 +1304,66 @@ margin-bottom: 20px; } }, "description" : "List of AMBE devices (serial or server address)" +}; + defs.AMBEDevices_2 = { + "required" : [ "nbDevices" ], + "properties" : { + "nbDevices" : { + "type" : "integer", + "description" : "Number of DV serial devices" + }, + "ambeDevices" : { + "type" : "array", + "description" : "List of AMBE devices", + "items" : { + "$ref" : "#/definitions/AMBEDevice" + } + } + }, + "description" : "List of AMBE devices (serial or server address)" +}; + defs.AMBEReport = { + "properties" : { + "serial" : { + "description" : "List of available DV serial devices", + "$ref" : "#/definitions/DVSerialDevices_2" + }, + "devices" : { + "description" : "List of AMBE devices (serial or address) used for AMBE frames processing", + "$ref" : "#/definitions/AMBEDevices_2" + } + }, + "description" : "AMBE" +}; + defs.AMBESettings = { + "properties" : { + "title" : { + "type" : "string" + }, + "rgbColor" : { + "type" : "integer" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIFeatureSetIndex" : { + "type" : "integer" + }, + "reverseAPIFeatureIndex" : { + "type" : "integer" + }, + "rollupState" : { + "$ref" : "#/definitions/RollupState" + } + }, + "description" : "AMBE" }; defs.AMDemodReport = { "properties" : { @@ -4625,6 +4711,15 @@ margin-bottom: 20px; } }, "description" : "DV serial device details" +}; + defs.DVSerialDevice_2 = { + "properties" : { + "deviceName" : { + "type" : "string", + "description" : "Name of the serial device in the system" + } + }, + "description" : "DV serial device details" }; defs.DVSerialDevices = { "required" : [ "nbDevices" ], @@ -4642,6 +4737,23 @@ margin-bottom: 20px; } }, "description" : "List of DV serial devices available in the system" +}; + defs.DVSerialDevices_2 = { + "required" : [ "nbDevices" ], + "properties" : { + "nbDevices" : { + "type" : "integer", + "description" : "Number of DV serial devices" + }, + "dvSerialDevices" : { + "type" : "array", + "description" : "Device names of DV serial devices", + "items" : { + "$ref" : "#/definitions/DVSerialDevice" + } + } + }, + "description" : "List of DV serial devices available in the system" }; defs.DemodAnalyzerSettings = { "properties" : { @@ -5278,6 +5390,9 @@ margin-bottom: 20px; "AFCActions" : { "$ref" : "#/definitions/AFCActions" }, + "AMBEActions" : { + "$ref" : "#/definitions/AMBEActions" + }, "GS232ControllerActions" : { "$ref" : "#/definitions/GS232ControllerActions" }, @@ -5417,6 +5532,9 @@ margin-bottom: 20px; "AFCReport" : { "$ref" : "#/definitions/AFCReport" }, + "AMBEReport" : { + "$ref" : "#/definitions/AMBEReport" + }, "GS232ControllerReport" : { "$ref" : "#/definitions/GS232ControllerReport" }, @@ -5503,6 +5621,9 @@ margin-bottom: 20px; "AISSettings" : { "$ref" : "#/definitions/AISSettings" }, + "AMBESettings" : { + "$ref" : "#/definitions/AMBESettings" + }, "AntennaToolsSettings" : { "$ref" : "#/definitions/AntennaToolsSettings" }, @@ -57769,7 +57890,7 @@ except ApiException as e:
- Generated 2022-05-24T15:35:23.001+02:00 + Generated 2022-05-24T21:52:35.030+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp new file mode 100644 index 000000000..4a6079e5f --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp @@ -0,0 +1,133 @@ +/** + * 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: 7.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 "SWGAMBEActions.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGAMBEActions::SWGAMBEActions(QString* json) { + init(); + this->fromJson(*json); +} + +SWGAMBEActions::SWGAMBEActions() { + update_devices = nullptr; + m_update_devices_isSet = false; + remove_all = 0; + m_remove_all_isSet = false; +} + +SWGAMBEActions::~SWGAMBEActions() { + this->cleanup(); +} + +void +SWGAMBEActions::init() { + update_devices = new SWGAMBEDevices_2(); + m_update_devices_isSet = false; + remove_all = 0; + m_remove_all_isSet = false; +} + +void +SWGAMBEActions::cleanup() { + if(update_devices != nullptr) { + delete update_devices; + } + +} + +SWGAMBEActions* +SWGAMBEActions::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGAMBEActions::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&update_devices, pJson["updateDevices"], "SWGAMBEDevices_2", "SWGAMBEDevices_2"); + + ::SWGSDRangel::setValue(&remove_all, pJson["removeAll"], "qint32", ""); + +} + +QString +SWGAMBEActions::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGAMBEActions::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if((update_devices != nullptr) && (update_devices->isSet())){ + toJsonValue(QString("updateDevices"), update_devices, obj, QString("SWGAMBEDevices_2")); + } + if(m_remove_all_isSet){ + obj->insert("removeAll", QJsonValue(remove_all)); + } + + return obj; +} + +SWGAMBEDevices_2* +SWGAMBEActions::getUpdateDevices() { + return update_devices; +} +void +SWGAMBEActions::setUpdateDevices(SWGAMBEDevices_2* update_devices) { + this->update_devices = update_devices; + this->m_update_devices_isSet = true; +} + +qint32 +SWGAMBEActions::getRemoveAll() { + return remove_all; +} +void +SWGAMBEActions::setRemoveAll(qint32 remove_all) { + this->remove_all = remove_all; + this->m_remove_all_isSet = true; +} + + +bool +SWGAMBEActions::isSet(){ + bool isObjectUpdated = false; + do{ + if(update_devices && update_devices->isSet()){ + isObjectUpdated = true; break; + } + if(m_remove_all_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEActions.h b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.h new file mode 100644 index 000000000..a742b6071 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.h @@ -0,0 +1,65 @@ +/** + * 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: 7.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. + */ + +/* + * SWGAMBEActions.h + * + * AMBE + */ + +#ifndef SWGAMBEActions_H_ +#define SWGAMBEActions_H_ + +#include + + +#include "SWGAMBEDevices_2.h" + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGAMBEActions: public SWGObject { +public: + SWGAMBEActions(); + SWGAMBEActions(QString* json); + virtual ~SWGAMBEActions(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGAMBEActions* fromJson(QString &jsonString) override; + + SWGAMBEDevices_2* getUpdateDevices(); + void setUpdateDevices(SWGAMBEDevices_2* update_devices); + + qint32 getRemoveAll(); + void setRemoveAll(qint32 remove_all); + + + virtual bool isSet() override; + +private: + SWGAMBEDevices_2* update_devices; + bool m_update_devices_isSet; + + qint32 remove_all; + bool m_remove_all_isSet; + +}; + +} + +#endif /* SWGAMBEActions_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.cpp new file mode 100644 index 000000000..9cfff94c3 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.cpp @@ -0,0 +1,133 @@ +/** + * 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: 7.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 "SWGAMBEDevice_2.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGAMBEDevice_2::SWGAMBEDevice_2(QString* json) { + init(); + this->fromJson(*json); +} + +SWGAMBEDevice_2::SWGAMBEDevice_2() { + device_ref = nullptr; + m_device_ref_isSet = false; + _delete = 0; + m__delete_isSet = false; +} + +SWGAMBEDevice_2::~SWGAMBEDevice_2() { + this->cleanup(); +} + +void +SWGAMBEDevice_2::init() { + device_ref = new QString(""); + m_device_ref_isSet = false; + _delete = 0; + m__delete_isSet = false; +} + +void +SWGAMBEDevice_2::cleanup() { + if(device_ref != nullptr) { + delete device_ref; + } + +} + +SWGAMBEDevice_2* +SWGAMBEDevice_2::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGAMBEDevice_2::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&device_ref, pJson["deviceRef"], "QString", "QString"); + + ::SWGSDRangel::setValue(&_delete, pJson["delete"], "qint32", ""); + +} + +QString +SWGAMBEDevice_2::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGAMBEDevice_2::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(device_ref != nullptr && *device_ref != QString("")){ + toJsonValue(QString("deviceRef"), device_ref, obj, QString("QString")); + } + if(m__delete_isSet){ + obj->insert("delete", QJsonValue(_delete)); + } + + return obj; +} + +QString* +SWGAMBEDevice_2::getDeviceRef() { + return device_ref; +} +void +SWGAMBEDevice_2::setDeviceRef(QString* device_ref) { + this->device_ref = device_ref; + this->m_device_ref_isSet = true; +} + +qint32 +SWGAMBEDevice_2::getDelete() { + return _delete; +} +void +SWGAMBEDevice_2::setDelete(qint32 _delete) { + this->_delete = _delete; + this->m__delete_isSet = true; +} + + +bool +SWGAMBEDevice_2::isSet(){ + bool isObjectUpdated = false; + do{ + if(device_ref && *device_ref != QString("")){ + isObjectUpdated = true; break; + } + if(m__delete_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.h b/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.h new file mode 100644 index 000000000..7decb9e28 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.h @@ -0,0 +1,65 @@ +/** + * 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: 7.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. + */ + +/* + * SWGAMBEDevice_2.h + * + * AMBE devices active in the system + */ + +#ifndef SWGAMBEDevice_2_H_ +#define SWGAMBEDevice_2_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGAMBEDevice_2: public SWGObject { +public: + SWGAMBEDevice_2(); + SWGAMBEDevice_2(QString* json); + virtual ~SWGAMBEDevice_2(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGAMBEDevice_2* fromJson(QString &jsonString) override; + + QString* getDeviceRef(); + void setDeviceRef(QString* device_ref); + + qint32 getDelete(); + void setDelete(qint32 _delete); + + + virtual bool isSet() override; + +private: + QString* device_ref; + bool m_device_ref_isSet; + + qint32 _delete; + bool m__delete_isSet; + +}; + +} + +#endif /* SWGAMBEDevice_2_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.cpp new file mode 100644 index 000000000..e3b3935ab --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.cpp @@ -0,0 +1,137 @@ +/** + * 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: 7.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 "SWGAMBEDevices_2.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGAMBEDevices_2::SWGAMBEDevices_2(QString* json) { + init(); + this->fromJson(*json); +} + +SWGAMBEDevices_2::SWGAMBEDevices_2() { + nb_devices = 0; + m_nb_devices_isSet = false; + ambe_devices = nullptr; + m_ambe_devices_isSet = false; +} + +SWGAMBEDevices_2::~SWGAMBEDevices_2() { + this->cleanup(); +} + +void +SWGAMBEDevices_2::init() { + nb_devices = 0; + m_nb_devices_isSet = false; + ambe_devices = new QList(); + m_ambe_devices_isSet = false; +} + +void +SWGAMBEDevices_2::cleanup() { + + if(ambe_devices != nullptr) { + auto arr = ambe_devices; + for(auto o: *arr) { + delete o; + } + delete ambe_devices; + } +} + +SWGAMBEDevices_2* +SWGAMBEDevices_2::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGAMBEDevices_2::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&nb_devices, pJson["nbDevices"], "qint32", ""); + + + ::SWGSDRangel::setValue(&ambe_devices, pJson["ambeDevices"], "QList", "SWGAMBEDevice"); +} + +QString +SWGAMBEDevices_2::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGAMBEDevices_2::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_nb_devices_isSet){ + obj->insert("nbDevices", QJsonValue(nb_devices)); + } + if(ambe_devices && ambe_devices->size() > 0){ + toJsonArray((QList*)ambe_devices, obj, "ambeDevices", "SWGAMBEDevice"); + } + + return obj; +} + +qint32 +SWGAMBEDevices_2::getNbDevices() { + return nb_devices; +} +void +SWGAMBEDevices_2::setNbDevices(qint32 nb_devices) { + this->nb_devices = nb_devices; + this->m_nb_devices_isSet = true; +} + +QList* +SWGAMBEDevices_2::getAmbeDevices() { + return ambe_devices; +} +void +SWGAMBEDevices_2::setAmbeDevices(QList* ambe_devices) { + this->ambe_devices = ambe_devices; + this->m_ambe_devices_isSet = true; +} + + +bool +SWGAMBEDevices_2::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_nb_devices_isSet){ + isObjectUpdated = true; break; + } + if(ambe_devices && (ambe_devices->size() > 0)){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.h b/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.h new file mode 100644 index 000000000..c60b61f99 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.h @@ -0,0 +1,66 @@ +/** + * 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: 7.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. + */ + +/* + * SWGAMBEDevices_2.h + * + * List of AMBE devices (serial or server address) + */ + +#ifndef SWGAMBEDevices_2_H_ +#define SWGAMBEDevices_2_H_ + +#include + + +#include "SWGAMBEDevice.h" +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGAMBEDevices_2: public SWGObject { +public: + SWGAMBEDevices_2(); + SWGAMBEDevices_2(QString* json); + virtual ~SWGAMBEDevices_2(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGAMBEDevices_2* fromJson(QString &jsonString) override; + + qint32 getNbDevices(); + void setNbDevices(qint32 nb_devices); + + QList* getAmbeDevices(); + void setAmbeDevices(QList* ambe_devices); + + + virtual bool isSet() override; + +private: + qint32 nb_devices; + bool m_nb_devices_isSet; + + QList* ambe_devices; + bool m_ambe_devices_isSet; + +}; + +} + +#endif /* SWGAMBEDevices_2_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp new file mode 100644 index 000000000..9f22650d4 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp @@ -0,0 +1,135 @@ +/** + * 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: 7.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 "SWGAMBEReport.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGAMBEReport::SWGAMBEReport(QString* json) { + init(); + this->fromJson(*json); +} + +SWGAMBEReport::SWGAMBEReport() { + serial = nullptr; + m_serial_isSet = false; + devices = nullptr; + m_devices_isSet = false; +} + +SWGAMBEReport::~SWGAMBEReport() { + this->cleanup(); +} + +void +SWGAMBEReport::init() { + serial = new SWGDVSerialDevices_2(); + m_serial_isSet = false; + devices = new SWGAMBEDevices_2(); + m_devices_isSet = false; +} + +void +SWGAMBEReport::cleanup() { + if(serial != nullptr) { + delete serial; + } + if(devices != nullptr) { + delete devices; + } +} + +SWGAMBEReport* +SWGAMBEReport::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGAMBEReport::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&serial, pJson["serial"], "SWGDVSerialDevices_2", "SWGDVSerialDevices_2"); + + ::SWGSDRangel::setValue(&devices, pJson["devices"], "SWGAMBEDevices_2", "SWGAMBEDevices_2"); + +} + +QString +SWGAMBEReport::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGAMBEReport::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if((serial != nullptr) && (serial->isSet())){ + toJsonValue(QString("serial"), serial, obj, QString("SWGDVSerialDevices_2")); + } + if((devices != nullptr) && (devices->isSet())){ + toJsonValue(QString("devices"), devices, obj, QString("SWGAMBEDevices_2")); + } + + return obj; +} + +SWGDVSerialDevices_2* +SWGAMBEReport::getSerial() { + return serial; +} +void +SWGAMBEReport::setSerial(SWGDVSerialDevices_2* serial) { + this->serial = serial; + this->m_serial_isSet = true; +} + +SWGAMBEDevices_2* +SWGAMBEReport::getDevices() { + return devices; +} +void +SWGAMBEReport::setDevices(SWGAMBEDevices_2* devices) { + this->devices = devices; + this->m_devices_isSet = true; +} + + +bool +SWGAMBEReport::isSet(){ + bool isObjectUpdated = false; + do{ + if(serial && serial->isSet()){ + isObjectUpdated = true; break; + } + if(devices && devices->isSet()){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h new file mode 100644 index 000000000..45f3f1d32 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h @@ -0,0 +1,66 @@ +/** + * 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: 7.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. + */ + +/* + * SWGAMBEReport.h + * + * AMBE + */ + +#ifndef SWGAMBEReport_H_ +#define SWGAMBEReport_H_ + +#include + + +#include "SWGAMBEDevices_2.h" +#include "SWGDVSerialDevices_2.h" + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGAMBEReport: public SWGObject { +public: + SWGAMBEReport(); + SWGAMBEReport(QString* json); + virtual ~SWGAMBEReport(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGAMBEReport* fromJson(QString &jsonString) override; + + SWGDVSerialDevices_2* getSerial(); + void setSerial(SWGDVSerialDevices_2* serial); + + SWGAMBEDevices_2* getDevices(); + void setDevices(SWGAMBEDevices_2* devices); + + + virtual bool isSet() override; + +private: + SWGDVSerialDevices_2* serial; + bool m_serial_isSet; + + SWGAMBEDevices_2* devices; + bool m_devices_isSet; + +}; + +} + +#endif /* SWGAMBEReport_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBESettings.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBESettings.cpp new file mode 100644 index 000000000..7f70bf550 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBESettings.cpp @@ -0,0 +1,275 @@ +/** + * 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: 7.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 "SWGAMBESettings.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGAMBESettings::SWGAMBESettings(QString* json) { + init(); + this->fromJson(*json); +} + +SWGAMBESettings::SWGAMBESettings() { + title = nullptr; + m_title_isSet = false; + rgb_color = 0; + m_rgb_color_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_feature_set_index = 0; + m_reverse_api_feature_set_index_isSet = false; + reverse_api_feature_index = 0; + m_reverse_api_feature_index_isSet = false; + rollup_state = nullptr; + m_rollup_state_isSet = false; +} + +SWGAMBESettings::~SWGAMBESettings() { + this->cleanup(); +} + +void +SWGAMBESettings::init() { + title = new QString(""); + m_title_isSet = false; + rgb_color = 0; + m_rgb_color_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_feature_set_index = 0; + m_reverse_api_feature_set_index_isSet = false; + reverse_api_feature_index = 0; + m_reverse_api_feature_index_isSet = false; + rollup_state = new SWGRollupState(); + m_rollup_state_isSet = false; +} + +void +SWGAMBESettings::cleanup() { + if(title != nullptr) { + delete title; + } + + + if(reverse_api_address != nullptr) { + delete reverse_api_address; + } + + + + if(rollup_state != nullptr) { + delete rollup_state; + } +} + +SWGAMBESettings* +SWGAMBESettings::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGAMBESettings::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); + + ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "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_feature_set_index, pJson["reverseAPIFeatureSetIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_feature_index, pJson["reverseAPIFeatureIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState"); + +} + +QString +SWGAMBESettings::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGAMBESettings::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(title != nullptr && *title != QString("")){ + toJsonValue(QString("title"), title, obj, QString("QString")); + } + if(m_rgb_color_isSet){ + obj->insert("rgbColor", QJsonValue(rgb_color)); + } + 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_feature_set_index_isSet){ + obj->insert("reverseAPIFeatureSetIndex", QJsonValue(reverse_api_feature_set_index)); + } + if(m_reverse_api_feature_index_isSet){ + obj->insert("reverseAPIFeatureIndex", QJsonValue(reverse_api_feature_index)); + } + if((rollup_state != nullptr) && (rollup_state->isSet())){ + toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState")); + } + + return obj; +} + +QString* +SWGAMBESettings::getTitle() { + return title; +} +void +SWGAMBESettings::setTitle(QString* title) { + this->title = title; + this->m_title_isSet = true; +} + +qint32 +SWGAMBESettings::getRgbColor() { + return rgb_color; +} +void +SWGAMBESettings::setRgbColor(qint32 rgb_color) { + this->rgb_color = rgb_color; + this->m_rgb_color_isSet = true; +} + +qint32 +SWGAMBESettings::getUseReverseApi() { + return use_reverse_api; +} +void +SWGAMBESettings::setUseReverseApi(qint32 use_reverse_api) { + this->use_reverse_api = use_reverse_api; + this->m_use_reverse_api_isSet = true; +} + +QString* +SWGAMBESettings::getReverseApiAddress() { + return reverse_api_address; +} +void +SWGAMBESettings::setReverseApiAddress(QString* reverse_api_address) { + this->reverse_api_address = reverse_api_address; + this->m_reverse_api_address_isSet = true; +} + +qint32 +SWGAMBESettings::getReverseApiPort() { + return reverse_api_port; +} +void +SWGAMBESettings::setReverseApiPort(qint32 reverse_api_port) { + this->reverse_api_port = reverse_api_port; + this->m_reverse_api_port_isSet = true; +} + +qint32 +SWGAMBESettings::getReverseApiFeatureSetIndex() { + return reverse_api_feature_set_index; +} +void +SWGAMBESettings::setReverseApiFeatureSetIndex(qint32 reverse_api_feature_set_index) { + this->reverse_api_feature_set_index = reverse_api_feature_set_index; + this->m_reverse_api_feature_set_index_isSet = true; +} + +qint32 +SWGAMBESettings::getReverseApiFeatureIndex() { + return reverse_api_feature_index; +} +void +SWGAMBESettings::setReverseApiFeatureIndex(qint32 reverse_api_feature_index) { + this->reverse_api_feature_index = reverse_api_feature_index; + this->m_reverse_api_feature_index_isSet = true; +} + +SWGRollupState* +SWGAMBESettings::getRollupState() { + return rollup_state; +} +void +SWGAMBESettings::setRollupState(SWGRollupState* rollup_state) { + this->rollup_state = rollup_state; + this->m_rollup_state_isSet = true; +} + + +bool +SWGAMBESettings::isSet(){ + bool isObjectUpdated = false; + do{ + if(title && *title != QString("")){ + isObjectUpdated = true; break; + } + if(m_rgb_color_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_feature_set_index_isSet){ + isObjectUpdated = true; break; + } + if(m_reverse_api_feature_index_isSet){ + isObjectUpdated = true; break; + } + if(rollup_state && rollup_state->isSet()){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBESettings.h b/swagger/sdrangel/code/qt5/client/SWGAMBESettings.h new file mode 100644 index 000000000..36961d06a --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBESettings.h @@ -0,0 +1,102 @@ +/** + * 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: 7.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. + */ + +/* + * SWGAMBESettings.h + * + * AMBE + */ + +#ifndef SWGAMBESettings_H_ +#define SWGAMBESettings_H_ + +#include + + +#include "SWGRollupState.h" +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGAMBESettings: public SWGObject { +public: + SWGAMBESettings(); + SWGAMBESettings(QString* json); + virtual ~SWGAMBESettings(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGAMBESettings* fromJson(QString &jsonString) override; + + QString* getTitle(); + void setTitle(QString* title); + + qint32 getRgbColor(); + void setRgbColor(qint32 rgb_color); + + 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 getReverseApiFeatureSetIndex(); + void setReverseApiFeatureSetIndex(qint32 reverse_api_feature_set_index); + + qint32 getReverseApiFeatureIndex(); + void setReverseApiFeatureIndex(qint32 reverse_api_feature_index); + + SWGRollupState* getRollupState(); + void setRollupState(SWGRollupState* rollup_state); + + + virtual bool isSet() override; + +private: + QString* title; + bool m_title_isSet; + + qint32 rgb_color; + bool m_rgb_color_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_feature_set_index; + bool m_reverse_api_feature_set_index_isSet; + + qint32 reverse_api_feature_index; + bool m_reverse_api_feature_index_isSet; + + SWGRollupState* rollup_state; + bool m_rollup_state_isSet; + +}; + +} + +#endif /* SWGAMBESettings_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.cpp b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.cpp new file mode 100644 index 000000000..06bba95f3 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.cpp @@ -0,0 +1,110 @@ +/** + * 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: 7.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 "SWGDVSerialDevice_2.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGDVSerialDevice_2::SWGDVSerialDevice_2(QString* json) { + init(); + this->fromJson(*json); +} + +SWGDVSerialDevice_2::SWGDVSerialDevice_2() { + device_name = nullptr; + m_device_name_isSet = false; +} + +SWGDVSerialDevice_2::~SWGDVSerialDevice_2() { + this->cleanup(); +} + +void +SWGDVSerialDevice_2::init() { + device_name = new QString(""); + m_device_name_isSet = false; +} + +void +SWGDVSerialDevice_2::cleanup() { + if(device_name != nullptr) { + delete device_name; + } +} + +SWGDVSerialDevice_2* +SWGDVSerialDevice_2::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGDVSerialDevice_2::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&device_name, pJson["deviceName"], "QString", "QString"); + +} + +QString +SWGDVSerialDevice_2::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGDVSerialDevice_2::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(device_name != nullptr && *device_name != QString("")){ + toJsonValue(QString("deviceName"), device_name, obj, QString("QString")); + } + + return obj; +} + +QString* +SWGDVSerialDevice_2::getDeviceName() { + return device_name; +} +void +SWGDVSerialDevice_2::setDeviceName(QString* device_name) { + this->device_name = device_name; + this->m_device_name_isSet = true; +} + + +bool +SWGDVSerialDevice_2::isSet(){ + bool isObjectUpdated = false; + do{ + if(device_name && *device_name != QString("")){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.h b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.h new file mode 100644 index 000000000..92a21c6be --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.h @@ -0,0 +1,59 @@ +/** + * 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: 7.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. + */ + +/* + * SWGDVSerialDevice_2.h + * + * DV serial device details + */ + +#ifndef SWGDVSerialDevice_2_H_ +#define SWGDVSerialDevice_2_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGDVSerialDevice_2: public SWGObject { +public: + SWGDVSerialDevice_2(); + SWGDVSerialDevice_2(QString* json); + virtual ~SWGDVSerialDevice_2(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGDVSerialDevice_2* fromJson(QString &jsonString) override; + + QString* getDeviceName(); + void setDeviceName(QString* device_name); + + + virtual bool isSet() override; + +private: + QString* device_name; + bool m_device_name_isSet; + +}; + +} + +#endif /* SWGDVSerialDevice_2_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.cpp b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.cpp new file mode 100644 index 000000000..18304ef01 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.cpp @@ -0,0 +1,137 @@ +/** + * 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: 7.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 "SWGDVSerialDevices_2.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGDVSerialDevices_2::SWGDVSerialDevices_2(QString* json) { + init(); + this->fromJson(*json); +} + +SWGDVSerialDevices_2::SWGDVSerialDevices_2() { + nb_devices = 0; + m_nb_devices_isSet = false; + dv_serial_devices = nullptr; + m_dv_serial_devices_isSet = false; +} + +SWGDVSerialDevices_2::~SWGDVSerialDevices_2() { + this->cleanup(); +} + +void +SWGDVSerialDevices_2::init() { + nb_devices = 0; + m_nb_devices_isSet = false; + dv_serial_devices = new QList(); + m_dv_serial_devices_isSet = false; +} + +void +SWGDVSerialDevices_2::cleanup() { + + if(dv_serial_devices != nullptr) { + auto arr = dv_serial_devices; + for(auto o: *arr) { + delete o; + } + delete dv_serial_devices; + } +} + +SWGDVSerialDevices_2* +SWGDVSerialDevices_2::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGDVSerialDevices_2::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&nb_devices, pJson["nbDevices"], "qint32", ""); + + + ::SWGSDRangel::setValue(&dv_serial_devices, pJson["dvSerialDevices"], "QList", "SWGDVSerialDevice"); +} + +QString +SWGDVSerialDevices_2::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGDVSerialDevices_2::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_nb_devices_isSet){ + obj->insert("nbDevices", QJsonValue(nb_devices)); + } + if(dv_serial_devices && dv_serial_devices->size() > 0){ + toJsonArray((QList*)dv_serial_devices, obj, "dvSerialDevices", "SWGDVSerialDevice"); + } + + return obj; +} + +qint32 +SWGDVSerialDevices_2::getNbDevices() { + return nb_devices; +} +void +SWGDVSerialDevices_2::setNbDevices(qint32 nb_devices) { + this->nb_devices = nb_devices; + this->m_nb_devices_isSet = true; +} + +QList* +SWGDVSerialDevices_2::getDvSerialDevices() { + return dv_serial_devices; +} +void +SWGDVSerialDevices_2::setDvSerialDevices(QList* dv_serial_devices) { + this->dv_serial_devices = dv_serial_devices; + this->m_dv_serial_devices_isSet = true; +} + + +bool +SWGDVSerialDevices_2::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_nb_devices_isSet){ + isObjectUpdated = true; break; + } + if(dv_serial_devices && (dv_serial_devices->size() > 0)){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.h b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.h new file mode 100644 index 000000000..d0065a428 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.h @@ -0,0 +1,66 @@ +/** + * 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: 7.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. + */ + +/* + * SWGDVSerialDevices_2.h + * + * List of DV serial devices available in the system + */ + +#ifndef SWGDVSerialDevices_2_H_ +#define SWGDVSerialDevices_2_H_ + +#include + + +#include "SWGDVSerialDevice.h" +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGDVSerialDevices_2: public SWGObject { +public: + SWGDVSerialDevices_2(); + SWGDVSerialDevices_2(QString* json); + virtual ~SWGDVSerialDevices_2(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGDVSerialDevices_2* fromJson(QString &jsonString) override; + + qint32 getNbDevices(); + void setNbDevices(qint32 nb_devices); + + QList* getDvSerialDevices(); + void setDvSerialDevices(QList* dv_serial_devices); + + + virtual bool isSet() override; + +private: + qint32 nb_devices; + bool m_nb_devices_isSet; + + QList* dv_serial_devices; + bool m_dv_serial_devices_isSet; + +}; + +} + +#endif /* SWGDVSerialDevices_2_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureActions.cpp b/swagger/sdrangel/code/qt5/client/SWGFeatureActions.cpp index ed766164f..c6567fdd6 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureActions.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureActions.cpp @@ -36,6 +36,8 @@ SWGFeatureActions::SWGFeatureActions() { m_originator_feature_index_isSet = false; afc_actions = nullptr; m_afc_actions_isSet = false; + ambe_actions = nullptr; + m_ambe_actions_isSet = false; gs232_controller_actions = nullptr; m_gs232_controller_actions_isSet = false; lime_rfe_actions = nullptr; @@ -70,6 +72,8 @@ SWGFeatureActions::init() { m_originator_feature_index_isSet = false; afc_actions = new SWGAFCActions(); m_afc_actions_isSet = false; + ambe_actions = new SWGAMBEActions(); + m_ambe_actions_isSet = false; gs232_controller_actions = new SWGGS232ControllerActions(); m_gs232_controller_actions_isSet = false; lime_rfe_actions = new SWGLimeRFEActions(); @@ -100,6 +104,9 @@ SWGFeatureActions::cleanup() { if(afc_actions != nullptr) { delete afc_actions; } + if(ambe_actions != nullptr) { + delete ambe_actions; + } if(gs232_controller_actions != nullptr) { delete gs232_controller_actions; } @@ -148,6 +155,8 @@ SWGFeatureActions::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&afc_actions, pJson["AFCActions"], "SWGAFCActions", "SWGAFCActions"); + ::SWGSDRangel::setValue(&ambe_actions, pJson["AMBEActions"], "SWGAMBEActions", "SWGAMBEActions"); + ::SWGSDRangel::setValue(&gs232_controller_actions, pJson["GS232ControllerActions"], "SWGGS232ControllerActions", "SWGGS232ControllerActions"); ::SWGSDRangel::setValue(&lime_rfe_actions, pJson["LimeRFEActions"], "SWGLimeRFEActions", "SWGLimeRFEActions"); @@ -194,6 +203,9 @@ SWGFeatureActions::asJsonObject() { if((afc_actions != nullptr) && (afc_actions->isSet())){ toJsonValue(QString("AFCActions"), afc_actions, obj, QString("SWGAFCActions")); } + if((ambe_actions != nullptr) && (ambe_actions->isSet())){ + toJsonValue(QString("AMBEActions"), ambe_actions, obj, QString("SWGAMBEActions")); + } if((gs232_controller_actions != nullptr) && (gs232_controller_actions->isSet())){ toJsonValue(QString("GS232ControllerActions"), gs232_controller_actions, obj, QString("SWGGS232ControllerActions")); } @@ -265,6 +277,16 @@ SWGFeatureActions::setAfcActions(SWGAFCActions* afc_actions) { this->m_afc_actions_isSet = true; } +SWGAMBEActions* +SWGFeatureActions::getAmbeActions() { + return ambe_actions; +} +void +SWGFeatureActions::setAmbeActions(SWGAMBEActions* ambe_actions) { + this->ambe_actions = ambe_actions; + this->m_ambe_actions_isSet = true; +} + SWGGS232ControllerActions* SWGFeatureActions::getGs232ControllerActions() { return gs232_controller_actions; @@ -372,6 +394,9 @@ SWGFeatureActions::isSet(){ if(afc_actions && afc_actions->isSet()){ isObjectUpdated = true; break; } + if(ambe_actions && ambe_actions->isSet()){ + isObjectUpdated = true; break; + } if(gs232_controller_actions && gs232_controller_actions->isSet()){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureActions.h b/swagger/sdrangel/code/qt5/client/SWGFeatureActions.h index 46fa415e3..50f7f4b2a 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureActions.h +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureActions.h @@ -23,6 +23,7 @@ #include "SWGAFCActions.h" +#include "SWGAMBEActions.h" #include "SWGGS232ControllerActions.h" #include "SWGLimeRFEActions.h" #include "SWGMapActions.h" @@ -64,6 +65,9 @@ public: SWGAFCActions* getAfcActions(); void setAfcActions(SWGAFCActions* afc_actions); + SWGAMBEActions* getAmbeActions(); + void setAmbeActions(SWGAMBEActions* ambe_actions); + SWGGS232ControllerActions* getGs232ControllerActions(); void setGs232ControllerActions(SWGGS232ControllerActions* gs232_controller_actions); @@ -107,6 +111,9 @@ private: SWGAFCActions* afc_actions; bool m_afc_actions_isSet; + SWGAMBEActions* ambe_actions; + bool m_ambe_actions_isSet; + SWGGS232ControllerActions* gs232_controller_actions; bool m_gs232_controller_actions_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp index 1b79ae52a..087a514f0 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp @@ -32,6 +32,8 @@ SWGFeatureReport::SWGFeatureReport() { m_feature_type_isSet = false; afc_report = nullptr; m_afc_report_isSet = false; + ambe_report = nullptr; + m_ambe_report_isSet = false; gs232_controller_report = nullptr; m_gs232_controller_report_isSet = false; lime_rfe_report = nullptr; @@ -62,6 +64,8 @@ SWGFeatureReport::init() { m_feature_type_isSet = false; afc_report = new SWGAFCReport(); m_afc_report_isSet = false; + ambe_report = new SWGAMBEReport(); + m_ambe_report_isSet = false; gs232_controller_report = new SWGGS232ControllerReport(); m_gs232_controller_report_isSet = false; lime_rfe_report = new SWGLimeRFEReport(); @@ -90,6 +94,9 @@ SWGFeatureReport::cleanup() { if(afc_report != nullptr) { delete afc_report; } + if(ambe_report != nullptr) { + delete ambe_report; + } if(gs232_controller_report != nullptr) { delete gs232_controller_report; } @@ -134,6 +141,8 @@ SWGFeatureReport::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&afc_report, pJson["AFCReport"], "SWGAFCReport", "SWGAFCReport"); + ::SWGSDRangel::setValue(&ambe_report, pJson["AMBEReport"], "SWGAMBEReport", "SWGAMBEReport"); + ::SWGSDRangel::setValue(&gs232_controller_report, pJson["GS232ControllerReport"], "SWGGS232ControllerReport", "SWGGS232ControllerReport"); ::SWGSDRangel::setValue(&lime_rfe_report, pJson["LimeRFEReport"], "SWGLimeRFEReport", "SWGLimeRFEReport"); @@ -174,6 +183,9 @@ SWGFeatureReport::asJsonObject() { if((afc_report != nullptr) && (afc_report->isSet())){ toJsonValue(QString("AFCReport"), afc_report, obj, QString("SWGAFCReport")); } + if((ambe_report != nullptr) && (ambe_report->isSet())){ + toJsonValue(QString("AMBEReport"), ambe_report, obj, QString("SWGAMBEReport")); + } if((gs232_controller_report != nullptr) && (gs232_controller_report->isSet())){ toJsonValue(QString("GS232ControllerReport"), gs232_controller_report, obj, QString("SWGGS232ControllerReport")); } @@ -225,6 +237,16 @@ SWGFeatureReport::setAfcReport(SWGAFCReport* afc_report) { this->m_afc_report_isSet = true; } +SWGAMBEReport* +SWGFeatureReport::getAmbeReport() { + return ambe_report; +} +void +SWGFeatureReport::setAmbeReport(SWGAMBEReport* ambe_report) { + this->ambe_report = ambe_report; + this->m_ambe_report_isSet = true; +} + SWGGS232ControllerReport* SWGFeatureReport::getGs232ControllerReport() { return gs232_controller_report; @@ -326,6 +348,9 @@ SWGFeatureReport::isSet(){ if(afc_report && afc_report->isSet()){ isObjectUpdated = true; break; } + if(ambe_report && ambe_report->isSet()){ + isObjectUpdated = true; break; + } if(gs232_controller_report && gs232_controller_report->isSet()){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.h b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.h index 25c6c51d1..563e26163 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 "SWGAMBEReport.h" #include "SWGGS232ControllerReport.h" #include "SWGLimeRFEReport.h" #include "SWGMapReport.h" @@ -58,6 +59,9 @@ public: SWGAFCReport* getAfcReport(); void setAfcReport(SWGAFCReport* afc_report); + SWGAMBEReport* getAmbeReport(); + void setAmbeReport(SWGAMBEReport* ambe_report); + SWGGS232ControllerReport* getGs232ControllerReport(); void setGs232ControllerReport(SWGGS232ControllerReport* gs232_controller_report); @@ -95,6 +99,9 @@ private: SWGAFCReport* afc_report; bool m_afc_report_isSet; + SWGAMBEReport* ambe_report; + bool m_ambe_report_isSet; + SWGGS232ControllerReport* gs232_controller_report; bool m_gs232_controller_report_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp index 61595592e..992647cd0 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp @@ -38,6 +38,8 @@ SWGFeatureSettings::SWGFeatureSettings() { m_afc_settings_isSet = false; ais_settings = nullptr; m_ais_settings_isSet = false; + ambe_settings = nullptr; + m_ambe_settings_isSet = false; antenna_tools_settings = nullptr; m_antenna_tools_settings_isSet = false; aprs_settings = nullptr; @@ -84,6 +86,8 @@ SWGFeatureSettings::init() { m_afc_settings_isSet = false; ais_settings = new SWGAISSettings(); m_ais_settings_isSet = false; + ambe_settings = new SWGAMBESettings(); + m_ambe_settings_isSet = false; antenna_tools_settings = new SWGAntennaToolsSettings(); m_antenna_tools_settings_isSet = false; aprs_settings = new SWGAPRSSettings(); @@ -127,6 +131,9 @@ SWGFeatureSettings::cleanup() { if(ais_settings != nullptr) { delete ais_settings; } + if(ambe_settings != nullptr) { + delete ambe_settings; + } if(antenna_tools_settings != nullptr) { delete antenna_tools_settings; } @@ -192,6 +199,8 @@ SWGFeatureSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&ais_settings, pJson["AISSettings"], "SWGAISSettings", "SWGAISSettings"); + ::SWGSDRangel::setValue(&ambe_settings, pJson["AMBESettings"], "SWGAMBESettings", "SWGAMBESettings"); + ::SWGSDRangel::setValue(&antenna_tools_settings, pJson["AntennaToolsSettings"], "SWGAntennaToolsSettings", "SWGAntennaToolsSettings"); ::SWGSDRangel::setValue(&aprs_settings, pJson["APRSSettings"], "SWGAPRSSettings", "SWGAPRSSettings"); @@ -251,6 +260,9 @@ SWGFeatureSettings::asJsonObject() { if((ais_settings != nullptr) && (ais_settings->isSet())){ toJsonValue(QString("AISSettings"), ais_settings, obj, QString("SWGAISSettings")); } + if((ambe_settings != nullptr) && (ambe_settings->isSet())){ + toJsonValue(QString("AMBESettings"), ambe_settings, obj, QString("SWGAMBESettings")); + } if((antenna_tools_settings != nullptr) && (antenna_tools_settings->isSet())){ toJsonValue(QString("AntennaToolsSettings"), antenna_tools_settings, obj, QString("SWGAntennaToolsSettings")); } @@ -347,6 +359,16 @@ SWGFeatureSettings::setAisSettings(SWGAISSettings* ais_settings) { this->m_ais_settings_isSet = true; } +SWGAMBESettings* +SWGFeatureSettings::getAmbeSettings() { + return ambe_settings; +} +void +SWGFeatureSettings::setAmbeSettings(SWGAMBESettings* ambe_settings) { + this->ambe_settings = ambe_settings; + this->m_ambe_settings_isSet = true; +} + SWGAntennaToolsSettings* SWGFeatureSettings::getAntennaToolsSettings() { return antenna_tools_settings; @@ -507,6 +529,9 @@ SWGFeatureSettings::isSet(){ if(ais_settings && ais_settings->isSet()){ isObjectUpdated = true; break; } + if(ambe_settings && ambe_settings->isSet()){ + isObjectUpdated = true; break; + } if(antenna_tools_settings && antenna_tools_settings->isSet()){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h index 3271cb913..27b5d305a 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h @@ -24,6 +24,7 @@ #include "SWGAFCSettings.h" #include "SWGAISSettings.h" +#include "SWGAMBESettings.h" #include "SWGAPRSSettings.h" #include "SWGAntennaToolsSettings.h" #include "SWGDemodAnalyzerSettings.h" @@ -73,6 +74,9 @@ public: SWGAISSettings* getAisSettings(); void setAisSettings(SWGAISSettings* ais_settings); + SWGAMBESettings* getAmbeSettings(); + void setAmbeSettings(SWGAMBESettings* ambe_settings); + SWGAntennaToolsSettings* getAntennaToolsSettings(); void setAntennaToolsSettings(SWGAntennaToolsSettings* antenna_tools_settings); @@ -134,6 +138,9 @@ private: SWGAISSettings* ais_settings; bool m_ais_settings_isSet; + SWGAMBESettings* ambe_settings; + bool m_ambe_settings_isSet; + SWGAntennaToolsSettings* antenna_tools_settings; bool m_antenna_tools_settings_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 2cb26fd51..3d7f6bfc6 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -25,8 +25,13 @@ #include "SWGAISModReport.h" #include "SWGAISModSettings.h" #include "SWGAISSettings.h" +#include "SWGAMBEActions.h" #include "SWGAMBEDevice.h" +#include "SWGAMBEDevice_2.h" #include "SWGAMBEDevices.h" +#include "SWGAMBEDevices_2.h" +#include "SWGAMBEReport.h" +#include "SWGAMBESettings.h" #include "SWGAMDemodReport.h" #include "SWGAMDemodSettings.h" #include "SWGAMModReport.h" @@ -94,7 +99,9 @@ #include "SWGDSDDemodReport.h" #include "SWGDSDDemodSettings.h" #include "SWGDVSerialDevice.h" +#include "SWGDVSerialDevice_2.h" #include "SWGDVSerialDevices.h" +#include "SWGDVSerialDevices_2.h" #include "SWGDemodAnalyzerSettings.h" #include "SWGDeviceActions.h" #include "SWGDeviceConfig.h" @@ -384,16 +391,41 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGAMBEActions").compare(type) == 0) { + SWGAMBEActions *obj = new SWGAMBEActions(); + obj->init(); + return obj; + } if(QString("SWGAMBEDevice").compare(type) == 0) { SWGAMBEDevice *obj = new SWGAMBEDevice(); obj->init(); return obj; } + if(QString("SWGAMBEDevice_2").compare(type) == 0) { + SWGAMBEDevice_2 *obj = new SWGAMBEDevice_2(); + obj->init(); + return obj; + } if(QString("SWGAMBEDevices").compare(type) == 0) { SWGAMBEDevices *obj = new SWGAMBEDevices(); obj->init(); return obj; } + if(QString("SWGAMBEDevices_2").compare(type) == 0) { + SWGAMBEDevices_2 *obj = new SWGAMBEDevices_2(); + obj->init(); + return obj; + } + if(QString("SWGAMBEReport").compare(type) == 0) { + SWGAMBEReport *obj = new SWGAMBEReport(); + obj->init(); + return obj; + } + if(QString("SWGAMBESettings").compare(type) == 0) { + SWGAMBESettings *obj = new SWGAMBESettings(); + obj->init(); + return obj; + } if(QString("SWGAMDemodReport").compare(type) == 0) { SWGAMDemodReport *obj = new SWGAMDemodReport(); obj->init(); @@ -729,11 +761,21 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGDVSerialDevice_2").compare(type) == 0) { + SWGDVSerialDevice_2 *obj = new SWGDVSerialDevice_2(); + obj->init(); + return obj; + } if(QString("SWGDVSerialDevices").compare(type) == 0) { SWGDVSerialDevices *obj = new SWGDVSerialDevices(); obj->init(); return obj; } + if(QString("SWGDVSerialDevices_2").compare(type) == 0) { + SWGDVSerialDevices_2 *obj = new SWGDVSerialDevices_2(); + obj->init(); + return obj; + } if(QString("SWGDemodAnalyzerSettings").compare(type) == 0) { SWGDemodAnalyzerSettings *obj = new SWGDemodAnalyzerSettings(); obj->init();