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

#include <SWGTestMISettings.h>

+ Inheritance diagram for SWGSDRangel::SWGTestMISettings:
+ Collaboration diagram for SWGSDRangel::SWGTestMISettings:

Public Member Functions

 SWGTestMISettings ()
 
 SWGTestMISettings (QString *json)
 
virtual ~SWGTestMISettings ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGTestMISettingsfromJson (QString &jsonString) override
 
QString * getFileRecordName ()
 
void setFileRecordName (QString *file_record_name)
 
qint32 getUseReverseApi ()
 
void setUseReverseApi (qint32 use_reverse_api)
 
QString * getReverseApiAddress ()
 
void setReverseApiAddress (QString *reverse_api_address)
 
qint32 getReverseApiPort ()
 
void setReverseApiPort (qint32 reverse_api_port)
 
qint32 getReverseApiDeviceIndex ()
 
void setReverseApiDeviceIndex (qint32 reverse_api_device_index)
 
QList< SWGTestMiStreamSettings * > * getStreams ()
 
void setStreams (QList< SWGTestMiStreamSettings *> *streams)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * file_record_name
 
bool m_file_record_name_isSet
 
qint32 use_reverse_api
 
bool m_use_reverse_api_isSet
 
QString * reverse_api_address
 
bool m_reverse_api_address_isSet
 
qint32 reverse_api_port
 
bool m_reverse_api_port_isSet
 
qint32 reverse_api_device_index
 
bool m_reverse_api_device_index_isSet
 
QList< SWGTestMiStreamSettings * > * streams
 
bool m_streams_isSet
 

Detailed Description

Definition at line 34 of file SWGTestMISettings.h.

Constructor & Destructor Documentation

◆ SWGTestMISettings() [1/2]

SWGSDRangel::SWGTestMISettings::SWGTestMISettings ( )

Definition at line 30 of file SWGTestMISettings.cpp.

References file_record_name, m_file_record_name_isSet, m_reverse_api_address_isSet, m_reverse_api_device_index_isSet, m_reverse_api_port_isSet, m_streams_isSet, m_use_reverse_api_isSet, reverse_api_address, reverse_api_device_index, reverse_api_port, streams, and use_reverse_api.

30  {
31  file_record_name = nullptr;
33  use_reverse_api = 0;
35  reverse_api_address = nullptr;
37  reverse_api_port = 0;
41  streams = nullptr;
42  m_streams_isSet = false;
43 }
QList< SWGTestMiStreamSettings * > * streams

◆ SWGTestMISettings() [2/2]

SWGSDRangel::SWGTestMISettings::SWGTestMISettings ( QString *  json)

Definition at line 25 of file SWGTestMISettings.cpp.

References fromJson(), and init().

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

◆ ~SWGTestMISettings()

SWGSDRangel::SWGTestMISettings::~SWGTestMISettings ( )
virtual

Definition at line 45 of file SWGTestMISettings.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGTestMISettings::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 111 of file SWGTestMISettings.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 122 of file SWGTestMISettings.cpp.

References file_record_name, m_reverse_api_device_index_isSet, m_reverse_api_port_isSet, m_use_reverse_api_isSet, reverse_api_address, reverse_api_device_index, reverse_api_port, streams, SWGSDRangel::toJsonArray(), SWGSDRangel::toJsonValue(), and use_reverse_api.

Referenced by asJson().

