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

#include <SWGFileSourceReport.h>

+ Inheritance diagram for SWGSDRangel::SWGFileSourceReport:
+ Collaboration diagram for SWGSDRangel::SWGFileSourceReport:

Public Member Functions

 SWGFileSourceReport ()
 
 SWGFileSourceReport (QString *json)
 
virtual ~SWGFileSourceReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGFileSourceReportfromJson (QString &jsonString) override
 
QString * getFileName ()
 
void setFileName (QString *file_name)
 
qint32 getFileSampleRate ()
 
void setFileSampleRate (qint32 file_sample_rate)
 
qint32 getFileSampleSize ()
 
void setFileSampleSize (qint32 file_sample_size)
 
QString * getAbsoluteTime ()
 
void setAbsoluteTime (QString *absolute_time)
 
QString * getElapsedTime ()
 
void setElapsedTime (QString *elapsed_time)
 
QString * getDurationTime ()
 
void setDurationTime (QString *duration_time)
 
qint32 getSampleRate ()
 
void setSampleRate (qint32 sample_rate)
 
float getChannelPowerDb ()
 
void setChannelPowerDb (float channel_power_db)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * file_name
 
bool m_file_name_isSet
 
qint32 file_sample_rate
 
bool m_file_sample_rate_isSet
 
qint32 file_sample_size
 
bool m_file_sample_size_isSet
 
QString * absolute_time
 
bool m_absolute_time_isSet
 
QString * elapsed_time
 
bool m_elapsed_time_isSet
 
QString * duration_time
 
bool m_duration_time_isSet
 
qint32 sample_rate
 
bool m_sample_rate_isSet
 
float channel_power_db
 
bool m_channel_power_db_isSet
 

Detailed Description

Definition at line 32 of file SWGFileSourceReport.h.

Constructor & Destructor Documentation

◆ SWGFileSourceReport() [1/2]

SWGSDRangel::SWGFileSourceReport::SWGFileSourceReport ( )

Definition at line 30 of file SWGFileSourceReport.cpp.

References absolute_time, channel_power_db, duration_time, elapsed_time, file_name, file_sample_rate, file_sample_size, m_absolute_time_isSet, m_channel_power_db_isSet, m_duration_time_isSet, m_elapsed_time_isSet, m_file_name_isSet, m_file_sample_rate_isSet, m_file_sample_size_isSet, m_sample_rate_isSet, and sample_rate.

30  {
31  file_name = nullptr;
32  m_file_name_isSet = false;
33  file_sample_rate = 0;
35  file_sample_size = 0;
37  absolute_time = nullptr;
38  m_absolute_time_isSet = false;
39  elapsed_time = nullptr;
40  m_elapsed_time_isSet = false;
41  duration_time = nullptr;
42  m_duration_time_isSet = false;
43  sample_rate = 0;
44  m_sample_rate_isSet = false;
45  channel_power_db = 0.0f;
47 }

◆ SWGFileSourceReport() [2/2]

SWGSDRangel::SWGFileSourceReport::SWGFileSourceReport ( QString *  json)

Definition at line 25 of file SWGFileSourceReport.cpp.

References fromJson(), and init().

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

◆ ~SWGFileSourceReport()

SWGSDRangel::SWGFileSourceReport::~SWGFileSourceReport ( )
virtual

Definition at line 49 of file SWGFileSourceReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGFileSourceReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 123 of file SWGFileSourceReport.cpp.

References asJsonObject().

