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::SWGBladeRF2InputReport Class Reference

#include <SWGBladeRF2InputReport.h>

+ Inheritance diagram for SWGSDRangel::SWGBladeRF2InputReport:
+ Collaboration diagram for SWGSDRangel::SWGBladeRF2InputReport:

Public Member Functions

 SWGBladeRF2InputReport ()
 
 SWGBladeRF2InputReport (QString *json)
 
virtual ~SWGBladeRF2InputReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGBladeRF2InputReportfromJson (QString &jsonString) override
 
SWGFrequencyRangegetFrequencyRange ()
 
void setFrequencyRange (SWGFrequencyRange *frequency_range)
 
SWGRangegetSampleRateRange ()
 
void setSampleRateRange (SWGRange *sample_rate_range)
 
SWGRangegetBandwidthRange ()
 
void setBandwidthRange (SWGRange *bandwidth_range)
 
SWGRangegetGlobalGainRange ()
 
void setGlobalGainRange (SWGRange *global_gain_range)
 
QList< SWGNamedEnum * > * getGainModes ()
 
void setGainModes (QList< SWGNamedEnum *> *gain_modes)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

SWGFrequencyRangefrequency_range
 
bool m_frequency_range_isSet
 
SWGRangesample_rate_range
 
bool m_sample_rate_range_isSet
 
SWGRangebandwidth_range
 
bool m_bandwidth_range_isSet
 
SWGRangeglobal_gain_range
 
bool m_global_gain_range_isSet
 
QList< SWGNamedEnum * > * gain_modes
 
bool m_gain_modes_isSet
 

Detailed Description

Definition at line 35 of file SWGBladeRF2InputReport.h.

Constructor & Destructor Documentation

◆ SWGBladeRF2InputReport() [1/2]

SWGSDRangel::SWGBladeRF2InputReport::SWGBladeRF2InputReport ( )

Definition at line 30 of file SWGBladeRF2InputReport.cpp.

References bandwidth_range, frequency_range, gain_modes, global_gain_range, m_bandwidth_range_isSet, m_frequency_range_isSet, m_gain_modes_isSet, m_global_gain_range_isSet, m_sample_rate_range_isSet, and sample_rate_range.

30  {
31  frequency_range = nullptr;
33  sample_rate_range = nullptr;
35  bandwidth_range = nullptr;
37  global_gain_range = nullptr;
39  gain_modes = nullptr;
40  m_gain_modes_isSet = false;
41 }

◆ SWGBladeRF2InputReport() [2/2]

SWGSDRangel::SWGBladeRF2InputReport::SWGBladeRF2InputReport ( QString *  json)

Definition at line 25 of file SWGBladeRF2InputReport.cpp.

References fromJson(), and init().

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

◆ ~SWGBladeRF2InputReport()

SWGSDRangel::SWGBladeRF2InputReport::~SWGBladeRF2InputReport ( )
virtual

Definition at line 43 of file SWGBladeRF2InputReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGBladeRF2InputReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 108 of file SWGBladeRF2InputReport.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 119 of file SWGBladeRF2InputReport.cpp.

References bandwidth_range, frequency_range, gain_modes, global_gain_range, SWGSDRangel::SWGFrequencyRange::isSet(), SWGSDRangel::SWGRange::isSet(), sample_rate_range, SWGSDRangel::toJsonArray(), and SWGSDRangel::toJsonValue().

Referenced by asJson().

