1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

REST API device and channel actions: added missing parts of generated code

This commit is contained in:
f4exb 2020-03-10 08:36:15 +01:00
parent 07c11edb87
commit 3e47aefd13
12 changed files with 1125 additions and 0 deletions

View File

@ -0,0 +1,21 @@
ChannelActions:
description: Base channel actions. Only the channel actions corresponding to the channel specified in the channelType field is or should be present.
discriminator: channelType
required:
- channelType
- direction
properties:
channelType:
description: Channel type code
type: string
direction:
description: 0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)
type: integer
originatorDeviceSetIndex:
description: Optional for reverse API. This is the device set index from where the message comes from.
type: integer
originatorChannelIndex:
description: Optional for reverse API. This is the channel index from where the message comes from.
type: integer
FileSourceActions:
$ref: "/doc/swagger/include/FileSource.yaml#/FileSourceActions"

View File

@ -0,0 +1,18 @@
DeviceActions:
description: Base device actions. Only the device actions corresponding to the device specified in the deviceHwType field is or should be present.
discriminator: deviceHwType
required:
- deviceHwType
- direction
properties:
deviceHwType:
description: Device hardware type code
type: string
direction:
description: 0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)
type: integer
originatorIndex:
description: Optional for reverse API. This is the device set index from where the message comes from.
type: integer
rtlSdrActions:
$ref: "/doc/swagger/include/RtlSdr.yaml#/RtlSdrActions"

View File

@ -0,0 +1,204 @@
/**
* 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: 4.13.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 "SWGChannelActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGChannelActions::SWGChannelActions(QString* json) {
init();
this->fromJson(*json);
}
SWGChannelActions::SWGChannelActions() {
channel_type = nullptr;
m_channel_type_isSet = false;
direction = 0;
m_direction_isSet = false;
originator_device_set_index = 0;
m_originator_device_set_index_isSet = false;
originator_channel_index = 0;
m_originator_channel_index_isSet = false;
file_source_actions = nullptr;
m_file_source_actions_isSet = false;
}
SWGChannelActions::~SWGChannelActions() {
this->cleanup();
}
void
SWGChannelActions::init() {
channel_type = new QString("");
m_channel_type_isSet = false;
direction = 0;
m_direction_isSet = false;
originator_device_set_index = 0;
m_originator_device_set_index_isSet = false;
originator_channel_index = 0;
m_originator_channel_index_isSet = false;
file_source_actions = new SWGFileSourceActions();
m_file_source_actions_isSet = false;
}
void
SWGChannelActions::cleanup() {
if(channel_type != nullptr) {
delete channel_type;
}
if(file_source_actions != nullptr) {
delete file_source_actions;
}
}
SWGChannelActions*
SWGChannelActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGChannelActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&channel_type, pJson["channelType"], "QString", "QString");
::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", "");
::SWGSDRangel::setValue(&originator_device_set_index, pJson["originatorDeviceSetIndex"], "qint32", "");
::SWGSDRangel::setValue(&originator_channel_index, pJson["originatorChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&file_source_actions, pJson["FileSourceActions"], "SWGFileSourceActions", "SWGFileSourceActions");
}
QString
SWGChannelActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGChannelActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(channel_type != nullptr && *channel_type != QString("")){
toJsonValue(QString("channelType"), channel_type, obj, QString("QString"));
}
if(m_direction_isSet){
obj->insert("direction", QJsonValue(direction));
}
if(m_originator_device_set_index_isSet){
obj->insert("originatorDeviceSetIndex", QJsonValue(originator_device_set_index));
}
if(m_originator_channel_index_isSet){
obj->insert("originatorChannelIndex", QJsonValue(originator_channel_index));
}
if((file_source_actions != nullptr) && (file_source_actions->isSet())){
toJsonValue(QString("FileSourceActions"), file_source_actions, obj, QString("SWGFileSourceActions"));
}
return obj;
}
QString*
SWGChannelActions::getChannelType() {
return channel_type;
}
void
SWGChannelActions::setChannelType(QString* channel_type) {
this->channel_type = channel_type;
this->m_channel_type_isSet = true;
}
qint32
SWGChannelActions::getDirection() {
return direction;
}
void
SWGChannelActions::setDirection(qint32 direction) {
this->direction = direction;
this->m_direction_isSet = true;
}
qint32
SWGChannelActions::getOriginatorDeviceSetIndex() {
return originator_device_set_index;
}
void
SWGChannelActions::setOriginatorDeviceSetIndex(qint32 originator_device_set_index) {
this->originator_device_set_index = originator_device_set_index;
this->m_originator_device_set_index_isSet = true;
}
qint32
SWGChannelActions::getOriginatorChannelIndex() {
return originator_channel_index;
}
void
SWGChannelActions::setOriginatorChannelIndex(qint32 originator_channel_index) {
this->originator_channel_index = originator_channel_index;
this->m_originator_channel_index_isSet = true;
}
SWGFileSourceActions*
SWGChannelActions::getFileSourceActions() {
return file_source_actions;
}
void
SWGChannelActions::setFileSourceActions(SWGFileSourceActions* file_source_actions) {
this->file_source_actions = file_source_actions;
this->m_file_source_actions_isSet = true;
}
bool
SWGChannelActions::isSet(){
bool isObjectUpdated = false;
do{
if(channel_type && *channel_type != QString("")){
isObjectUpdated = true; break;
}
if(m_direction_isSet){
isObjectUpdated = true; break;
}
if(m_originator_device_set_index_isSet){
isObjectUpdated = true; break;
}
if(m_originator_channel_index_isSet){
isObjectUpdated = true; break;
}
if(file_source_actions && file_source_actions->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,84 @@
/**
* 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: 4.13.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.
*/
/*
* SWGChannelActions.h
*
* Base channel actions. Only the channel actions corresponding to the channel specified in the channelType field is or should be present.
*/
#ifndef SWGChannelActions_H_
#define SWGChannelActions_H_
#include <QJsonObject>
#include "SWGFileSourceActions.h"
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGChannelActions: public SWGObject {
public:
SWGChannelActions();
SWGChannelActions(QString* json);
virtual ~SWGChannelActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGChannelActions* fromJson(QString &jsonString) override;
QString* getChannelType();
void setChannelType(QString* channel_type);
qint32 getDirection();
void setDirection(qint32 direction);
qint32 getOriginatorDeviceSetIndex();
void setOriginatorDeviceSetIndex(qint32 originator_device_set_index);
qint32 getOriginatorChannelIndex();
void setOriginatorChannelIndex(qint32 originator_channel_index);
SWGFileSourceActions* getFileSourceActions();
void setFileSourceActions(SWGFileSourceActions* file_source_actions);
virtual bool isSet() override;
private:
QString* channel_type;
bool m_channel_type_isSet;
qint32 direction;
bool m_direction_isSet;
qint32 originator_device_set_index;
bool m_originator_device_set_index_isSet;
qint32 originator_channel_index;
bool m_originator_channel_index_isSet;
SWGFileSourceActions* file_source_actions;
bool m_file_source_actions_isSet;
};
}
#endif /* SWGChannelActions_H_ */

