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

#include <SWGUDPSinkReport.h>

+ Inheritance diagram for SWGSDRangel::SWGUDPSinkReport:
+ Collaboration diagram for SWGSDRangel::SWGUDPSinkReport:

Public Member Functions

 SWGUDPSinkReport ()
 
 SWGUDPSinkReport (QString *json)
 
virtual ~SWGUDPSinkReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGUDPSinkReportfromJson (QString &jsonString) override
 
float getOutputPowerDb ()
 
void setOutputPowerDb (float output_power_db)
 
float getChannelPowerDb ()
 
void setChannelPowerDb (float channel_power_db)
 
qint32 getSquelch ()
 
void setSquelch (qint32 squelch)
 
qint32 getInputSampleRate ()
 
void setInputSampleRate (qint32 input_sample_rate)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

float output_power_db
 
bool m_output_power_db_isSet
 
float channel_power_db
 
bool m_channel_power_db_isSet
 
qint32 squelch
 
bool m_squelch_isSet
 
qint32 input_sample_rate
 
bool m_input_sample_rate_isSet
 

Detailed Description

Definition at line 31 of file SWGUDPSinkReport.h.

Constructor & Destructor Documentation

◆ SWGUDPSinkReport() [1/2]

SWGSDRangel::SWGUDPSinkReport::SWGUDPSinkReport ( )

◆ SWGUDPSinkReport() [2/2]

SWGSDRangel::SWGUDPSinkReport::SWGUDPSinkReport ( QString *  json)

Definition at line 25 of file SWGUDPSinkReport.cpp.

References fromJson(), and init().

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

◆ ~SWGUDPSinkReport()

SWGSDRangel::SWGUDPSinkReport::~SWGUDPSinkReport ( )
virtual

Definition at line 41 of file SWGUDPSinkReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGUDPSinkReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 98 of file SWGUDPSinkReport.cpp.

References channel_power_db, input_sample_rate, m_channel_power_db_isSet, m_input_sample_rate_isSet, m_output_power_db_isSet, m_squelch_isSet, output_power_db, and squelch.

Referenced by asJson().

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

◆ cleanup()

void SWGSDRangel::SWGUDPSinkReport::cleanup ( )

Definition at line 58 of file SWGUDPSinkReport.cpp.

Referenced by ~SWGUDPSinkReport().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 66 of file SWGUDPSinkReport.cpp.

References fromJsonObject().

Referenced by SWGUDPSinkReport().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 75 of file SWGUDPSinkReport.cpp.

References channel_power_db, input_sample_rate, output_power_db, SWGSDRangel::setValue(), and squelch.

Referenced by fromJson().

75  {
76  ::SWGSDRangel::setValue(&output_power_db, pJson["outputPowerDB"], "float", "");
77 
78  ::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
79 
80  ::SWGSDRangel::setValue(&squelch, pJson["squelch"], "qint32", "");
81 
82  ::SWGSDRangel::setValue(&input_sample_rate, pJson["inputSampleRate"], "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:

◆ getChannelPowerDb()

float SWGSDRangel::SWGUDPSinkReport::getChannelPowerDb ( )

Definition at line 127 of file SWGUDPSinkReport.cpp.

References channel_power_db.

127  {
128  return channel_power_db;
129 }

◆ getInputSampleRate()

qint32 SWGSDRangel::SWGUDPSinkReport::getInputSampleRate ( )

Definition at line 147 of file SWGUDPSinkReport.cpp.

References input_sample_rate.

147  {
148  return input_sample_rate;
149 }

◆ getOutputPowerDb()

float SWGSDRangel::SWGUDPSinkReport::getOutputPowerDb ( )

Definition at line 117 of file SWGUDPSinkReport.cpp.

References output_power_db.

117  {
118  return output_power_db;
119 }

◆ getSquelch()

qint32 SWGSDRangel::SWGUDPSinkReport::getSquelch ( )

Definition at line 137 of file SWGUDPSinkReport.cpp.

References squelch.

137  {
138  return squelch;
139 }

◆ init()

void SWGSDRangel::SWGUDPSinkReport::init ( )

◆ isSet()

bool SWGSDRangel::SWGUDPSinkReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 158 of file SWGUDPSinkReport.cpp.

References m_channel_power_db_isSet, m_input_sample_rate_isSet, m_output_power_db_isSet, and m_squelch_isSet.

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

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

◆ setChannelPowerDb()

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

Definition at line 131 of file SWGUDPSinkReport.cpp.

References channel_power_db, and m_channel_power_db_isSet.

Referenced by UDPSink::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setInputSampleRate()

void SWGSDRangel::SWGUDPSinkReport::setInputSampleRate ( qint32  input_sample_rate)

Definition at line 151 of file SWGUDPSinkReport.cpp.

References input_sample_rate, and m_input_sample_rate_isSet.

Referenced by UDPSink::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setOutputPowerDb()

void SWGSDRangel::SWGUDPSinkReport::setOutputPowerDb ( float  output_power_db)

Definition at line 121 of file SWGUDPSinkReport.cpp.

References m_output_power_db_isSet, and output_power_db.

Referenced by UDPSink::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setSquelch()

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

Definition at line 141 of file SWGUDPSinkReport.cpp.

References m_squelch_isSet, and squelch.

Referenced by UDPSink::webapiFormatChannelReport().

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

Member Data Documentation

◆ channel_power_db

float SWGSDRangel::SWGUDPSinkReport::channel_power_db
private

◆ input_sample_rate

qint32 SWGSDRangel::SWGUDPSinkReport::input_sample_rate
private

◆ m_channel_power_db_isSet

bool SWGSDRangel::SWGUDPSinkReport::m_channel_power_db_isSet
private

Definition at line 64 of file SWGUDPSinkReport.h.

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

◆ m_input_sample_rate_isSet

bool SWGSDRangel::SWGUDPSinkReport::m_input_sample_rate_isSet
private

Definition at line 70 of file SWGUDPSinkReport.h.

Referenced by asJsonObject(), init(), isSet(), setInputSampleRate(), and SWGUDPSinkReport().

◆ m_output_power_db_isSet

bool SWGSDRangel::SWGUDPSinkReport::m_output_power_db_isSet
private

Definition at line 61 of file SWGUDPSinkReport.h.

Referenced by asJsonObject(), init(), isSet(), setOutputPowerDb(), and SWGUDPSinkReport().

◆ m_squelch_isSet

bool SWGSDRangel::SWGUDPSinkReport::m_squelch_isSet
private

Definition at line 67 of file SWGUDPSinkReport.h.

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

◆ output_power_db

float SWGSDRangel::SWGUDPSinkReport::output_power_db
private

◆ squelch

qint32 SWGSDRangel::SWGUDPSinkReport::squelch
private

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