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

#include <SWGATVModReport.h>

+ Inheritance diagram for SWGSDRangel::SWGATVModReport:
+ Collaboration diagram for SWGSDRangel::SWGATVModReport:

Public Member Functions

 SWGATVModReport ()
 
 SWGATVModReport (QString *json)
 
virtual ~SWGATVModReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGATVModReportfromJson (QString &jsonString) override
 
float getChannelPowerDb ()
 
void setChannelPowerDb (float channel_power_db)
 
qint32 getChannelSampleRate ()
 
void setChannelSampleRate (qint32 channel_sample_rate)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

float channel_power_db
 
bool m_channel_power_db_isSet
 
qint32 channel_sample_rate
 
bool m_channel_sample_rate_isSet
 

Detailed Description

Definition at line 31 of file SWGATVModReport.h.

Constructor & Destructor Documentation

◆ SWGATVModReport() [1/2]

SWGSDRangel::SWGATVModReport::SWGATVModReport ( )

◆ SWGATVModReport() [2/2]

SWGSDRangel::SWGATVModReport::SWGATVModReport ( QString *  json)

Definition at line 25 of file SWGATVModReport.cpp.

References fromJson(), and init().

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

◆ ~SWGATVModReport()

SWGSDRangel::SWGATVModReport::~SWGATVModReport ( )
virtual

Definition at line 37 of file SWGATVModReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGATVModReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 73 of file SWGATVModReport.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 84 of file SWGATVModReport.cpp.

References channel_power_db, channel_sample_rate, m_channel_power_db_isSet, and m_channel_sample_rate_isSet.

Referenced by asJson().

84  {
85  QJsonObject* obj = new QJsonObject();
87  obj->insert("channelPowerDB", QJsonValue(channel_power_db));
88  }
90  obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
91  }
92 
93  return obj;
94 }
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGATVModReport::cleanup ( )

Definition at line 50 of file SWGATVModReport.cpp.

Referenced by ~SWGATVModReport().

50  {
51 
52 
53 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 56 of file SWGATVModReport.cpp.

References fromJsonObject().

Referenced by SWGATVModReport().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 65 of file SWGATVModReport.cpp.

References channel_power_db, channel_sample_rate, and SWGSDRangel::setValue().

Referenced by fromJson().

65  {
66  ::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
67 
68  ::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
69 
70 }
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:

◆ getChannelPowerDb()

float SWGSDRangel::SWGATVModReport::getChannelPowerDb ( )

Definition at line 97 of file SWGATVModReport.cpp.

References channel_power_db.

97  {
98  return channel_power_db;
99 }

◆ getChannelSampleRate()

qint32 SWGSDRangel::SWGATVModReport::getChannelSampleRate ( )

Definition at line 107 of file SWGATVModReport.cpp.

References channel_sample_rate.

107  {
108  return channel_sample_rate;
109 }

◆ init()

void SWGSDRangel::SWGATVModReport::init ( )

Definition at line 42 of file SWGATVModReport.cpp.

References channel_power_db, channel_sample_rate, m_channel_power_db_isSet, and m_channel_sample_rate_isSet.

Referenced by SWGATVModReport(), and ATVMod::webapiReportGet().

+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGATVModReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 118 of file SWGATVModReport.cpp.

References m_channel_power_db_isSet, and m_channel_sample_rate_isSet.

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

118  {
119  bool isObjectUpdated = false;
120  do{
121  if(m_channel_power_db_isSet){ isObjectUpdated = true; break;}
122  if(m_channel_sample_rate_isSet){ isObjectUpdated = true; break;}
123  }while(false);
124  return isObjectUpdated;
125 }
+ Here is the caller graph for this function:

◆ setChannelPowerDb()

void SWGSDRangel::SWGATVModReport::setChannelPowerDb ( float  channel_power_db)

Definition at line 101 of file SWGATVModReport.cpp.

References channel_power_db, and m_channel_power_db_isSet.

Referenced by ATVMod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelSampleRate()

void SWGSDRangel::SWGATVModReport::setChannelSampleRate ( qint32  channel_sample_rate)

Definition at line 111 of file SWGATVModReport.cpp.

References channel_sample_rate, and m_channel_sample_rate_isSet.

Referenced by ATVMod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

Member Data Documentation

◆ channel_power_db

float SWGSDRangel::SWGATVModReport::channel_power_db
private

◆ channel_sample_rate

qint32 SWGSDRangel::SWGATVModReport::channel_sample_rate
private

◆ m_channel_power_db_isSet

bool SWGSDRangel::SWGATVModReport::m_channel_power_db_isSet
private

Definition at line 55 of file SWGATVModReport.h.

Referenced by asJsonObject(), init(), isSet(), setChannelPowerDb(), and SWGATVModReport().

◆ m_channel_sample_rate_isSet

bool SWGSDRangel::SWGATVModReport::m_channel_sample_rate_isSet
private

Definition at line 58 of file SWGATVModReport.h.

Referenced by asJsonObject(), init(), isSet(), setChannelSampleRate(), and SWGATVModReport().


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