View File

@ -0,0 +1,181 @@
/**
* 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: 4.13.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 "SWGDeviceActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGDeviceActions::SWGDeviceActions(QString* json) {
init();
this->fromJson(*json);
}
SWGDeviceActions::SWGDeviceActions() {
device_hw_type = nullptr;
m_device_hw_type_isSet = false;
direction = 0;
m_direction_isSet = false;
originator_index = 0;
m_originator_index_isSet = false;
rtl_sdr_actions = nullptr;
m_rtl_sdr_actions_isSet = false;
}
SWGDeviceActions::~SWGDeviceActions() {
this->cleanup();
}
void
SWGDeviceActions::init() {
device_hw_type = new QString("");
m_device_hw_type_isSet = false;
direction = 0;
m_direction_isSet = false;
originator_index = 0;
m_originator_index_isSet = false;
rtl_sdr_actions = new SWGRtlSdrActions();
m_rtl_sdr_actions_isSet = false;
}
void
SWGDeviceActions::cleanup() {
if(device_hw_type != nullptr) {
delete device_hw_type;
}
if(rtl_sdr_actions != nullptr) {
delete rtl_sdr_actions;
}
}
SWGDeviceActions*
SWGDeviceActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGDeviceActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&device_hw_type, pJson["deviceHwType"], "QString", "QString");
::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", "");
::SWGSDRangel::setValue(&originator_index, pJson["originatorIndex"], "qint32", "");
::SWGSDRangel::setValue(&rtl_sdr_actions, pJson["rtlSdrActions"], "SWGRtlSdrActions", "SWGRtlSdrActions");
}
QString
SWGDeviceActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGDeviceActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(device_hw_type != nullptr && *device_hw_type != QString("")){
toJsonValue(QString("deviceHwType"), device_hw_type, obj, QString("QString"));
}
if(m_direction_isSet){
obj->insert("direction", QJsonValue(direction));
}
if(m_originator_index_isSet){
obj->insert("originatorIndex", QJsonValue(originator_index));
}
if((rtl_sdr_actions != nullptr) && (rtl_sdr_actions->isSet())){
toJsonValue(QString("rtlSdrActions"), rtl_sdr_actions, obj, QString("SWGRtlSdrActions"));
}
return obj;
}
QString*
SWGDeviceActions::getDeviceHwType() {
return device_hw_type;
}
void
SWGDeviceActions::setDeviceHwType(QString* device_hw_type) {
this->device_hw_type = device_hw_type;
this->m_device_hw_type_isSet = true;
}
qint32
SWGDeviceActions::getDirection() {
return direction;
}
void
SWGDeviceActions::setDirection(qint32 direction) {
this->direction = direction;
this->m_direction_isSet = true;
}
qint32
SWGDeviceActions::getOriginatorIndex() {
return originator_index;
}
void
SWGDeviceActions::setOriginatorIndex(qint32 originator_index) {
this->originator_index = originator_index;
this->m_originator_index_isSet = true;
}
SWGRtlSdrActions*
SWGDeviceActions::getRtlSdrActions() {
return rtl_sdr_actions;
}
void
SWGDeviceActions::setRtlSdrActions(SWGRtlSdrActions* rtl_sdr_actions) {
this->rtl_sdr_actions = rtl_sdr_actions;
this->m_rtl_sdr_actions_isSet = true;
}
bool
SWGDeviceActions::isSet(){
bool isObjectUpdated = false;
do{
if(device_hw_type && *device_hw_type != QString("")){
isObjectUpdated = true; break;
}
if(m_direction_isSet){
isObjectUpdated = true; break;
}
if(m_originator_index_isSet){
isObjectUpdated = true; break;
}
if(rtl_sdr_actions && rtl_sdr_actions->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,78 @@
/**
* 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: 4.13.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.
*/
/*
* SWGDeviceActions.h
*
* Base device actions. Only the device actions corresponding to the device specified in the deviceHwType field is or should be present.
*/
#ifndef SWGDeviceActions_H_
#define SWGDeviceActions_H_
#include <QJsonObject>
#include "SWGRtlSdrActions.h"
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGDeviceActions: public SWGObject {
public:
SWGDeviceActions();
SWGDeviceActions(QString* json);
virtual ~SWGDeviceActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGDeviceActions* fromJson(QString &jsonString) override;
QString* getDeviceHwType();
void setDeviceHwType(QString* device_hw_type);
qint32 getDirection();
void setDirection(qint32 direction);
qint32 getOriginatorIndex();
void setOriginatorIndex(qint32 originator_index);
SWGRtlSdrActions* getRtlSdrActions();
void setRtlSdrActions(SWGRtlSdrActions* rtl_sdr_actions);
virtual bool isSet() override;
private:
QString* device_hw_type;
bool m_device_hw_type_isSet;
qint32 direction;
bool m_direction_isSet;
qint32 originator_index;
bool m_originator_index_isSet;
SWGRtlSdrActions* rtl_sdr_actions;
bool m_rtl_sdr_actions_isSet;
};
}
#endif /* SWGDeviceActions_H_ */

