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

#include <SWGPlutoSdrOutputReport.h>

+ Inheritance diagram for SWGSDRangel::SWGPlutoSdrOutputReport:
+ Collaboration diagram for SWGSDRangel::SWGPlutoSdrOutputReport:

Public Member Functions

 SWGPlutoSdrOutputReport ()
 
 SWGPlutoSdrOutputReport (QString *json)
 
virtual ~SWGPlutoSdrOutputReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGPlutoSdrOutputReportfromJson (QString &jsonString) override
 
qint32 getDacRate ()
 
void setDacRate (qint32 dac_rate)
 
QString * getRssi ()
 
void setRssi (QString *rssi)
 
float getTemperature ()
 
void setTemperature (float temperature)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 dac_rate
 
bool m_dac_rate_isSet
 
QString * rssi
 
bool m_rssi_isSet
 
float temperature
 
bool m_temperature_isSet
 

Detailed Description

Definition at line 32 of file SWGPlutoSdrOutputReport.h.

Constructor & Destructor Documentation

◆ SWGPlutoSdrOutputReport() [1/2]

SWGSDRangel::SWGPlutoSdrOutputReport::SWGPlutoSdrOutputReport ( )

◆ SWGPlutoSdrOutputReport() [2/2]

SWGSDRangel::SWGPlutoSdrOutputReport::SWGPlutoSdrOutputReport ( QString *  json)

Definition at line 25 of file SWGPlutoSdrOutputReport.cpp.

References fromJson(), and init().

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

◆ ~SWGPlutoSdrOutputReport()

SWGSDRangel::SWGPlutoSdrOutputReport::~SWGPlutoSdrOutputReport ( )
virtual

Definition at line 39 of file SWGPlutoSdrOutputReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGPlutoSdrOutputReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 82 of file SWGPlutoSdrOutputReport.cpp.

References asJsonObject().

83 {
84  QJsonObject* obj = this->asJsonObject();
85 
86  QJsonDocument doc(*obj);
87  QByteArray bytes = doc.toJson();
88  delete obj;
89  return QString(bytes);
90 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 93 of file SWGPlutoSdrOutputReport.cpp.

References dac_rate, m_dac_rate_isSet, m_temperature_isSet, rssi, temperature, and SWGSDRangel::toJsonValue().

Referenced by asJson().

93  {
94  QJsonObject* obj = new QJsonObject();
95  if(m_dac_rate_isSet){
96  obj->insert("dacRate", QJsonValue(dac_rate));
97  }
98  if(rssi != nullptr && *rssi != QString("")){
99  toJsonValue(QString("rssi"), rssi, obj, QString("QString"));
100  }
102  obj->insert("temperature", QJsonValue(temperature));
103  }
104 
105  return obj;
106 }
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::SWGPlutoSdrOutputReport::cleanup ( )

Definition at line 54 of file SWGPlutoSdrOutputReport.cpp.

References rssi.

Referenced by ~SWGPlutoSdrOutputReport().

54  {
55 
56  if(rssi != nullptr) {
57  delete rssi;
58  }
59 
60 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 63 of file SWGPlutoSdrOutputReport.cpp.

References fromJsonObject().

Referenced by SWGPlutoSdrOutputReport().

63  {
64  QByteArray array (json.toStdString().c_str());
65  QJsonDocument doc = QJsonDocument::fromJson(array);
66  QJsonObject jsonObject = doc.object();
67  this->fromJsonObject(jsonObject);
68  return this;
69 }
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::SWGPlutoSdrOutputReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 72 of file SWGPlutoSdrOutputReport.cpp.

References dac_rate, rssi, SWGSDRangel::setValue(), and temperature.

Referenced by fromJson().

72  {
73  ::SWGSDRangel::setValue(&dac_rate, pJson["dacRate"], "qint32", "");
74 
75  ::SWGSDRangel::setValue(&rssi, pJson["rssi"], "QString", "QString");
76 
77  ::SWGSDRangel::setValue(&temperature, pJson["temperature"], "float", "");
78 
79 }
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:

◆ getDacRate()

qint32 SWGSDRangel::SWGPlutoSdrOutputReport::getDacRate ( )

Definition at line 109 of file SWGPlutoSdrOutputReport.cpp.

References dac_rate.

109  {
110  return dac_rate;
111 }

◆ getRssi()

QString * SWGSDRangel::SWGPlutoSdrOutputReport::getRssi ( )

Definition at line 119 of file SWGPlutoSdrOutputReport.cpp.

References rssi.

119  {
120  return rssi;
121 }

◆ getTemperature()

float SWGSDRangel::SWGPlutoSdrOutputReport::getTemperature ( )

Definition at line 129 of file SWGPlutoSdrOutputReport.cpp.

References temperature.

129  {
130  return temperature;
131 }

◆ init()

void SWGSDRangel::SWGPlutoSdrOutputReport::init ( )

◆ isSet()

bool SWGSDRangel::SWGPlutoSdrOutputReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 140 of file SWGPlutoSdrOutputReport.cpp.

References m_dac_rate_isSet, m_temperature_isSet, and rssi.

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

140  {
141  bool isObjectUpdated = false;
142  do{
143  if(m_dac_rate_isSet){ isObjectUpdated = true; break;}
144  if(rssi != nullptr && *rssi != QString("")){ isObjectUpdated = true; break;}
145  if(m_temperature_isSet){ isObjectUpdated = true; break;}
146  }while(false);
147  return isObjectUpdated;
148 }
+ Here is the caller graph for this function:

◆ setDacRate()

void SWGSDRangel::SWGPlutoSdrOutputReport::setDacRate ( qint32  dac_rate)

Definition at line 113 of file SWGPlutoSdrOutputReport.cpp.

References dac_rate, and m_dac_rate_isSet.

Referenced by PlutoSDROutput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setRssi()

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

Definition at line 123 of file SWGPlutoSdrOutputReport.cpp.

References m_rssi_isSet, and rssi.

Referenced by PlutoSDROutput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setTemperature()

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

Definition at line 133 of file SWGPlutoSdrOutputReport.cpp.

References m_temperature_isSet, and temperature.

Referenced by PlutoSDROutput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

Member Data Documentation

◆ dac_rate

qint32 SWGSDRangel::SWGPlutoSdrOutputReport::dac_rate
private

◆ m_dac_rate_isSet

bool SWGSDRangel::SWGPlutoSdrOutputReport::m_dac_rate_isSet
private

◆ m_rssi_isSet

bool SWGSDRangel::SWGPlutoSdrOutputReport::m_rssi_isSet
private

Definition at line 62 of file SWGPlutoSdrOutputReport.h.

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

◆ m_temperature_isSet

bool SWGSDRangel::SWGPlutoSdrOutputReport::m_temperature_isSet
private

◆ rssi

QString* SWGSDRangel::SWGPlutoSdrOutputReport::rssi
private

◆ temperature

float SWGSDRangel::SWGPlutoSdrOutputReport::temperature
private

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