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

#include <SWGAMModReport.h>

+ Inheritance diagram for SWGSDRangel::SWGAMModReport:
+ Collaboration diagram for SWGSDRangel::SWGAMModReport:

Public Member Functions

 SWGAMModReport ()
 
 SWGAMModReport (QString *json)
 
virtual ~SWGAMModReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGAMModReportfromJson (QString &jsonString) override
 
float getChannelPowerDb ()
 
void setChannelPowerDb (float channel_power_db)
 
qint32 getAudioSampleRate ()
 
void setAudioSampleRate (qint32 audio_sample_rate)
 
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 audio_sample_rate
 
bool m_audio_sample_rate_isSet
 
qint32 channel_sample_rate
 
bool m_channel_sample_rate_isSet
 

Detailed Description

Definition at line 31 of file SWGAMModReport.h.

Constructor & Destructor Documentation

◆ SWGAMModReport() [1/2]

SWGSDRangel::SWGAMModReport::SWGAMModReport ( )

◆ SWGAMModReport() [2/2]

SWGSDRangel::SWGAMModReport::SWGAMModReport ( QString *  json)

Definition at line 25 of file SWGAMModReport.cpp.

References fromJson(), and init().

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

◆ ~SWGAMModReport()

SWGSDRangel::SWGAMModReport::~SWGAMModReport ( )
virtual

Definition at line 39 of file SWGAMModReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGAMModReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 80 of file SWGAMModReport.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 91 of file SWGAMModReport.cpp.

References audio_sample_rate, channel_power_db, channel_sample_rate, m_audio_sample_rate_isSet, m_channel_power_db_isSet, and m_channel_sample_rate_isSet.

Referenced by asJson().

91  {
92  QJsonObject* obj = new QJsonObject();
94  obj->insert("channelPowerDB", QJsonValue(channel_power_db));
95  }
97  obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
98  }
100  obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
101  }
102 
103  return obj;
104 }
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGAMModReport::cleanup ( )

Definition at line 54 of file SWGAMModReport.cpp.

Referenced by ~SWGAMModReport().

54  {
55 
56 
57 
58 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 61 of file SWGAMModReport.cpp.

References fromJsonObject().

Referenced by SWGAMModReport().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 70 of file SWGAMModReport.cpp.

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

Referenced by fromJson().

70  {
71  ::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
72 
73  ::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
74 
75  ::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
76 
77 }
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:

◆ getAudioSampleRate()

qint32 SWGSDRangel::SWGAMModReport::getAudioSampleRate ( )

Definition at line 117 of file SWGAMModReport.cpp.

References audio_sample_rate.

117  {
118  return audio_sample_rate;
119 }

◆ getChannelPowerDb()

float SWGSDRangel::SWGAMModReport::getChannelPowerDb ( )

Definition at line 107 of file SWGAMModReport.cpp.

References channel_power_db.

107  {
108  return channel_power_db;
109 }

◆ getChannelSampleRate()

qint32 SWGSDRangel::SWGAMModReport::getChannelSampleRate ( )

Definition at line 127 of file SWGAMModReport.cpp.

References channel_sample_rate.

127  {
128  return channel_sample_rate;
129 }

◆ init()

void SWGSDRangel::SWGAMModReport::init ( )

◆ isSet()

bool SWGSDRangel::SWGAMModReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 138 of file SWGAMModReport.cpp.

References m_audio_sample_rate_isSet, m_channel_power_db_isSet, and m_channel_sample_rate_isSet.

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

138  {
139  bool isObjectUpdated = false;
140  do{
141  if(m_channel_power_db_isSet){ isObjectUpdated = true; break;}
142  if(m_audio_sample_rate_isSet){ isObjectUpdated = true; break;}
143  if(m_channel_sample_rate_isSet){ isObjectUpdated = true; break;}
144  }while(false);
145  return isObjectUpdated;
146 }
+ Here is the caller graph for this function:

◆ setAudioSampleRate()

void SWGSDRangel::SWGAMModReport::setAudioSampleRate ( qint32  audio_sample_rate)

Definition at line 121 of file SWGAMModReport.cpp.

References audio_sample_rate, and m_audio_sample_rate_isSet.

Referenced by AMMod::webapiFormatChannelReport().

121  {
123  this->m_audio_sample_rate_isSet = true;
124 }
+ Here is the caller graph for this function:

◆ setChannelPowerDb()

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

Definition at line 111 of file SWGAMModReport.cpp.

References channel_power_db, and m_channel_power_db_isSet.

Referenced by AMMod::webapiFormatChannelReport().

111  {
113  this->m_channel_power_db_isSet = true;
114 }
+ Here is the caller graph for this function:

◆ setChannelSampleRate()

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

Definition at line 131 of file SWGAMModReport.cpp.

References channel_sample_rate, and m_channel_sample_rate_isSet.

Referenced by AMMod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

Member Data Documentation

◆ audio_sample_rate

qint32 SWGSDRangel::SWGAMModReport::audio_sample_rate
private

◆ channel_power_db

float SWGSDRangel::SWGAMModReport::channel_power_db
private

◆ channel_sample_rate

qint32 SWGSDRangel::SWGAMModReport::channel_sample_rate
private

◆ m_audio_sample_rate_isSet

bool SWGSDRangel::SWGAMModReport::m_audio_sample_rate_isSet
private

Definition at line 61 of file SWGAMModReport.h.

Referenced by asJsonObject(), init(), isSet(), setAudioSampleRate(), and SWGAMModReport().

◆ m_channel_power_db_isSet

bool SWGSDRangel::SWGAMModReport::m_channel_power_db_isSet
private

Definition at line 58 of file SWGAMModReport.h.

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

◆ m_channel_sample_rate_isSet

bool SWGSDRangel::SWGAMModReport::m_channel_sample_rate_isSet
private

Definition at line 64 of file SWGAMModReport.h.

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


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