SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Attributes | List of all members
SWGSDRangel::SWGSDRPlayReport Class Reference

#include <SWGSDRPlayReport.h>

+ Inheritance diagram for SWGSDRangel::SWGSDRPlayReport:
+ Collaboration diagram for SWGSDRangel::SWGSDRPlayReport:

Public Member Functions

 SWGSDRPlayReport ()
 
 SWGSDRPlayReport (QString *json)
 
virtual ~SWGSDRPlayReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGSDRPlayReportfromJson (QString &jsonString) override
 
QList< SWGSampleRate * > * getSampleRates ()
 
void setSampleRates (QList< SWGSampleRate *> *sample_rates)
 
QList< SWGBandwidth * > * getBandwidths ()
 
void setBandwidths (QList< SWGBandwidth *> *bandwidths)
 
QList< SWGFrequency * > * getIntermediateFrequencies ()
 
void setIntermediateFrequencies (QList< SWGFrequency *> *intermediate_frequencies)
 
QList< SWGFrequencyBand * > * getFrequencyBands ()
 
void setFrequencyBands (QList< SWGFrequencyBand *> *frequency_bands)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QList< SWGSampleRate * > * sample_rates
 
bool m_sample_rates_isSet
 
QList< SWGBandwidth * > * bandwidths
 
bool m_bandwidths_isSet
 
QList< SWGFrequency * > * intermediate_frequencies
 
bool m_intermediate_frequencies_isSet
 
QList< SWGFrequencyBand * > * frequency_bands
 
bool m_frequency_bands_isSet
 

Detailed Description

Definition at line 36 of file SWGSDRPlayReport.h.

Constructor & Destructor Documentation

◆ SWGSDRPlayReport() [1/2]

SWGSDRangel::SWGSDRPlayReport::SWGSDRPlayReport ( )

◆ SWGSDRPlayReport() [2/2]

SWGSDRangel::SWGSDRPlayReport::SWGSDRPlayReport ( QString *  json)

Definition at line 25 of file SWGSDRPlayReport.cpp.

References fromJson(), and init().

25  {
26  init();
27  this->fromJson(*json);
28 }
virtual SWGSDRPlayReport * fromJson(QString &jsonString) override
+ Here is the call graph for this function:

◆ ~SWGSDRPlayReport()

SWGSDRangel::SWGSDRPlayReport::~SWGSDRPlayReport ( )
virtual

Definition at line 41 of file SWGSDRPlayReport.cpp.

References cleanup().

