14 changed files with 5402 additions and 2 deletions
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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(¢er_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; |
||||
} |
||||
} |
||||
|
||||
@ -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_ */ |
||||
@ -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; |
||||
} |
||||
} |
||||
|
||||
@ -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_ */ |
||||
@ -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; |
||||
} |
||||
} |
||||
|
||||
@ -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_ */ |
||||
@ -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; |
||||
} |
||||
} |
||||
|
||||
@ -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…
Reference in new issue