mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
AMBE feature: report frames decoding successes and failures
This commit is contained in:
parent
100ca3510c
commit
c4cb135177
@ -347,20 +347,16 @@ void AMBE::webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response)
|
||||
|
||||
// devices
|
||||
|
||||
SWGSDRangel::SWGAMBEDevices *swgAMBEDevices = response.getAmbeReport()->getDevices();
|
||||
swgAMBEDevices->init();
|
||||
response.getAmbeReport()->setDevices(new QList<SWGSDRangel::SWGAMBEDeviceReport*>);
|
||||
QList<AMBEEngine::DeviceRef> deviceRefs;
|
||||
getAMBEEngine()->getDeviceRefs(deviceRefs);
|
||||
|
||||
qDeviceNames.clear();
|
||||
getAMBEEngine()->getDeviceRefs(qDeviceNames);
|
||||
swgAMBEDevices->setNbDevices((int) qDeviceNames.size());
|
||||
QList<SWGSDRangel::SWGAMBEDevice*> *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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
|
||||
public:
|
||||
QList<QString>& getAvailableDevices() { return m_availableDevices; }
|
||||
QList<QString>& getUsedDevices() { return m_usedDevices; }
|
||||
QList<AMBEEngine::DeviceRef>& getUsedDevices() { return m_usedDevices; }
|
||||
|
||||
static MsgReportDevices* create() {
|
||||
return new MsgReportDevices();
|
||||
@ -70,7 +70,7 @@ public:
|
||||
|
||||
private:
|
||||
QList<QString> m_availableDevices;
|
||||
QList<QString> m_usedDevices;
|
||||
QList<AMBEEngine::DeviceRef> m_usedDevices;
|
||||
|
||||
MsgReportDevices() :
|
||||
Message()
|
||||
|
@ -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<QString>& deviceNames)
|
||||
void AMBEEngine::getDeviceRefs(QList<DeviceRef>& deviceRefs)
|
||||
{
|
||||
std::vector<AMBEController>::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;
|
||||
}
|
||||
}
|
||||
|
@ -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<QString>& devicesRefs); //!< reference of the devices used (device path or url)
|
||||
void getDeviceRefs(QList<DeviceRef>& 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
|
||||
|
@ -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<QString> inUseDevices;
|
||||
QList<AMBEEngine::DeviceRef> 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();
|
||||
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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_
|
||||
|
@ -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:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2022-05-24T23:13:14.725+02:00
|
||||
Generated 2022-05-25T12:47:57.273+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2022-05-24T23:13:14.725+02:00
|
||||
Generated 2022-05-25T12:47:57.273+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
156
swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.cpp
Normal file
156
swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.cpp
Normal file
@ -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 <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
71
swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.h
Normal file
71
swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.h
Normal file
@ -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 <QJsonObject>
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
||||
#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_ */
|
@ -42,7 +42,7 @@ void
|
||||
SWGAMBEReport::init() {
|
||||
serial = new SWGDVSerialDevices();
|
||||
m_serial_isSet = false;
|
||||
devices = new SWGAMBEDevices();
|
||||
devices = new QList<SWGAMBEDeviceReport*>();
|
||||
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<void*>*)devices, obj, "devices", "SWGAMBEDeviceReport");
|
||||
}
|
||||
|
||||
return obj;
|
||||
@ -107,12 +111,12 @@ SWGAMBEReport::setSerial(SWGDVSerialDevices* serial) {
|
||||
this->m_serial_isSet = true;
|
||||
}
|
||||
|
||||
SWGAMBEDevices*
|
||||
QList<SWGAMBEDeviceReport*>*
|
||||
SWGAMBEReport::getDevices() {
|
||||
return devices;
|
||||
}
|
||||
void
|
||||
SWGAMBEReport::setDevices(SWGAMBEDevices* devices) {
|
||||
SWGAMBEReport::setDevices(QList<SWGAMBEDeviceReport*>* 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);
|
||||
|
@ -22,8 +22,9 @@
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "SWGAMBEDevices.h"
|
||||
#include "SWGAMBEDeviceReport.h"
|
||||
#include "SWGDVSerialDevices.h"
|
||||
#include <QList>
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
@ -46,8 +47,8 @@ public:
|
||||
SWGDVSerialDevices* getSerial();
|
||||
void setSerial(SWGDVSerialDevices* serial);
|
||||
|
||||
SWGAMBEDevices* getDevices();
|
||||
void setDevices(SWGAMBEDevices* devices);
|
||||
QList<SWGAMBEDeviceReport*>* getDevices();
|
||||
void setDevices(QList<SWGAMBEDeviceReport*>* devices);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
@ -56,7 +57,7 @@ private:
|
||||
SWGDVSerialDevices* serial;
|
||||
bool m_serial_isSet;
|
||||
|
||||
SWGAMBEDevices* devices;
|
||||
QList<SWGAMBEDeviceReport*>* devices;
|
||||
bool m_devices_isSet;
|
||||
|
||||
};
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user