diff --git a/plugins/feature/ambe/ambe.cpp b/plugins/feature/ambe/ambe.cpp index 7457f06da..b75ba8179 100644 --- a/plugins/feature/ambe/ambe.cpp +++ b/plugins/feature/ambe/ambe.cpp @@ -347,20 +347,16 @@ void AMBE::webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response) // devices - SWGSDRangel::SWGAMBEDevices *swgAMBEDevices = response.getAmbeReport()->getDevices(); - swgAMBEDevices->init(); + response.getAmbeReport()->setDevices(new QList); + QList deviceRefs; + getAMBEEngine()->getDeviceRefs(deviceRefs); - qDeviceNames.clear(); - getAMBEEngine()->getDeviceRefs(qDeviceNames); - swgAMBEDevices->setNbDevices((int) qDeviceNames.size()); - QList *ambeDeviceNamesList = swgAMBEDevices->getAmbeDevices(); - - for (const auto& deviceName : qDeviceNames) + for (auto& deviceRef : deviceRefs) { - ambeDeviceNamesList->append(new SWGSDRangel::SWGAMBEDevice); - ambeDeviceNamesList->back()->init(); - *ambeDeviceNamesList->back()->getDeviceRef() = deviceName; - ambeDeviceNamesList->back()->setDelete(0); + response.getAmbeReport()->getDevices()->append(new SWGSDRangel::SWGAMBEDeviceReport); + response.getAmbeReport()->getDevices()->back()->setDevicePath(new QString(deviceRef.m_devicePath)); + response.getAmbeReport()->getDevices()->back()->setSuccessCount(deviceRef.m_successCount); + response.getAmbeReport()->getDevices()->back()->setFailureCount(deviceRef.m_failureCount); } } diff --git a/plugins/feature/ambe/ambe.h b/plugins/feature/ambe/ambe.h index 6e049101c..e4e317669 100644 --- a/plugins/feature/ambe/ambe.h +++ b/plugins/feature/ambe/ambe.h @@ -62,7 +62,7 @@ public: public: QList& getAvailableDevices() { return m_availableDevices; } - QList& getUsedDevices() { return m_usedDevices; } + QList& getUsedDevices() { return m_usedDevices; } static MsgReportDevices* create() { return new MsgReportDevices(); @@ -70,7 +70,7 @@ public: private: QList m_availableDevices; - QList m_usedDevices; + QList m_usedDevices; MsgReportDevices() : Message() diff --git a/plugins/feature/ambe/ambeengine.cpp b/plugins/feature/ambe/ambeengine.cpp index c77eade8a..faa91610a 100644 --- a/plugins/feature/ambe/ambeengine.cpp +++ b/plugins/feature/ambe/ambeengine.cpp @@ -43,6 +43,16 @@ #include "ambeworker.h" #include "ambeengine.h" +uint32_t AMBEEngine::AMBEController::getSuccessCount() const +{ + return worker ? worker->getSuccessCount() : 0; +} + +uint32_t AMBEEngine::AMBEController::getFailureCount() const +{ + return worker ? worker->getFailureCount() : 0; +} + AMBEEngine::AMBEEngine() {} @@ -291,13 +301,13 @@ void AMBEEngine::releaseAll() m_controllers.clear(); } -void AMBEEngine::getDeviceRefs(QList& deviceNames) +void AMBEEngine::getDeviceRefs(QList& deviceRefs) { std::vector::const_iterator it = m_controllers.begin(); while (it != m_controllers.end()) { - deviceNames.push_back(QString(it->device.c_str())); + deviceRefs.push_back(DeviceRef{QString(it->device.c_str()), it->getSuccessCount(), it->getFailureCount()}); ++it; } } diff --git a/plugins/feature/ambe/ambeengine.h b/plugins/feature/ambe/ambeengine.h index 9e9fd805b..21bbb421a 100644 --- a/plugins/feature/ambe/ambeengine.h +++ b/plugins/feature/ambe/ambeengine.h @@ -36,6 +36,13 @@ class AMBEEngine : public QObject { Q_OBJECT public: + struct DeviceRef + { + QString m_devicePath; //!< device path or url + uint32_t m_successCount; //!< number of frames successfully decoded + uint32_t m_failureCount; //!< number of frames failing decoding + }; + AMBEEngine(); ~AMBEEngine(); @@ -43,7 +50,7 @@ public: void releaseAll(); int getNbDevices() const { return m_controllers.size(); } //!< number of devices used - void getDeviceRefs(QList& devicesRefs); //!< reference of the devices used (device path or url) + void getDeviceRefs(QList& devicesRefs); //!< reference of the devices used 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 @@ -67,6 +74,9 @@ private: QThread *thread; AMBEWorker *worker; std::string device; + + uint32_t getSuccessCount() const; + uint32_t getFailureCount() const; }; #ifndef _WIN32 diff --git a/plugins/feature/ambe/ambegui.cpp b/plugins/feature/ambe/ambegui.cpp index 2db66558d..e99026cc2 100644 --- a/plugins/feature/ambe/ambegui.cpp +++ b/plugins/feature/ambe/ambegui.cpp @@ -192,7 +192,12 @@ bool AMBEGUI::handleMessage(const Message& message) ui->ambeDeviceRefs->clear(); for (const auto& inUseDevice : cfg.getUsedDevices()) { - ui->ambeDeviceRefs->addItem(inUseDevice); + ui->ambeDeviceRefs->addItem( + tr("%1 - %2|%3") + .arg(inUseDevice.m_devicePath) + .arg(inUseDevice.m_successCount) + .arg(inUseDevice.m_failureCount) + ); } return true; @@ -226,14 +231,19 @@ void AMBEGUI::populateSerialList() void AMBEGUI::refreshInUseList() { - QList inUseDevices; + QList inUseDevices; m_ambe->getAMBEEngine()->getDeviceRefs(inUseDevices); ui->ambeDeviceRefs->clear(); for (const auto& inUseDevice : inUseDevices) { - qDebug("AMBEGUI::refreshInUseList: %s", qPrintable(inUseDevice)); - ui->ambeDeviceRefs->addItem(inUseDevice); + qDebug("AMBEGUI::refreshInUseList: %s", qPrintable(inUseDevice.m_devicePath)); + ui->ambeDeviceRefs->addItem( + tr("%1 - %2|%3") + .arg(inUseDevice.m_devicePath) + .arg(inUseDevice.m_successCount) + .arg(inUseDevice.m_failureCount) + ); } } void AMBEGUI::on_importSerial_clicked() @@ -253,7 +263,7 @@ void AMBEGUI::on_importSerial_clicked() { if (m_ambe->getAMBEEngine()->registerController(serialName.toStdString())) { - ui->ambeDeviceRefs->addItem(serialName); + ui->ambeDeviceRefs->addItem(tr("%1 - 0|0").arg(serialName)); ui->statusText->setText(tr("%1 added").arg(serialName)); } else @@ -300,7 +310,7 @@ void AMBEGUI::on_removeAmbeDevice_clicked() return; } - QString deviceName = deviceItem->text(); + QString deviceName = deviceItem->text().split(" ").at(0); m_ambe->getAMBEEngine()->releaseController(deviceName.toStdString()); ui->statusText->setText(tr("%1 removed").arg(deviceName)); refreshInUseList(); diff --git a/plugins/feature/ambe/ambeworker.cpp b/plugins/feature/ambe/ambeworker.cpp index 37713daba..11c6f2ae3 100644 --- a/plugins/feature/ambe/ambeworker.cpp +++ b/plugins/feature/ambe/ambeworker.cpp @@ -33,7 +33,9 @@ AMBEWorker::AMBEWorker() : m_upsamplerLastValue(0.0f), m_phase(0), m_upsampling(1), - m_volume(1.0f) + m_volume(1.0f), + m_successCount(0), + m_failureCount(0) { m_audioBuffer.resize(48000); m_audioBufferFill = 0; @@ -119,10 +121,13 @@ void AMBEWorker::handleInputMessages() m_audioBufferFill = 0; } + + m_successCount++; } else { qDebug("AMBEWorker::handleInputMessages: MsgMbeDecode: decode failed"); + m_failureCount++; } } diff --git a/plugins/feature/ambe/ambeworker.h b/plugins/feature/ambe/ambeworker.h index e6136c139..f094f83c0 100644 --- a/plugins/feature/ambe/ambeworker.h +++ b/plugins/feature/ambe/ambeworker.h @@ -115,6 +115,8 @@ public: void stop(); bool isAvailable(); bool hasFifo(AudioFifo *audioFifo); + uint32_t getSuccessCount() const { return m_successCount; } + uint32_t getFailureCount() const { return m_failureCount; } void postTest() { @@ -151,6 +153,8 @@ private: float m_volume; float m_upsamplingFactors[7]; AudioCompressor m_compressor; + uint32_t m_successCount; + uint32_t m_failureCount; }; #endif // SDRBASE_AMBE_AMBEWORKER_H_ diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 136e97d20..120b8e2ef 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1274,6 +1274,23 @@ margin-bottom: 20px; } }, "description" : "AMBE devices active in the system" +}; + defs.AMBEDeviceReport = { + "properties" : { + "devicePath" : { + "type" : "string", + "description" : "AMBE device full path or AMBE server URL" + }, + "successCount" : { + "type" : "integer", + "description" : "number of frames decoded successfully" + }, + "failureCount" : { + "type" : "integer", + "description" : "number of frames that failed to decode" + } + }, + "description" : "Report of AMBE device in use" }; defs.AMBEDevices = { "required" : [ "nbDevices" ], @@ -1299,8 +1316,11 @@ margin-bottom: 20px; "$ref" : "#/definitions/DVSerialDevices" }, "devices" : { + "type" : "array", "description" : "List of AMBE devices or servers in use", - "$ref" : "#/definitions/AMBEDevices" + "items" : { + "$ref" : "#/definitions/AMBEDeviceReport" + } } }, "description" : "AMBE" @@ -56040,7 +56060,7 @@ except ApiException as e:
- Generated 2022-05-24T23:13:14.725+02:00 + Generated 2022-05-25T12:47:57.273+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml b/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml index 275857baf..1720cecfb 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml @@ -27,7 +27,9 @@ AMBEReport: $ref: "/doc/swagger/include/AMBE.yaml#/definitions/DVSerialDevices" devices: description: List of AMBE devices or servers in use - $ref: "/doc/swagger/include/AMBE.yaml#/definitions/AMBEDevices" + type: array + items: + $ref: "/doc/swagger/include/AMBE.yaml#/definitions/AMBEDeviceReport" AMBEActions: description: AMBE @@ -86,3 +88,16 @@ definitions: delete: description: "1 if device is to be removed from active list" type: integer + + AMBEDeviceReport: + description: "Report of AMBE device in use" + properties: + devicePath: + type: string + description: AMBE device full path or AMBE server URL + successCount: + type: integer + description: number of frames decoded successfully + failureCount: + type: integer + description: number of frames that failed to decode diff --git a/swagger/sdrangel/api/swagger/include/AMBE.yaml b/swagger/sdrangel/api/swagger/include/AMBE.yaml index f4e9cef2c..d696083a0 100644 --- a/swagger/sdrangel/api/swagger/include/AMBE.yaml +++ b/swagger/sdrangel/api/swagger/include/AMBE.yaml @@ -27,7 +27,9 @@ AMBEReport: $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" + type: array + items: + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/definitions/AMBEDeviceReport" AMBEActions: description: AMBE @@ -86,3 +88,16 @@ definitions: delete: description: "1 if device is to be removed from active list" type: integer + + AMBEDeviceReport: + description: "Report of AMBE device in use" + properties: + devicePath: + type: string + description: AMBE device full path or AMBE server URL + successCount: + type: integer + description: number of frames decoded successfully + failureCount: + type: integer + description: number of frames that failed to decode diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 136e97d20..120b8e2ef 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1274,6 +1274,23 @@ margin-bottom: 20px; } }, "description" : "AMBE devices active in the system" +}; + defs.AMBEDeviceReport = { + "properties" : { + "devicePath" : { + "type" : "string", + "description" : "AMBE device full path or AMBE server URL" + }, + "successCount" : { + "type" : "integer", + "description" : "number of frames decoded successfully" + }, + "failureCount" : { + "type" : "integer", + "description" : "number of frames that failed to decode" + } + }, + "description" : "Report of AMBE device in use" }; defs.AMBEDevices = { "required" : [ "nbDevices" ], @@ -1299,8 +1316,11 @@ margin-bottom: 20px; "$ref" : "#/definitions/DVSerialDevices" }, "devices" : { + "type" : "array", "description" : "List of AMBE devices or servers in use", - "$ref" : "#/definitions/AMBEDevices" + "items" : { + "$ref" : "#/definitions/AMBEDeviceReport" + } } }, "description" : "AMBE" @@ -56040,7 +56060,7 @@ except ApiException as e:
- Generated 2022-05-24T23:13:14.725+02:00 + Generated 2022-05-25T12:47:57.273+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.cpp new file mode 100644 index 000000000..5b750967e --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.cpp @@ -0,0 +1,156 @@ +/** + * 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 "SWGAMBEDeviceReport.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGAMBEDeviceReport::SWGAMBEDeviceReport(QString* json) { + init(); + this->fromJson(*json); +} + +SWGAMBEDeviceReport::SWGAMBEDeviceReport() { + device_path = nullptr; + m_device_path_isSet = false; + success_count = 0; + m_success_count_isSet = false; + failure_count = 0; + m_failure_count_isSet = false; +} + +SWGAMBEDeviceReport::~SWGAMBEDeviceReport() { + this->cleanup(); +} + +void +SWGAMBEDeviceReport::init() { + device_path = new QString(""); + m_device_path_isSet = false; + success_count = 0; + m_success_count_isSet = false; + failure_count = 0; + m_failure_count_isSet = false; +} + +void +SWGAMBEDeviceReport::cleanup() { + if(device_path != nullptr) { + delete device_path; + } + + +} + +SWGAMBEDeviceReport* +SWGAMBEDeviceReport::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGAMBEDeviceReport::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&device_path, pJson["devicePath"], "QString", "QString"); + + ::SWGSDRangel::setValue(&success_count, pJson["successCount"], "qint32", ""); + + ::SWGSDRangel::setValue(&failure_count, pJson["failureCount"], "qint32", ""); + +} + +QString +SWGAMBEDeviceReport::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGAMBEDeviceReport::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(device_path != nullptr && *device_path != QString("")){ + toJsonValue(QString("devicePath"), device_path, obj, QString("QString")); + } + if(m_success_count_isSet){ + obj->insert("successCount", QJsonValue(success_count)); + } + if(m_failure_count_isSet){ + obj->insert("failureCount", QJsonValue(failure_count)); + } + + return obj; +} + +QString* +SWGAMBEDeviceReport::getDevicePath() { + return device_path; +} +void +SWGAMBEDeviceReport::setDevicePath(QString* device_path) { + this->device_path = device_path; + this->m_device_path_isSet = true; +} + +qint32 +SWGAMBEDeviceReport::getSuccessCount() { + return success_count; +} +void +SWGAMBEDeviceReport::setSuccessCount(qint32 success_count) { + this->success_count = success_count; + this->m_success_count_isSet = true; +} + +qint32 +SWGAMBEDeviceReport::getFailureCount() { + return failure_count; +} +void +SWGAMBEDeviceReport::setFailureCount(qint32 failure_count) { + this->failure_count = failure_count; + this->m_failure_count_isSet = true; +} + + +bool +SWGAMBEDeviceReport::isSet(){ + bool isObjectUpdated = false; + do{ + if(device_path && *device_path != QString("")){ + isObjectUpdated = true; break; + } + if(m_success_count_isSet){ + isObjectUpdated = true; break; + } + if(m_failure_count_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.h b/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.h new file mode 100644 index 000000000..ea3614186 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.h @@ -0,0 +1,71 @@ +/** + * 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. + */ + +/* + * SWGAMBEDeviceReport.h + * + * Report of AMBE device in use + */ + +#ifndef SWGAMBEDeviceReport_H_ +#define SWGAMBEDeviceReport_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGAMBEDeviceReport: public SWGObject { +public: + SWGAMBEDeviceReport(); + SWGAMBEDeviceReport(QString* json); + virtual ~SWGAMBEDeviceReport(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGAMBEDeviceReport* fromJson(QString &jsonString) override; + + QString* getDevicePath(); + void setDevicePath(QString* device_path); + + qint32 getSuccessCount(); + void setSuccessCount(qint32 success_count); + + qint32 getFailureCount(); + void setFailureCount(qint32 failure_count); + + + virtual bool isSet() override; + +private: + QString* device_path; + bool m_device_path_isSet; + + qint32 success_count; + bool m_success_count_isSet; + + qint32 failure_count; + bool m_failure_count_isSet; + +}; + +} + +#endif /* SWGAMBEDeviceReport_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp index a3b8c8fd7..ae3c88090 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp @@ -42,7 +42,7 @@ void SWGAMBEReport::init() { serial = new SWGDVSerialDevices(); m_serial_isSet = false; - devices = new SWGAMBEDevices(); + devices = new QList(); m_devices_isSet = false; } @@ -52,6 +52,10 @@ SWGAMBEReport::cleanup() { delete serial; } if(devices != nullptr) { + auto arr = devices; + for(auto o: *arr) { + delete o; + } delete devices; } } @@ -69,8 +73,8 @@ void SWGAMBEReport::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&serial, pJson["serial"], "SWGDVSerialDevices", "SWGDVSerialDevices"); - ::SWGSDRangel::setValue(&devices, pJson["devices"], "SWGAMBEDevices", "SWGAMBEDevices"); + ::SWGSDRangel::setValue(&devices, pJson["devices"], "QList", "SWGAMBEDeviceReport"); } QString @@ -90,8 +94,8 @@ SWGAMBEReport::asJsonObject() { if((serial != nullptr) && (serial->isSet())){ toJsonValue(QString("serial"), serial, obj, QString("SWGDVSerialDevices")); } - if((devices != nullptr) && (devices->isSet())){ - toJsonValue(QString("devices"), devices, obj, QString("SWGAMBEDevices")); + if(devices && devices->size() > 0){ + toJsonArray((QList*)devices, obj, "devices", "SWGAMBEDeviceReport"); } return obj; @@ -107,12 +111,12 @@ SWGAMBEReport::setSerial(SWGDVSerialDevices* serial) { this->m_serial_isSet = true; } -SWGAMBEDevices* +QList* SWGAMBEReport::getDevices() { return devices; } void -SWGAMBEReport::setDevices(SWGAMBEDevices* devices) { +SWGAMBEReport::setDevices(QList* devices) { this->devices = devices; this->m_devices_isSet = true; } @@ -125,7 +129,7 @@ SWGAMBEReport::isSet(){ if(serial && serial->isSet()){ isObjectUpdated = true; break; } - if(devices && devices->isSet()){ + if(devices && (devices->size() > 0)){ isObjectUpdated = true; break; } }while(false); diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h index feef5985b..2471dfddd 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h @@ -22,8 +22,9 @@ #include -#include "SWGAMBEDevices.h" +#include "SWGAMBEDeviceReport.h" #include "SWGDVSerialDevices.h" +#include #include "SWGObject.h" #include "export.h" @@ -46,8 +47,8 @@ public: SWGDVSerialDevices* getSerial(); void setSerial(SWGDVSerialDevices* serial); - SWGAMBEDevices* getDevices(); - void setDevices(SWGAMBEDevices* devices); + QList* getDevices(); + void setDevices(QList* devices); virtual bool isSet() override; @@ -56,7 +57,7 @@ private: SWGDVSerialDevices* serial; bool m_serial_isSet; - SWGAMBEDevices* devices; + QList* devices; bool m_devices_isSet; }; diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 5d387a7fa..cf694db10 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -27,6 +27,7 @@ #include "SWGAISSettings.h" #include "SWGAMBEActions.h" #include "SWGAMBEDevice.h" +#include "SWGAMBEDeviceReport.h" #include "SWGAMBEDevices.h" #include "SWGAMBEReport.h" #include "SWGAMBESettings.h" @@ -397,6 +398,11 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGAMBEDeviceReport").compare(type) == 0) { + SWGAMBEDeviceReport *obj = new SWGAMBEDeviceReport(); + obj->init(); + return obj; + } if(QString("SWGAMBEDevices").compare(type) == 0) { SWGAMBEDevices *obj = new SWGAMBEDevices(); obj->init();