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

#include <SWGFileInputReport.h>

+ Inheritance diagram for SWGSDRangel::SWGFileInputReport:
+ Collaboration diagram for SWGSDRangel::SWGFileInputReport:

Public Member Functions

 SWGFileInputReport ()
 
 SWGFileInputReport (QString *json)
 
virtual ~SWGFileInputReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGFileInputReportfromJson (QString &jsonString) override
 
QString * getFileName ()
 
void setFileName (QString *file_name)
 
qint32 getSampleRate ()
 
void setSampleRate (qint32 sample_rate)
 
qint32 getSampleSize ()
 
void setSampleSize (qint32 sample_size)
 
QString * getAbsoluteTime ()
 
void setAbsoluteTime (QString *absolute_time)
 
QString * getElapsedTime ()
 
void setElapsedTime (QString *elapsed_time)
 
QString * getDurationTime ()
 
void setDurationTime (QString *duration_time)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * file_name
 
bool m_file_name_isSet
 
qint32 sample_rate
 
bool m_sample_rate_isSet
 
qint32 sample_size
 
bool m_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
 

Detailed Description

Definition at line 32 of file SWGFileInputReport.h.

Constructor & Destructor Documentation

◆ SWGFileInputReport() [1/2]

SWGSDRangel::SWGFileInputReport::SWGFileInputReport ( )

Definition at line 30 of file SWGFileInputReport.cpp.

References absolute_time, duration_time, elapsed_time, file_name, m_absolute_time_isSet, m_duration_time_isSet, m_elapsed_time_isSet, m_file_name_isSet, m_sample_rate_isSet, m_sample_size_isSet, sample_rate, and sample_size.

30  {
31  file_name = nullptr;
32  m_file_name_isSet = false;
33  sample_rate = 0;
34  m_sample_rate_isSet = false;
35  sample_size = 0;
36  m_sample_size_isSet = false;
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 }

◆ SWGFileInputReport() [2/2]

SWGSDRangel::SWGFileInputReport::SWGFileInputReport ( QString *  json)

Definition at line 25 of file SWGFileInputReport.cpp.

References fromJson(), and init().

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

◆ ~SWGFileInputReport()

SWGSDRangel::SWGFileInputReport::~SWGFileInputReport ( )
virtual

Definition at line 45 of file SWGFileInputReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGFileInputReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 109 of file SWGFileInputReport.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 120 of file SWGFileInputReport.cpp.

References absolute_time, duration_time, elapsed_time, file_name, m_sample_rate_isSet, m_sample_size_isSet, sample_rate, sample_size, and SWGSDRangel::toJsonValue().

Referenced by asJson().

120  {
121  QJsonObject* obj = new QJsonObject();
122  if(file_name != nullptr && *file_name != QString("")){
123  toJsonValue(QString("fileName"), file_name, obj, QString("QString"));
124  }
126  obj->insert("sampleRate", QJsonValue(sample_rate));
127  }
129  obj->insert("sampleSize", QJsonValue(sample_size));
130  }
131  if(absolute_time != nullptr && *absolute_time != QString("")){
132  toJsonValue(QString("absoluteTime"), absolute_time, obj, QString("QString"));
133  }
134  if(elapsed_time != nullptr && *elapsed_time != QString("")){
135  toJsonValue(QString("elapsedTime"), elapsed_time, obj, QString("QString"));
136  }
137  if(duration_time != nullptr && *duration_time != QString("")){
138  toJsonValue(QString("durationTime"), duration_time, obj, QString("QString"));
139  }
140 
141  return obj;
142 }
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::SWGFileInputReport::cleanup ( )

Definition at line 66 of file SWGFileInputReport.cpp.

References absolute_time, duration_time, elapsed_time, and file_name.

Referenced by ~SWGFileInputReport().