122  {
123  QJsonObject* obj = new QJsonObject();
124  if(file_record_name != nullptr && *file_record_name != QString("")){
125  toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
126  }
128  obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
129  }
130  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
131  toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
132  }
134  obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
135  }
137  obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
138  }
139  if(streams->size() > 0){
140  toJsonArray((QList<void*>*)streams, obj, "streams", "SWGTestMiStreamSettings");
141  }
142 
143  return obj;
144 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
QList< SWGTestMiStreamSettings * > * streams
void toJsonArray(QList< void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:445
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGTestMISettings::cleanup ( )

Definition at line 66 of file SWGTestMISettings.cpp.

References file_record_name, reverse_api_address, and streams.

Referenced by ~SWGTestMISettings().

66  {
67  if(file_record_name != nullptr) {
68  delete file_record_name;
69  }
70 
71  if(reverse_api_address != nullptr) {
72  delete reverse_api_address;
73  }
74 
75 
76  if(streams != nullptr) {
77  auto arr = streams;
78  for(auto o: *arr) {
79  delete o;
80  }
81  delete streams;
82  }
83 }
QList< SWGTestMiStreamSettings * > * streams
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 86 of file SWGTestMISettings.cpp.

References fromJsonObject().

Referenced by SWGTestMISettings().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 95 of file SWGTestMISettings.cpp.

References file_record_name, reverse_api_address, reverse_api_device_index, reverse_api_port, SWGSDRangel::setValue(), streams, and use_reverse_api.

Referenced by fromJson(), and WebAPIRequestMapper::validateDeviceSettings().

95  {
96  ::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
97 
98  ::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
99 
100  ::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
101 
102  ::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
103 
104  ::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
105 
106 
107  ::SWGSDRangel::setValue(&streams, pJson["streams"], "QList", "SWGTestMiStreamSettings");
108 }
QList< SWGTestMiStreamSettings * > * streams
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:

◆ getFileRecordName()

QString * SWGSDRangel::SWGTestMISettings::getFileRecordName ( )

Definition at line 147 of file SWGTestMISettings.cpp.

References file_record_name.

Referenced by TestMI::webapiFormatDeviceSettings(), and TestMI::webapiSettingsPutPatch().

147  {
148  return file_record_name;
149 }
+ Here is the caller graph for this function:

◆ getReverseApiAddress()

QString * SWGSDRangel::SWGTestMISettings::getReverseApiAddress ( )

Definition at line 167 of file SWGTestMISettings.cpp.

References reverse_api_address.

Referenced by TestMI::webapiFormatDeviceSettings(), and TestMI::webapiSettingsPutPatch().

167  {
168  return reverse_api_address;
169 }
+ Here is the caller graph for this function:

◆ getReverseApiDeviceIndex()

qint32 SWGSDRangel::SWGTestMISettings::getReverseApiDeviceIndex ( )

Definition at line 187 of file SWGTestMISettings.cpp.

References reverse_api_device_index.

Referenced by TestMI::webapiSettingsPutPatch().

187  {
189 }
+ Here is the caller graph for this function:

◆ getReverseApiPort()

qint32 SWGSDRangel::SWGTestMISettings::getReverseApiPort ( )

Definition at line 177 of file SWGTestMISettings.cpp.

References reverse_api_port.

Referenced by TestMI::webapiSettingsPutPatch().

177  {
178  return reverse_api_port;
179 }
+ Here is the caller graph for this function:

◆ getStreams()

QList< SWGTestMiStreamSettings * > * SWGSDRangel::SWGTestMISettings::getStreams ( )

Definition at line 197 of file SWGTestMISettings.cpp.

References streams.

Referenced by TestMI::webapiFormatDeviceSettings(), TestMI::webapiReverseSendSettings(), and TestMI::webapiSettingsPutPatch().

197  {
198  return streams;
199 }
QList< SWGTestMiStreamSettings * > * streams
+ Here is the caller graph for this function:

◆ getUseReverseApi()

qint32 SWGSDRangel::SWGTestMISettings::getUseReverseApi ( )

Definition at line 157 of file SWGTestMISettings.cpp.

References use_reverse_api.

Referenced by TestMI::webapiSettingsPutPatch().

157  {
158  return use_reverse_api;
159 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGTestMISettings::init ( )

Definition at line 50 of file SWGTestMISettings.cpp.

References file_record_name, m_file_record_name_isSet, m_reverse_api_address_isSet, m_reverse_api_device_index_isSet, m_reverse_api_port_isSet, m_streams_isSet, m_use_reverse_api_isSet, reverse_api_address, reverse_api_device_index, reverse_api_port, streams, and use_reverse_api.

Referenced by SWGTestMISettings(), and TestMI::webapiSettingsGet().

50  {
51  file_record_name = new QString("");
53  use_reverse_api = 0;
55  reverse_api_address = new QString("");
57  reverse_api_port = 0;
61  streams = new QList<SWGTestMiStreamSettings*>();
62  m_streams_isSet = false;
63 }
QList< SWGTestMiStreamSettings * > * streams
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGTestMISettings::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 208 of file SWGTestMISettings.cpp.

References file_record_name, m_reverse_api_device_index_isSet, m_reverse_api_port_isSet, m_use_reverse_api_isSet, reverse_api_address, and streams.

Referenced by SWGSDRangel::SWGDeviceSettings::asJsonObject(), SWGSDRangel::SWGDeviceSettings_2::asJsonObject(), SWGSDRangel::SWGDeviceSettings_2::isSet(), and SWGSDRangel::SWGDeviceSettings::isSet().

208  {
209  bool isObjectUpdated = false;
210  do{
211  if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
212  if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
213  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ isObjectUpdated = true; break;}
214  if(m_reverse_api_port_isSet){ isObjectUpdated = true; break;}
215  if(m_reverse_api_device_index_isSet){ isObjectUpdated = true; break;}
216  if(streams->size() > 0){ isObjectUpdated = true; break;}
217  }while(false);
218  return isObjectUpdated;
219 }
QList< SWGTestMiStreamSettings * > * streams
+ Here is the caller graph for this function:

◆ setFileRecordName()

void SWGSDRangel::SWGTestMISettings::setFileRecordName ( QString *  file_record_name)

Definition at line 151 of file SWGTestMISettings.cpp.

References file_record_name, and m_file_record_name_isSet.

Referenced by TestMI::webapiFormatDeviceSettings(), and TestMI::webapiReverseSendSettings().

+ Here is the caller graph for this function:

◆ setReverseApiAddress()

void SWGSDRangel::SWGTestMISettings::setReverseApiAddress ( QString *  reverse_api_address)

Definition at line 171 of file SWGTestMISettings.cpp.

References m_reverse_api_address_isSet, and reverse_api_address.

Referenced by TestMI::webapiFormatDeviceSettings().

+ Here is the caller graph for this function:

◆ setReverseApiDeviceIndex()

void SWGSDRangel::SWGTestMISettings::setReverseApiDeviceIndex ( qint32  reverse_api_device_index)

Definition at line 191 of file SWGTestMISettings.cpp.

References m_reverse_api_device_index_isSet, and reverse_api_device_index.

Referenced by TestMI::webapiFormatDeviceSettings().

+ Here is the caller graph for this function:

◆ setReverseApiPort()

void SWGSDRangel::SWGTestMISettings::setReverseApiPort ( qint32  reverse_api_port)

Definition at line 181 of file SWGTestMISettings.cpp.

References m_reverse_api_port_isSet, and reverse_api_port.

Referenced by TestMI::webapiFormatDeviceSettings().

+ Here is the caller graph for this function:

◆ setStreams()

void SWGSDRangel::SWGTestMISettings::setStreams ( QList< SWGTestMiStreamSettings *> *  streams)

Definition at line 201 of file SWGTestMISettings.cpp.

References m_streams_isSet, and streams.

201  {
202  this->streams = streams;
203  this->m_streams_isSet = true;
204 }
QList< SWGTestMiStreamSettings * > * streams

◆ setUseReverseApi()

void SWGSDRangel::SWGTestMISettings::setUseReverseApi ( qint32  use_reverse_api)

Definition at line 161 of file SWGTestMISettings.cpp.

References m_use_reverse_api_isSet, and use_reverse_api.

Referenced by TestMI::webapiFormatDeviceSettings().

+ Here is the caller graph for this function:

Member Data Documentation

◆ file_record_name

QString* SWGSDRangel::SWGTestMISettings::file_record_name
private

◆ m_file_record_name_isSet

bool SWGSDRangel::SWGTestMISettings::m_file_record_name_isSet
private

Definition at line 70 of file SWGTestMISettings.h.

Referenced by init(), setFileRecordName(), and SWGTestMISettings().

◆ m_reverse_api_address_isSet

bool SWGSDRangel::SWGTestMISettings::m_reverse_api_address_isSet
private

Definition at line 76 of file SWGTestMISettings.h.

Referenced by init(), setReverseApiAddress(), and SWGTestMISettings().

◆ m_reverse_api_device_index_isSet

bool SWGSDRangel::SWGTestMISettings::m_reverse_api_device_index_isSet
private

◆ m_reverse_api_port_isSet

bool SWGSDRangel::SWGTestMISettings::m_reverse_api_port_isSet
private

Definition at line 79 of file SWGTestMISettings.h.

Referenced by asJsonObject(), init(), isSet(), setReverseApiPort(), and SWGTestMISettings().

◆ m_streams_isSet

bool SWGSDRangel::SWGTestMISettings::m_streams_isSet
private

Definition at line 85 of file SWGTestMISettings.h.

Referenced by init(), setStreams(), and SWGTestMISettings().

◆ m_use_reverse_api_isSet

bool SWGSDRangel::SWGTestMISettings::m_use_reverse_api_isSet
private

Definition at line 73 of file SWGTestMISettings.h.

Referenced by asJsonObject(), init(), isSet(), setUseReverseApi(), and SWGTestMISettings().

◆ reverse_api_address

QString* SWGSDRangel::SWGTestMISettings::reverse_api_address
private

◆ reverse_api_device_index

qint32 SWGSDRangel::SWGTestMISettings::reverse_api_device_index
private

◆ reverse_api_port

qint32 SWGSDRangel::SWGTestMISettings::reverse_api_port
private

◆ streams

QList<SWGTestMiStreamSettings*>* SWGSDRangel::SWGTestMISettings::streams
private

◆ use_reverse_api

qint32 SWGSDRangel::SWGTestMISettings::use_reverse_api
private

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