View File

@ -0,0 +1,148 @@
/**
* 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: 4.13.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 "SWGDevicesetApi.h"
#include "SWGHelpers.h"
#include "SWGModelFactory.h"
#include <QJsonArray>
#include <QJsonDocument>
namespace SWGSDRangel {
SWGDevicesetApi::SWGDevicesetApi() {}
SWGDevicesetApi::~SWGDevicesetApi() {}
SWGDevicesetApi::SWGDevicesetApi(QString host, QString basePath) {
this->host = host;
this->basePath = basePath;
}
void
SWGDevicesetApi::devicesetChannelActionsPost(qint32 device_set_index, qint32 channel_index, SWGChannelActions& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/actions");
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
fullPath.replace(channel_indexPathParam, stringValue(channel_index));
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "POST");
QString output = body.asJson();
input.request_body.append(output);
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDevicesetApi::devicesetChannelActionsPostCallback);
worker->execute(&input);
}
void
SWGDevicesetApi::devicesetChannelActionsPostCallback(SWGHttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGSuccessResponse* output = static_cast<SWGSuccessResponse*>(create(json, QString("SWGSuccessResponse")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit devicesetChannelActionsPostSignal(output);
} else {
emit devicesetChannelActionsPostSignalE(output, error_type, error_str);
emit devicesetChannelActionsPostSignalEFull(worker, error_type, error_str);
}
}
void
SWGDevicesetApi::devicesetDeviceActionsPost(qint32 device_set_index, SWGDeviceActions& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/actions");
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "POST");
QString output = body.asJson();
input.request_body.append(output);
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDevicesetApi::devicesetDeviceActionsPostCallback);
worker->execute(&input);
}
void
SWGDevicesetApi::devicesetDeviceActionsPostCallback(SWGHttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGSuccessResponse* output = static_cast<SWGSuccessResponse*>(create(json, QString("SWGSuccessResponse")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit devicesetDeviceActionsPostSignal(output);
} else {
emit devicesetDeviceActionsPostSignalE(output, error_type, error_str);
emit devicesetDeviceActionsPostSignalEFull(worker, error_type, error_str);
}
}
}

View File

@ -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: 4.13.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.
*/
#ifndef _SWG_SWGDevicesetApi_H_
#define _SWG_SWGDevicesetApi_H_
#include "SWGHttpRequest.h"
#include "SWGChannelActions.h"
#include "SWGDeviceActions.h"
#include "SWGErrorResponse.h"
#include "SWGSuccessResponse.h"
#include <QObject>
namespace SWGSDRangel {
class SWGDevicesetApi: public QObject {
Q_OBJECT
public:
SWGDevicesetApi();
SWGDevicesetApi(QString host, QString basePath);
~SWGDevicesetApi();
QString host;
QString basePath;
QMap<QString, QString> defaultHeaders;
void devicesetChannelActionsPost(qint32 device_set_index, qint32 channel_index, SWGChannelActions& body);
void devicesetDeviceActionsPost(qint32 device_set_index, SWGDeviceActions& body);
private:
void devicesetChannelActionsPostCallback (SWGHttpRequestWorker * worker);
void devicesetDeviceActionsPostCallback (SWGHttpRequestWorker * worker);
signals:
void devicesetChannelActionsPostSignal(SWGSuccessResponse* summary);
void devicesetDeviceActionsPostSignal(SWGSuccessResponse* summary);
void devicesetChannelActionsPostSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetDeviceActionsPostSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetChannelActionsPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetDeviceActionsPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
};
}
#endif

