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

#include <SWGBFMDemodReport.h>

+ Inheritance diagram for SWGSDRangel::SWGBFMDemodReport:
+ Collaboration diagram for SWGSDRangel::SWGBFMDemodReport:

Public Member Functions

 SWGBFMDemodReport ()
 
 SWGBFMDemodReport (QString *json)
 
virtual ~SWGBFMDemodReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGBFMDemodReportfromJson (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)
 
qint32 getPilotLocked ()
 
void setPilotLocked (qint32 pilot_locked)
 
float getPilotPowerDb ()
 
void setPilotPowerDb (float pilot_power_db)
 
SWGRDSReportgetRdsReport ()
 
void setRdsReport (SWGRDSReport *rds_report)
 
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
 
qint32 pilot_locked
 
bool m_pilot_locked_isSet
 
float pilot_power_db
 
bool m_pilot_power_db_isSet
 
SWGRDSReportrds_report
 
bool m_rds_report_isSet
 

Detailed Description

Definition at line 32 of file SWGBFMDemodReport.h.

Constructor & Destructor Documentation

◆ SWGBFMDemodReport() [1/2]

SWGSDRangel::SWGBFMDemodReport::SWGBFMDemodReport ( )

Definition at line 30 of file SWGBFMDemodReport.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_pilot_locked_isSet, m_pilot_power_db_isSet, m_rds_report_isSet, m_squelch_isSet, pilot_locked, pilot_power_db, rds_report, and squelch.

30  {
31  channel_power_db = 0.0f;
33  squelch = 0;
34  m_squelch_isSet = false;
39  pilot_locked = 0;
40  m_pilot_locked_isSet = false;
41  pilot_power_db = 0.0f;
42  m_pilot_power_db_isSet = false;
43  rds_report = nullptr;
44  m_rds_report_isSet = false;
45 }

◆ SWGBFMDemodReport() [2/2]

SWGSDRangel::SWGBFMDemodReport::SWGBFMDemodReport ( QString *  json)

Definition at line 25 of file SWGBFMDemodReport.cpp.

References fromJson(), and init().

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

◆ ~SWGBFMDemodReport()

SWGSDRangel::SWGBFMDemodReport::~SWGBFMDemodReport ( )
virtual

Definition at line 47 of file SWGBFMDemodReport.cpp.

References cleanup().

47  {
48  this->cleanup();
49 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGBFMDemodReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 110 of file SWGBFMDemodReport.cpp.

References asJsonObject().

111 {
112  QJsonObject* obj = this->asJsonObject();
113 
114  QJsonDocument doc(*obj);
115  QByteArray bytes = doc.toJson();
116  delete obj;
117  return QString(bytes);
118 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 121 of file SWGBFMDemodReport.cpp.

References audio_sample_rate, channel_power_db, channel_sample_rate, SWGSDRangel::SWGRDSReport::isSet(), m_audio_sample_rate_isSet, m_channel_power_db_isSet, m_channel_sample_rate_isSet, m_pilot_locked_isSet, m_pilot_power_db_isSet, m_squelch_isSet, pilot_locked, pilot_power_db, rds_report, squelch, and SWGSDRangel::toJsonValue().

Referenced by asJson().

121  {
122  QJsonObject* obj = new QJsonObject();
124  obj->insert("channelPowerDB", QJsonValue(channel_power_db));
125  }
126  if(m_squelch_isSet){
127  obj->insert("squelch", QJsonValue(squelch));
128  }
130  obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
131  }
133  obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
134  }
136  obj->insert("pilotLocked", QJsonValue(pilot_locked));
137  }
139  obj->insert("pilotPowerDB", QJsonValue(pilot_power_db));
140  }
141  if((rds_report != nullptr) && (rds_report->isSet())){
142  toJsonValue(QString("rdsReport"), rds_report, obj, QString("SWGRDSReport"));
143  }
144 
145  return obj;
146 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
virtual bool isSet() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGBFMDemodReport::cleanup ( )

Definition at line 70 of file SWGBFMDemodReport.cpp.

References rds_report.

Referenced by ~SWGBFMDemodReport().

