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

#include <SWGNFMDemodReport.h>

+ Inheritance diagram for SWGSDRangel::SWGNFMDemodReport:
+ Collaboration diagram for SWGSDRangel::SWGNFMDemodReport:

Public Member Functions

 SWGNFMDemodReport ()
 
 SWGNFMDemodReport (QString *json)
 
virtual ~SWGNFMDemodReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGNFMDemodReportfromJson (QString &jsonString) override
 
float getChannelPowerDb ()
 
void setChannelPowerDb (float channel_power_db)
 
float getCtcssTone ()
 
void setCtcssTone (float ctcss_tone)
 
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
 
float ctcss_tone
 
bool m_ctcss_tone_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 SWGNFMDemodReport.h.

Constructor & Destructor Documentation

◆ SWGNFMDemodReport() [1/2]

SWGSDRangel::SWGNFMDemodReport::SWGNFMDemodReport ( )

Definition at line 30 of file SWGNFMDemodReport.cpp.

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

◆ SWGNFMDemodReport() [2/2]

SWGSDRangel::SWGNFMDemodReport::SWGNFMDemodReport ( QString *  json)

Definition at line 25 of file SWGNFMDemodReport.cpp.

References fromJson(), and init().

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

◆ ~SWGNFMDemodReport()

SWGSDRangel::SWGNFMDemodReport::~SWGNFMDemodReport ( )
virtual

Definition at line 43 of file SWGNFMDemodReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGNFMDemodReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 94 of file SWGNFMDemodReport.cpp.

References asJsonObject().

95 {
96  QJsonObject* obj = this->asJsonObject();
97 
98  QJsonDocument doc(*obj);
99  QByteArray bytes = doc.toJson();
100  delete obj;
101  return QString(bytes);
102 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 105 of file SWGNFMDemodReport.cpp.

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

Referenced by asJson().

105  {
106  QJsonObject* obj = new QJsonObject();
108  obj->insert("channelPowerDB", QJsonValue(channel_power_db));
109  }
110  if(m_ctcss_tone_isSet){
111  obj->insert("ctcssTone", QJsonValue(ctcss_tone));
112  }
113  if(m_squelch_isSet){
114  obj->insert("squelch", QJsonValue(squelch));
115  }
117  obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
118  }
120  obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
121  }
122 
123  return obj;
124 }
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGNFMDemodReport::cleanup ( )

Definition at line 62 of file SWGNFMDemodReport.cpp.

Referenced by ~SWGNFMDemodReport().