View 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: 4.13.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 "SWGFileSourceActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGFileSourceActions::SWGFileSourceActions(QString* json) {
init();
this->fromJson(*json);
}
SWGFileSourceActions::SWGFileSourceActions() {
play = 0;
m_play_isSet = false;
}
SWGFileSourceActions::~SWGFileSourceActions() {
this->cleanup();
}
void
SWGFileSourceActions::init() {
play = 0;
m_play_isSet = false;
}
void
SWGFileSourceActions::cleanup() {
}
SWGFileSourceActions*
SWGFileSourceActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGFileSourceActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&play, pJson["play"], "qint32", "");
}
QString
SWGFileSourceActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGFileSourceActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_play_isSet){
obj->insert("play", QJsonValue(play));
}
return obj;
}
qint32
SWGFileSourceActions::getPlay() {
return play;
}
void
SWGFileSourceActions::setPlay(qint32 play) {
this->play = play;
this->m_play_isSet = true;
}
bool
SWGFileSourceActions::isSet(){
bool isObjectUpdated = false;
do{
if(m_play_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View 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: 4.13.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.
*/
/*
* SWGFileSourceActions.h
*
* FileSource
*/
#ifndef SWGFileSourceActions_H_
#define SWGFileSourceActions_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGFileSourceActions: public SWGObject {
public:
SWGFileSourceActions();
SWGFileSourceActions(QString* json);
virtual ~SWGFileSourceActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGFileSourceActions* fromJson(QString &jsonString) override;
qint32 getPlay();
void setPlay(qint32 play);
virtual bool isSet() override;
private:
qint32 play;
bool m_play_isSet;
};
}
#endif /* SWGFileSourceActions_H_ */

View 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: 4.13.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 "SWGRtlSdrActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGRtlSdrActions::SWGRtlSdrActions(QString* json) {
init();
this->fromJson(*json);
}
SWGRtlSdrActions::SWGRtlSdrActions() {
record = 0;
m_record_isSet = false;
}
SWGRtlSdrActions::~SWGRtlSdrActions() {
this->cleanup();
}
void
SWGRtlSdrActions::init() {
record = 0;
m_record_isSet = false;
}
void
SWGRtlSdrActions::cleanup() {
}
SWGRtlSdrActions*
SWGRtlSdrActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGRtlSdrActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&record, pJson["record"], "qint32", "");
}
QString
SWGRtlSdrActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGRtlSdrActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_record_isSet){
obj->insert("record", QJsonValue(record));
}
return obj;
}
qint32
SWGRtlSdrActions::getRecord() {
return record;
}
void
SWGRtlSdrActions::setRecord(qint32 record) {
this->record = record;
this->m_record_isSet = true;
}
bool
SWGRtlSdrActions::isSet(){
bool isObjectUpdated = false;
do{
if(m_record_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View 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: 4.13.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.
*/
/*
* SWGRtlSdrActions.h
*
* RTLSDR
*/
#ifndef SWGRtlSdrActions_H_
#define SWGRtlSdrActions_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGRtlSdrActions: public SWGObject {
public:
SWGRtlSdrActions();
SWGRtlSdrActions(QString* json);
virtual ~SWGRtlSdrActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGRtlSdrActions* fromJson(QString &jsonString) override;
qint32 getRecord();
void setRecord(qint32 record);
virtual bool isSet() override;
private:
qint32 record;
bool m_record_isSet;
};
}
#endif /* SWGRtlSdrActions_H_ */