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

#include <SWGAMDemodReport.h>

+ Inheritance diagram for SWGSDRangel::SWGAMDemodReport:
+ Collaboration diagram for SWGSDRangel::SWGAMDemodReport:

Public Member Functions

 SWGAMDemodReport ()
 
 SWGAMDemodReport (QString *json)
 
virtual ~SWGAMDemodReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGAMDemodReportfromJson (QString &jsonString) override
 
float getChannelPowerDb ()
 
void setChannelPowerDb (float channel_power_db)
 
qint32 getSquelch ()
 
void setSquelch (qint32 squelch)
 
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 squelch
 
bool m_squelch_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 SWGAMDemodReport.h.

Constructor & Destructor Documentation

◆ SWGAMDemodReport() [1/2]

SWGSDRangel::SWGAMDemodReport::SWGAMDemodReport ( )

◆ SWGAMDemodReport() [2/2]

SWGSDRangel::SWGAMDemodReport::SWGAMDemodReport ( QString *  json)

Definition at line 25 of file SWGAMDemodReport.cpp.

References fromJson(), and init().

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

◆ ~SWGAMDemodReport()

SWGSDRangel::SWGAMDemodReport::~SWGAMDemodReport ( )
virtual

Definition at line 41 of file SWGAMDemodReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGAMDemodReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 87 of file SWGAMDemodReport.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 98 of file SWGAMDemodReport.cpp.

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

Referenced by asJson().

98  {
99  QJsonObject* obj = new QJsonObject();
101  obj->insert("channelPowerDB", QJsonValue(channel_power_db));
102  }
103  if(m_squelch_isSet){
104  obj->insert("squelch", QJsonValue(squelch));
105  }
107  obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
108  }
110  obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
111  }
112 
113  return obj;
114 }
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGAMDemodReport::cleanup ( )

Definition at line 58 of file SWGAMDemodReport.cpp.

Referenced by ~SWGAMDemodReport().

58  {
59 
60 
61 
62 
63 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 66 of file SWGAMDemodReport.cpp.

References fromJsonObject().

Referenced by SWGAMDemodReport().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 75 of file SWGAMDemodReport.cpp.

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

Referenced by fromJson().

75  {
76  ::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
77 
78  ::SWGSDRangel::setValue(&squelch, pJson["squelch"], "qint32", "");
79 
80  ::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
81 
82  ::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
83 
84 }
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::SWGAMDemodReport::getAudioSampleRate ( )

Definition at line 137 of file SWGAMDemodReport.cpp.

References audio_sample_rate.

137  {
138  return audio_sample_rate;
139 }

◆ getChannelPowerDb()

float SWGSDRangel::SWGAMDemodReport::getChannelPowerDb ( )

Definition at line 117 of file SWGAMDemodReport.cpp.

References channel_power_db.

117  {
118  return channel_power_db;
119 }

◆ getChannelSampleRate()

qint32 SWGSDRangel::SWGAMDemodReport::getChannelSampleRate ( )

Definition at line 147 of file SWGAMDemodReport.cpp.

References channel_sample_rate.

147  {
148  return channel_sample_rate;
149 }

◆ getSquelch()

qint32 SWGSDRangel::SWGAMDemodReport::getSquelch ( )

Definition at line 127 of file SWGAMDemodReport.cpp.

References squelch.

127  {
128  return squelch;
129 }

◆ init()

void SWGSDRangel::SWGAMDemodReport::init ( )

◆ isSet()

bool SWGSDRangel::SWGAMDemodReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 158 of file SWGAMDemodReport.cpp.

References m_audio_sample_rate_isSet, m_channel_power_db_isSet, m_channel_sample_rate_isSet, and m_squelch_isSet.

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

158  {
159  bool isObjectUpdated = false;
160  do{
161  if(m_channel_power_db_isSet){ isObjectUpdated = true; break;}
162  if(m_squelch_isSet){ isObjectUpdated = true; break;}
163  if(m_audio_sample_rate_isSet){ isObjectUpdated = true; break;}
164  if(m_channel_sample_rate_isSet){ isObjectUpdated = true; break;}
165  }while(false);
166  return isObjectUpdated;
167 }
+ Here is the caller graph for this function:

◆ setAudioSampleRate()

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

Definition at line 141 of file SWGAMDemodReport.cpp.

References audio_sample_rate, and m_audio_sample_rate_isSet.

Referenced by AMDemod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelPowerDb()

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

Definition at line 121 of file SWGAMDemodReport.cpp.

References channel_power_db, and m_channel_power_db_isSet.

Referenced by AMDemod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelSampleRate()

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

Definition at line 151 of file SWGAMDemodReport.cpp.

References channel_sample_rate, and m_channel_sample_rate_isSet.

Referenced by AMDemod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setSquelch()

void SWGSDRangel::SWGAMDemodReport::setSquelch ( qint32  squelch)

Definition at line 131 of file SWGAMDemodReport.cpp.

References m_squelch_isSet, and squelch.

Referenced by AMDemod::webapiFormatChannelReport().

131  {
132  this->squelch = squelch;
133  this->m_squelch_isSet = true;
134 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ audio_sample_rate

qint32 SWGSDRangel::SWGAMDemodReport::audio_sample_rate
private

◆ channel_power_db

float SWGSDRangel::SWGAMDemodReport::channel_power_db
private

◆ channel_sample_rate

qint32 SWGSDRangel::SWGAMDemodReport::channel_sample_rate
private

◆ m_audio_sample_rate_isSet

bool SWGSDRangel::SWGAMDemodReport::m_audio_sample_rate_isSet
private

Definition at line 67 of file SWGAMDemodReport.h.

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

◆ m_channel_power_db_isSet

bool SWGSDRangel::SWGAMDemodReport::m_channel_power_db_isSet
private

Definition at line 61 of file SWGAMDemodReport.h.

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

◆ m_channel_sample_rate_isSet

bool SWGSDRangel::SWGAMDemodReport::m_channel_sample_rate_isSet
private

Definition at line 70 of file SWGAMDemodReport.h.

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

◆ m_squelch_isSet

bool SWGSDRangel::SWGAMDemodReport::m_squelch_isSet
private

Definition at line 64 of file SWGAMDemodReport.h.

Referenced by asJsonObject(), init(), isSet(), setSquelch(), and SWGAMDemodReport().

◆ squelch

qint32 SWGSDRangel::SWGAMDemodReport::squelch
private

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