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

#include <SWGPlutoSdrInputReport.h>

+ Inheritance diagram for SWGSDRangel::SWGPlutoSdrInputReport:
+ Collaboration diagram for SWGSDRangel::SWGPlutoSdrInputReport:

Public Member Functions

 SWGPlutoSdrInputReport ()
 
 SWGPlutoSdrInputReport (QString *json)
 
virtual ~SWGPlutoSdrInputReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGPlutoSdrInputReportfromJson (QString &jsonString) override
 
qint32 getAdcRate ()
 
void setAdcRate (qint32 adc_rate)
 
QString * getRssi ()
 
void setRssi (QString *rssi)
 
qint32 getGainDb ()
 
void setGainDb (qint32 gain_db)
 
float getTemperature ()
 
void setTemperature (float temperature)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 adc_rate
 
bool m_adc_rate_isSet
 
QString * rssi
 
bool m_rssi_isSet
 
qint32 gain_db
 
bool m_gain_db_isSet
 
float temperature
 
bool m_temperature_isSet
 

Detailed Description

Definition at line 32 of file SWGPlutoSdrInputReport.h.

Constructor & Destructor Documentation

◆ SWGPlutoSdrInputReport() [1/2]

SWGSDRangel::SWGPlutoSdrInputReport::SWGPlutoSdrInputReport ( )

◆ SWGPlutoSdrInputReport() [2/2]

SWGSDRangel::SWGPlutoSdrInputReport::SWGPlutoSdrInputReport ( QString *  json)

Definition at line 25 of file SWGPlutoSdrInputReport.cpp.

References fromJson(), and init().

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

◆ ~SWGPlutoSdrInputReport()

SWGSDRangel::SWGPlutoSdrInputReport::~SWGPlutoSdrInputReport ( )
virtual

Definition at line 41 of file SWGPlutoSdrInputReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGPlutoSdrInputReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 89 of file SWGPlutoSdrInputReport.cpp.

References asJsonObject().

