mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-08 20:38:39 -05:00
SDRplay V3: added device type in API report
This commit is contained in:
parent
786d753ec9
commit
0ec7ec414d
@ -937,6 +937,28 @@ void SDRPlayV3Input::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& resp
|
|||||||
response.getSdrPlayV3Report()->getBandwidths()->append(new SWGSDRangel::SWGBandwidth);
|
response.getSdrPlayV3Report()->getBandwidths()->append(new SWGSDRangel::SWGBandwidth);
|
||||||
response.getSdrPlayV3Report()->getBandwidths()->back()->setBandwidth(SDRPlayV3Bandwidths::getBandwidth(i));
|
response.getSdrPlayV3Report()->getBandwidths()->back()->setBandwidth(SDRPlayV3Bandwidths::getBandwidth(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch(getDeviceId())
|
||||||
|
{
|
||||||
|
case SDRPLAY_RSP1_ID:
|
||||||
|
response.getSdrPlayV3Report()->setDeviceType(new QString("RSP1"));
|
||||||
|
break;
|
||||||
|
case SDRPLAY_RSP1A_ID:
|
||||||
|
response.getSdrPlayV3Report()->setDeviceType(new QString("RSP1A"));
|
||||||
|
break;
|
||||||
|
case SDRPLAY_RSP2_ID:
|
||||||
|
response.getSdrPlayV3Report()->setDeviceType(new QString("RSP2"));
|
||||||
|
break;
|
||||||
|
case SDRPLAY_RSPduo_ID:
|
||||||
|
response.getSdrPlayV3Report()->setDeviceType(new QString("RSPduo"));
|
||||||
|
break;
|
||||||
|
case SDRPLAY_RSPdx_ID:
|
||||||
|
response.getSdrPlayV3Report()->setDeviceType(new QString("RSPdx"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
response.getSdrPlayV3Report()->setDeviceType(new QString("Unknown"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDRPlayV3Input::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const SDRPlayV3Settings& settings, bool force)
|
void SDRPlayV3Input::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const SDRPlayV3Settings& settings, bool force)
|
||||||
|
@ -9495,6 +9495,10 @@ margin-bottom: 20px;
|
|||||||
};
|
};
|
||||||
defs.SDRPlayV3Report = {
|
defs.SDRPlayV3Report = {
|
||||||
"properties" : {
|
"properties" : {
|
||||||
|
"deviceType" : {
|
||||||
|
"type" : "string",
|
||||||
|
"description" : "SDRplay device type. Can be RSP1, RSP1A, RSP2, RSPduo, RSPdx, Unknown"
|
||||||
|
},
|
||||||
"bandwidths" : {
|
"bandwidths" : {
|
||||||
"type" : "array",
|
"type" : "array",
|
||||||
"items" : {
|
"items" : {
|
||||||
@ -47724,7 +47728,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2021-08-21T12:00:48.492+02:00
|
Generated 2021-08-25T15:15:18.832+02:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,6 +51,9 @@ SDRPlayV3Settings:
|
|||||||
SDRPlayV3Report:
|
SDRPlayV3Report:
|
||||||
description: SDRplayV3
|
description: SDRplayV3
|
||||||
properties:
|
properties:
|
||||||
|
deviceType:
|
||||||
|
type: string
|
||||||
|
description: SDRplay device type. Can be RSP1, RSP1A, RSP2, RSPduo, RSPdx, Unknown
|
||||||
bandwidths:
|
bandwidths:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
|
@ -51,6 +51,9 @@ SDRPlayV3Settings:
|
|||||||
SDRPlayV3Report:
|
SDRPlayV3Report:
|
||||||
description: SDRplayV3
|
description: SDRplayV3
|
||||||
properties:
|
properties:
|
||||||
|
deviceType:
|
||||||
|
type: string
|
||||||
|
description: SDRplay device type. Can be RSP1, RSP1A, RSP2, RSPduo, RSPdx, Unknown
|
||||||
bandwidths:
|
bandwidths:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
|
@ -9495,6 +9495,10 @@ margin-bottom: 20px;
|
|||||||
};
|
};
|
||||||
defs.SDRPlayV3Report = {
|
defs.SDRPlayV3Report = {
|
||||||
"properties" : {
|
"properties" : {
|
||||||
|
"deviceType" : {
|
||||||
|
"type" : "string",
|
||||||
|
"description" : "SDRplay device type. Can be RSP1, RSP1A, RSP2, RSPduo, RSPdx, Unknown"
|
||||||
|
},
|
||||||
"bandwidths" : {
|
"bandwidths" : {
|
||||||
"type" : "array",
|
"type" : "array",
|
||||||
"items" : {
|
"items" : {
|
||||||
@ -47724,7 +47728,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2021-08-21T12:00:48.492+02:00
|
Generated 2021-08-25T15:15:18.832+02:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -28,6 +28,8 @@ SWGSDRPlayV3Report::SWGSDRPlayV3Report(QString* json) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SWGSDRPlayV3Report::SWGSDRPlayV3Report() {
|
SWGSDRPlayV3Report::SWGSDRPlayV3Report() {
|
||||||
|
device_type = nullptr;
|
||||||
|
m_device_type_isSet = false;
|
||||||
bandwidths = nullptr;
|
bandwidths = nullptr;
|
||||||
m_bandwidths_isSet = false;
|
m_bandwidths_isSet = false;
|
||||||
intermediate_frequencies = nullptr;
|
intermediate_frequencies = nullptr;
|
||||||
@ -40,6 +42,8 @@ SWGSDRPlayV3Report::~SWGSDRPlayV3Report() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
SWGSDRPlayV3Report::init() {
|
SWGSDRPlayV3Report::init() {
|
||||||
|
device_type = new QString("");
|
||||||
|
m_device_type_isSet = false;
|
||||||
bandwidths = new QList<SWGBandwidth*>();
|
bandwidths = new QList<SWGBandwidth*>();
|
||||||
m_bandwidths_isSet = false;
|
m_bandwidths_isSet = false;
|
||||||
intermediate_frequencies = new QList<SWGFrequency*>();
|
intermediate_frequencies = new QList<SWGFrequency*>();
|
||||||
@ -48,6 +52,9 @@ SWGSDRPlayV3Report::init() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
SWGSDRPlayV3Report::cleanup() {
|
SWGSDRPlayV3Report::cleanup() {
|
||||||
|
if(device_type != nullptr) {
|
||||||
|
delete device_type;
|
||||||
|
}
|
||||||
if(bandwidths != nullptr) {
|
if(bandwidths != nullptr) {
|
||||||
auto arr = bandwidths;
|
auto arr = bandwidths;
|
||||||
for(auto o: *arr) {
|
for(auto o: *arr) {
|
||||||
@ -75,6 +82,8 @@ SWGSDRPlayV3Report::fromJson(QString &json) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
SWGSDRPlayV3Report::fromJsonObject(QJsonObject &pJson) {
|
SWGSDRPlayV3Report::fromJsonObject(QJsonObject &pJson) {
|
||||||
|
::SWGSDRangel::setValue(&device_type, pJson["deviceType"], "QString", "QString");
|
||||||
|
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&bandwidths, pJson["bandwidths"], "QList", "SWGBandwidth");
|
::SWGSDRangel::setValue(&bandwidths, pJson["bandwidths"], "QList", "SWGBandwidth");
|
||||||
|
|
||||||
@ -95,6 +104,9 @@ SWGSDRPlayV3Report::asJson ()
|
|||||||
QJsonObject*
|
QJsonObject*
|
||||||
SWGSDRPlayV3Report::asJsonObject() {
|
SWGSDRPlayV3Report::asJsonObject() {
|
||||||
QJsonObject* obj = new QJsonObject();
|
QJsonObject* obj = new QJsonObject();
|
||||||
|
if(device_type != nullptr && *device_type != QString("")){
|
||||||
|
toJsonValue(QString("deviceType"), device_type, obj, QString("QString"));
|
||||||
|
}
|
||||||
if(bandwidths && bandwidths->size() > 0){
|
if(bandwidths && bandwidths->size() > 0){
|
||||||
toJsonArray((QList<void*>*)bandwidths, obj, "bandwidths", "SWGBandwidth");
|
toJsonArray((QList<void*>*)bandwidths, obj, "bandwidths", "SWGBandwidth");
|
||||||
}
|
}
|
||||||
@ -105,6 +117,16 @@ SWGSDRPlayV3Report::asJsonObject() {
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString*
|
||||||
|
SWGSDRPlayV3Report::getDeviceType() {
|
||||||
|
return device_type;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGSDRPlayV3Report::setDeviceType(QString* device_type) {
|
||||||
|
this->device_type = device_type;
|
||||||
|
this->m_device_type_isSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
QList<SWGBandwidth*>*
|
QList<SWGBandwidth*>*
|
||||||
SWGSDRPlayV3Report::getBandwidths() {
|
SWGSDRPlayV3Report::getBandwidths() {
|
||||||
return bandwidths;
|
return bandwidths;
|
||||||
@ -130,6 +152,9 @@ bool
|
|||||||
SWGSDRPlayV3Report::isSet(){
|
SWGSDRPlayV3Report::isSet(){
|
||||||
bool isObjectUpdated = false;
|
bool isObjectUpdated = false;
|
||||||
do{
|
do{
|
||||||
|
if(device_type && *device_type != QString("")){
|
||||||
|
isObjectUpdated = true; break;
|
||||||
|
}
|
||||||
if(bandwidths && (bandwidths->size() > 0)){
|
if(bandwidths && (bandwidths->size() > 0)){
|
||||||
isObjectUpdated = true; break;
|
isObjectUpdated = true; break;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "SWGBandwidth.h"
|
#include "SWGBandwidth.h"
|
||||||
#include "SWGFrequency.h"
|
#include "SWGFrequency.h"
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
#include "SWGObject.h"
|
#include "SWGObject.h"
|
||||||
#include "export.h"
|
#include "export.h"
|
||||||
@ -44,6 +45,9 @@ public:
|
|||||||
virtual void fromJsonObject(QJsonObject &json) override;
|
virtual void fromJsonObject(QJsonObject &json) override;
|
||||||
virtual SWGSDRPlayV3Report* fromJson(QString &jsonString) override;
|
virtual SWGSDRPlayV3Report* fromJson(QString &jsonString) override;
|
||||||
|
|
||||||
|
QString* getDeviceType();
|
||||||
|
void setDeviceType(QString* device_type);
|
||||||
|
|
||||||
QList<SWGBandwidth*>* getBandwidths();
|
QList<SWGBandwidth*>* getBandwidths();
|
||||||
void setBandwidths(QList<SWGBandwidth*>* bandwidths);
|
void setBandwidths(QList<SWGBandwidth*>* bandwidths);
|
||||||
|
|
||||||
@ -54,6 +58,9 @@ public:
|
|||||||
virtual bool isSet() override;
|
virtual bool isSet() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QString* device_type;
|
||||||
|
bool m_device_type_isSet;
|
||||||
|
|
||||||
QList<SWGBandwidth*>* bandwidths;
|
QList<SWGBandwidth*>* bandwidths;
|
||||||
bool m_bandwidths_isSet;
|
bool m_bandwidths_isSet;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user