70  {
71 
72 
73 
74 
75 
76 
77  if(rds_report != nullptr) {
78  delete rds_report;
79  }
80 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 83 of file SWGBFMDemodReport.cpp.

References fromJsonObject().

Referenced by SWGBFMDemodReport().

83  {
84  QByteArray array (json.toStdString().c_str());
85  QJsonDocument doc = QJsonDocument::fromJson(array);
86  QJsonObject jsonObject = doc.object();
87  this->fromJsonObject(jsonObject);
88  return this;
89 }
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::SWGBFMDemodReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 92 of file SWGBFMDemodReport.cpp.

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

Referenced by fromJson().

92  {
93  ::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
94 
95  ::SWGSDRangel::setValue(&squelch, pJson["squelch"], "qint32", "");
96 
97  ::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
98 
99  ::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
100 
101  ::SWGSDRangel::setValue(&pilot_locked, pJson["pilotLocked"], "qint32", "");
102 
103  ::SWGSDRangel::setValue(&pilot_power_db, pJson["pilotPowerDB"], "float", "");
104 
105  ::SWGSDRangel::setValue(&rds_report, pJson["rdsReport"], "SWGRDSReport", "SWGRDSReport");
106 
107 }
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::SWGBFMDemodReport::getAudioSampleRate ( )

Definition at line 169 of file SWGBFMDemodReport.cpp.

References audio_sample_rate.

169  {
170  return audio_sample_rate;
171 }

◆ getChannelPowerDb()

float SWGSDRangel::SWGBFMDemodReport::getChannelPowerDb ( )

Definition at line 149 of file SWGBFMDemodReport.cpp.

References channel_power_db.

149  {
150  return channel_power_db;
151 }

◆ getChannelSampleRate()

qint32 SWGSDRangel::SWGBFMDemodReport::getChannelSampleRate ( )

Definition at line 179 of file SWGBFMDemodReport.cpp.

References channel_sample_rate.

179  {
180  return channel_sample_rate;
181 }

◆ getPilotLocked()

qint32 SWGSDRangel::SWGBFMDemodReport::getPilotLocked ( )

Definition at line 189 of file SWGBFMDemodReport.cpp.

References pilot_locked.

189  {
190  return pilot_locked;
191 }

◆ getPilotPowerDb()

float SWGSDRangel::SWGBFMDemodReport::getPilotPowerDb ( )

Definition at line 199 of file SWGBFMDemodReport.cpp.

References pilot_power_db.

199  {
200  return pilot_power_db;
201 }

◆ getRdsReport()

SWGRDSReport * SWGSDRangel::SWGBFMDemodReport::getRdsReport ( )

Definition at line 209 of file SWGBFMDemodReport.cpp.

References rds_report.

Referenced by BFMDemod::webapiFormatChannelReport().

209  {
210  return rds_report;
211 }
+ Here is the caller graph for this function:

◆ getSquelch()

qint32 SWGSDRangel::SWGBFMDemodReport::getSquelch ( )

Definition at line 159 of file SWGBFMDemodReport.cpp.

References squelch.

159  {
160  return squelch;
161 }

◆ init()

void SWGSDRangel::SWGBFMDemodReport::init ( )

Definition at line 52 of file SWGBFMDemodReport.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_pilot_locked_isSet, m_pilot_power_db_isSet, m_rds_report_isSet, m_squelch_isSet, pilot_locked, pilot_power_db, rds_report, and squelch.

Referenced by SWGBFMDemodReport(), and BFMDemod::webapiReportGet().

52  {
53  channel_power_db = 0.0f;
55  squelch = 0;
56  m_squelch_isSet = false;
61  pilot_locked = 0;
62  m_pilot_locked_isSet = false;
63  pilot_power_db = 0.0f;
64  m_pilot_power_db_isSet = false;
65  rds_report = new SWGRDSReport();
66  m_rds_report_isSet = false;
67 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGBFMDemodReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 220 of file SWGBFMDemodReport.cpp.

References SWGSDRangel::SWGRDSReport::isSet(), m_audio_sample_rate_isSet, m_channel_power_db_isSet, m_channel_sample_rate_isSet, m_pilot_locked_isSet, m_pilot_power_db_isSet, m_squelch_isSet, and rds_report.

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

220  {
221  bool isObjectUpdated = false;
222  do{
223  if(m_channel_power_db_isSet){ isObjectUpdated = true; break;}
224  if(m_squelch_isSet){ isObjectUpdated = true; break;}
225  if(m_audio_sample_rate_isSet){ isObjectUpdated = true; break;}
226  if(m_channel_sample_rate_isSet){ isObjectUpdated = true; break;}
227  if(m_pilot_locked_isSet){ isObjectUpdated = true; break;}
228  if(m_pilot_power_db_isSet){ isObjectUpdated = true; break;}
229  if(rds_report != nullptr && rds_report->isSet()){ isObjectUpdated = true; break;}
230  }while(false);
231  return isObjectUpdated;
232 }
virtual bool isSet() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAudioSampleRate()

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

Definition at line 173 of file SWGBFMDemodReport.cpp.

References audio_sample_rate, and m_audio_sample_rate_isSet.

Referenced by BFMDemod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelPowerDb()

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

Definition at line 153 of file SWGBFMDemodReport.cpp.

References channel_power_db, and m_channel_power_db_isSet.

Referenced by BFMDemod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelSampleRate()

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

Definition at line 183 of file SWGBFMDemodReport.cpp.

References channel_sample_rate, and m_channel_sample_rate_isSet.

Referenced by BFMDemod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setPilotLocked()

void SWGSDRangel::SWGBFMDemodReport::setPilotLocked ( qint32  pilot_locked)

Definition at line 193 of file SWGBFMDemodReport.cpp.

References m_pilot_locked_isSet, and pilot_locked.

Referenced by BFMDemod::webapiFormatChannelReport().

193  {
194  this->pilot_locked = pilot_locked;
195  this->m_pilot_locked_isSet = true;
196 }
+ Here is the caller graph for this function:

◆ setPilotPowerDb()

void SWGSDRangel::SWGBFMDemodReport::setPilotPowerDb ( float  pilot_power_db)

Definition at line 203 of file SWGBFMDemodReport.cpp.

References m_pilot_power_db_isSet, and pilot_power_db.

Referenced by BFMDemod::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setRdsReport()

void SWGSDRangel::SWGBFMDemodReport::setRdsReport ( SWGRDSReport rds_report)

Definition at line 213 of file SWGBFMDemodReport.cpp.

References m_rds_report_isSet, and rds_report.

Referenced by BFMDemod::webapiFormatChannelReport().

213  {
214  this->rds_report = rds_report;
215  this->m_rds_report_isSet = true;
216 }
+ Here is the caller graph for this function:

◆ setSquelch()

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

Definition at line 163 of file SWGBFMDemodReport.cpp.

References m_squelch_isSet, and squelch.

Referenced by BFMDemod::webapiFormatChannelReport().

163  {
164  this->squelch = squelch;
165  this->m_squelch_isSet = true;
166 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ audio_sample_rate

qint32 SWGSDRangel::SWGBFMDemodReport::audio_sample_rate
private

◆ channel_power_db

float SWGSDRangel::SWGBFMDemodReport::channel_power_db
private

◆ channel_sample_rate

qint32 SWGSDRangel::SWGBFMDemodReport::channel_sample_rate
private

◆ m_audio_sample_rate_isSet

bool SWGSDRangel::SWGBFMDemodReport::m_audio_sample_rate_isSet
private

Definition at line 77 of file SWGBFMDemodReport.h.

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

◆ m_channel_power_db_isSet

bool SWGSDRangel::SWGBFMDemodReport::m_channel_power_db_isSet
private

Definition at line 71 of file SWGBFMDemodReport.h.

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

◆ m_channel_sample_rate_isSet

bool SWGSDRangel::SWGBFMDemodReport::m_channel_sample_rate_isSet
private

◆ m_pilot_locked_isSet

bool SWGSDRangel::SWGBFMDemodReport::m_pilot_locked_isSet
private

Definition at line 83 of file SWGBFMDemodReport.h.

Referenced by asJsonObject(), init(), isSet(), setPilotLocked(), and SWGBFMDemodReport().

◆ m_pilot_power_db_isSet

bool SWGSDRangel::SWGBFMDemodReport::m_pilot_power_db_isSet
private

Definition at line 86 of file SWGBFMDemodReport.h.

Referenced by asJsonObject(), init(), isSet(), setPilotPowerDb(), and SWGBFMDemodReport().

◆ m_rds_report_isSet

bool SWGSDRangel::SWGBFMDemodReport::m_rds_report_isSet
private

Definition at line 89 of file SWGBFMDemodReport.h.

Referenced by init(), setRdsReport(), and SWGBFMDemodReport().

◆ m_squelch_isSet

bool SWGSDRangel::SWGBFMDemodReport::m_squelch_isSet
private

Definition at line 74 of file SWGBFMDemodReport.h.

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

◆ pilot_locked

qint32 SWGSDRangel::SWGBFMDemodReport::pilot_locked
private

◆ pilot_power_db

float SWGSDRangel::SWGBFMDemodReport::pilot_power_db
private

◆ rds_report

SWGRDSReport* SWGSDRangel::SWGBFMDemodReport::rds_report
private

◆ squelch

qint32 SWGSDRangel::SWGBFMDemodReport::squelch
private

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