Browse Source

Regenerate swagger

chirpmodem-v8.0.0
srcejon 2 months ago
parent
commit
bd7ac31172
  1. 1732
      sdrbase/resources/webapi/doc/html2/index.html
  2. 117
      sdrbase/resources/webapi/doc/swagger/swagger.yaml
  3. 1732
      swagger/sdrangel/code/html2/index.html
  4. 197
      swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.cpp
  5. 19
      swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.h
  6. 345
      swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.cpp
  7. 120
      swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.h
  8. 484
      swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.cpp
  9. 157
      swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.h
  10. 24
      swagger/sdrangel/code/qt5/client/SWGModelFactory.h
  11. 200
      swagger/sdrangel/code/qt5/client/SWGSpectrumActions.cpp
  12. 82
      swagger/sdrangel/code/qt5/client/SWGSpectrumActions.h
  13. 131
      swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.cpp
  14. 64
      swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.h

1732
sdrbase/resources/webapi/doc/html2/index.html

File diff suppressed because it is too large Load Diff

117
sdrbase/resources/webapi/doc/swagger/swagger.yaml

@ -1252,6 +1252,123 @@ paths: @@ -1252,6 +1252,123 @@ paths:
"501":
$ref: "#/responses/Response_501"
/sdrangel/deviceset/{deviceSetIndex}/spectrum/report:
x-swagger-router-controller: deviceset
get:
description: Get the latest main spectrum measurement results
operationId: devicesetSpectrumReportGet
tags:
- DeviceSet
parameters:
- in: path
name: deviceSetIndex
type: integer
required: true
description: Index of device set in the device set list
responses:
"200":
description: On success return the results of the selected measurement
schema:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrumReport"
"404":
description: Invalid index
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrangel/deviceset/{deviceSetIndex}/spectrum/actions:
x-swagger-router-controller: deviceset
post:
description: post an action or actions on the main spectrum
operationId: devicesetSpectrumActionsPost
tags:
- DeviceSet
parameters:
- in: path
name: deviceSetIndex
type: integer
required: true
description: Index of device set in the device set list
- name: body
in: body
description: Action(s) to apply to the main spectrum
required: true
schema:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/SpectrumActions"
responses:
"202":
description: Message to perform action was sent successfully
schema:
$ref: "#/definitions/SuccessResponse"
"400":
description: Unknown action, no action given, or an action that needs a spectrum display
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Invalid index
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrangel/deviceset/{deviceSetIndex}/spectrum/data:
x-swagger-router-controller: deviceset
get:
description: Get the main spectrum power values, reduced to a number of bins
operationId: devicesetSpectrumDataGet
tags:
- DeviceSet
parameters:
- in: path
name: deviceSetIndex
type: integer
required: true
description: Index of device set in the device set list
- name: bins
in: query
description: Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
required: false
type: integer
- name: startFrequency
in: query
description: Lowest frequency to return in Hz. Default is the start of the spectrum
required: false
type: integer
format: int64
- name: stopFrequency
in: query
description: Highest frequency to return in Hz. Default is the end of the spectrum
required: false
type: integer
format: int64
- name: reduce
in: query
description: How several bins are combined into one, max or mean (default max)
required: false
type: string
responses:
"200":
description: On success return the reduced spectrum
schema:
$ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrumData"
"400":
description: Invalid bins, frequency range or reduction
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Invalid index
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrangel/deviceset/{deviceSetIndex}/spectrum/server:
x-swagger-router-controller: deviceset
get:

1732
swagger/sdrangel/code/html2/index.html

File diff suppressed because it is too large Load Diff

197
swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.cpp