90 {
91  QJsonObject* obj = this->asJsonObject();
92 
93  QJsonDocument doc(*obj);
94  QByteArray bytes = doc.toJson();
95  delete obj;
96  return QString(bytes);
97 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 100 of file SWGPlutoSdrInputReport.cpp.

References adc_rate, gain_db, m_adc_rate_isSet, m_gain_db_isSet, m_temperature_isSet, rssi, temperature, and SWGSDRangel::toJsonValue().

Referenced by asJson().

100  {
101  QJsonObject* obj = new QJsonObject();
102  if(m_adc_rate_isSet){
103  obj->insert("adcRate", QJsonValue(adc_rate));
104  }
105  if(rssi != nullptr && *rssi != QString("")){
106  toJsonValue(QString("rssi"), rssi, obj, QString("QString"));
107  }
108  if(m_gain_db_isSet){
109  obj->insert("gainDB", QJsonValue(gain_db));
110  }
112  obj->insert("temperature", QJsonValue(temperature));
113  }
114 
115  return obj;
116 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGPlutoSdrInputReport::cleanup ( )

Definition at line 58 of file SWGPlutoSdrInputReport.cpp.

References rssi.

Referenced by ~SWGPlutoSdrInputReport().

58  {
59 
60  if(rssi != nullptr) {
61  delete rssi;
62  }
63 
64 
65 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 68 of file SWGPlutoSdrInputReport.cpp.

References fromJsonObject().

Referenced by SWGPlutoSdrInputReport().

68  {
69  QByteArray array (json.toStdString().c_str());
70  QJsonDocument doc = QJsonDocument::fromJson(array);
71  QJsonObject jsonObject = doc.object();
72  this->fromJsonObject(jsonObject);
73  return this;
74 }
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::SWGPlutoSdrInputReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 77 of file SWGPlutoSdrInputReport.cpp.

References adc_rate, gain_db, rssi, SWGSDRangel::setValue(), and temperature.

Referenced by fromJson().

77  {
78  ::SWGSDRangel::setValue(&adc_rate, pJson["adcRate"], "qint32", "");
79 
80  ::SWGSDRangel::setValue(&rssi, pJson["rssi"], "QString", "QString");
81 
82  ::SWGSDRangel::setValue(&gain_db, pJson["gainDB"], "qint32", "");
83 
84  ::SWGSDRangel::setValue(&temperature, pJson["temperature"], "float", "");
85 
86 }
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:

◆ getAdcRate()

qint32 SWGSDRangel::SWGPlutoSdrInputReport::getAdcRate ( )

Definition at line 119 of file SWGPlutoSdrInputReport.cpp.

References adc_rate.

119  {
120  return adc_rate;
121 }

◆ getGainDb()

qint32 SWGSDRangel::SWGPlutoSdrInputReport::getGainDb ( )

Definition at line 139 of file SWGPlutoSdrInputReport.cpp.

References gain_db.

139  {
140  return gain_db;
141 }

◆ getRssi()

QString * SWGSDRangel::SWGPlutoSdrInputReport::getRssi ( )

Definition at line 129 of file SWGPlutoSdrInputReport.cpp.

References rssi.

129  {
130  return rssi;
131 }

◆ getTemperature()

float SWGSDRangel::SWGPlutoSdrInputReport::getTemperature ( )

Definition at line 149 of file SWGPlutoSdrInputReport.cpp.

References temperature.

149  {
150  return temperature;
151 }

◆ init()

void SWGSDRangel::SWGPlutoSdrInputReport::init ( )

◆ isSet()

bool SWGSDRangel::SWGPlutoSdrInputReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 160 of file SWGPlutoSdrInputReport.cpp.

References m_adc_rate_isSet, m_gain_db_isSet, m_temperature_isSet, and rssi.

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

160  {
161  bool isObjectUpdated = false;
162  do{
163  if(m_adc_rate_isSet){ isObjectUpdated = true; break;}
164  if(rssi != nullptr && *rssi != QString("")){ isObjectUpdated = true; break;}
165  if(m_gain_db_isSet){ isObjectUpdated = true; break;}
166  if(m_temperature_isSet){ isObjectUpdated = true; break;}
167  }while(false);
168  return isObjectUpdated;
169 }
+ Here is the caller graph for this function:

◆ setAdcRate()

void SWGSDRangel::SWGPlutoSdrInputReport::setAdcRate ( qint32  adc_rate)

Definition at line 123 of file SWGPlutoSdrInputReport.cpp.

References adc_rate, and m_adc_rate_isSet.

Referenced by PlutoSDRInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setGainDb()

void SWGSDRangel::SWGPlutoSdrInputReport::setGainDb ( qint32  gain_db)

Definition at line 143 of file SWGPlutoSdrInputReport.cpp.

References gain_db, and m_gain_db_isSet.

Referenced by PlutoSDRInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setRssi()

void SWGSDRangel::SWGPlutoSdrInputReport::setRssi ( QString *  rssi)

Definition at line 133 of file SWGPlutoSdrInputReport.cpp.

References m_rssi_isSet, and rssi.

Referenced by PlutoSDRInput::webapiFormatDeviceReport().

133  {
134  this->rssi = rssi;
135  this->m_rssi_isSet = true;
136 }
+ Here is the caller graph for this function:

◆ setTemperature()

void SWGSDRangel::SWGPlutoSdrInputReport::setTemperature ( float  temperature)

Definition at line 153 of file SWGPlutoSdrInputReport.cpp.

References m_temperature_isSet, and temperature.

Referenced by PlutoSDRInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

Member Data Documentation

◆ adc_rate

qint32 SWGSDRangel::SWGPlutoSdrInputReport::adc_rate
private

◆ gain_db

qint32 SWGSDRangel::SWGPlutoSdrInputReport::gain_db
private

◆ m_adc_rate_isSet

bool SWGSDRangel::SWGPlutoSdrInputReport::m_adc_rate_isSet
private

◆ m_gain_db_isSet

bool SWGSDRangel::SWGPlutoSdrInputReport::m_gain_db_isSet
private

Definition at line 68 of file SWGPlutoSdrInputReport.h.

Referenced by asJsonObject(), init(), isSet(), setGainDb(), and SWGPlutoSdrInputReport().

◆ m_rssi_isSet

bool SWGSDRangel::SWGPlutoSdrInputReport::m_rssi_isSet
private

Definition at line 65 of file SWGPlutoSdrInputReport.h.

Referenced by init(), setRssi(), and SWGPlutoSdrInputReport().

◆ m_temperature_isSet

bool SWGSDRangel::SWGPlutoSdrInputReport::m_temperature_isSet
private

◆ rssi

QString* SWGSDRangel::SWGPlutoSdrInputReport::rssi
private

◆ temperature

float SWGSDRangel::SWGPlutoSdrInputReport::temperature
private

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