sdrangel/swagger/sdrangel/code/qt5/client/SWGPacketModSettings.cpp

667 wiersze
18 KiB
C++

/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 4.15.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 "SWGPacketModSettings.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGPacketModSettings::SWGPacketModSettings(QString* json) {
init();
this->fromJson(*json);
}
SWGPacketModSettings::SWGPacketModSettings() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
mode = nullptr;
m_mode_isSet = false;
rf_bandwidth = 0.0f;
m_rf_bandwidth_isSet = false;
fm_deviation = 0.0f;
m_fm_deviation_isSet = false;
gain = 0.0f;
m_gain_isSet = false;
channel_mute = 0;
m_channel_mute_isSet = false;
repeat = 0;
m_repeat_isSet = false;
repeat_delay = 0.0f;
m_repeat_delay_isSet = false;
repeat_count = 0;
m_repeat_count_isSet = false;
ax25_pre_flags = 0;
m_ax25_pre_flags_isSet = false;
ax25_post_flags = 0;
m_ax25_post_flags_isSet = false;
pre_emphasis = 0;
m_pre_emphasis_isSet = false;
pre_emphasis_tau = 0.0f;
m_pre_emphasis_tau_isSet = false;
pre_emphasis_high_freq = 0.0f;
m_pre_emphasis_high_freq_isSet = false;
bpf = 0;
m_bpf_isSet = false;
bpf_low_cutoff = 0.0f;
m_bpf_low_cutoff_isSet = false;
bpf_high_cutoff = 0.0f;
m_bpf_high_cutoff_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = nullptr;
m_title_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
m_use_reverse_api_isSet = false;
reverse_api_address = nullptr;
m_reverse_api_address_isSet = false;
reverse_api_port = 0;
m_reverse_api_port_isSet = false;
reverse_api_device_index = 0;
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
}
SWGPacketModSettings::~SWGPacketModSettings() {
this->cleanup();
}
void
SWGPacketModSettings::init() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
mode = new QString("");
m_mode_isSet = false;
rf_bandwidth = 0.0f;
m_rf_bandwidth_isSet = false;
fm_deviation = 0.0f;
m_fm_deviation_isSet = false;
gain = 0.0f;
m_gain_isSet = false;
channel_mute = 0;
m_channel_mute_isSet = false;
repeat = 0;
m_repeat_isSet = false;
repeat_delay = 0.0f;
m_repeat_delay_isSet = false;
repeat_count = 0;
m_repeat_count_isSet = false;
ax25_pre_flags = 0;
m_ax25_pre_flags_isSet = false;
ax25_post_flags = 0;
m_ax25_post_flags_isSet = false;
pre_emphasis = 0;
m_pre_emphasis_isSet = false;
pre_emphasis_tau = 0.0f;
m_pre_emphasis_tau_isSet = false;
pre_emphasis_high_freq = 0.0f;
m_pre_emphasis_high_freq_isSet = false;
bpf = 0;
m_bpf_isSet = false;
bpf_low_cutoff = 0.0f;
m_bpf_low_cutoff_isSet = false;
bpf_high_cutoff = 0.0f;
m_bpf_high_cutoff_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = new QString("");
m_title_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
m_use_reverse_api_isSet = false;
reverse_api_address = new QString("");
m_reverse_api_address_isSet = false;
reverse_api_port = 0;
m_reverse_api_port_isSet = false;
reverse_api_device_index = 0;
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
}
void
SWGPacketModSettings::cleanup() {
if(mode != nullptr) {
delete mode;
}
if(title != nullptr) {
delete title;
}
if(reverse_api_address != nullptr) {
delete reverse_api_address;
}
}
SWGPacketModSettings*
SWGPacketModSettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGPacketModSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
::SWGSDRangel::setValue(&mode, pJson["mode"], "QString", "QString");
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
::SWGSDRangel::setValue(&fm_deviation, pJson["fmDeviation"], "float", "");
::SWGSDRangel::setValue(&gain, pJson["gain"], "float", "");
::SWGSDRangel::setValue(&channel_mute, pJson["channelMute"], "qint32", "");
::SWGSDRangel::setValue(&repeat, pJson["repeat"], "qint32", "");
::SWGSDRangel::setValue(&repeat_delay, pJson["repeatDelay"], "float", "");
::SWGSDRangel::setValue(&repeat_count, pJson["repeatCount"], "qint32", "");
::SWGSDRangel::setValue(&ax25_pre_flags, pJson["ax25PreFlags"], "qint32", "");
::SWGSDRangel::setValue(&ax25_post_flags, pJson["ax25PostFlags"], "qint32", "");
::SWGSDRangel::setValue(&pre_emphasis, pJson["preEmphasis"], "qint32", "");
::SWGSDRangel::setValue(&pre_emphasis_tau, pJson["preEmphasisTau"], "float", "");
::SWGSDRangel::setValue(&pre_emphasis_high_freq, pJson["preEmphasisHighFreq"], "float", "");
::SWGSDRangel::setValue(&bpf, pJson["bpf"], "qint32", "");
::SWGSDRangel::setValue(&bpf_low_cutoff, pJson["bpfLowCutoff"], "float", "");
::SWGSDRangel::setValue(&bpf_high_cutoff, pJson["bpfHighCutoff"], "float", "");
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
}
QString
SWGPacketModSettings::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGPacketModSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_input_frequency_offset_isSet){
obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
}
if(mode != nullptr && *mode != QString("")){
toJsonValue(QString("mode"), mode, obj, QString("QString"));
}
if(m_rf_bandwidth_isSet){
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
}
if(m_fm_deviation_isSet){
obj->insert("fmDeviation", QJsonValue(fm_deviation));
}
if(m_gain_isSet){
obj->insert("gain", QJsonValue(gain));
}
if(m_channel_mute_isSet){
obj->insert("channelMute", QJsonValue(channel_mute));
}
if(m_repeat_isSet){
obj->insert("repeat", QJsonValue(repeat));
}
if(m_repeat_delay_isSet){
obj->insert("repeatDelay", QJsonValue(repeat_delay));
}
if(m_repeat_count_isSet){
obj->insert("repeatCount", QJsonValue(repeat_count));
}
if(m_ax25_pre_flags_isSet){
obj->insert("ax25PreFlags", QJsonValue(ax25_pre_flags));
}
if(m_ax25_post_flags_isSet){
obj->insert("ax25PostFlags", QJsonValue(ax25_post_flags));
}
if(m_pre_emphasis_isSet){
obj->insert("preEmphasis", QJsonValue(pre_emphasis));
}
if(m_pre_emphasis_tau_isSet){
obj->insert("preEmphasisTau", QJsonValue(pre_emphasis_tau));
}
if(m_pre_emphasis_high_freq_isSet){
obj->insert("preEmphasisHighFreq", QJsonValue(pre_emphasis_high_freq));
}
if(m_bpf_isSet){
obj->insert("bpf", QJsonValue(bpf));
}
if(m_bpf_low_cutoff_isSet){
obj->insert("bpfLowCutoff", QJsonValue(bpf_low_cutoff));
}
if(m_bpf_high_cutoff_isSet){
obj->insert("bpfHighCutoff", QJsonValue(bpf_high_cutoff));
}
if(m_rgb_color_isSet){
obj->insert("rgbColor", QJsonValue(rgb_color));
}
if(title != nullptr && *title != QString("")){
toJsonValue(QString("title"), title, obj, QString("QString"));
}
if(m_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index));
}
if(m_use_reverse_api_isSet){
obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
}
if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
}
if(m_reverse_api_port_isSet){
obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
}
if(m_reverse_api_device_index_isSet){
obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
}
if(m_reverse_api_channel_index_isSet){
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
}
return obj;
}
qint64
SWGPacketModSettings::getInputFrequencyOffset() {
return input_frequency_offset;
}
void
SWGPacketModSettings::setInputFrequencyOffset(qint64 input_frequency_offset) {
this->input_frequency_offset = input_frequency_offset;
this->m_input_frequency_offset_isSet = true;
}
QString*
SWGPacketModSettings::getMode() {
return mode;
}
void
SWGPacketModSettings::setMode(QString* mode) {
this->mode = mode;
this->m_mode_isSet = true;
}
float
SWGPacketModSettings::getRfBandwidth() {
return rf_bandwidth;
}
void
SWGPacketModSettings::setRfBandwidth(float rf_bandwidth) {
this->rf_bandwidth = rf_bandwidth;
this->m_rf_bandwidth_isSet = true;
}
float
SWGPacketModSettings::getFmDeviation() {
return fm_deviation;
}
void
SWGPacketModSettings::setFmDeviation(float fm_deviation) {
this->fm_deviation = fm_deviation;
this->m_fm_deviation_isSet = true;
}
float
SWGPacketModSettings::getGain() {
return gain;
}
void
SWGPacketModSettings::setGain(float gain) {
this->gain = gain;
this->m_gain_isSet = true;
}
qint32
SWGPacketModSettings::getChannelMute() {
return channel_mute;
}
void
SWGPacketModSettings::setChannelMute(qint32 channel_mute) {
this->channel_mute = channel_mute;
this->m_channel_mute_isSet = true;
}
qint32
SWGPacketModSettings::getRepeat() {
return repeat;
}
void
SWGPacketModSettings::setRepeat(qint32 repeat) {
this->repeat = repeat;
this->m_repeat_isSet = true;
}
float
SWGPacketModSettings::getRepeatDelay() {
return repeat_delay;
}
void
SWGPacketModSettings::setRepeatDelay(float repeat_delay) {
this->repeat_delay = repeat_delay;
this->m_repeat_delay_isSet = true;
}
qint32
SWGPacketModSettings::getRepeatCount() {
return repeat_count;
}
void
SWGPacketModSettings::setRepeatCount(qint32 repeat_count) {
this->repeat_count = repeat_count;
this->m_repeat_count_isSet = true;
}
qint32
SWGPacketModSettings::getAx25PreFlags() {
return ax25_pre_flags;
}
void
SWGPacketModSettings::setAx25PreFlags(qint32 ax25_pre_flags) {
this->ax25_pre_flags = ax25_pre_flags;
this->m_ax25_pre_flags_isSet = true;
}
qint32
SWGPacketModSettings::getAx25PostFlags() {
return ax25_post_flags;
}
void
SWGPacketModSettings::setAx25PostFlags(qint32 ax25_post_flags) {
this->ax25_post_flags = ax25_post_flags;
this->m_ax25_post_flags_isSet = true;
}
qint32
SWGPacketModSettings::getPreEmphasis() {
return pre_emphasis;
}
void
SWGPacketModSettings::setPreEmphasis(qint32 pre_emphasis) {
this->pre_emphasis = pre_emphasis;
this->m_pre_emphasis_isSet = true;
}
float
SWGPacketModSettings::getPreEmphasisTau() {
return pre_emphasis_tau;
}
void
SWGPacketModSettings::setPreEmphasisTau(float pre_emphasis_tau) {
this->pre_emphasis_tau = pre_emphasis_tau;
this->m_pre_emphasis_tau_isSet = true;
}
float
SWGPacketModSettings::getPreEmphasisHighFreq() {
return pre_emphasis_high_freq;
}
void
SWGPacketModSettings::setPreEmphasisHighFreq(float pre_emphasis_high_freq) {
this->pre_emphasis_high_freq = pre_emphasis_high_freq;
this->m_pre_emphasis_high_freq_isSet = true;
}
qint32
SWGPacketModSettings::getBpf() {
return bpf;
}
void
SWGPacketModSettings::setBpf(qint32 bpf) {
this->bpf = bpf;
this->m_bpf_isSet = true;
}
float
SWGPacketModSettings::getBpfLowCutoff() {
return bpf_low_cutoff;
}
void
SWGPacketModSettings::setBpfLowCutoff(float bpf_low_cutoff) {
this->bpf_low_cutoff = bpf_low_cutoff;
this->m_bpf_low_cutoff_isSet = true;
}
float
SWGPacketModSettings::getBpfHighCutoff() {
return bpf_high_cutoff;
}
void
SWGPacketModSettings::setBpfHighCutoff(float bpf_high_cutoff) {
this->bpf_high_cutoff = bpf_high_cutoff;
this->m_bpf_high_cutoff_isSet = true;
}
qint32
SWGPacketModSettings::getRgbColor() {
return rgb_color;
}
void
SWGPacketModSettings::setRgbColor(qint32 rgb_color) {
this->rgb_color = rgb_color;
this->m_rgb_color_isSet = true;
}
QString*
SWGPacketModSettings::getTitle() {
return title;
}
void
SWGPacketModSettings::setTitle(QString* title) {
this->title = title;
this->m_title_isSet = true;
}
qint32
SWGPacketModSettings::getStreamIndex() {
return stream_index;
}
void
SWGPacketModSettings::setStreamIndex(qint32 stream_index) {
this->stream_index = stream_index;
this->m_stream_index_isSet = true;
}
qint32
SWGPacketModSettings::getUseReverseApi() {
return use_reverse_api;
}
void
SWGPacketModSettings::setUseReverseApi(qint32 use_reverse_api) {
this->use_reverse_api = use_reverse_api;
this->m_use_reverse_api_isSet = true;
}
QString*
SWGPacketModSettings::getReverseApiAddress() {
return reverse_api_address;
}
void
SWGPacketModSettings::setReverseApiAddress(QString* reverse_api_address) {
this->reverse_api_address = reverse_api_address;
this->m_reverse_api_address_isSet = true;
}
qint32
SWGPacketModSettings::getReverseApiPort() {
return reverse_api_port;
}
void
SWGPacketModSettings::setReverseApiPort(qint32 reverse_api_port) {
this->reverse_api_port = reverse_api_port;
this->m_reverse_api_port_isSet = true;
}
qint32
SWGPacketModSettings::getReverseApiDeviceIndex() {
return reverse_api_device_index;
}
void
SWGPacketModSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
this->reverse_api_device_index = reverse_api_device_index;
this->m_reverse_api_device_index_isSet = true;
}
qint32
SWGPacketModSettings::getReverseApiChannelIndex() {
return reverse_api_channel_index;
}
void
SWGPacketModSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) {
this->reverse_api_channel_index = reverse_api_channel_index;
this->m_reverse_api_channel_index_isSet = true;
}
bool
SWGPacketModSettings::isSet(){
bool isObjectUpdated = false;
do{
if(m_input_frequency_offset_isSet){
isObjectUpdated = true; break;
}
if(mode && *mode != QString("")){
isObjectUpdated = true; break;
}
if(m_rf_bandwidth_isSet){
isObjectUpdated = true; break;
}
if(m_fm_deviation_isSet){
isObjectUpdated = true; break;
}
if(m_gain_isSet){
isObjectUpdated = true; break;
}
if(m_channel_mute_isSet){
isObjectUpdated = true; break;
}
if(m_repeat_isSet){
isObjectUpdated = true; break;
}
if(m_repeat_delay_isSet){
isObjectUpdated = true; break;
}
if(m_repeat_count_isSet){
isObjectUpdated = true; break;
}
if(m_ax25_pre_flags_isSet){
isObjectUpdated = true; break;
}
if(m_ax25_post_flags_isSet){
isObjectUpdated = true; break;
}
if(m_pre_emphasis_isSet){
isObjectUpdated = true; break;
}
if(m_pre_emphasis_tau_isSet){
isObjectUpdated = true; break;
}
if(m_pre_emphasis_high_freq_isSet){
isObjectUpdated = true; break;
}
if(m_bpf_isSet){
isObjectUpdated = true; break;
}
if(m_bpf_low_cutoff_isSet){
isObjectUpdated = true; break;
}
if(m_bpf_high_cutoff_isSet){
isObjectUpdated = true; break;
}
if(m_rgb_color_isSet){
isObjectUpdated = true; break;
}
if(title && *title != QString("")){
isObjectUpdated = true; break;
}
if(m_stream_index_isSet){
isObjectUpdated = true; break;
}
if(m_use_reverse_api_isSet){
isObjectUpdated = true; break;
}
if(reverse_api_address && *reverse_api_address != QString("")){
isObjectUpdated = true; break;
}
if(m_reverse_api_port_isSet){
isObjectUpdated = true; break;
}
if(m_reverse_api_device_index_isSet){
isObjectUpdated = true; break;
}
if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}