66  {
67  if(file_name != nullptr) {
68  delete file_name;
69  }
70 
71 
72  if(absolute_time != nullptr) {
73  delete absolute_time;
74  }
75  if(elapsed_time != nullptr) {
76  delete elapsed_time;
77  }
78  if(duration_time != nullptr) {
79  delete duration_time;
80  }
81 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 84 of file SWGFileInputReport.cpp.

References fromJsonObject().

Referenced by SWGFileInputReport().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 93 of file SWGFileInputReport.cpp.

References absolute_time, duration_time, elapsed_time, file_name, sample_rate, sample_size, and SWGSDRangel::setValue().

Referenced by fromJson().

93  {
94  ::SWGSDRangel::setValue(&file_name, pJson["fileName"], "QString", "QString");
95 
96  ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
97 
98  ::SWGSDRangel::setValue(&sample_size, pJson["sampleSize"], "qint32", "");
99 
100  ::SWGSDRangel::setValue(&absolute_time, pJson["absoluteTime"], "QString", "QString");
101 
102  ::SWGSDRangel::setValue(&elapsed_time, pJson["elapsedTime"], "QString", "QString");
103 
104  ::SWGSDRangel::setValue(&duration_time, pJson["durationTime"], "QString", "QString");
105 
106 }
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::SWGFileInputReport::getAbsoluteTime ( )

Definition at line 175 of file SWGFileInputReport.cpp.

References absolute_time.

175  {
176  return absolute_time;
177 }

◆ getDurationTime()

QString * SWGSDRangel::SWGFileInputReport::getDurationTime ( )

Definition at line 195 of file SWGFileInputReport.cpp.

References duration_time.

195  {
196  return duration_time;
197 }

◆ getElapsedTime()

QString * SWGSDRangel::SWGFileInputReport::getElapsedTime ( )

Definition at line 185 of file SWGFileInputReport.cpp.

References elapsed_time.

185  {
186  return elapsed_time;
187 }

◆ getFileName()

QString * SWGSDRangel::SWGFileInputReport::getFileName ( )

Definition at line 145 of file SWGFileInputReport.cpp.

References file_name.

145  {
146  return file_name;
147 }

◆ getSampleRate()

qint32 SWGSDRangel::SWGFileInputReport::getSampleRate ( )

Definition at line 155 of file SWGFileInputReport.cpp.

References sample_rate.

155  {
156  return sample_rate;
157 }

◆ getSampleSize()

qint32 SWGSDRangel::SWGFileInputReport::getSampleSize ( )

Definition at line 165 of file SWGFileInputReport.cpp.

References sample_size.

165  {
166  return sample_size;
167 }

◆ init()

void SWGSDRangel::SWGFileInputReport::init ( )

Definition at line 50 of file SWGFileInputReport.cpp.

References absolute_time, duration_time, elapsed_time, file_name, m_absolute_time_isSet, m_duration_time_isSet, m_elapsed_time_isSet, m_file_name_isSet, m_sample_rate_isSet, m_sample_size_isSet, sample_rate, and sample_size.

Referenced by SWGFileInputReport(), and FileInput::webapiReportGet().

50  {
51  file_name = new QString("");
52  m_file_name_isSet = false;
53  sample_rate = 0;
54  m_sample_rate_isSet = false;
55  sample_size = 0;
56  m_sample_size_isSet = false;
57  absolute_time = new QString("");
58  m_absolute_time_isSet = false;
59  elapsed_time = new QString("");
60  m_elapsed_time_isSet = false;
61  duration_time = new QString("");
62  m_duration_time_isSet = false;
63 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGFileInputReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 206 of file SWGFileInputReport.cpp.

References absolute_time, duration_time, elapsed_time, file_name, m_sample_rate_isSet, and m_sample_size_isSet.

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

206  {
207  bool isObjectUpdated = false;
208  do{
209  if(file_name != nullptr && *file_name != QString("")){ isObjectUpdated = true; break;}
210  if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
211  if(m_sample_size_isSet){ isObjectUpdated = true; break;}
212  if(absolute_time != nullptr && *absolute_time != QString("")){ isObjectUpdated = true; break;}
213  if(elapsed_time != nullptr && *elapsed_time != QString("")){ isObjectUpdated = true; break;}
214  if(duration_time != nullptr && *duration_time != QString("")){ isObjectUpdated = true; break;}
215  }while(false);
216  return isObjectUpdated;
217 }
+ Here is the caller graph for this function:

◆ setAbsoluteTime()

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

Definition at line 179 of file SWGFileInputReport.cpp.

References absolute_time, and m_absolute_time_isSet.

Referenced by FileInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setDurationTime()

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

Definition at line 199 of file SWGFileInputReport.cpp.

References duration_time, and m_duration_time_isSet.

Referenced by FileInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setElapsedTime()

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

Definition at line 189 of file SWGFileInputReport.cpp.

References elapsed_time, and m_elapsed_time_isSet.

Referenced by FileInput::webapiFormatDeviceReport().

189  {
190  this->elapsed_time = elapsed_time;
191  this->m_elapsed_time_isSet = true;
192 }
+ Here is the caller graph for this function:

◆ setFileName()

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

Definition at line 149 of file SWGFileInputReport.cpp.

References file_name, and m_file_name_isSet.

Referenced by FileInput::webapiFormatDeviceReport().

149  {
150  this->file_name = file_name;
151  this->m_file_name_isSet = true;
152 }
+ Here is the caller graph for this function:

◆ setSampleRate()

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

Definition at line 159 of file SWGFileInputReport.cpp.

References m_sample_rate_isSet, and sample_rate.

Referenced by FileInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

◆ setSampleSize()

void SWGSDRangel::SWGFileInputReport::setSampleSize ( qint32  sample_size)

Definition at line 169 of file SWGFileInputReport.cpp.

References m_sample_size_isSet, and sample_size.

Referenced by FileInput::webapiFormatDeviceReport().

+ Here is the caller graph for this function:

Member Data Documentation

◆ absolute_time

QString* SWGSDRangel::SWGFileInputReport::absolute_time
private

◆ duration_time

QString* SWGSDRangel::SWGFileInputReport::duration_time
private

◆ elapsed_time

QString* SWGSDRangel::SWGFileInputReport::elapsed_time
private

◆ file_name

QString* SWGSDRangel::SWGFileInputReport::file_name
private

◆ m_absolute_time_isSet

bool SWGSDRangel::SWGFileInputReport::m_absolute_time_isSet
private

Definition at line 77 of file SWGFileInputReport.h.

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

◆ m_duration_time_isSet

bool SWGSDRangel::SWGFileInputReport::m_duration_time_isSet
private

Definition at line 83 of file SWGFileInputReport.h.

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

◆ m_elapsed_time_isSet

bool SWGSDRangel::SWGFileInputReport::m_elapsed_time_isSet
private

Definition at line 80 of file SWGFileInputReport.h.

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

◆ m_file_name_isSet

bool SWGSDRangel::SWGFileInputReport::m_file_name_isSet
private

Definition at line 68 of file SWGFileInputReport.h.

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

◆ m_sample_rate_isSet

bool SWGSDRangel::SWGFileInputReport::m_sample_rate_isSet
private

Definition at line 71 of file SWGFileInputReport.h.

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

◆ m_sample_size_isSet

bool SWGSDRangel::SWGFileInputReport::m_sample_size_isSet
private

Definition at line 74 of file SWGFileInputReport.h.

Referenced by asJsonObject(), init(), isSet(), setSampleSize(), and SWGFileInputReport().

◆ sample_rate

qint32 SWGSDRangel::SWGFileInputReport::sample_rate
private

◆ sample_size

qint32 SWGSDRangel::SWGFileInputReport::sample_size
private

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