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

#include <SWGNFMModReport.h>

+ Inheritance diagram for SWGSDRangel::SWGNFMModReport:
+ Collaboration diagram for SWGSDRangel::SWGNFMModReport:

Public Member Functions

 SWGNFMModReport ()
 
 SWGNFMModReport (QString *json)
 
virtual ~SWGNFMModReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGNFMModReportfromJson (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 SWGNFMModReport.h.

Constructor & Destructor Documentation

◆ SWGNFMModReport() [1/2]

SWGSDRangel::SWGNFMModReport::SWGNFMModReport ( )

◆ SWGNFMModReport() [2/2]

SWGSDRangel::SWGNFMModReport::SWGNFMModReport ( QString *  json)

Definition at line 25 of file SWGNFMModReport.cpp.

References fromJson(), and init().

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

◆ ~SWGNFMModReport()

SWGSDRangel::SWGNFMModReport::~SWGNFMModReport ( )
virtual

Definition at line 39 of file SWGNFMModReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGNFMModReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 91 of file SWGNFMModReport.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::SWGNFMModReport::cleanup ( )

Definition at line 54 of file SWGNFMModReport.cpp.

Referenced by ~SWGNFMModReport().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 61 of file SWGNFMModReport.cpp.

References fromJsonObject().

Referenced by SWGNFMModReport().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 70 of file SWGNFMModReport.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::SWGNFMModReport::getAudioSampleRate ( )

Definition at line 117 of file SWGNFMModReport.cpp.

References audio_sample_rate.

117  {
118  return audio_sample_rate;
119 }

◆ getChannelPowerDb()

float SWGSDRangel::SWGNFMModReport::getChannelPowerDb ( )

Definition at line 107 of file SWGNFMModReport.cpp.

References channel_power_db.

107  {
108  return channel_power_db;
109 }

◆ getChannelSampleRate()

qint32 SWGSDRangel::SWGNFMModReport::getChannelSampleRate ( )

Definition at line 127 of file SWGNFMModReport.cpp.

References channel_sample_rate.

127  {
128  return channel_sample_rate;
129 }

◆ init()

void SWGSDRangel::SWGNFMModReport::init ( )

◆ isSet()

bool SWGSDRangel::SWGNFMModReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 138 of file SWGNFMModReport.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::SWGNFMModReport::setAudioSampleRate ( qint32  audio_sample_rate)

Definition at line 121 of file SWGNFMModReport.cpp.

References audio_sample_rate, and m_audio_sample_rate_isSet.

Referenced by NFMMod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelPowerDb()

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

Definition at line 111 of file SWGNFMModReport.cpp.

References channel_power_db, and m_channel_power_db_isSet.

Referenced by NFMMod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelSampleRate()

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

Definition at line 131 of file SWGNFMModReport.cpp.

References channel_sample_rate, and m_channel_sample_rate_isSet.

Referenced by NFMMod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

Member Data Documentation

◆ audio_sample_rate

qint32 SWGSDRangel::SWGNFMModReport::audio_sample_rate
private

◆ channel_power_db

float SWGSDRangel::SWGNFMModReport::channel_power_db
private

◆ channel_sample_rate

qint32 SWGSDRangel::SWGNFMModReport::channel_sample_rate
private

◆ m_audio_sample_rate_isSet

bool SWGSDRangel::SWGNFMModReport::m_audio_sample_rate_isSet
private

Definition at line 61 of file SWGNFMModReport.h.

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

◆ m_channel_power_db_isSet

bool SWGSDRangel::SWGNFMModReport::m_channel_power_db_isSet
private

Definition at line 58 of file SWGNFMModReport.h.

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

◆ m_channel_sample_rate_isSet

bool SWGSDRangel::SWGNFMModReport::m_channel_sample_rate_isSet
private

Definition at line 64 of file SWGNFMModReport.h.

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


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