10 changed files with 471 additions and 0 deletions
@ -0,0 +1,263 @@
@@ -0,0 +1,263 @@
|
||||
/**
|
||||
* 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 "SWGATVDemodReport.h" |
||||
|
||||
#include "SWGHelpers.h" |
||||
|
||||
#include <QJsonDocument> |
||||
#include <QJsonArray> |
||||
#include <QObject> |
||||
#include <QDebug> |
||||
|
||||
namespace SWGSDRangel { |
||||
|
||||
SWGATVDemodReport::SWGATVDemodReport(QString* json) { |
||||
init(); |
||||
this->fromJson(*json); |
||||
} |
||||
|
||||
SWGATVDemodReport::SWGATVDemodReport() { |
||||
channel_power_db = 0.0f; |
||||
m_channel_power_db_isSet = false; |
||||
channel_sample_rate = 0; |
||||
m_channel_sample_rate_isSet = false; |
||||
bfo_locked = 0; |
||||
m_bfo_locked_isSet = false; |
||||
colour_locked = 0; |
||||
m_colour_locked_isSet = false; |
||||
burst_amplitude = 0.0f; |
||||
m_burst_amplitude_isSet = false; |
||||
carrier_frequency_error = 0.0f; |
||||
m_carrier_frequency_error_isSet = false; |
||||
ghost_delay = 0.0f; |
||||
m_ghost_delay_isSet = false; |
||||
ghost_amplitude = 0.0f; |
||||
m_ghost_amplitude_isSet = false; |
||||
} |
||||
|
||||
SWGATVDemodReport::~SWGATVDemodReport() { |
||||
this->cleanup(); |
||||
} |
||||
|
||||
void |
||||
SWGATVDemodReport::init() { |
||||
channel_power_db = 0.0f; |
||||
m_channel_power_db_isSet = false; |
||||
channel_sample_rate = 0; |
||||
m_channel_sample_rate_isSet = false; |
||||
bfo_locked = 0; |
||||
m_bfo_locked_isSet = false; |
||||
colour_locked = 0; |
||||
m_colour_locked_isSet = false; |
||||
burst_amplitude = 0.0f; |
||||
m_burst_amplitude_isSet = false; |
||||
carrier_frequency_error = 0.0f; |
||||
m_carrier_frequency_error_isSet = false; |
||||
ghost_delay = 0.0f; |
||||
m_ghost_delay_isSet = false; |
||||
ghost_amplitude = 0.0f; |
||||
m_ghost_amplitude_isSet = false; |
||||
} |
||||
|
||||
void |
||||
SWGATVDemodReport::cleanup() { |
||||
|
||||
|
||||
} |
||||
|
||||
SWGATVDemodReport* |
||||
SWGATVDemodReport::fromJson(QString &json) { |
||||
QByteArray array (json.toStdString().c_str()); |
||||
QJsonDocument doc = QJsonDocument::fromJson(array); |
||||
QJsonObject jsonObject = doc.object(); |
||||
this->fromJsonObject(jsonObject); |
||||
return this; |
||||
} |
||||
|
||||
void |
||||
SWGATVDemodReport::fromJsonObject(QJsonObject &pJson) { |
||||
::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", ""); |
||||
|
||||
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&bfo_locked, pJson["bfoLocked"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&colour_locked, pJson["colourLocked"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&burst_amplitude, pJson["burstAmplitude"], "float", ""); |
||||
|
||||
::SWGSDRangel::setValue(&carrier_frequency_error, pJson["carrierFrequencyError"], "float", ""); |
||||
|
||||
::SWGSDRangel::setValue(&ghost_delay, pJson["ghostDelay"], "float", ""); |
||||
|
||||
::SWGSDRangel::setValue(&ghost_amplitude, pJson["ghostAmplitude"], "float", ""); |
||||
|
||||
} |
||||
|
||||
QString |
||||
SWGATVDemodReport::asJson () |
||||
{ |
||||
QJsonObject* obj = this->asJsonObject(); |
||||
|
||||
QJsonDocument doc(*obj); |
||||
QByteArray bytes = doc.toJson(); |
||||
delete obj; |
||||
return QString(bytes); |
||||
} |
||||
|
||||
QJsonObject* |
||||
SWGATVDemodReport::asJsonObject() { |
||||
QJsonObject* obj = new QJsonObject(); |
||||
if(m_channel_power_db_isSet){ |
||||
obj->insert("channelPowerDB", QJsonValue(channel_power_db)); |
||||
} |
||||
if(m_channel_sample_rate_isSet){ |
||||
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate)); |
||||
} |
||||
if(m_bfo_locked_isSet){ |
||||
obj->insert("bfoLocked", QJsonValue(bfo_locked)); |
||||
} |
||||
if(m_colour_locked_isSet){ |
||||
obj->insert("colourLocked", QJsonValue(colour_locked)); |
||||
} |
||||
if(m_burst_amplitude_isSet){ |
||||
obj->insert("burstAmplitude", QJsonValue(burst_amplitude)); |
||||
} |
||||
if(m_carrier_frequency_error_isSet){ |
||||
obj->insert("carrierFrequencyError", QJsonValue(carrier_frequency_error)); |
||||
} |
||||
if(m_ghost_delay_isSet){ |
||||
obj->insert("ghostDelay", QJsonValue(ghost_delay)); |
||||
} |
||||
if(m_ghost_amplitude_isSet){ |
||||
obj->insert("ghostAmplitude", QJsonValue(ghost_amplitude)); |
||||
} |
||||
|
||||
return obj; |
||||
} |
||||
|
||||
float |
||||
SWGATVDemodReport::getChannelPowerDb() { |
||||
return channel_power_db; |
||||
} |
||||
void |
||||
SWGATVDemodReport::setChannelPowerDb(float channel_power_db) { |
||||
this->channel_power_db = channel_power_db; |
||||
this->m_channel_power_db_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGATVDemodReport::getChannelSampleRate() { |
||||
return channel_sample_rate; |
||||
} |
||||
void |
||||
SWGATVDemodReport::setChannelSampleRate(qint32 channel_sample_rate) { |
||||
this->channel_sample_rate = channel_sample_rate; |
||||
this->m_channel_sample_rate_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGATVDemodReport::getBfoLocked() { |
||||
return bfo_locked; |
||||
} |
||||
void |
||||
SWGATVDemodReport::setBfoLocked(qint32 bfo_locked) { |
||||
this->bfo_locked = bfo_locked; |
||||
this->m_bfo_locked_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGATVDemodReport::getColourLocked() { |
||||
return colour_locked; |
||||
} |
||||
void |
||||
SWGATVDemodReport::setColourLocked(qint32 colour_locked) { |
||||
this->colour_locked = colour_locked; |
||||
this->m_colour_locked_isSet = true; |
||||
} |
||||
|
||||
float |
||||
SWGATVDemodReport::getBurstAmplitude() { |
||||
return burst_amplitude; |
||||
} |
||||
void |
||||
SWGATVDemodReport::setBurstAmplitude(float burst_amplitude) { |
||||
this->burst_amplitude = burst_amplitude; |
||||
this->m_burst_amplitude_isSet = true; |
||||
} |
||||
|
||||
float |
||||
SWGATVDemodReport::getCarrierFrequencyError() { |
||||
return carrier_frequency_error; |
||||
} |
||||
void |
||||
SWGATVDemodReport::setCarrierFrequencyError(float carrier_frequency_error) { |
||||
this->carrier_frequency_error = carrier_frequency_error; |
||||
this->m_carrier_frequency_error_isSet = true; |
||||
} |
||||
|
||||
float |
||||
SWGATVDemodReport::getGhostDelay() { |
||||
return ghost_delay; |
||||
} |
||||
void |
||||
SWGATVDemodReport::setGhostDelay(float ghost_delay) { |
||||
this->ghost_delay = ghost_delay; |
||||
this->m_ghost_delay_isSet = true; |
||||
} |
||||
|
||||
float |
||||
SWGATVDemodReport::getGhostAmplitude() { |
||||
return ghost_amplitude; |
||||
} |
||||
void |
||||
SWGATVDemodReport::setGhostAmplitude(float ghost_amplitude) { |
||||
this->ghost_amplitude = ghost_amplitude; |
||||
this->m_ghost_amplitude_isSet = true; |
||||
} |
||||
|
||||
|
||||
bool |
||||
SWGATVDemodReport::isSet(){ |
||||
bool isObjectUpdated = false; |
||||
do{ |
||||
if(m_channel_power_db_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_channel_sample_rate_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_bfo_locked_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_colour_locked_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_burst_amplitude_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_carrier_frequency_error_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_ghost_delay_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_ghost_amplitude_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
}while(false); |
||||
return isObjectUpdated; |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,100 @@
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* 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. |
||||
*/ |
||||
|
||||
/*
|
||||
* SWGATVDemodReport.h |
||||
* |
||||
* ATVDemod |
||||
*/ |
||||
|
||||
#ifndef SWGATVDemodReport_H_ |
||||
#define SWGATVDemodReport_H_ |
||||
|
||||
#include <QJsonObject> |
||||
|
||||
|
||||
|
||||
#include "SWGObject.h" |
||||
#include "export.h" |
||||
|
||||
namespace SWGSDRangel { |
||||
|
||||
class SWG_API SWGATVDemodReport: public SWGObject { |
||||
public: |
||||
SWGATVDemodReport(); |
||||
SWGATVDemodReport(QString* json); |
||||
virtual ~SWGATVDemodReport(); |
||||
void init(); |
||||
void cleanup(); |
||||
|
||||
virtual QString asJson () override; |
||||
virtual QJsonObject* asJsonObject() override; |
||||
virtual void fromJsonObject(QJsonObject &json) override; |
||||
virtual SWGATVDemodReport* fromJson(QString &jsonString) override; |
||||
|
||||
float getChannelPowerDb(); |
||||
void setChannelPowerDb(float channel_power_db); |
||||
|
||||
qint32 getChannelSampleRate(); |
||||
void setChannelSampleRate(qint32 channel_sample_rate); |
||||
|
||||
qint32 getBfoLocked(); |
||||
void setBfoLocked(qint32 bfo_locked); |
||||
|
||||
qint32 getColourLocked(); |
||||
void setColourLocked(qint32 colour_locked); |
||||
|
||||
float getBurstAmplitude(); |
||||
void setBurstAmplitude(float burst_amplitude); |
||||
|
||||
float getCarrierFrequencyError(); |
||||
void setCarrierFrequencyError(float carrier_frequency_error); |
||||
|
||||
float getGhostDelay(); |
||||
void setGhostDelay(float ghost_delay); |
||||
|
||||
float getGhostAmplitude(); |
||||
void setGhostAmplitude(float ghost_amplitude); |
||||
|
||||
|
||||
virtual bool isSet() override; |
||||
|
||||
private: |
||||
float channel_power_db; |
||||
bool m_channel_power_db_isSet; |
||||
|
||||
qint32 channel_sample_rate; |
||||
bool m_channel_sample_rate_isSet; |
||||
|
||||
qint32 bfo_locked; |
||||
bool m_bfo_locked_isSet; |
||||
|
||||
qint32 colour_locked; |
||||
bool m_colour_locked_isSet; |
||||
|
||||
float burst_amplitude; |
||||
bool m_burst_amplitude_isSet; |
||||
|
||||
float carrier_frequency_error; |
||||
bool m_carrier_frequency_error_isSet; |
||||
|
||||
float ghost_delay; |
||||
bool m_ghost_delay_isSet; |
||||
|
||||
float ghost_amplitude; |
||||
bool m_ghost_amplitude_isSet; |
||||
|
||||
}; |
||||
|
||||
} |
||||
|
||||
#endif /* SWGATVDemodReport_H_ */ |
||||
Loading…
Reference in new issue