@ -1442,6 +1442,203 @@ SWGDeviceSetApi::devicesetGetCallback(SWGHttpRequestWorker * worker) { @@ -1442,6 +1442,203 @@ SWGDeviceSetApi::devicesetGetCallback(SWGHttpRequestWorker * worker) {
}
}
void
SWGDeviceSetApi::devicesetSpectrumActionsPost(qint32 device_set_index, SWGSpectrumActions& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/spectrum/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.toUtf8());
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDeviceSetApi::devicesetSpectrumActionsPostCallback);
worker->execute(&input);
}
void
SWGDeviceSetApi::devicesetSpectrumActionsPostCallback(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 devicesetSpectrumActionsPostSignal(output);
} else {
emit devicesetSpectrumActionsPostSignalE(output, error_type, error_str);
emit devicesetSpectrumActionsPostSignalEFull(worker, error_type, error_str);
}
}
void
SWGDeviceSetApi::devicesetSpectrumDataGet(qint32 device_set_index, qint32 bins, qint64 start_frequency, qint64 stop_frequency, QString* reduce) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/spectrum/data");
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("bins"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(bins)));
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("startFrequency"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(start_frequency)));
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("stopFrequency"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(stop_frequency)));
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("reduce"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(reduce)));
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "GET");
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDeviceSetApi::devicesetSpectrumDataGetCallback);
worker->execute(&input);
}
void
SWGDeviceSetApi::devicesetSpectrumDataGetCallback(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);
SWGGLSpectrumData* output = static_cast<SWGGLSpectrumData*>(create(json, QString("SWGGLSpectrumData")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit devicesetSpectrumDataGetSignal(output);
} else {
emit devicesetSpectrumDataGetSignalE(output, error_type, error_str);
emit devicesetSpectrumDataGetSignalEFull(worker, error_type, error_str);
}
}
void
SWGDeviceSetApi::devicesetSpectrumReportGet(qint32 device_set_index) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/spectrum/report");
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, "GET");
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDeviceSetApi::devicesetSpectrumReportGetCallback);
worker->execute(&input);
}
void
SWGDeviceSetApi::devicesetSpectrumReportGetCallback(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);
SWGGLSpectrumReport* output = static_cast<SWGGLSpectrumReport*>(create(json, QString("SWGGLSpectrumReport")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit devicesetSpectrumReportGetSignal(output);
} else {
emit devicesetSpectrumReportGetSignalE(output, error_type, error_str);
emit devicesetSpectrumReportGetSignalEFull(worker, error_type, error_str);
}
}
void
SWGDeviceSetApi::devicesetSpectrumServerDelete(qint32 device_set_index) {
QString fullPath;

19
swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.h

@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
#include "SWGHttpRequest.h"
#include <QString>
#include "SWGChannelActions.h"
#include "SWGChannelReport.h"
#include "SWGChannelSettings.h"
@ -27,6 +28,9 @@ @@ -27,6 +28,9 @@
#include "SWGDeviceState.h"
#include "SWGErrorResponse.h"
#include "SWGGLSpectrum.h"
#include "SWGGLSpectrumData.h"
#include "SWGGLSpectrumReport.h"
#include "SWGSpectrumActions.h"
#include "SWGSpectrumServer.h"
#include "SWGSuccessResponse.h"
#include "SWGWorkspaceInfo.h"
@ -72,6 +76,9 @@ public: @@ -72,6 +76,9 @@ public:
void devicesetDeviceWorkspaceGet(qint32 device_set_index);
void devicesetDeviceWorkspacePut(qint32 device_set_index, SWGWorkspaceInfo& body);
void devicesetGet(qint32 device_set_index);
void devicesetSpectrumActionsPost(qint32 device_set_index, SWGSpectrumActions& body);
void devicesetSpectrumDataGet(qint32 device_set_index, qint32 bins, qint64 start_frequency, qint64 stop_frequency, QString* reduce);
void devicesetSpectrumReportGet(qint32 device_set_index);
void devicesetSpectrumServerDelete(qint32 device_set_index);
void devicesetSpectrumServerGet(qint32 device_set_index);
void devicesetSpectrumServerPost(qint32 device_set_index);
@ -109,6 +116,9 @@ private: @@ -109,6 +116,9 @@ private:
void devicesetDeviceWorkspaceGetCallback (SWGHttpRequestWorker * worker);
void devicesetDeviceWorkspacePutCallback (SWGHttpRequestWorker * worker);
void devicesetGetCallback (SWGHttpRequestWorker * worker);
void devicesetSpectrumActionsPostCallback (SWGHttpRequestWorker * worker);
void devicesetSpectrumDataGetCallback (SWGHttpRequestWorker * worker);
void devicesetSpectrumReportGetCallback (SWGHttpRequestWorker * worker);
void devicesetSpectrumServerDeleteCallback (SWGHttpRequestWorker * worker);
void devicesetSpectrumServerGetCallback (SWGHttpRequestWorker * worker);
void devicesetSpectrumServerPostCallback (SWGHttpRequestWorker * worker);
@ -146,6 +156,9 @@ signals: @@ -146,6 +156,9 @@ signals:
void devicesetDeviceWorkspaceGetSignal(SWGWorkspaceInfo* summary);
void devicesetDeviceWorkspacePutSignal(SWGSuccessResponse* summary);
void devicesetGetSignal(SWGDeviceSet* summary);
void devicesetSpectrumActionsPostSignal(SWGSuccessResponse* summary);
void devicesetSpectrumDataGetSignal(SWGGLSpectrumData* summary);
void devicesetSpectrumReportGetSignal(SWGGLSpectrumReport* summary);
void devicesetSpectrumServerDeleteSignal(SWGSuccessResponse* summary);
void devicesetSpectrumServerGetSignal(SWGSpectrumServer* summary);
void devicesetSpectrumServerPostSignal(SWGSuccessResponse* summary);
@ -182,6 +195,9 @@ signals: @@ -182,6 +195,9 @@ signals:
void devicesetDeviceWorkspaceGetSignalE(SWGWorkspaceInfo* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetDeviceWorkspacePutSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetGetSignalE(SWGDeviceSet* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumActionsPostSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumDataGetSignalE(SWGGLSpectrumData* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumReportGetSignalE(SWGGLSpectrumReport* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumServerDeleteSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumServerGetSignalE(SWGSpectrumServer* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumServerPostSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
@ -218,6 +234,9 @@ signals: @@ -218,6 +234,9 @@ signals:
void devicesetDeviceWorkspaceGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetDeviceWorkspacePutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumActionsPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumDataGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumReportGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumServerDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumServerGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetSpectrumServerPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);

345
swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.cpp

@ -0,0 +1,345 @@ @@ -0,0 +1,345 @@
/**
* 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 "SWGGLSpectrumData.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGGLSpectrumData::SWGGLSpectrumData(QString* json) {
init();
this->fromJson(*json);
}
SWGGLSpectrumData::SWGGLSpectrumData() {
center_frequency = 0L;
m_center_frequency_isSet = false;
bandwidth = 0;
m_bandwidth_isSet = false;
fft_size = 0;
m_fft_size_isSet = false;
linear = 0;
m_linear_isSet = false;
updated = nullptr;
m_updated_isSet = false;
start_frequency = 0L;
m_start_frequency_isSet = false;
stop_frequency = 0L;
m_stop_frequency_isSet = false;
bin_bandwidth = 0.0f;
m_bin_bandwidth_isSet = false;
bins = 0;
m_bins_isSet = false;
reduce = nullptr;
m_reduce_isSet = false;
power = new QList<float>();
m_power_isSet = false;
}
SWGGLSpectrumData::~SWGGLSpectrumData() {
this->cleanup();
}
void
SWGGLSpectrumData::init() {
center_frequency = 0L;
m_center_frequency_isSet = false;
bandwidth = 0;
m_bandwidth_isSet = false;
fft_size = 0;
m_fft_size_isSet = false;
linear = 0;
m_linear_isSet = false;
updated = new QString("");
m_updated_isSet = false;
start_frequency = 0L;
m_start_frequency_isSet = false;
stop_frequency = 0L;
m_stop_frequency_isSet = false;
bin_bandwidth = 0.0f;
m_bin_bandwidth_isSet = false;
bins = 0;
m_bins_isSet = false;
reduce = new QString("");
m_reduce_isSet = false;
power = new QList<float>();
m_power_isSet = false;
}
void
SWGGLSpectrumData::cleanup() {
if(updated != nullptr) {
delete updated;
}
if(reduce != nullptr) {
delete reduce;
}
}
SWGGLSpectrumData*
SWGGLSpectrumData::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGGLSpectrumData::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
::SWGSDRangel::setValue(&fft_size, pJson["fftSize"], "qint32", "");
::SWGSDRangel::setValue(&linear, pJson["linear"], "qint32", "");
::SWGSDRangel::setValue(&updated, pJson["updated"], "QString", "QString");
::SWGSDRangel::setValue(&start_frequency, pJson["startFrequency"], "qint64", "");
::SWGSDRangel::setValue(&stop_frequency, pJson["stopFrequency"], "qint64", "");
::SWGSDRangel::setValue(&bin_bandwidth, pJson["binBandwidth"], "float", "");
::SWGSDRangel::setValue(&bins, pJson["bins"], "qint32", "");
::SWGSDRangel::setValue(&reduce, pJson["reduce"], "QString", "QString");
::SWGSDRangel::setValue(&power, pJson["power"], "QList", "float");
}
QString
SWGGLSpectrumData::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGGLSpectrumData::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_center_frequency_isSet){
obj->insert("centerFrequency", QJsonValue(center_frequency));
}
if(m_bandwidth_isSet){
obj->insert("bandwidth", QJsonValue(bandwidth));
}
if(m_fft_size_isSet){
obj->insert("fftSize", QJsonValue(fft_size));
}
if(m_linear_isSet){
obj->insert("linear", QJsonValue(linear));
}
if(updated != nullptr && *updated != QString("")){
toJsonValue(QString("updated"), updated, obj, QString("QString"));
}
if(m_start_frequency_isSet){
obj->insert("startFrequency", QJsonValue(start_frequency));
}
if(m_stop_frequency_isSet){
obj->insert("stopFrequency", QJsonValue(stop_frequency));
}
if(m_bin_bandwidth_isSet){
obj->insert("binBandwidth", QJsonValue(bin_bandwidth));
}
if(m_bins_isSet){
obj->insert("bins", QJsonValue(bins));
}
if(reduce != nullptr && *reduce != QString("")){
toJsonValue(QString("reduce"), reduce, obj, QString("QString"));
}
if(power && power->size() > 0){
toJsonArray((QList<void*>*)power, obj, "power", "");
}
return obj;
}
qint64
SWGGLSpectrumData::getCenterFrequency() {
return center_frequency;
}
void
SWGGLSpectrumData::setCenterFrequency(qint64 center_frequency) {
this->center_frequency = center_frequency;
this->m_center_frequency_isSet = true;
}
qint32
SWGGLSpectrumData::getBandwidth() {
return bandwidth;
}
void
SWGGLSpectrumData::setBandwidth(qint32 bandwidth) {
this->bandwidth = bandwidth;
this->m_bandwidth_isSet = true;
}
qint32
SWGGLSpectrumData::getFftSize() {
return fft_size;
}
void
SWGGLSpectrumData::setFftSize(qint32 fft_size) {
this->fft_size = fft_size;
this->m_fft_size_isSet = true;
}
qint32
SWGGLSpectrumData::getLinear() {
return linear;
}
void
SWGGLSpectrumData::setLinear(qint32 linear) {
this->linear = linear;
this->m_linear_isSet = true;
}
QString*
SWGGLSpectrumData::getUpdated() {
return updated;
}
void
SWGGLSpectrumData::setUpdated(QString* updated) {
this->updated = updated;
this->m_updated_isSet = true;
}
qint64
SWGGLSpectrumData::getStartFrequency() {
return start_frequency;
}
void
SWGGLSpectrumData::setStartFrequency(qint64 start_frequency) {
this->start_frequency = start_frequency;
this->m_start_frequency_isSet = true;
}
qint64
SWGGLSpectrumData::getStopFrequency() {
return stop_frequency;
}
void
SWGGLSpectrumData::setStopFrequency(qint64 stop_frequency) {
this->stop_frequency = stop_frequency;
this->m_stop_frequency_isSet = true;
}
float
SWGGLSpectrumData::getBinBandwidth() {
return bin_bandwidth;
}
void
SWGGLSpectrumData::setBinBandwidth(float bin_bandwidth) {
this->bin_bandwidth = bin_bandwidth;
this->m_bin_bandwidth_isSet = true;
}
qint32
SWGGLSpectrumData::getBins() {
return bins;
}
void
SWGGLSpectrumData::setBins(qint32 bins) {
this->bins = bins;
this->m_bins_isSet = true;
}
QString*
SWGGLSpectrumData::getReduce() {
return reduce;
}
void
SWGGLSpectrumData::setReduce(QString* reduce) {
this->reduce = reduce;
this->m_reduce_isSet = true;
}
QList<float>*
SWGGLSpectrumData::getPower() {
return power;
}
void
SWGGLSpectrumData::setPower(QList<float>* power) {
this->power = power;
this->m_power_isSet = true;
}
bool
SWGGLSpectrumData::isSet(){
bool isObjectUpdated = false;
do{
if(m_center_frequency_isSet){
isObjectUpdated = true; break;
}
if(m_bandwidth_isSet){
isObjectUpdated = true; break;
}
if(m_fft_size_isSet){
isObjectUpdated = true; break;
}
if(m_linear_isSet){
isObjectUpdated = true; break;
}
if(updated && *updated != QString("")){
isObjectUpdated = true; break;
}
if(m_start_frequency_isSet){
isObjectUpdated = true; break;
}
if(m_stop_frequency_isSet){
isObjectUpdated = true; break;
}
if(m_bin_bandwidth_isSet){
isObjectUpdated = true; break;
}
if(m_bins_isSet){
isObjectUpdated = true; break;
}
if(reduce && *reduce != QString("")){
isObjectUpdated = true; break;
}
if(m_power_isSet){
isObjectUpdated = true; break;
}
if(power && (power->size() > 0)){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

120
swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.h

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
/**
* 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.
*/
/*
* SWGGLSpectrumData.h
*
* A copy of the current power spectrum, reduced to the number of bins asked for so that the answer stays a sensible size whatever the FFT size. The spectrum is only computed while something is consuming it, a spectrum window or a websocket client, so updated says how old these values are and is absent if none has been produced yet.
*/
#ifndef SWGGLSpectrumData_H_
#define SWGGLSpectrumData_H_
#include <QJsonObject>
#include <QList>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGGLSpectrumData: public SWGObject {
public:
SWGGLSpectrumData();
SWGGLSpectrumData(QString* json);
virtual ~SWGGLSpectrumData();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGGLSpectrumData* fromJson(QString &jsonString) override;
qint64 getCenterFrequency();
void setCenterFrequency(qint64 center_frequency);
qint32 getBandwidth();
void setBandwidth(qint32 bandwidth);
qint32 getFftSize();
void setFftSize(qint32 fft_size);
qint32 getLinear();
void setLinear(qint32 linear);
QString* getUpdated();
void setUpdated(QString* updated);
qint64 getStartFrequency();
void setStartFrequency(qint64 start_frequency);
qint64 getStopFrequency();
void setStopFrequency(qint64 stop_frequency);
float getBinBandwidth();
void setBinBandwidth(float bin_bandwidth);
qint32 getBins();
void setBins(qint32 bins);
QString* getReduce();
void setReduce(QString* reduce);
QList<float>* getPower();
void setPower(QList<float>* power);
virtual bool isSet() override;
private:
qint64 center_frequency;
bool m_center_frequency_isSet;
qint32 bandwidth;
bool m_bandwidth_isSet;
qint32 fft_size;
bool m_fft_size_isSet;
qint32 linear;
bool m_linear_isSet;
QString* updated;
bool m_updated_isSet;
qint64 start_frequency;
bool m_start_frequency_isSet;
qint64 stop_frequency;
bool m_stop_frequency_isSet;
float bin_bandwidth;
bool m_bin_bandwidth_isSet;
qint32 bins;
bool m_bins_isSet;
QString* reduce;
bool m_reduce_isSet;
QList<float>* power;
bool m_power_isSet;
};
}
#endif /* SWGGLSpectrumData_H_ */

484
swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.cpp

@ -0,0 +1,484 @@ @@ -0,0 +1,484 @@
/**
* 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 "SWGGLSpectrumReport.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGGLSpectrumReport::SWGGLSpectrumReport(QString* json) {
init();
this->fromJson(*json);
}
SWGGLSpectrumReport::SWGGLSpectrumReport() {
measurement = 0;
m_measurement_isSet = false;
updated = nullptr;
m_updated_isSet = false;
peaks = nullptr;
m_peaks_isSet = false;
channel_power = 0.0f;
m_channel_power_isSet = false;
adj_channel_power_left = 0.0f;
m_adj_channel_power_left_isSet = false;
adj_channel_power_left_ratio = 0.0f;
m_adj_channel_power_left_ratio_isSet = false;
adj_channel_power_centre = 0.0f;
m_adj_channel_power_centre_isSet = false;
adj_channel_power_right = 0.0f;
m_adj_channel_power_right_isSet = false;
adj_channel_power_right_ratio = 0.0f;
m_adj_channel_power_right_ratio_isSet = false;
occupied_bandwidth = 0.0f;
m_occupied_bandwidth_isSet = false;
bandwidth3d_b = 0.0f;
m_bandwidth3d_b_isSet = false;
snr = 0.0f;
m_snr_isSet = false;
snfr = 0.0f;
m_snfr_isSet = false;
thd = 0.0f;
m_thd_isSet = false;
thd_plus_noise = 0.0f;
m_thd_plus_noise_isSet = false;
sinad = 0.0f;
m_sinad_isSet = false;
sfdr = 0.0f;
m_sfdr_isSet = false;
}
SWGGLSpectrumReport::~SWGGLSpectrumReport() {
this->cleanup();
}
void
SWGGLSpectrumReport::init() {
measurement = 0;
m_measurement_isSet = false;
updated = new QString("");
m_updated_isSet = false;
peaks = new QList<SWGSpectrumPeak*>();
m_peaks_isSet = false;
channel_power = 0.0f;
m_channel_power_isSet = false;
adj_channel_power_left = 0.0f;
m_adj_channel_power_left_isSet = false;
adj_channel_power_left_ratio = 0.0f;
m_adj_channel_power_left_ratio_isSet = false;
adj_channel_power_centre = 0.0f;
m_adj_channel_power_centre_isSet = false;
adj_channel_power_right = 0.0f;
m_adj_channel_power_right_isSet = false;
adj_channel_power_right_ratio = 0.0f;
m_adj_channel_power_right_ratio_isSet = false;
occupied_bandwidth = 0.0f;
m_occupied_bandwidth_isSet = false;
bandwidth3d_b = 0.0f;
m_bandwidth3d_b_isSet = false;
snr = 0.0f;
m_snr_isSet = false;
snfr = 0.0f;
m_snfr_isSet = false;
thd = 0.0f;
m_thd_isSet = false;
thd_plus_noise = 0.0f;
m_thd_plus_noise_isSet = false;
sinad = 0.0f;
m_sinad_isSet = false;
sfdr = 0.0f;
m_sfdr_isSet = false;
}
void
SWGGLSpectrumReport::cleanup() {
if(updated != nullptr) {
delete updated;
}
if(peaks != nullptr) {
auto arr = peaks;
for(auto o: *arr) {
delete o;
}
delete peaks;
}
}
SWGGLSpectrumReport*
SWGGLSpectrumReport::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGGLSpectrumReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&measurement, pJson["measurement"], "qint32", "");
::SWGSDRangel::setValue(&updated, pJson["updated"], "QString", "QString");
::SWGSDRangel::setValue(&peaks, pJson["peaks"], "QList", "SWGSpectrumPeak");
::SWGSDRangel::setValue(&channel_power, pJson["channelPower"], "float", "");
::SWGSDRangel::setValue(&adj_channel_power_left, pJson["adjChannelPowerLeft"], "float", "");
::SWGSDRangel::setValue(&adj_channel_power_left_ratio, pJson["adjChannelPowerLeftRatio"], "float", "");
::SWGSDRangel::setValue(&adj_channel_power_centre, pJson["adjChannelPowerCentre"], "float", "");
::SWGSDRangel::setValue(&adj_channel_power_right, pJson["adjChannelPowerRight"], "float", "");
::SWGSDRangel::setValue(&adj_channel_power_right_ratio, pJson["adjChannelPowerRightRatio"], "float", "");
::SWGSDRangel::setValue(&occupied_bandwidth, pJson["occupiedBandwidth"], "float", "");
::SWGSDRangel::setValue(&bandwidth3d_b, pJson["bandwidth3dB"], "float", "");
::SWGSDRangel::setValue(&snr, pJson["snr"], "float", "");
::SWGSDRangel::setValue(&snfr, pJson["snfr"], "float", "");
::SWGSDRangel::setValue(&thd, pJson["thd"], "float", "");
::SWGSDRangel::setValue(&thd_plus_noise, pJson["thdPlusNoise"], "float", "");
::SWGSDRangel::setValue(&sinad, pJson["sinad"], "float", "");
::SWGSDRangel::setValue(&sfdr, pJson["sfdr"], "float", "");
}
QString
SWGGLSpectrumReport::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGGLSpectrumReport::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_measurement_isSet){
obj->insert("measurement", QJsonValue(measurement));
}
if(updated != nullptr && *updated != QString("")){
toJsonValue(QString("updated"), updated, obj, QString("QString"));
}
if(peaks && peaks->size() > 0){
toJsonArray((QList<void*>*)peaks, obj, "peaks", "SWGSpectrumPeak");
}
if(m_channel_power_isSet){
obj->insert("channelPower", QJsonValue(channel_power));
}
if(m_adj_channel_power_left_isSet){
obj->insert("adjChannelPowerLeft", QJsonValue(adj_channel_power_left));
}
if(m_adj_channel_power_left_ratio_isSet){
obj->insert("adjChannelPowerLeftRatio", QJsonValue(adj_channel_power_left_ratio));
}
if(m_adj_channel_power_centre_isSet){
obj->insert("adjChannelPowerCentre", QJsonValue(adj_channel_power_centre));
}
if(m_adj_channel_power_right_isSet){
obj->insert("adjChannelPowerRight", QJsonValue(adj_channel_power_right));
}
if(m_adj_channel_power_right_ratio_isSet){
obj->insert("adjChannelPowerRightRatio", QJsonValue(adj_channel_power_right_ratio));
}
if(m_occupied_bandwidth_isSet){
obj->insert("occupiedBandwidth", QJsonValue(occupied_bandwidth));
}
if(m_bandwidth3d_b_isSet){
obj->insert("bandwidth3dB", QJsonValue(bandwidth3d_b));
}
if(m_snr_isSet){
obj->insert("snr", QJsonValue(snr));
}
if(m_snfr_isSet){
obj->insert("snfr", QJsonValue(snfr));
}
if(m_thd_isSet){
obj->insert("thd", QJsonValue(thd));
}
if(m_thd_plus_noise_isSet){
obj->insert("thdPlusNoise", QJsonValue(thd_plus_noise));
}
if(m_sinad_isSet){
obj->insert("sinad", QJsonValue(sinad));
}
if(m_sfdr_isSet){
obj->insert("sfdr", QJsonValue(sfdr));
}
return obj;
}
qint32
SWGGLSpectrumReport::getMeasurement() {
return measurement;
}
void
SWGGLSpectrumReport::setMeasurement(qint32 measurement) {
this->measurement = measurement;
this->m_measurement_isSet = true;
}
QString*
SWGGLSpectrumReport::getUpdated() {
return updated;
}
void
SWGGLSpectrumReport::setUpdated(QString* updated) {
this->updated = updated;
this->m_updated_isSet = true;
}
QList<SWGSpectrumPeak*>*
SWGGLSpectrumReport::getPeaks() {
return peaks;
}
void
SWGGLSpectrumReport::setPeaks(QList<SWGSpectrumPeak*>* peaks) {
this->peaks = peaks;
this->m_peaks_isSet = true;
}
float
SWGGLSpectrumReport::getChannelPower() {
return channel_power;
}
void
SWGGLSpectrumReport::setChannelPower(float channel_power) {
this->channel_power = channel_power;
this->m_channel_power_isSet = true;
}
float
SWGGLSpectrumReport::getAdjChannelPowerLeft() {
return adj_channel_power_left;
}
void
SWGGLSpectrumReport::setAdjChannelPowerLeft(float adj_channel_power_left) {
this->adj_channel_power_left = adj_channel_power_left;
this->m_adj_channel_power_left_isSet = true;
}
float
SWGGLSpectrumReport::getAdjChannelPowerLeftRatio() {
return adj_channel_power_left_ratio;
}
void
SWGGLSpectrumReport::setAdjChannelPowerLeftRatio(float adj_channel_power_left_ratio) {
this->adj_channel_power_left_ratio = adj_channel_power_left_ratio;
this->m_adj_channel_power_left_ratio_isSet = true;
}
float
SWGGLSpectrumReport::getAdjChannelPowerCentre() {
return adj_channel_power_centre;
}
void
SWGGLSpectrumReport::setAdjChannelPowerCentre(float adj_channel_power_centre) {
this->adj_channel_power_centre = adj_channel_power_centre;
this->m_adj_channel_power_centre_isSet = true;
}
float
SWGGLSpectrumReport::getAdjChannelPowerRight() {
return adj_channel_power_right;
}
void
SWGGLSpectrumReport::setAdjChannelPowerRight(float adj_channel_power_right) {
this->adj_channel_power_right = adj_channel_power_right;
this->m_adj_channel_power_right_isSet = true;
}
float
SWGGLSpectrumReport::getAdjChannelPowerRightRatio() {
return adj_channel_power_right_ratio;
}
void
SWGGLSpectrumReport::setAdjChannelPowerRightRatio(float adj_channel_power_right_ratio) {
this->adj_channel_power_right_ratio = adj_channel_power_right_ratio;
this->m_adj_channel_power_right_ratio_isSet = true;
}
float
SWGGLSpectrumReport::getOccupiedBandwidth() {
return occupied_bandwidth;
}
void
SWGGLSpectrumReport::setOccupiedBandwidth(float occupied_bandwidth) {
this->occupied_bandwidth = occupied_bandwidth;
this->m_occupied_bandwidth_isSet = true;
}
float
SWGGLSpectrumReport::getBandwidth3dB() {
return bandwidth3d_b;
}
void
SWGGLSpectrumReport::setBandwidth3dB(float bandwidth3d_b) {
this->bandwidth3d_b = bandwidth3d_b;
this->m_bandwidth3d_b_isSet = true;
}
float
SWGGLSpectrumReport::getSnr() {
return snr;
}
void
SWGGLSpectrumReport::setSnr(float snr) {
this->snr = snr;
this->m_snr_isSet = true;
}
float
SWGGLSpectrumReport::getSnfr() {
return snfr;
}
void
SWGGLSpectrumReport::setSnfr(float snfr) {
this->snfr = snfr;
this->m_snfr_isSet = true;
}
float
SWGGLSpectrumReport::getThd() {
return thd;
}
void
SWGGLSpectrumReport::setThd(float thd) {
this->thd = thd;
this->m_thd_isSet = true;
}
float
SWGGLSpectrumReport::getThdPlusNoise() {
return thd_plus_noise;
}
void
SWGGLSpectrumReport::setThdPlusNoise(float thd_plus_noise) {
this->thd_plus_noise = thd_plus_noise;
this->m_thd_plus_noise_isSet = true;
}
float
SWGGLSpectrumReport::getSinad() {
return sinad;
}
void
SWGGLSpectrumReport::setSinad(float sinad) {
this->sinad = sinad;
this->m_sinad_isSet = true;
}
float
SWGGLSpectrumReport::getSfdr() {
return sfdr;
}
void
SWGGLSpectrumReport::setSfdr(float sfdr) {
this->sfdr = sfdr;
this->m_sfdr_isSet = true;
}
bool
SWGGLSpectrumReport::isSet(){
bool isObjectUpdated = false;
do{
if(m_measurement_isSet){
isObjectUpdated = true; break;
}
if(updated && *updated != QString("")){
isObjectUpdated = true; break;
}
if(peaks && (peaks->size() > 0)){
isObjectUpdated = true; break;
}
if(m_channel_power_isSet){
isObjectUpdated = true; break;
}
if(m_adj_channel_power_left_isSet){
isObjectUpdated = true; break;
}
if(m_adj_channel_power_left_ratio_isSet){
isObjectUpdated = true; break;
}
if(m_adj_channel_power_centre_isSet){
isObjectUpdated = true; break;
}
if(m_adj_channel_power_right_isSet){
isObjectUpdated = true; break;
}
if(m_adj_channel_power_right_ratio_isSet){
isObjectUpdated = true; break;
}
if(m_occupied_bandwidth_isSet){
isObjectUpdated = true; break;
}
if(m_bandwidth3d_b_isSet){
isObjectUpdated = true; break;
}
if(m_snr_isSet){
isObjectUpdated = true; break;
}
if(m_snfr_isSet){
isObjectUpdated = true; break;
}
if(m_thd_isSet){
isObjectUpdated = true; break;
}
if(m_thd_plus_noise_isSet){
isObjectUpdated = true; break;
}
if(m_sinad_isSet){
isObjectUpdated = true; break;
}
if(m_sfdr_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

157
swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.h

@ -0,0 +1,157 @@ @@ -0,0 +1,157 @@
/**
* 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.
*/
/*
* SWGGLSpectrumReport.h
*
* The latest values of whichever spectrum measurement is switched on. Which fields are present depends on the measurement: with none selected nothing is measured at all and only the measurement field is returned. The figures are those of the spectrum as displayed, so they match the window rather than the full span when it is zoomed, and they are only produced by a running GUI.
*/
#ifndef SWGGLSpectrumReport_H_
#define SWGGLSpectrumReport_H_
#include <QJsonObject>
#include "SWGSpectrumPeak.h"
#include <QList>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGGLSpectrumReport: public SWGObject {
public:
SWGGLSpectrumReport();
SWGGLSpectrumReport(QString* json);
virtual ~SWGGLSpectrumReport();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGGLSpectrumReport* fromJson(QString &jsonString) override;
qint32 getMeasurement();
void setMeasurement(qint32 measurement);
QString* getUpdated();
void setUpdated(QString* updated);
QList<SWGSpectrumPeak*>* getPeaks();
void setPeaks(QList<SWGSpectrumPeak*>* peaks);
float getChannelPower();
void setChannelPower(float channel_power);
float getAdjChannelPowerLeft();
void setAdjChannelPowerLeft(float adj_channel_power_left);
float getAdjChannelPowerLeftRatio();
void setAdjChannelPowerLeftRatio(float adj_channel_power_left_ratio);
float getAdjChannelPowerCentre();
void setAdjChannelPowerCentre(float adj_channel_power_centre);
float getAdjChannelPowerRight();
void setAdjChannelPowerRight(float adj_channel_power_right);
float getAdjChannelPowerRightRatio();
void setAdjChannelPowerRightRatio(float adj_channel_power_right_ratio);
float getOccupiedBandwidth();
void setOccupiedBandwidth(float occupied_bandwidth);
float getBandwidth3dB();
void setBandwidth3dB(float bandwidth3d_b);
float getSnr();
void setSnr(float snr);
float getSnfr();
void setSnfr(float snfr);
float getThd();
void setThd(float thd);
float getThdPlusNoise();
void setThdPlusNoise(float thd_plus_noise);
float getSinad();
void setSinad(float sinad);
float getSfdr();
void setSfdr(float sfdr);
virtual bool isSet() override;
private:
qint32 measurement;
bool m_measurement_isSet;
QString* updated;
bool m_updated_isSet;
QList<SWGSpectrumPeak*>* peaks;
bool m_peaks_isSet;
float channel_power;
bool m_channel_power_isSet;
float adj_channel_power_left;
bool m_adj_channel_power_left_isSet;
float adj_channel_power_left_ratio;
bool m_adj_channel_power_left_ratio_isSet;
float adj_channel_power_centre;
bool m_adj_channel_power_centre_isSet;
float adj_channel_power_right;
bool m_adj_channel_power_right_isSet;
float adj_channel_power_right_ratio;
bool m_adj_channel_power_right_ratio_isSet;
float occupied_bandwidth;
bool m_occupied_bandwidth_isSet;
float bandwidth3d_b;
bool m_bandwidth3d_b_isSet;
float snr;
bool m_snr_isSet;
float snfr;
bool m_snfr_isSet;
float thd;
bool m_thd_isSet;
float thd_plus_noise;
bool m_thd_plus_noise_isSet;
float sinad;
bool m_sinad_isSet;
float sfdr;
bool m_sfdr_isSet;
};
}
#endif /* SWGGLSpectrumReport_H_ */

24
swagger/sdrangel/code/qt5/client/SWGModelFactory.h

@ -179,6 +179,8 @@ @@ -179,6 +179,8 @@
#include "SWGFrequencyRange.h"
#include "SWGGLScope.h"
#include "SWGGLSpectrum.h"
#include "SWGGLSpectrumData.h"
#include "SWGGLSpectrumReport.h"
#include "SWGGS232ControllerActions.h"
#include "SWGGS232ControllerReport.h"
#include "SWGGS232ControllerSettings.h"
@ -365,10 +367,12 @@ @@ -365,10 +367,12 @@
#include "SWGSoapySDRInputSettings.h"
#include "SWGSoapySDROutputSettings.h"
#include "SWGSoapySDRReport.h"
#include "SWGSpectrumActions.h"
#include "SWGSpectrumAnnotationMarker.h"
#include "SWGSpectrumCalibrationPoint.h"
#include "SWGSpectrumHistogramMarker.h"
#include "SWGSpectrumMemorySettings.h"
#include "SWGSpectrumPeak.h"
#include "SWGSpectrumServer.h"
#include "SWGSpectrumServer_clients.h"
#include "SWGSpectrumWaterfallMarker.h"
@ -1244,6 +1248,16 @@ namespace SWGSDRangel { @@ -1244,6 +1248,16 @@ namespace SWGSDRangel {
obj->init();
return obj;
}
if(QString("SWGGLSpectrumData").compare(type) == 0) {
SWGGLSpectrumData *obj = new SWGGLSpectrumData();
obj->init();
return obj;
}
if(QString("SWGGLSpectrumReport").compare(type) == 0) {
SWGGLSpectrumReport *obj = new SWGGLSpectrumReport();
obj->init();
return obj;
}
if(QString("SWGGS232ControllerActions").compare(type) == 0) {
SWGGS232ControllerActions *obj = new SWGGS232ControllerActions();
obj->init();
@ -2174,6 +2188,11 @@ namespace SWGSDRangel { @@ -2174,6 +2188,11 @@ namespace SWGSDRangel {
obj->init();
return obj;
}
if(QString("SWGSpectrumActions").compare(type) == 0) {
SWGSpectrumActions *obj = new SWGSpectrumActions();
obj->init();
return obj;
}
if(QString("SWGSpectrumAnnotationMarker").compare(type) == 0) {
SWGSpectrumAnnotationMarker *obj = new SWGSpectrumAnnotationMarker();
obj->init();
@ -2194,6 +2213,11 @@ namespace SWGSDRangel { @@ -2194,6 +2213,11 @@ namespace SWGSDRangel {
obj->init();
return obj;
}
if(QString("SWGSpectrumPeak").compare(type) == 0) {
SWGSpectrumPeak *obj = new SWGSpectrumPeak();
obj->init();
return obj;
}
if(QString("SWGSpectrumServer").compare(type) == 0) {
SWGSpectrumServer *obj = new SWGSpectrumServer();
obj->init();

200
swagger/sdrangel/code/qt5/client/SWGSpectrumActions.cpp

@ -0,0 +1,200 @@ @@ -0,0 +1,200 @@
/**
* 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 "SWGSpectrumActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGSpectrumActions::SWGSpectrumActions(QString* json) {
init();
this->fromJson(*json);
}
SWGSpectrumActions::SWGSpectrumActions() {
autoscale = 0;
m_autoscale_isSet = false;
clear_spectrum = 0;
m_clear_spectrum_isSet = false;
reset_measurements = 0;
m_reset_measurements_isSet = false;
freeze = 0;
m_freeze_isSet = false;
goto_marker = 0;
m_goto_marker_isSet = false;
}
SWGSpectrumActions::~SWGSpectrumActions() {
this->cleanup();
}
void
SWGSpectrumActions::init() {
autoscale = 0;
m_autoscale_isSet = false;
clear_spectrum = 0;
m_clear_spectrum_isSet = false;
reset_measurements = 0;
m_reset_measurements_isSet = false;
freeze = 0;
m_freeze_isSet = false;
goto_marker = 0;
m_goto_marker_isSet = false;
}
void
SWGSpectrumActions::cleanup() {
}
SWGSpectrumActions*
SWGSpectrumActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGSpectrumActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&autoscale, pJson["autoscale"], "qint32", "");
::SWGSDRangel::setValue(&clear_spectrum, pJson["clearSpectrum"], "qint32", "");
::SWGSDRangel::setValue(&reset_measurements, pJson["resetMeasurements"], "qint32", "");
::SWGSDRangel::setValue(&freeze, pJson["freeze"], "qint32", "");
::SWGSDRangel::setValue(&goto_marker, pJson["gotoMarker"], "qint32", "");
}
QString
SWGSpectrumActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGSpectrumActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_autoscale_isSet){
obj->insert("autoscale", QJsonValue(autoscale));
}
if(m_clear_spectrum_isSet){
obj->insert("clearSpectrum", QJsonValue(clear_spectrum));
}
if(m_reset_measurements_isSet){
obj->insert("resetMeasurements", QJsonValue(reset_measurements));
}
if(m_freeze_isSet){
obj->insert("freeze", QJsonValue(freeze));
}
if(m_goto_marker_isSet){
obj->insert("gotoMarker", QJsonValue(goto_marker));
}
return obj;
}
qint32
SWGSpectrumActions::getAutoscale() {
return autoscale;
}
void
SWGSpectrumActions::setAutoscale(qint32 autoscale) {
this->autoscale = autoscale;
this->m_autoscale_isSet = true;
}
qint32
SWGSpectrumActions::getClearSpectrum() {
return clear_spectrum;
}
void
SWGSpectrumActions::setClearSpectrum(qint32 clear_spectrum) {
this->clear_spectrum = clear_spectrum;
this->m_clear_spectrum_isSet = true;
}
qint32
SWGSpectrumActions::getResetMeasurements() {
return reset_measurements;
}
void
SWGSpectrumActions::setResetMeasurements(qint32 reset_measurements) {
this->reset_measurements = reset_measurements;
this->m_reset_measurements_isSet = true;
}
qint32
SWGSpectrumActions::getFreeze() {
return freeze;
}
void
SWGSpectrumActions::setFreeze(qint32 freeze) {
this->freeze = freeze;
this->m_freeze_isSet = true;
}
qint32
SWGSpectrumActions::getGotoMarker() {
return goto_marker;
}
void
SWGSpectrumActions::setGotoMarker(qint32 goto_marker) {
this->goto_marker = goto_marker;
this->m_goto_marker_isSet = true;
}
bool
SWGSpectrumActions::isSet(){
bool isObjectUpdated = false;
do{
if(m_autoscale_isSet){
isObjectUpdated = true; break;
}
if(m_clear_spectrum_isSet){
isObjectUpdated = true; break;
}
if(m_reset_measurements_isSet){
isObjectUpdated = true; break;
}
if(m_freeze_isSet){
isObjectUpdated = true; break;
}
if(m_goto_marker_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

82
swagger/sdrangel/code/qt5/client/SWGSpectrumActions.h

@ -0,0 +1,82 @@ @@ -0,0 +1,82 @@
/**
* 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.
*/
/*
* SWGSpectrumActions.h
*
* Actions on the main spectrum of a device set
*/
#ifndef SWGSpectrumActions_H_
#define SWGSpectrumActions_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGSpectrumActions: public SWGObject {
public:
SWGSpectrumActions();
SWGSpectrumActions(QString* json);
virtual ~SWGSpectrumActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGSpectrumActions* fromJson(QString &jsonString) override;
qint32 getAutoscale();
void setAutoscale(qint32 autoscale);
qint32 getClearSpectrum();
void setClearSpectrum(qint32 clear_spectrum);
qint32 getResetMeasurements();
void setResetMeasurements(qint32 reset_measurements);
qint32 getFreeze();
void setFreeze(qint32 freeze);
qint32 getGotoMarker();
void setGotoMarker(qint32 goto_marker);
virtual bool isSet() override;
private:
qint32 autoscale;
bool m_autoscale_isSet;
qint32 clear_spectrum;
bool m_clear_spectrum_isSet;
qint32 reset_measurements;
bool m_reset_measurements_isSet;
qint32 freeze;
bool m_freeze_isSet;
qint32 goto_marker;
bool m_goto_marker_isSet;
};
}
#endif /* SWGSpectrumActions_H_ */

131
swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.cpp

@ -0,0 +1,131 @@ @@ -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 "SWGSpectrumPeak.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGSpectrumPeak::SWGSpectrumPeak(QString* json) {
init();
this->fromJson(*json);
}
SWGSpectrumPeak::SWGSpectrumPeak() {
frequency = 0L;
m_frequency_isSet = false;
power = 0.0f;
m_power_isSet = false;
}
SWGSpectrumPeak::~SWGSpectrumPeak() {
this->cleanup();
}
void
SWGSpectrumPeak::init() {
frequency = 0L;
m_frequency_isSet = false;
power = 0.0f;
m_power_isSet = false;
}
void
SWGSpectrumPeak::cleanup() {
}
SWGSpectrumPeak*
SWGSpectrumPeak::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGSpectrumPeak::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&frequency, pJson["frequency"], "qint64", "");
::SWGSDRangel::setValue(&power, pJson["power"], "float", "");
}
QString
SWGSpectrumPeak::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGSpectrumPeak::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;
}
qint64
SWGSpectrumPeak::getFrequency() {
return frequency;
}
void
SWGSpectrumPeak::setFrequency(qint64 frequency) {
this->frequency = frequency;
this->m_frequency_isSet = true;
}
float
SWGSpectrumPeak::getPower() {
return power;
}
void
SWGSpectrumPeak::setPower(float power) {
this->power = power;
this->m_power_isSet = true;
}
bool
SWGSpectrumPeak::isSet(){
bool isObjectUpdated = false;
do{
if(m_frequency_isSet){
isObjectUpdated = true; break;
}
if(m_power_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

64
swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.h

@ -0,0 +1,64 @@ @@ -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.
*/
/*
* SWGSpectrumPeak.h
*
* One peak found in the spectrum
*/
#ifndef SWGSpectrumPeak_H_
#define SWGSpectrumPeak_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGSpectrumPeak: public SWGObject {
public:
SWGSpectrumPeak();
SWGSpectrumPeak(QString* json);
virtual ~SWGSpectrumPeak();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGSpectrumPeak* fromJson(QString &jsonString) override;
qint64 getFrequency();
void setFrequency(qint64 frequency);
float getPower();
void setPower(float power);
virtual bool isSet() override;
private:
qint64 frequency;
bool m_frequency_isSet;
float power;
bool m_power_isSet;
};
}
#endif /* SWGSpectrumPeak_H_ */
Loading…
Cancel
Save