124 {
125  QJsonObject* obj = this->asJsonObject();
126 
127  QJsonDocument doc(*obj);
128  QByteArray bytes = doc.toJson();
129  delete obj;
130  return QString(bytes);
131 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 134 of file SWGFileSourceReport.cpp.

References absolute_time, channel_power_db, duration_time, elapsed_time, file_name, file_sample_rate, file_sample_size, m_channel_power_db_isSet, m_file_sample_rate_isSet, m_file_sample_size_isSet, m_sample_rate_isSet, sample_rate, and SWGSDRangel::toJsonValue().

Referenced by asJson().

134  {
135  QJsonObject* obj = new QJsonObject();
136  if(file_name != nullptr && *file_name != QString("")){
137  toJsonValue(QString("fileName"), file_name, obj, QString("QString"));
138  }
140  obj->insert("fileSampleRate", QJsonValue(file_sample_rate));
141  }
143  obj->insert("fileSampleSize", QJsonValue(file_sample_size));
144  }
145  if(absolute_time != nullptr && *absolute_time != QString("")){
146  toJsonValue(QString("absoluteTime"), absolute_time, obj, QString("QString"));
147  }
148  if(elapsed_time != nullptr && *elapsed_time != QString("")){
149  toJsonValue(QString("elapsedTime"), elapsed_time, obj, QString("QString"));
150  }
151  if(duration_time != nullptr && *duration_time != QString("")){
152  toJsonValue(QString("durationTime"), duration_time, obj, QString("QString"));
153  }
155  obj->insert("sampleRate", QJsonValue(sample_rate));
156  }
158  obj->insert("channelPowerDB", QJsonValue(channel_power_db));
159  }
160 
161  return obj;
162 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGFileSourceReport::cleanup ( )

Definition at line 74 of file SWGFileSourceReport.cpp.

References absolute_time, duration_time, elapsed_time, and file_name.

Referenced by ~SWGFileSourceReport().