62  {
63 
64 
65 
66 
67 
68 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 71 of file SWGNFMDemodReport.cpp.

References fromJsonObject().

Referenced by SWGNFMDemodReport().

71  {
72  QByteArray array (json.toStdString().c_str());
73  QJsonDocument doc = QJsonDocument::fromJson(array);
74  QJsonObject jsonObject = doc.object();
75  this->fromJsonObject(jsonObject);
76  return this;
77 }
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::SWGNFMDemodReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 80 of file SWGNFMDemodReport.cpp.

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

Referenced by fromJson().

80  {
81  ::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
82 
83  ::SWGSDRangel::setValue(&ctcss_tone, pJson["ctcssTone"], "float", "");
84 
85  ::SWGSDRangel::setValue(&squelch, pJson["squelch"], "qint32", "");
86 
87  ::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
88 
89  ::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
90 
91 }
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::SWGNFMDemodReport::getAudioSampleRate ( )

Definition at line 157 of file SWGNFMDemodReport.cpp.

References audio_sample_rate.

157  {
158  return audio_sample_rate;
159 }

◆ getChannelPowerDb()

float SWGSDRangel::SWGNFMDemodReport::getChannelPowerDb ( )

Definition at line 127 of file SWGNFMDemodReport.cpp.

References channel_power_db.

127  {
128  return channel_power_db;
129 }

◆ getChannelSampleRate()

qint32 SWGSDRangel::SWGNFMDemodReport::getChannelSampleRate ( )

Definition at line 167 of file SWGNFMDemodReport.cpp.

References channel_sample_rate.

167  {
168  return channel_sample_rate;
169 }

◆ getCtcssTone()

float SWGSDRangel::SWGNFMDemodReport::getCtcssTone ( )

Definition at line 137 of file SWGNFMDemodReport.cpp.

References ctcss_tone.

137  {
138  return ctcss_tone;
139 }

◆ getSquelch()

qint32 SWGSDRangel::SWGNFMDemodReport::getSquelch ( )

Definition at line 147 of file SWGNFMDemodReport.cpp.

References squelch.

147  {
148  return squelch;
149 }

◆ init()

void SWGSDRangel::SWGNFMDemodReport::init ( )

Definition at line 48 of file SWGNFMDemodReport.cpp.

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

Referenced by SWGNFMDemodReport(), and NFMDemod::webapiReportGet().

+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGNFMDemodReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 178 of file SWGNFMDemodReport.cpp.

References m_audio_sample_rate_isSet, m_channel_power_db_isSet, m_channel_sample_rate_isSet, m_ctcss_tone_isSet, and m_squelch_isSet.

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

178  {
179  bool isObjectUpdated = false;
180  do{
181  if(m_channel_power_db_isSet){ isObjectUpdated = true; break;}
182  if(m_ctcss_tone_isSet){ isObjectUpdated = true; break;}
183  if(m_squelch_isSet){ isObjectUpdated = true; break;}
184  if(m_audio_sample_rate_isSet){ isObjectUpdated = true; break;}
185  if(m_channel_sample_rate_isSet){ isObjectUpdated = true; break;}
186  }while(false);
187  return isObjectUpdated;
188 }
+ Here is the caller graph for this function:

◆ setAudioSampleRate()

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

Definition at line 161 of file SWGNFMDemodReport.cpp.

References audio_sample_rate, and m_audio_sample_rate_isSet.

Referenced by NFMDemod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelPowerDb()

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

Definition at line 131 of file SWGNFMDemodReport.cpp.

References channel_power_db, and m_channel_power_db_isSet.

Referenced by NFMDemod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelSampleRate()

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

Definition at line 171 of file SWGNFMDemodReport.cpp.

References channel_sample_rate, and m_channel_sample_rate_isSet.

Referenced by NFMDemod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setCtcssTone()

void SWGSDRangel::SWGNFMDemodReport::setCtcssTone ( float  ctcss_tone)

Definition at line 141 of file SWGNFMDemodReport.cpp.

References ctcss_tone, and m_ctcss_tone_isSet.

Referenced by NFMDemod::webapiFormatChannelReport().

141  {
142  this->ctcss_tone = ctcss_tone;
143  this->m_ctcss_tone_isSet = true;
144 }
+ Here is the caller graph for this function:

◆ setSquelch()

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

Definition at line 151 of file SWGNFMDemodReport.cpp.

References m_squelch_isSet, and squelch.

Referenced by NFMDemod::webapiFormatChannelReport().

151  {
152  this->squelch = squelch;
153  this->m_squelch_isSet = true;
154 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ audio_sample_rate

qint32 SWGSDRangel::SWGNFMDemodReport::audio_sample_rate
private

◆ channel_power_db

float SWGSDRangel::SWGNFMDemodReport::channel_power_db
private

◆ channel_sample_rate

qint32 SWGSDRangel::SWGNFMDemodReport::channel_sample_rate
private

◆ ctcss_tone

float SWGSDRangel::SWGNFMDemodReport::ctcss_tone
private

◆ m_audio_sample_rate_isSet

bool SWGSDRangel::SWGNFMDemodReport::m_audio_sample_rate_isSet
private

Definition at line 73 of file SWGNFMDemodReport.h.

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

◆ m_channel_power_db_isSet

bool SWGSDRangel::SWGNFMDemodReport::m_channel_power_db_isSet
private

Definition at line 64 of file SWGNFMDemodReport.h.

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

◆ m_channel_sample_rate_isSet

bool SWGSDRangel::SWGNFMDemodReport::m_channel_sample_rate_isSet
private

◆ m_ctcss_tone_isSet

bool SWGSDRangel::SWGNFMDemodReport::m_ctcss_tone_isSet
private

Definition at line 67 of file SWGNFMDemodReport.h.

Referenced by asJsonObject(), init(), isSet(), setCtcssTone(), and SWGNFMDemodReport().

◆ m_squelch_isSet

bool SWGSDRangel::SWGNFMDemodReport::m_squelch_isSet
private

Definition at line 70 of file SWGNFMDemodReport.h.

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

◆ squelch

qint32 SWGSDRangel::SWGNFMDemodReport::squelch
private

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