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

#include <SWGAirspyHFReport.h>

+ Inheritance diagram for SWGSDRangel::SWGAirspyHFReport:
+ Collaboration diagram for SWGSDRangel::SWGAirspyHFReport:

Public Member Functions

 SWGAirspyHFReport ()
 
 SWGAirspyHFReport (QString *json)
 
virtual ~SWGAirspyHFReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGAirspyHFReportfromJson (QString &jsonString) override
 
QList< SWGSampleRate * > * getSampleRates ()
 
void setSampleRates (QList< SWGSampleRate *> *sample_rates)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QList< SWGSampleRate * > * sample_rates
 
bool m_sample_rates_isSet
 

Detailed Description

Definition at line 33 of file SWGAirspyHFReport.h.

Constructor & Destructor Documentation

◆ SWGAirspyHFReport() [1/2]

SWGSDRangel::SWGAirspyHFReport::SWGAirspyHFReport ( )

Definition at line 30 of file SWGAirspyHFReport.cpp.

References m_sample_rates_isSet, and sample_rates.

30  {
31  sample_rates = nullptr;
32  m_sample_rates_isSet = false;
33 }
QList< SWGSampleRate * > * sample_rates

◆ SWGAirspyHFReport() [2/2]

SWGSDRangel::SWGAirspyHFReport::SWGAirspyHFReport ( QString *  json)

Definition at line 25 of file SWGAirspyHFReport.cpp.

References fromJson(), and init().

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

◆ ~SWGAirspyHFReport()

SWGSDRangel::SWGAirspyHFReport::~SWGAirspyHFReport ( )
virtual

Definition at line 35 of file SWGAirspyHFReport.cpp.

References cleanup().

35  {
36  this->cleanup();
37 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGAirspyHFReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 72 of file SWGAirspyHFReport.cpp.

References asJsonObject().

73 {
74  QJsonObject* obj = this->asJsonObject();
75 
76  QJsonDocument doc(*obj);
77  QByteArray bytes = doc.toJson();
78  delete obj;
79  return QString(bytes);
80 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 83 of file SWGAirspyHFReport.cpp.

References sample_rates, and SWGSDRangel::toJsonArray().

Referenced by asJson().

83  {
84  QJsonObject* obj = new QJsonObject();
85  if(sample_rates->size() > 0){
86  toJsonArray((QList<void*>*)sample_rates, obj, "sampleRates", "SWGSampleRate");
87  }
88 
89  return obj;
90 }
QList< SWGSampleRate * > * sample_rates
void toJsonArray(QList< void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:445
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGAirspyHFReport::cleanup ( )

Definition at line 46 of file SWGAirspyHFReport.cpp.

References sample_rates.

Referenced by ~SWGAirspyHFReport().

46  {
47  if(sample_rates != nullptr) {
48  auto arr = sample_rates;
49  for(auto o: *arr) {
50  delete o;
51  }
52  delete sample_rates;
53  }
54 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 57 of file SWGAirspyHFReport.cpp.

References fromJsonObject().

Referenced by SWGAirspyHFReport().

57  {
58  QByteArray array (json.toStdString().c_str());
59  QJsonDocument doc = QJsonDocument::fromJson(array);
60  QJsonObject jsonObject = doc.object();
61  this->fromJsonObject(jsonObject);
62  return this;
63 }
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::SWGAirspyHFReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 66 of file SWGAirspyHFReport.cpp.

References sample_rates, and SWGSDRangel::setValue().

Referenced by fromJson().

66  {
67 
68  ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGSampleRate");
69 }
QList< SWGSampleRate * > * sample_rates
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:

◆ getSampleRates()

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

Definition at line 93 of file SWGAirspyHFReport.cpp.

References sample_rates.

Referenced by AirspyHFInput::webapiFormatDeviceReport().

93  {
94  return sample_rates;
95 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGAirspyHFReport::init ( )

Definition at line 40 of file SWGAirspyHFReport.cpp.

References m_sample_rates_isSet, and sample_rates.

Referenced by SWGAirspyHFReport(), and AirspyHFInput::webapiReportGet().

40  {
41  sample_rates = new QList<SWGSampleRate*>();
42  m_sample_rates_isSet = false;
43 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGAirspyHFReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 104 of file SWGAirspyHFReport.cpp.

References sample_rates.

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

104  {
105  bool isObjectUpdated = false;
106  do{
107  if(sample_rates->size() > 0){ isObjectUpdated = true; break;}
108  }while(false);
109  return isObjectUpdated;
110 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

◆ setSampleRates()

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

Definition at line 97 of file SWGAirspyHFReport.cpp.

References m_sample_rates_isSet, and sample_rates.

Referenced by AirspyHFInput::webapiFormatDeviceReport().

97  {
98  this->sample_rates = sample_rates;
99  this->m_sample_rates_isSet = true;
100 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_sample_rates_isSet

bool SWGSDRangel::SWGAirspyHFReport::m_sample_rates_isSet
private

Definition at line 54 of file SWGAirspyHFReport.h.

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

◆ sample_rates

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

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