74  {
75  if(file_name != nullptr) {
76  delete file_name;
77  }
78 
79 
80  if(absolute_time != nullptr) {
81  delete absolute_time;
82  }
83  if(elapsed_time != nullptr) {
84  delete elapsed_time;
85  }
86  if(duration_time != nullptr) {
87  delete duration_time;
88  }
89 
90 
91 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 94 of file SWGFileSourceReport.cpp.

References fromJsonObject().

Referenced by SWGFileSourceReport().

94  {
95  QByteArray array (json.toStdString().c_str());
96  QJsonDocument doc = QJsonDocument::fromJson(array);
97  QJsonObject jsonObject = doc.object();
98  this->fromJsonObject(jsonObject);
99  return this;
100 }
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::SWGFileSourceReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 103 of file SWGFileSourceReport.cpp.

References absolute_time, channel_power_db, duration_time, elapsed_time, file_name, file_sample_rate, file_sample_size, sample_rate, and SWGSDRangel::setValue().

Referenced by fromJson().

103  {
104  ::SWGSDRangel::setValue(&file_name, pJson["fileName"], "QString", "QString");
105 
106  ::SWGSDRangel::setValue(&file_sample_rate, pJson["fileSampleRate"], "qint32", "");
107 
108  ::SWGSDRangel::setValue(&file_sample_size, pJson["fileSampleSize"], "qint32", "");
109 
110  ::SWGSDRangel::setValue(&absolute_time, pJson["absoluteTime"], "QString", "QString");
111 
112  ::SWGSDRangel::setValue(&elapsed_time, pJson["elapsedTime"], "QString", "QString");
113 
114  ::SWGSDRangel::setValue(&duration_time, pJson["durationTime"], "QString", "QString");
115 
116  ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
117 
118  ::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
119 
120 }
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:

◆ getAbsoluteTime()

QString * SWGSDRangel::SWGFileSourceReport::getAbsoluteTime ( )

Definition at line 195 of file SWGFileSourceReport.cpp.

References absolute_time.

195  {
196  return absolute_time;
197 }

◆ getChannelPowerDb()

float SWGSDRangel::SWGFileSourceReport::getChannelPowerDb ( )

Definition at line 235 of file SWGFileSourceReport.cpp.

References channel_power_db.

235  {
236  return channel_power_db;
237 }

◆ getDurationTime()

QString * SWGSDRangel::SWGFileSourceReport::getDurationTime ( )

Definition at line 215 of file SWGFileSourceReport.cpp.

References duration_time.

215  {
216  return duration_time;
217 }

◆ getElapsedTime()

QString * SWGSDRangel::SWGFileSourceReport::getElapsedTime ( )

Definition at line 205 of file SWGFileSourceReport.cpp.

References elapsed_time.

205  {
206  return elapsed_time;
207 }

◆ getFileName()

QString * SWGSDRangel::SWGFileSourceReport::getFileName ( )

Definition at line 165 of file SWGFileSourceReport.cpp.

References file_name.

165  {
166  return file_name;
167 }

◆ getFileSampleRate()

qint32 SWGSDRangel::SWGFileSourceReport::getFileSampleRate ( )

Definition at line 175 of file SWGFileSourceReport.cpp.

References file_sample_rate.

175  {
176  return file_sample_rate;
177 }

◆ getFileSampleSize()

qint32 SWGSDRangel::SWGFileSourceReport::getFileSampleSize ( )

Definition at line 185 of file SWGFileSourceReport.cpp.

References file_sample_size.

185  {
186  return file_sample_size;
187 }

◆ getSampleRate()

qint32 SWGSDRangel::SWGFileSourceReport::getSampleRate ( )

Definition at line 225 of file SWGFileSourceReport.cpp.

References sample_rate.

225  {
226  return sample_rate;
227 }

◆ init()

void SWGSDRangel::SWGFileSourceReport::init ( )

Definition at line 54 of file SWGFileSourceReport.cpp.

References absolute_time, channel_power_db, duration_time, elapsed_time, file_name, file_sample_rate, file_sample_size, m_absolute_time_isSet, m_channel_power_db_isSet, m_duration_time_isSet, m_elapsed_time_isSet, m_file_name_isSet, m_file_sample_rate_isSet, m_file_sample_size_isSet, m_sample_rate_isSet, and sample_rate.

Referenced by SWGFileSourceReport(), and FileSource::webapiReportGet().

54  {
55  file_name = new QString("");
56  m_file_name_isSet = false;
57  file_sample_rate = 0;
59  file_sample_size = 0;
61  absolute_time = new QString("");
62  m_absolute_time_isSet = false;
63  elapsed_time = new QString("");
64  m_elapsed_time_isSet = false;
65  duration_time = new QString("");
66  m_duration_time_isSet = false;
67  sample_rate = 0;
68  m_sample_rate_isSet = false;
69  channel_power_db = 0.0f;
71 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGFileSourceReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 246 of file SWGFileSourceReport.cpp.

References absolute_time, duration_time, elapsed_time, file_name, m_channel_power_db_isSet, m_file_sample_rate_isSet, m_file_sample_size_isSet, and m_sample_rate_isSet.

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

246  {
247  bool isObjectUpdated = false;
248  do{
249  if(file_name != nullptr && *file_name != QString("")){ isObjectUpdated = true; break;}
250  if(m_file_sample_rate_isSet){ isObjectUpdated = true; break;}
251  if(m_file_sample_size_isSet){ isObjectUpdated = true; break;}
252  if(absolute_time != nullptr && *absolute_time != QString("")){ isObjectUpdated = true; break;}
253  if(elapsed_time != nullptr && *elapsed_time != QString("")){ isObjectUpdated = true; break;}
254  if(duration_time != nullptr && *duration_time != QString("")){ isObjectUpdated = true; break;}
255  if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
256  if(m_channel_power_db_isSet){ isObjectUpdated = true; break;}
257  }while(false);
258  return isObjectUpdated;
259 }
+ Here is the caller graph for this function:

◆ setAbsoluteTime()

void SWGSDRangel::SWGFileSourceReport::setAbsoluteTime ( QString *  absolute_time)

Definition at line 199 of file SWGFileSourceReport.cpp.

References absolute_time, and m_absolute_time_isSet.

Referenced by FileSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setChannelPowerDb()

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

Definition at line 239 of file SWGFileSourceReport.cpp.

References channel_power_db, and m_channel_power_db_isSet.

Referenced by FileSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setDurationTime()

void SWGSDRangel::SWGFileSourceReport::setDurationTime ( QString *  duration_time)

Definition at line 219 of file SWGFileSourceReport.cpp.

References duration_time, and m_duration_time_isSet.

Referenced by FileSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setElapsedTime()

void SWGSDRangel::SWGFileSourceReport::setElapsedTime ( QString *  elapsed_time)

Definition at line 209 of file SWGFileSourceReport.cpp.

References elapsed_time, and m_elapsed_time_isSet.

Referenced by FileSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setFileName()

void SWGSDRangel::SWGFileSourceReport::setFileName ( QString *  file_name)

Definition at line 169 of file SWGFileSourceReport.cpp.

References file_name, and m_file_name_isSet.

Referenced by FileSource::webapiFormatChannelReport().

169  {
170  this->file_name = file_name;
171  this->m_file_name_isSet = true;
172 }
+ Here is the caller graph for this function:

◆ setFileSampleRate()

void SWGSDRangel::SWGFileSourceReport::setFileSampleRate ( qint32  file_sample_rate)

Definition at line 179 of file SWGFileSourceReport.cpp.

References file_sample_rate, and m_file_sample_rate_isSet.

Referenced by FileSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setFileSampleSize()

void SWGSDRangel::SWGFileSourceReport::setFileSampleSize ( qint32  file_sample_size)

Definition at line 189 of file SWGFileSourceReport.cpp.

References file_sample_size, and m_file_sample_size_isSet.

Referenced by FileSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

◆ setSampleRate()

void SWGSDRangel::SWGFileSourceReport::setSampleRate ( qint32  sample_rate)

Definition at line 229 of file SWGFileSourceReport.cpp.

References m_sample_rate_isSet, and sample_rate.

Referenced by FileSource::webapiFormatChannelReport().

+ Here is the caller graph for this function:

Member Data Documentation

◆ absolute_time

QString* SWGSDRangel::SWGFileSourceReport::absolute_time
private

◆ channel_power_db

float SWGSDRangel::SWGFileSourceReport::channel_power_db
private

◆ duration_time

QString* SWGSDRangel::SWGFileSourceReport::duration_time
private

◆ elapsed_time

QString* SWGSDRangel::SWGFileSourceReport::elapsed_time
private

◆ file_name

QString* SWGSDRangel::SWGFileSourceReport::file_name
private

◆ file_sample_rate

qint32 SWGSDRangel::SWGFileSourceReport::file_sample_rate
private

◆ file_sample_size

qint32 SWGSDRangel::SWGFileSourceReport::file_sample_size
private

◆ m_absolute_time_isSet

bool SWGSDRangel::SWGFileSourceReport::m_absolute_time_isSet
private

Definition at line 83 of file SWGFileSourceReport.h.

Referenced by init(), setAbsoluteTime(), and SWGFileSourceReport().

◆ m_channel_power_db_isSet

bool SWGSDRangel::SWGFileSourceReport::m_channel_power_db_isSet
private

◆ m_duration_time_isSet

bool SWGSDRangel::SWGFileSourceReport::m_duration_time_isSet
private

Definition at line 89 of file SWGFileSourceReport.h.

Referenced by init(), setDurationTime(), and SWGFileSourceReport().

◆ m_elapsed_time_isSet

bool SWGSDRangel::SWGFileSourceReport::m_elapsed_time_isSet
private

Definition at line 86 of file SWGFileSourceReport.h.

Referenced by init(), setElapsedTime(), and SWGFileSourceReport().

◆ m_file_name_isSet

bool SWGSDRangel::SWGFileSourceReport::m_file_name_isSet
private

Definition at line 74 of file SWGFileSourceReport.h.

Referenced by init(), setFileName(), and SWGFileSourceReport().

◆ m_file_sample_rate_isSet

bool SWGSDRangel::SWGFileSourceReport::m_file_sample_rate_isSet
private

◆ m_file_sample_size_isSet

bool SWGSDRangel::SWGFileSourceReport::m_file_sample_size_isSet
private

◆ m_sample_rate_isSet

bool SWGSDRangel::SWGFileSourceReport::m_sample_rate_isSet
private

Definition at line 92 of file SWGFileSourceReport.h.

Referenced by asJsonObject(), init(), isSet(), setSampleRate(), and SWGFileSourceReport().

◆ sample_rate

qint32 SWGSDRangel::SWGFileSourceReport::sample_rate
private

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