119  {
120  QJsonObject* obj = new QJsonObject();
121  if((frequency_range != nullptr) && (frequency_range->isSet())){
122  toJsonValue(QString("frequencyRange"), frequency_range, obj, QString("SWGFrequencyRange"));
123  }
124  if((sample_rate_range != nullptr) && (sample_rate_range->isSet())){
125  toJsonValue(QString("sampleRateRange"), sample_rate_range, obj, QString("SWGRange"));
126  }
127  if((bandwidth_range != nullptr) && (bandwidth_range->isSet())){
128  toJsonValue(QString("bandwidthRange"), bandwidth_range, obj, QString("SWGRange"));
129  }
130  if((global_gain_range != nullptr) && (global_gain_range->isSet())){
131  toJsonValue(QString("globalGainRange"), global_gain_range, obj, QString("SWGRange"));
132  }
133  if(gain_modes->size() > 0){
134  toJsonArray((QList<void*>*)gain_modes, obj, "gainModes", "SWGNamedEnum");
135  }
136 
137  return obj;
138 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
void toJsonArray(QList< void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:445
virtual bool isSet() override
Definition: SWGRange.cpp:138
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGBladeRF2InputReport::cleanup ( )

Definition at line 62 of file SWGBladeRF2InputReport.cpp.

References bandwidth_range, frequency_range, gain_modes, global_gain_range, and sample_rate_range.

Referenced by ~SWGBladeRF2InputReport().

62  {
63  if(frequency_range != nullptr) {
64  delete frequency_range;
65  }
66  if(sample_rate_range != nullptr) {
67  delete sample_rate_range;
68  }
69  if(bandwidth_range != nullptr) {
70  delete bandwidth_range;
71  }
72  if(global_gain_range != nullptr) {
73  delete global_gain_range;
74  }
75  if(gain_modes != nullptr) {
76  auto arr = gain_modes;
77  for(auto o: *arr) {
78  delete o;
79  }
80  delete gain_modes;
81  }
82 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 85 of file SWGBladeRF2InputReport.cpp.

References fromJsonObject().

Referenced by SWGBladeRF2InputReport().

85  {
86  QByteArray array (json.toStdString().c_str());
87  QJsonDocument doc = QJsonDocument::fromJson(array);
88  QJsonObject jsonObject = doc.object();
89  this->fromJsonObject(jsonObject);
90  return this;
91 }
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::SWGBladeRF2InputReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 94 of file SWGBladeRF2InputReport.cpp.

References bandwidth_range, frequency_range, gain_modes, global_gain_range, sample_rate_range, and SWGSDRangel::setValue().

Referenced by fromJson().

94  {
95  ::SWGSDRangel::setValue(&frequency_range, pJson["frequencyRange"], "SWGFrequencyRange", "SWGFrequencyRange");
96 
97  ::SWGSDRangel::setValue(&sample_rate_range, pJson["sampleRateRange"], "SWGRange", "SWGRange");
98 
99  ::SWGSDRangel::setValue(&bandwidth_range, pJson["bandwidthRange"], "SWGRange", "SWGRange");
100 
101  ::SWGSDRangel::setValue(&global_gain_range, pJson["globalGainRange"], "SWGRange", "SWGRange");
102 
103 
104  ::SWGSDRangel::setValue(&gain_modes, pJson["gainModes"], "QList", "SWGNamedEnum");
105 }
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBandwidthRange()

SWGRange * SWGSDRangel::SWGBladeRF2InputReport::getBandwidthRange ( )

Definition at line 161 of file SWGBladeRF2InputReport.cpp.

References bandwidth_range.

Referenced by BladeRF2Input::webapiFormatDeviceReport().

161  {
162  return bandwidth_range;
163 }
+ Here is the caller graph for this function:

◆ getFrequencyRange()

SWGFrequencyRange * SWGSDRangel::SWGBladeRF2InputReport::getFrequencyRange ( )

Definition at line 141 of file SWGBladeRF2InputReport.cpp.

References frequency_range.

Referenced by BladeRF2Input::webapiFormatDeviceReport().

141  {
142  return frequency_range;
143 }
+ Here is the caller graph for this function:

◆ getGainModes()

QList< SWGNamedEnum * > * SWGSDRangel::SWGBladeRF2InputReport::getGainModes ( )

Definition at line 181 of file SWGBladeRF2InputReport.cpp.

References gain_modes.

Referenced by BladeRF2Input::webapiFormatDeviceReport().

181  {
182  return gain_modes;
183 }
+ Here is the caller graph for this function:

◆ getGlobalGainRange()

SWGRange * SWGSDRangel::SWGBladeRF2InputReport::getGlobalGainRange ( )

Definition at line 171 of file SWGBladeRF2InputReport.cpp.

References global_gain_range.

Referenced by BladeRF2Input::webapiFormatDeviceReport().

171  {
172  return global_gain_range;
173 }
+ Here is the caller graph for this function:

◆ getSampleRateRange()

SWGRange * SWGSDRangel::SWGBladeRF2InputReport::getSampleRateRange ( )

Definition at line 151 of file SWGBladeRF2InputReport.cpp.

References sample_rate_range.

Referenced by BladeRF2Input::webapiFormatDeviceReport().

151  {
152  return sample_rate_range;
153 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGBladeRF2InputReport::init ( )

Definition at line 48 of file SWGBladeRF2InputReport.cpp.

References bandwidth_range, frequency_range, gain_modes, global_gain_range, m_bandwidth_range_isSet, m_frequency_range_isSet, m_gain_modes_isSet, m_global_gain_range_isSet, m_sample_rate_range_isSet, and sample_rate_range.

Referenced by SWGBladeRF2InputReport(), and BladeRF2Input::webapiReportGet().

48  {
49  frequency_range = new SWGFrequencyRange();
51  sample_rate_range = new SWGRange();
53  bandwidth_range = new SWGRange();
55  global_gain_range = new SWGRange();
57  gain_modes = new QList<SWGNamedEnum*>();
58  m_gain_modes_isSet = false;
59 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGBladeRF2InputReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 192 of file SWGBladeRF2InputReport.cpp.

References bandwidth_range, frequency_range, gain_modes, global_gain_range, SWGSDRangel::SWGRange::isSet(), SWGSDRangel::SWGFrequencyRange::isSet(), and sample_rate_range.

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

192  {
193  bool isObjectUpdated = false;
194  do{
195  if(frequency_range != nullptr && frequency_range->isSet()){ isObjectUpdated = true; break;}
196  if(sample_rate_range != nullptr && sample_rate_range->isSet()){ isObjectUpdated = true; break;}
197  if(bandwidth_range != nullptr && bandwidth_range->isSet()){ isObjectUpdated = true; break;}
198  if(global_gain_range != nullptr && global_gain_range->isSet()){ isObjectUpdated = true; break;}
199  if(gain_modes->size() > 0){ isObjectUpdated = true; break;}
200  }while(false);
201  return isObjectUpdated;
202 }
virtual bool isSet() override
Definition: SWGRange.cpp:138
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setBandwidthRange()

void SWGSDRangel::SWGBladeRF2InputReport::setBandwidthRange ( SWGRange bandwidth_range)

Definition at line 165 of file SWGBladeRF2InputReport.cpp.

References bandwidth_range, and m_bandwidth_range_isSet.

Referenced by BladeRF2Input::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setFrequencyRange()

void SWGSDRangel::SWGBladeRF2InputReport::setFrequencyRange ( SWGFrequencyRange frequency_range)

Definition at line 145 of file SWGBladeRF2InputReport.cpp.

References frequency_range, and m_frequency_range_isSet.

Referenced by BladeRF2Input::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setGainModes()

void SWGSDRangel::SWGBladeRF2InputReport::setGainModes ( QList< SWGNamedEnum *> *  gain_modes)

Definition at line 185 of file SWGBladeRF2InputReport.cpp.

References gain_modes, and m_gain_modes_isSet.

Referenced by BladeRF2Input::webapiFormatDeviceReport().

185  {
186  this->gain_modes = gain_modes;
187  this->m_gain_modes_isSet = true;
188 }
+ Here is the caller graph for this function:

◆ setGlobalGainRange()

void SWGSDRangel::SWGBladeRF2InputReport::setGlobalGainRange ( SWGRange global_gain_range)

Definition at line 175 of file SWGBladeRF2InputReport.cpp.

References global_gain_range, and m_global_gain_range_isSet.

Referenced by BladeRF2Input::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setSampleRateRange()

void SWGSDRangel::SWGBladeRF2InputReport::setSampleRateRange ( SWGRange sample_rate_range)

Definition at line 155 of file SWGBladeRF2InputReport.cpp.

References m_sample_rate_range_isSet, and sample_rate_range.

Referenced by BladeRF2Input::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

Member Data Documentation

◆ bandwidth_range

SWGRange* SWGSDRangel::SWGBladeRF2InputReport::bandwidth_range
private

◆ frequency_range

SWGFrequencyRange* SWGSDRangel::SWGBladeRF2InputReport::frequency_range
private

◆ gain_modes

QList<SWGNamedEnum*>* SWGSDRangel::SWGBladeRF2InputReport::gain_modes
private

◆ global_gain_range

SWGRange* SWGSDRangel::SWGBladeRF2InputReport::global_gain_range
private

◆ m_bandwidth_range_isSet

bool SWGSDRangel::SWGBladeRF2InputReport::m_bandwidth_range_isSet
private

Definition at line 74 of file SWGBladeRF2InputReport.h.

Referenced by init(), setBandwidthRange(), and SWGBladeRF2InputReport().

◆ m_frequency_range_isSet

bool SWGSDRangel::SWGBladeRF2InputReport::m_frequency_range_isSet
private

Definition at line 68 of file SWGBladeRF2InputReport.h.

Referenced by init(), setFrequencyRange(), and SWGBladeRF2InputReport().

◆ m_gain_modes_isSet

bool SWGSDRangel::SWGBladeRF2InputReport::m_gain_modes_isSet
private

Definition at line 80 of file SWGBladeRF2InputReport.h.

Referenced by init(), setGainModes(), and SWGBladeRF2InputReport().

◆ m_global_gain_range_isSet

bool SWGSDRangel::SWGBladeRF2InputReport::m_global_gain_range_isSet
private

Definition at line 77 of file SWGBladeRF2InputReport.h.

Referenced by init(), setGlobalGainRange(), and SWGBladeRF2InputReport().

◆ m_sample_rate_range_isSet

bool SWGSDRangel::SWGBladeRF2InputReport::m_sample_rate_range_isSet
private

Definition at line 71 of file SWGBladeRF2InputReport.h.

Referenced by init(), setSampleRateRange(), and SWGBladeRF2InputReport().

◆ sample_rate_range

SWGRange* SWGSDRangel::SWGBladeRF2InputReport::sample_rate_range
private

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