mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-10 18:43:28 -05:00
Update FreqScanner swagger files
This commit is contained in:
parent
4837d3aba3
commit
092efb3780
@ -3598,6 +3598,9 @@ margin-bottom: 20px;
|
||||
"FileSourceActions" : {
|
||||
"$ref" : "#/definitions/FileSourceActions"
|
||||
},
|
||||
"FreqScannerActions" : {
|
||||
"$ref" : "#/definitions/FreqScannerActions"
|
||||
},
|
||||
"IEEE_802_15_4_ModActions" : {
|
||||
"$ref" : "#/definitions/IEEE_802_15_4_ModActions"
|
||||
},
|
||||
@ -7221,6 +7224,28 @@ margin-bottom: 20px;
|
||||
}
|
||||
},
|
||||
"description" : "FreeDVMod"
|
||||
};
|
||||
defs.FreqScannerActions = {
|
||||
"properties" : {
|
||||
"run" : {
|
||||
"type" : "integer",
|
||||
"description" : "Set the plugin running state\n * 0 - idle\n * 1 - run\n"
|
||||
}
|
||||
},
|
||||
"description" : "Frequency Scanner actions"
|
||||
};
|
||||
defs.FreqScannerChannelState = {
|
||||
"properties" : {
|
||||
"frequency" : {
|
||||
"type" : "integer",
|
||||
"description" : "Channel centre frequency in Hz"
|
||||
},
|
||||
"power" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "Channel power in dB"
|
||||
}
|
||||
}
|
||||
};
|
||||
defs.FreqScannerFrequency = {
|
||||
"properties" : {
|
||||
@ -7252,6 +7277,12 @@ margin-bottom: 20px;
|
||||
"properties" : {
|
||||
"channelSampleRate" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"channelState" : {
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"$ref" : "#/definitions/FreqScannerChannelState"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description" : "FreqScanner"
|
||||
@ -59084,7 +59115,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2024-06-18T10:11:11.522+02:00
|
||||
Generated 2024-06-21T10:02:32.986+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,6 +25,8 @@ ChannelActions:
|
||||
$ref: "/doc/swagger/include/FileSink.yaml#/FileSinkActions"
|
||||
FileSourceActions:
|
||||
$ref: "/doc/swagger/include/FileSource.yaml#/FileSourceActions"
|
||||
FreqScannerActions:
|
||||
$ref: "/doc/swagger/include/FreqScanner.yaml#/FreqScannerActions"
|
||||
IEEE_802_15_4_ModActions:
|
||||
$ref: "/doc/swagger/include/IEEE_802_15_4_Mod.yaml#/IEEE_802_15_4_ModActions"
|
||||
PacketModActions:
|
||||
|
@ -59,6 +59,20 @@ FreqScannerReport:
|
||||
properties:
|
||||
channelSampleRate:
|
||||
type: integer
|
||||
channelState:
|
||||
type: array
|
||||
items:
|
||||
$ref: "/doc/swagger/include/FreqScanner.yaml#/FreqScannerChannelState"
|
||||
|
||||
FreqScannerChannelState:
|
||||
properties:
|
||||
frequency:
|
||||
description: "Channel centre frequency in Hz"
|
||||
type: integer
|
||||
power:
|
||||
description: "Channel power in dB"
|
||||
type: number
|
||||
format: float
|
||||
|
||||
FreqScannerFrequency:
|
||||
properties:
|
||||
@ -77,3 +91,13 @@ FreqScannerFrequency:
|
||||
type: string
|
||||
squelch:
|
||||
type: string
|
||||
|
||||
FreqScannerActions:
|
||||
description: "Frequency Scanner actions"
|
||||
properties:
|
||||
run:
|
||||
type: integer
|
||||
description: >
|
||||
Set the plugin running state
|
||||
* 0 - idle
|
||||
* 1 - run
|
||||
|
@ -25,6 +25,8 @@ ChannelActions:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FileSink.yaml#/FileSinkActions"
|
||||
FileSourceActions:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FileSource.yaml#/FileSourceActions"
|
||||
FreqScannerActions:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FreqScanner.yaml#/FreqScannerActions"
|
||||
IEEE_802_15_4_ModActions:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/IEEE_802_15_4_Mod.yaml#/IEEE_802_15_4_ModActions"
|
||||
PacketModActions:
|
||||
|
@ -59,6 +59,20 @@ FreqScannerReport:
|
||||
properties:
|
||||
channelSampleRate:
|
||||
type: integer
|
||||
channelState:
|
||||
type: array
|
||||
items:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FreqScanner.yaml#/FreqScannerChannelState"
|
||||
|
||||
FreqScannerChannelState:
|
||||
properties:
|
||||
frequency:
|
||||
description: "Channel centre frequency in Hz"
|
||||
type: integer
|
||||
power:
|
||||
description: "Channel power in dB"
|
||||
type: number
|
||||
format: float
|
||||
|
||||
FreqScannerFrequency:
|
||||
properties:
|
||||
@ -77,3 +91,13 @@ FreqScannerFrequency:
|
||||
type: string
|
||||
squelch:
|
||||
type: string
|
||||
|
||||
FreqScannerActions:
|
||||
description: "Frequency Scanner actions"
|
||||
properties:
|
||||
run:
|
||||
type: integer
|
||||
description: >
|
||||
Set the plugin running state
|
||||
* 0 - idle
|
||||
* 1 - run
|
||||
|
@ -3598,6 +3598,9 @@ margin-bottom: 20px;
|
||||
"FileSourceActions" : {
|
||||
"$ref" : "#/definitions/FileSourceActions"
|
||||
},
|
||||
"FreqScannerActions" : {
|
||||
"$ref" : "#/definitions/FreqScannerActions"
|
||||
},
|
||||
"IEEE_802_15_4_ModActions" : {
|
||||
"$ref" : "#/definitions/IEEE_802_15_4_ModActions"
|
||||
},
|
||||
@ -7221,6 +7224,28 @@ margin-bottom: 20px;
|
||||
}
|
||||
},
|
||||
"description" : "FreeDVMod"
|
||||
};
|
||||
defs.FreqScannerActions = {
|
||||
"properties" : {
|
||||
"run" : {
|
||||
"type" : "integer",
|
||||
"description" : "Set the plugin running state\n * 0 - idle\n * 1 - run\n"
|
||||
}
|
||||
},
|
||||
"description" : "Frequency Scanner actions"
|
||||
};
|
||||
defs.FreqScannerChannelState = {
|
||||
"properties" : {
|
||||
"frequency" : {
|
||||
"type" : "integer",
|
||||
"description" : "Channel centre frequency in Hz"
|
||||
},
|
||||
"power" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "Channel power in dB"
|
||||
}
|
||||
}
|
||||
};
|
||||
defs.FreqScannerFrequency = {
|
||||
"properties" : {
|
||||
@ -7252,6 +7277,12 @@ margin-bottom: 20px;
|
||||
"properties" : {
|
||||
"channelSampleRate" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"channelState" : {
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"$ref" : "#/definitions/FreqScannerChannelState"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description" : "FreqScanner"
|
||||
@ -59084,7 +59115,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2024-06-18T10:11:11.522+02:00
|
||||
Generated 2024-06-21T10:02:32.986+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -44,6 +44,8 @@ SWGChannelActions::SWGChannelActions() {
|
||||
m_file_sink_actions_isSet = false;
|
||||
file_source_actions = nullptr;
|
||||
m_file_source_actions_isSet = false;
|
||||
freq_scanner_actions = nullptr;
|
||||
m_freq_scanner_actions_isSet = false;
|
||||
ieee_802_15_4_mod_actions = nullptr;
|
||||
m_ieee_802_15_4_mod_actions_isSet = false;
|
||||
packet_mod_actions = nullptr;
|
||||
@ -80,6 +82,8 @@ SWGChannelActions::init() {
|
||||
m_file_sink_actions_isSet = false;
|
||||
file_source_actions = new SWGFileSourceActions();
|
||||
m_file_source_actions_isSet = false;
|
||||
freq_scanner_actions = new SWGFreqScannerActions();
|
||||
m_freq_scanner_actions_isSet = false;
|
||||
ieee_802_15_4_mod_actions = new SWGIEEE_802_15_4_ModActions();
|
||||
m_ieee_802_15_4_mod_actions_isSet = false;
|
||||
packet_mod_actions = new SWGPacketModActions();
|
||||
@ -114,6 +118,9 @@ SWGChannelActions::cleanup() {
|
||||
if(file_source_actions != nullptr) {
|
||||
delete file_source_actions;
|
||||
}
|
||||
if(freq_scanner_actions != nullptr) {
|
||||
delete freq_scanner_actions;
|
||||
}
|
||||
if(ieee_802_15_4_mod_actions != nullptr) {
|
||||
delete ieee_802_15_4_mod_actions;
|
||||
}
|
||||
@ -161,6 +168,8 @@ SWGChannelActions::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&file_source_actions, pJson["FileSourceActions"], "SWGFileSourceActions", "SWGFileSourceActions");
|
||||
|
||||
::SWGSDRangel::setValue(&freq_scanner_actions, pJson["FreqScannerActions"], "SWGFreqScannerActions", "SWGFreqScannerActions");
|
||||
|
||||
::SWGSDRangel::setValue(&ieee_802_15_4_mod_actions, pJson["IEEE_802_15_4_ModActions"], "SWGIEEE_802_15_4_ModActions", "SWGIEEE_802_15_4_ModActions");
|
||||
|
||||
::SWGSDRangel::setValue(&packet_mod_actions, pJson["PacketModActions"], "SWGPacketModActions", "SWGPacketModActions");
|
||||
@ -213,6 +222,9 @@ SWGChannelActions::asJsonObject() {
|
||||
if((file_source_actions != nullptr) && (file_source_actions->isSet())){
|
||||
toJsonValue(QString("FileSourceActions"), file_source_actions, obj, QString("SWGFileSourceActions"));
|
||||
}
|
||||
if((freq_scanner_actions != nullptr) && (freq_scanner_actions->isSet())){
|
||||
toJsonValue(QString("FreqScannerActions"), freq_scanner_actions, obj, QString("SWGFreqScannerActions"));
|
||||
}
|
||||
if((ieee_802_15_4_mod_actions != nullptr) && (ieee_802_15_4_mod_actions->isSet())){
|
||||
toJsonValue(QString("IEEE_802_15_4_ModActions"), ieee_802_15_4_mod_actions, obj, QString("SWGIEEE_802_15_4_ModActions"));
|
||||
}
|
||||
@ -315,6 +327,16 @@ SWGChannelActions::setFileSourceActions(SWGFileSourceActions* file_source_action
|
||||
this->m_file_source_actions_isSet = true;
|
||||
}
|
||||
|
||||
SWGFreqScannerActions*
|
||||
SWGChannelActions::getFreqScannerActions() {
|
||||
return freq_scanner_actions;
|
||||
}
|
||||
void
|
||||
SWGChannelActions::setFreqScannerActions(SWGFreqScannerActions* freq_scanner_actions) {
|
||||
this->freq_scanner_actions = freq_scanner_actions;
|
||||
this->m_freq_scanner_actions_isSet = true;
|
||||
}
|
||||
|
||||
SWGIEEE_802_15_4_ModActions*
|
||||
SWGChannelActions::getIeee802154ModActions() {
|
||||
return ieee_802_15_4_mod_actions;
|
||||
@ -404,6 +426,9 @@ SWGChannelActions::isSet(){
|
||||
if(file_source_actions && file_source_actions->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(freq_scanner_actions && freq_scanner_actions->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(ieee_802_15_4_mod_actions && ieee_802_15_4_mod_actions->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "SWGAPTDemodActions.h"
|
||||
#include "SWGFileSinkActions.h"
|
||||
#include "SWGFileSourceActions.h"
|
||||
#include "SWGFreqScannerActions.h"
|
||||
#include "SWGIEEE_802_15_4_ModActions.h"
|
||||
#include "SWGPSK31ModActions.h"
|
||||
#include "SWGPacketModActions.h"
|
||||
@ -76,6 +77,9 @@ public:
|
||||
SWGFileSourceActions* getFileSourceActions();
|
||||
void setFileSourceActions(SWGFileSourceActions* file_source_actions);
|
||||
|
||||
SWGFreqScannerActions* getFreqScannerActions();
|
||||
void setFreqScannerActions(SWGFreqScannerActions* freq_scanner_actions);
|
||||
|
||||
SWGIEEE_802_15_4_ModActions* getIeee802154ModActions();
|
||||
void setIeee802154ModActions(SWGIEEE_802_15_4_ModActions* ieee_802_15_4_mod_actions);
|
||||
|
||||
@ -122,6 +126,9 @@ private:
|
||||
SWGFileSourceActions* file_source_actions;
|
||||
bool m_file_source_actions_isSet;
|
||||
|
||||
SWGFreqScannerActions* freq_scanner_actions;
|
||||
bool m_freq_scanner_actions_isSet;
|
||||
|
||||
SWGIEEE_802_15_4_ModActions* ieee_802_15_4_mod_actions;
|
||||
bool m_ieee_802_15_4_mod_actions_isSet;
|
||||
|
||||
|
108
swagger/sdrangel/code/qt5/client/SWGFreqScannerActions.cpp
Normal file
108
swagger/sdrangel/code/qt5/client/SWGFreqScannerActions.cpp
Normal file
@ -0,0 +1,108 @@
|
||||
/**
|
||||
* 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 "SWGFreqScannerActions.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGFreqScannerActions::SWGFreqScannerActions(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGFreqScannerActions::SWGFreqScannerActions() {
|
||||
run = 0;
|
||||
m_run_isSet = false;
|
||||
}
|
||||
|
||||
SWGFreqScannerActions::~SWGFreqScannerActions() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerActions::init() {
|
||||
run = 0;
|
||||
m_run_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerActions::cleanup() {
|
||||
|
||||
}
|
||||
|
||||
SWGFreqScannerActions*
|
||||
SWGFreqScannerActions::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerActions::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&run, pJson["run"], "qint32", "");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
SWGFreqScannerActions::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGFreqScannerActions::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_run_isSet){
|
||||
obj->insert("run", QJsonValue(run));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerActions::getRun() {
|
||||
return run;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerActions::setRun(qint32 run) {
|
||||
this->run = run;
|
||||
this->m_run_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGFreqScannerActions::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_run_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
}
|
||||
|
58
swagger/sdrangel/code/qt5/client/SWGFreqScannerActions.h
Normal file
58
swagger/sdrangel/code/qt5/client/SWGFreqScannerActions.h
Normal file
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGFreqScannerActions.h
|
||||
*
|
||||
* Frequency Scanner actions
|
||||
*/
|
||||
|
||||
#ifndef SWGFreqScannerActions_H_
|
||||
#define SWGFreqScannerActions_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWG_API SWGFreqScannerActions: public SWGObject {
|
||||
public:
|
||||
SWGFreqScannerActions();
|
||||
SWGFreqScannerActions(QString* json);
|
||||
virtual ~SWGFreqScannerActions();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
virtual QString asJson () override;
|
||||
virtual QJsonObject* asJsonObject() override;
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGFreqScannerActions* fromJson(QString &jsonString) override;
|
||||
|
||||
qint32 getRun();
|
||||
void setRun(qint32 run);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
qint32 run;
|
||||
bool m_run_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGFreqScannerActions_H_ */
|
131
swagger/sdrangel/code/qt5/client/SWGFreqScannerChannelState.cpp
Normal file
131
swagger/sdrangel/code/qt5/client/SWGFreqScannerChannelState.cpp
Normal file
@ -0,0 +1,131 @@
|
||||
/**
|
||||
* 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 "SWGFreqScannerChannelState.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGFreqScannerChannelState::SWGFreqScannerChannelState(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGFreqScannerChannelState::SWGFreqScannerChannelState() {
|
||||
frequency = 0;
|
||||
m_frequency_isSet = false;
|
||||
power = 0.0f;
|
||||
m_power_isSet = false;
|
||||
}
|
||||
|
||||
SWGFreqScannerChannelState::~SWGFreqScannerChannelState() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerChannelState::init() {
|
||||
frequency = 0;
|
||||
m_frequency_isSet = false;
|
||||
power = 0.0f;
|
||||
m_power_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerChannelState::cleanup() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGFreqScannerChannelState*
|
||||
SWGFreqScannerChannelState::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerChannelState::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&frequency, pJson["frequency"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&power, pJson["power"], "float", "");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
SWGFreqScannerChannelState::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGFreqScannerChannelState::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_frequency_isSet){
|
||||
obj->insert("frequency", QJsonValue(frequency));
|
||||
}
|
||||
if(m_power_isSet){
|
||||
obj->insert("power", QJsonValue(power));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerChannelState::getFrequency() {
|
||||
return frequency;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerChannelState::setFrequency(qint32 frequency) {
|
||||
this->frequency = frequency;
|
||||
this->m_frequency_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGFreqScannerChannelState::getPower() {
|
||||
return power;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerChannelState::setPower(float power) {
|
||||
this->power = power;
|
||||
this->m_power_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGFreqScannerChannelState::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_frequency_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_power_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGFreqScannerChannelState.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SWGFreqScannerChannelState_H_
|
||||
#define SWGFreqScannerChannelState_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWG_API SWGFreqScannerChannelState: public SWGObject {
|
||||
public:
|
||||
SWGFreqScannerChannelState();
|
||||
SWGFreqScannerChannelState(QString* json);
|
||||
virtual ~SWGFreqScannerChannelState();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
virtual QString asJson () override;
|
||||
virtual QJsonObject* asJsonObject() override;
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGFreqScannerChannelState* fromJson(QString &jsonString) override;
|
||||
|
||||
qint32 getFrequency();
|
||||
void setFrequency(qint32 frequency);
|
||||
|
||||
float getPower();
|
||||
void setPower(float power);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
qint32 frequency;
|
||||
bool m_frequency_isSet;
|
||||
|
||||
float power;
|
||||
bool m_power_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGFreqScannerChannelState_H_ */
|
@ -30,6 +30,8 @@ SWGFreqScannerReport::SWGFreqScannerReport(QString* json) {
|
||||
SWGFreqScannerReport::SWGFreqScannerReport() {
|
||||
channel_sample_rate = 0;
|
||||
m_channel_sample_rate_isSet = false;
|
||||
channel_state = nullptr;
|
||||
m_channel_state_isSet = false;
|
||||
}
|
||||
|
||||
SWGFreqScannerReport::~SWGFreqScannerReport() {
|
||||
@ -40,11 +42,20 @@ void
|
||||
SWGFreqScannerReport::init() {
|
||||
channel_sample_rate = 0;
|
||||
m_channel_sample_rate_isSet = false;
|
||||
channel_state = new QList<SWGFreqScannerChannelState*>();
|
||||
m_channel_state_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerReport::cleanup() {
|
||||
|
||||
if(channel_state != nullptr) {
|
||||
auto arr = channel_state;
|
||||
for(auto o: *arr) {
|
||||
delete o;
|
||||
}
|
||||
delete channel_state;
|
||||
}
|
||||
}
|
||||
|
||||
SWGFreqScannerReport*
|
||||
@ -60,6 +71,8 @@ void
|
||||
SWGFreqScannerReport::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
|
||||
|
||||
|
||||
::SWGSDRangel::setValue(&channel_state, pJson["channelState"], "QList", "SWGFreqScannerChannelState");
|
||||
}
|
||||
|
||||
QString
|
||||
@ -79,6 +92,9 @@ SWGFreqScannerReport::asJsonObject() {
|
||||
if(m_channel_sample_rate_isSet){
|
||||
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
|
||||
}
|
||||
if(channel_state && channel_state->size() > 0){
|
||||
toJsonArray((QList<void*>*)channel_state, obj, "channelState", "SWGFreqScannerChannelState");
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
@ -93,6 +109,16 @@ SWGFreqScannerReport::setChannelSampleRate(qint32 channel_sample_rate) {
|
||||
this->m_channel_sample_rate_isSet = true;
|
||||
}
|
||||
|
||||
QList<SWGFreqScannerChannelState*>*
|
||||
SWGFreqScannerReport::getChannelState() {
|
||||
return channel_state;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerReport::setChannelState(QList<SWGFreqScannerChannelState*>* channel_state) {
|
||||
this->channel_state = channel_state;
|
||||
this->m_channel_state_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGFreqScannerReport::isSet(){
|
||||
@ -101,6 +127,9 @@ SWGFreqScannerReport::isSet(){
|
||||
if(m_channel_sample_rate_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(channel_state && (channel_state->size() > 0)){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "SWGFreqScannerChannelState.h"
|
||||
#include <QList>
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
@ -44,6 +46,9 @@ public:
|
||||
qint32 getChannelSampleRate();
|
||||
void setChannelSampleRate(qint32 channel_sample_rate);
|
||||
|
||||
QList<SWGFreqScannerChannelState*>* getChannelState();
|
||||
void setChannelState(QList<SWGFreqScannerChannelState*>* channel_state);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
@ -51,6 +56,9 @@ private:
|
||||
qint32 channel_sample_rate;
|
||||
bool m_channel_sample_rate_isSet;
|
||||
|
||||
QList<SWGFreqScannerChannelState*>* channel_state;
|
||||
bool m_channel_state_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -157,6 +157,8 @@
|
||||
#include "SWGFreeDVDemodSettings.h"
|
||||
#include "SWGFreeDVModReport.h"
|
||||
#include "SWGFreeDVModSettings.h"
|
||||
#include "SWGFreqScannerActions.h"
|
||||
#include "SWGFreqScannerChannelState.h"
|
||||
#include "SWGFreqScannerFrequency.h"
|
||||
#include "SWGFreqScannerReport.h"
|
||||
#include "SWGFreqScannerSettings.h"
|
||||
@ -1102,6 +1104,16 @@ namespace SWGSDRangel {
|
||||
obj->init();
|
||||
return obj;
|
||||
}
|
||||
if(QString("SWGFreqScannerActions").compare(type) == 0) {
|
||||
SWGFreqScannerActions *obj = new SWGFreqScannerActions();
|
||||
obj->init();
|
||||
return obj;
|
||||
}
|
||||
if(QString("SWGFreqScannerChannelState").compare(type) == 0) {
|
||||
SWGFreqScannerChannelState *obj = new SWGFreqScannerChannelState();
|
||||
obj->init();
|
||||
return obj;
|
||||
}
|
||||
if(QString("SWGFreqScannerFrequency").compare(type) == 0) {
|
||||
SWGFreqScannerFrequency *obj = new SWGFreqScannerFrequency();
|
||||
obj->init();
|
||||
|
Loading…
Reference in New Issue
Block a user