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

#include <SWGRtlSdrReport.h>

+ Inheritance diagram for SWGSDRangel::SWGRtlSdrReport:
+ Collaboration diagram for SWGSDRangel::SWGRtlSdrReport:

Public Member Functions

 SWGRtlSdrReport ()
 
 SWGRtlSdrReport (QString *json)
 
virtual ~SWGRtlSdrReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGRtlSdrReportfromJson (QString &jsonString) override
 
QList< SWGGain * > * getGains ()
 
void setGains (QList< SWGGain *> *gains)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QList< SWGGain * > * gains
 
bool m_gains_isSet
 

Detailed Description

Definition at line 33 of file SWGRtlSdrReport.h.

Constructor & Destructor Documentation

◆ SWGRtlSdrReport() [1/2]

SWGSDRangel::SWGRtlSdrReport::SWGRtlSdrReport ( )

Definition at line 30 of file SWGRtlSdrReport.cpp.

References gains, and m_gains_isSet.

30  {
31  gains = nullptr;
32  m_gains_isSet = false;
33 }
QList< SWGGain * > * gains

◆ SWGRtlSdrReport() [2/2]

SWGSDRangel::SWGRtlSdrReport::SWGRtlSdrReport ( QString *  json)

Definition at line 25 of file SWGRtlSdrReport.cpp.

References fromJson(), and init().

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

◆ ~SWGRtlSdrReport()

SWGSDRangel::SWGRtlSdrReport::~SWGRtlSdrReport ( )
virtual

Definition at line 35 of file SWGRtlSdrReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGRtlSdrReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 72 of file SWGRtlSdrReport.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::SWGRtlSdrReport::asJsonObject ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 83 of file SWGRtlSdrReport.cpp.

References gains, and SWGSDRangel::toJsonArray().

Referenced by asJson().

83  {
84  QJsonObject* obj = new QJsonObject();
85  if(gains->size() > 0){
86  toJsonArray((QList<void*>*)gains, obj, "gains", "SWGGain");
87  }
88 
89  return obj;
90 }
QList< SWGGain * > * gains
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::SWGRtlSdrReport::cleanup ( )

Definition at line 46 of file SWGRtlSdrReport.cpp.

References gains.

Referenced by ~SWGRtlSdrReport().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 57 of file SWGRtlSdrReport.cpp.

References fromJsonObject().

Referenced by SWGRtlSdrReport().

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::SWGRtlSdrReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 66 of file SWGRtlSdrReport.cpp.

References gains, and SWGSDRangel::setValue().

Referenced by fromJson().

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

◆ getGains()

QList< SWGGain * > * SWGSDRangel::SWGRtlSdrReport::getGains ( )

Definition at line 93 of file SWGRtlSdrReport.cpp.

References gains.

Referenced by RTLSDRInput::webapiFormatDeviceReport().

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

◆ init()

void SWGSDRangel::SWGRtlSdrReport::init ( )

Definition at line 40 of file SWGRtlSdrReport.cpp.

References gains, and m_gains_isSet.

Referenced by SWGRtlSdrReport(), and RTLSDRInput::webapiReportGet().

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

◆ isSet()

bool SWGSDRangel::SWGRtlSdrReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 104 of file SWGRtlSdrReport.cpp.

References gains.

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

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

◆ setGains()

void SWGSDRangel::SWGRtlSdrReport::setGains ( QList< SWGGain *> *  gains)

Definition at line 97 of file SWGRtlSdrReport.cpp.

References gains, and m_gains_isSet.

Referenced by RTLSDRInput::webapiFormatDeviceReport().

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

Member Data Documentation

◆ gains

QList<SWGGain*>* SWGSDRangel::SWGRtlSdrReport::gains
private

◆ m_gains_isSet

bool SWGSDRangel::SWGRtlSdrReport::m_gains_isSet
private

Definition at line 54 of file SWGRtlSdrReport.h.

Referenced by init(), setGains(), and SWGRtlSdrReport().


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