41  {
42  this->cleanup();
43 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGSDRPlayReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 111 of file SWGSDRPlayReport.cpp.

References asJsonObject().

112 {
113  QJsonObject* obj = this->asJsonObject();
114 
115  QJsonDocument doc(*obj);
116  QByteArray bytes = doc.toJson();
117  delete obj;
118  return QString(bytes);
119 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

QJsonObject * SWGSDRangel::SWGSDRPlayReport::asJsonObject ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 122 of file SWGSDRPlayReport.cpp.

References bandwidths, frequency_bands, intermediate_frequencies, sample_rates, and SWGSDRangel::toJsonArray().

Referenced by asJson().

122  {
123  QJsonObject* obj = new QJsonObject();
124  if(sample_rates->size() > 0){
125  toJsonArray((QList<void*>*)sample_rates, obj, "sampleRates", "SWGSampleRate");
126  }
127  if(bandwidths->size() > 0){
128  toJsonArray((QList<void*>*)bandwidths, obj, "bandwidths", "SWGBandwidth");
129  }
130  if(intermediate_frequencies->size() > 0){
131  toJsonArray((QList<void*>*)intermediate_frequencies, obj, "intermediateFrequencies", "SWGFrequency");
132  }
133  if(frequency_bands->size() > 0){
134  toJsonArray((QList<void*>*)frequency_bands, obj, "frequencyBands", "SWGFrequencyBand");
135  }
136 
137  return obj;
138 }
QList< SWGFrequency * > * intermediate_frequencies
void toJsonArray(QList< void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:445
QList< SWGSampleRate * > * sample_rates
QList< SWGBandwidth * > * bandwidths
QList< SWGFrequencyBand * > * frequency_bands
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGSDRPlayReport::cleanup ( )

Definition at line 58 of file SWGSDRPlayReport.cpp.

References bandwidths, frequency_bands, intermediate_frequencies, and sample_rates.

Referenced by ~SWGSDRPlayReport().

58  {
59  if(sample_rates != nullptr) {
60  auto arr = sample_rates;
61  for(auto o: *arr) {
62  delete o;
63  }
64  delete sample_rates;
65  }
66  if(bandwidths != nullptr) {
67  auto arr = bandwidths;
68  for(auto o: *arr) {
69  delete o;
70  }
71  delete bandwidths;
72  }
73  if(intermediate_frequencies != nullptr) {
74  auto arr = intermediate_frequencies;
75  for(auto o: *arr) {
76  delete o;
77  }
79  }
80  if(frequency_bands != nullptr) {
81  auto arr = frequency_bands;
82  for(auto o: *arr) {
83  delete o;
84  }
85  delete frequency_bands;
86  }
87 }
QList< SWGFrequency * > * intermediate_frequencies
QList< SWGSampleRate * > * sample_rates
QList< SWGBandwidth * > * bandwidths
QList< SWGFrequencyBand * > * frequency_bands
+ Here is the caller graph for this function:

◆ fromJson()

SWGSDRPlayReport * SWGSDRangel::SWGSDRPlayReport::fromJson ( QString &  jsonString)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 90 of file SWGSDRPlayReport.cpp.

References fromJsonObject().

Referenced by SWGSDRPlayReport().

90  {
91  QByteArray array (json.toStdString().c_str());
92  QJsonDocument doc = QJsonDocument::fromJson(array);
93  QJsonObject jsonObject = doc.object();
94  this->fromJsonObject(jsonObject);
95  return this;
96 }
virtual void fromJsonObject(QJsonObject &json) override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

void SWGSDRangel::SWGSDRPlayReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 99 of file SWGSDRPlayReport.cpp.

References bandwidths, frequency_bands, intermediate_frequencies, sample_rates, and SWGSDRangel::setValue().

Referenced by fromJson().

99  {
100 
101  ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGSampleRate");
102 
103  ::SWGSDRangel::setValue(&bandwidths, pJson["bandwidths"], "QList", "SWGBandwidth");
104 
105  ::SWGSDRangel::setValue(&intermediate_frequencies, pJson["intermediateFrequencies"], "QList", "SWGFrequency");
106 
107  ::SWGSDRangel::setValue(&frequency_bands, pJson["frequencyBands"], "QList", "SWGFrequencyBand");
108 }
QList< SWGFrequency * > * intermediate_frequencies
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
QList< SWGSampleRate * > * sample_rates
QList< SWGBandwidth * > * bandwidths
QList< SWGFrequencyBand * > * frequency_bands
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBandwidths()

QList< SWGBandwidth * > * SWGSDRangel::SWGSDRPlayReport::getBandwidths ( )

Definition at line 151 of file SWGSDRPlayReport.cpp.

References bandwidths.

Referenced by SDRPlayInput::webapiFormatDeviceReport().

151  {
152  return bandwidths;
153 }
QList< SWGBandwidth * > * bandwidths
+ Here is the caller graph for this function:

◆ getFrequencyBands()

QList< SWGFrequencyBand * > * SWGSDRangel::SWGSDRPlayReport::getFrequencyBands ( )

Definition at line 171 of file SWGSDRPlayReport.cpp.

References frequency_bands.

Referenced by SDRPlayInput::webapiFormatDeviceReport().

171  {
172  return frequency_bands;
173 }
QList< SWGFrequencyBand * > * frequency_bands
+ Here is the caller graph for this function:

◆ getIntermediateFrequencies()

QList< SWGFrequency * > * SWGSDRangel::SWGSDRPlayReport::getIntermediateFrequencies ( )

Definition at line 161 of file SWGSDRPlayReport.cpp.

References intermediate_frequencies.

Referenced by SDRPlayInput::webapiFormatDeviceReport().

161  {
163 }
QList< SWGFrequency * > * intermediate_frequencies
+ Here is the caller graph for this function:

◆ getSampleRates()

QList< SWGSampleRate * > * SWGSDRangel::SWGSDRPlayReport::getSampleRates ( )

Definition at line 141 of file SWGSDRPlayReport.cpp.

References sample_rates.

Referenced by SDRPlayInput::webapiFormatDeviceReport().

141  {
142  return sample_rates;
143 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGSDRPlayReport::init ( )

Definition at line 46 of file SWGSDRPlayReport.cpp.

References bandwidths, frequency_bands, intermediate_frequencies, m_bandwidths_isSet, m_frequency_bands_isSet, m_intermediate_frequencies_isSet, m_sample_rates_isSet, and sample_rates.

Referenced by SWGSDRPlayReport(), and SDRPlayInput::webapiReportGet().

46  {
47  sample_rates = new QList<SWGSampleRate*>();
48  m_sample_rates_isSet = false;
49  bandwidths = new QList<SWGBandwidth*>();
50  m_bandwidths_isSet = false;
51  intermediate_frequencies = new QList<SWGFrequency*>();
53  frequency_bands = new QList<SWGFrequencyBand*>();
55 }
QList< SWGFrequency * > * intermediate_frequencies
QList< SWGSampleRate * > * sample_rates
QList< SWGBandwidth * > * bandwidths
QList< SWGFrequencyBand * > * frequency_bands
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGSDRPlayReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 182 of file SWGSDRPlayReport.cpp.

References bandwidths, frequency_bands, intermediate_frequencies, and sample_rates.

Referenced by SWGSDRangel::SWGDeviceReport::asJsonObject(), and SWGSDRangel::SWGDeviceReport::isSet().

182  {
183  bool isObjectUpdated = false;
184  do{
185  if(sample_rates->size() > 0){ isObjectUpdated = true; break;}
186  if(bandwidths->size() > 0){ isObjectUpdated = true; break;}
187  if(intermediate_frequencies->size() > 0){ isObjectUpdated = true; break;}
188  if(frequency_bands->size() > 0){ isObjectUpdated = true; break;}
189  }while(false);
190  return isObjectUpdated;
191 }
QList< SWGFrequency * > * intermediate_frequencies
QList< SWGSampleRate * > * sample_rates
QList< SWGBandwidth * > * bandwidths
QList< SWGFrequencyBand * > * frequency_bands
+ Here is the caller graph for this function:

◆ setBandwidths()

void SWGSDRangel::SWGSDRPlayReport::setBandwidths ( QList< SWGBandwidth *> *  bandwidths)

Definition at line 155 of file SWGSDRPlayReport.cpp.

References bandwidths, and m_bandwidths_isSet.

Referenced by SDRPlayInput::webapiFormatDeviceReport().

155  {
156  this->bandwidths = bandwidths;
157  this->m_bandwidths_isSet = true;
158 }
QList< SWGBandwidth * > * bandwidths
+ Here is the caller graph for this function:

◆ setFrequencyBands()

void SWGSDRangel::SWGSDRPlayReport::setFrequencyBands ( QList< SWGFrequencyBand *> *  frequency_bands)

Definition at line 175 of file SWGSDRPlayReport.cpp.

References frequency_bands, and m_frequency_bands_isSet.

Referenced by SDRPlayInput::webapiFormatDeviceReport().

175  {
177  this->m_frequency_bands_isSet = true;
178 }
QList< SWGFrequencyBand * > * frequency_bands
+ Here is the caller graph for this function:

◆ setIntermediateFrequencies()

void SWGSDRangel::SWGSDRPlayReport::setIntermediateFrequencies ( QList< SWGFrequency *> *  intermediate_frequencies)

Definition at line 165 of file SWGSDRPlayReport.cpp.

References intermediate_frequencies, and m_intermediate_frequencies_isSet.

Referenced by SDRPlayInput::webapiFormatDeviceReport().

165  {
168 }
QList< SWGFrequency * > * intermediate_frequencies
+ Here is the caller graph for this function:

◆ setSampleRates()

void SWGSDRangel::SWGSDRPlayReport::setSampleRates ( QList< SWGSampleRate *> *  sample_rates)

Definition at line 145 of file SWGSDRPlayReport.cpp.

References m_sample_rates_isSet, and sample_rates.

Referenced by SDRPlayInput::webapiFormatDeviceReport().

145  {
146  this->sample_rates = sample_rates;
147  this->m_sample_rates_isSet = true;
148 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

Member Data Documentation

◆ bandwidths

QList<SWGBandwidth*>* SWGSDRangel::SWGSDRPlayReport::bandwidths
private

◆ frequency_bands

QList<SWGFrequencyBand*>* SWGSDRangel::SWGSDRPlayReport::frequency_bands
private

◆ intermediate_frequencies

QList<SWGFrequency*>* SWGSDRangel::SWGSDRPlayReport::intermediate_frequencies
private

◆ m_bandwidths_isSet

bool SWGSDRangel::SWGSDRPlayReport::m_bandwidths_isSet
private

Definition at line 69 of file SWGSDRPlayReport.h.

Referenced by init(), setBandwidths(), and SWGSDRPlayReport().

◆ m_frequency_bands_isSet

bool SWGSDRangel::SWGSDRPlayReport::m_frequency_bands_isSet
private

Definition at line 75 of file SWGSDRPlayReport.h.

Referenced by init(), setFrequencyBands(), and SWGSDRPlayReport().

◆ m_intermediate_frequencies_isSet

bool SWGSDRangel::SWGSDRPlayReport::m_intermediate_frequencies_isSet
private

Definition at line 72 of file SWGSDRPlayReport.h.

Referenced by init(), setIntermediateFrequencies(), and SWGSDRPlayReport().

◆ m_sample_rates_isSet

bool SWGSDRangel::SWGSDRPlayReport::m_sample_rates_isSet
private

Definition at line 66 of file SWGSDRPlayReport.h.

Referenced by init(), setSampleRates(), and SWGSDRPlayReport().

◆ sample_rates

QList<SWGSampleRate*>* SWGSDRangel::SWGSDRPlayReport::sample_rates
private

The documentation for this class was generated from the following files: