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

#include <SWGUDPSourceReport.h>

+ Inheritance diagram for SWGSDRangel::SWGUDPSourceReport:
+ Collaboration diagram for SWGSDRangel::SWGUDPSourceReport:

Public Member Functions

 SWGUDPSourceReport ()
 
 SWGUDPSourceReport (QString *json)
 
virtual ~SWGUDPSourceReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGUDPSourceReportfromJson (QString &jsonString) override
 
float getChannelPowerDb ()
 
void setChannelPowerDb (float channel_power_db)
 
float getInputPowerDb ()
 
void setInputPowerDb (float input_power_db)
 
qint32 getSquelch ()
 
void setSquelch (qint32 squelch)
 
qint32 getBufferGauge ()
 
void setBufferGauge (qint32 buffer_gauge)
 
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 input_power_db
 
bool m_input_power_db_isSet
 
qint32 squelch
 
bool m_squelch_isSet
 
qint32 buffer_gauge
 
bool m_buffer_gauge_isSet
 
qint32 channel_sample_rate
 
bool m_channel_sample_rate_isSet
 

Detailed Description

Definition at line 31 of file SWGUDPSourceReport.h.

Constructor & Destructor Documentation

◆ SWGUDPSourceReport() [1/2]

SWGSDRangel::SWGUDPSourceReport::SWGUDPSourceReport ( )

Definition at line 30 of file SWGUDPSourceReport.cpp.

References buffer_gauge, channel_power_db, channel_sample_rate, input_power_db, m_buffer_gauge_isSet, m_channel_power_db_isSet, m_channel_sample_rate_isSet, m_input_power_db_isSet, m_squelch_isSet, and squelch.

◆ SWGUDPSourceReport() [2/2]

SWGSDRangel::SWGUDPSourceReport::SWGUDPSourceReport ( QString *  json)

Definition at line 25 of file SWGUDPSourceReport.cpp.

References fromJson(), and init().

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

◆ ~SWGUDPSourceReport()

SWGSDRangel::SWGUDPSourceReport::~SWGUDPSourceReport ( )
virtual

Definition at line 43 of file SWGUDPSourceReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGUDPSourceReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 105 of file SWGUDPSourceReport.cpp.

References buffer_gauge, channel_power_db, channel_sample_rate, input_power_db, m_buffer_gauge_isSet, m_channel_power_db_isSet, m_channel_sample_rate_isSet, m_input_power_db_isSet, m_squelch_isSet, and squelch.

Referenced by asJson().

105  {
106  QJsonObject* obj = new QJsonObject();
108  obj->insert("channelPowerDB", QJsonValue(channel_power_db));
109  }
111  obj->insert("inputPowerDB", QJsonValue(input_power_db));
112  }
113  if(m_squelch_isSet){
114  obj->insert("squelch", QJsonValue(squelch));
115  }
117  obj->insert("bufferGauge", QJsonValue(buffer_gauge));
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::SWGUDPSourceReport::cleanup ( )

Definition at line 62 of file SWGUDPSourceReport.cpp.

Referenced by ~SWGUDPSourceReport().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 71 of file SWGUDPSourceReport.cpp.

References fromJsonObject().

Referenced by SWGUDPSourceReport().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 80 of file SWGUDPSourceReport.cpp.

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

Referenced by fromJson().

80  {
81  ::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
82 
83  ::SWGSDRangel::setValue(&input_power_db, pJson["inputPowerDB"], "float", "");
84 
85  ::SWGSDRangel::setValue(&squelch, pJson["squelch"], "qint32", "");
86 
87  ::SWGSDRangel::setValue(&buffer_gauge, pJson["bufferGauge"], "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:

◆ getBufferGauge()

qint32 SWGSDRangel::SWGUDPSourceReport::getBufferGauge ( )

Definition at line 157 of file SWGUDPSourceReport.cpp.

References buffer_gauge.

157  {
158  return buffer_gauge;
159 }

◆ getChannelPowerDb()

float SWGSDRangel::SWGUDPSourceReport::getChannelPowerDb ( )

Definition at line 127 of file SWGUDPSourceReport.cpp.

References channel_power_db.

127  {
128  return channel_power_db;
129 }

◆ getChannelSampleRate()

qint32 SWGSDRangel::SWGUDPSourceReport::getChannelSampleRate ( )

Definition at line 167 of file SWGUDPSourceReport.cpp.

References channel_sample_rate.

167  {
168  return channel_sample_rate;
169 }

◆ getInputPowerDb()

float SWGSDRangel::SWGUDPSourceReport::getInputPowerDb ( )

Definition at line 137 of file SWGUDPSourceReport.cpp.

References input_power_db.

137  {
138  return input_power_db;
139 }

◆ getSquelch()

qint32 SWGSDRangel::SWGUDPSourceReport::getSquelch ( )

Definition at line 147 of file SWGUDPSourceReport.cpp.

References squelch.

147  {
148  return squelch;
149 }

◆ init()

void SWGSDRangel::SWGUDPSourceReport::init ( )

Definition at line 48 of file SWGUDPSourceReport.cpp.

References buffer_gauge, channel_power_db, channel_sample_rate, input_power_db, m_buffer_gauge_isSet, m_channel_power_db_isSet, m_channel_sample_rate_isSet, m_input_power_db_isSet, m_squelch_isSet, and squelch.

Referenced by SWGUDPSourceReport(), and UDPSource::webapiReportGet().

+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGUDPSourceReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 178 of file SWGUDPSourceReport.cpp.

References m_buffer_gauge_isSet, m_channel_power_db_isSet, m_channel_sample_rate_isSet, m_input_power_db_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_input_power_db_isSet){ isObjectUpdated = true; break;}
183  if(m_squelch_isSet){ isObjectUpdated = true; break;}
184  if(m_buffer_gauge_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:

◆ setBufferGauge()

void SWGSDRangel::SWGUDPSourceReport::setBufferGauge ( qint32  buffer_gauge)

Definition at line 161 of file SWGUDPSourceReport.cpp.

References buffer_gauge, and m_buffer_gauge_isSet.

Referenced by UDPSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelPowerDb()

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

Definition at line 131 of file SWGUDPSourceReport.cpp.

References channel_power_db, and m_channel_power_db_isSet.

Referenced by UDPSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelSampleRate()

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

Definition at line 171 of file SWGUDPSourceReport.cpp.

References channel_sample_rate, and m_channel_sample_rate_isSet.

Referenced by UDPSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setInputPowerDb()

void SWGSDRangel::SWGUDPSourceReport::setInputPowerDb ( float  input_power_db)

Definition at line 141 of file SWGUDPSourceReport.cpp.

References input_power_db, and m_input_power_db_isSet.

Referenced by UDPSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setSquelch()

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

Definition at line 151 of file SWGUDPSourceReport.cpp.

References m_squelch_isSet, and squelch.

Referenced by UDPSource::webapiFormatChannelReport().

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

Member Data Documentation

◆ buffer_gauge

qint32 SWGSDRangel::SWGUDPSourceReport::buffer_gauge
private

◆ channel_power_db

float SWGSDRangel::SWGUDPSourceReport::channel_power_db
private

◆ channel_sample_rate

qint32 SWGSDRangel::SWGUDPSourceReport::channel_sample_rate
private

◆ input_power_db

float SWGSDRangel::SWGUDPSourceReport::input_power_db
private

◆ m_buffer_gauge_isSet

bool SWGSDRangel::SWGUDPSourceReport::m_buffer_gauge_isSet
private

Definition at line 73 of file SWGUDPSourceReport.h.

Referenced by asJsonObject(), init(), isSet(), setBufferGauge(), and SWGUDPSourceReport().

◆ m_channel_power_db_isSet

bool SWGSDRangel::SWGUDPSourceReport::m_channel_power_db_isSet
private

Definition at line 64 of file SWGUDPSourceReport.h.

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

◆ m_channel_sample_rate_isSet

bool SWGSDRangel::SWGUDPSourceReport::m_channel_sample_rate_isSet
private

◆ m_input_power_db_isSet

bool SWGSDRangel::SWGUDPSourceReport::m_input_power_db_isSet
private

Definition at line 67 of file SWGUDPSourceReport.h.

Referenced by asJsonObject(), init(), isSet(), setInputPowerDb(), and SWGUDPSourceReport().

◆ m_squelch_isSet

bool SWGSDRangel::SWGUDPSourceReport::m_squelch_isSet
private

Definition at line 70 of file SWGUDPSourceReport.h.

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

◆ squelch

qint32 SWGSDRangel::SWGUDPSourceReport::squelch
private

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