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

#include <SWGRemoteSourceSettings.h>

+ Inheritance diagram for SWGSDRangel::SWGRemoteSourceSettings:
+ Collaboration diagram for SWGSDRangel::SWGRemoteSourceSettings:

Public Member Functions

 SWGRemoteSourceSettings ()
 
 SWGRemoteSourceSettings (QString *json)
 
virtual ~SWGRemoteSourceSettings ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGRemoteSourceSettingsfromJson (QString &jsonString) override
 
QString * getDataAddress ()
 
void setDataAddress (QString *data_address)
 
qint32 getDataPort ()
 
void setDataPort (qint32 data_port)
 
qint32 getRgbColor ()
 
void setRgbColor (qint32 rgb_color)
 
QString * getTitle ()
 
void setTitle (QString *title)
 
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)
 
qint32 getReverseApiChannelIndex ()
 
void setReverseApiChannelIndex (qint32 reverse_api_channel_index)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * data_address
 
bool m_data_address_isSet
 
qint32 data_port
 
bool m_data_port_isSet
 
qint32 rgb_color
 
bool m_rgb_color_isSet
 
QString * title
 
bool m_title_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
 
qint32 reverse_api_channel_index
 
bool m_reverse_api_channel_index_isSet
 

Detailed Description

Definition at line 32 of file SWGRemoteSourceSettings.h.

Constructor & Destructor Documentation

◆ SWGRemoteSourceSettings() [1/2]

SWGSDRangel::SWGRemoteSourceSettings::SWGRemoteSourceSettings ( )

Definition at line 30 of file SWGRemoteSourceSettings.cpp.

References data_address, data_port, m_data_address_isSet, m_data_port_isSet, m_reverse_api_address_isSet, m_reverse_api_channel_index_isSet, m_reverse_api_device_index_isSet, m_reverse_api_port_isSet, m_rgb_color_isSet, m_title_isSet, m_use_reverse_api_isSet, reverse_api_address, reverse_api_channel_index, reverse_api_device_index, reverse_api_port, rgb_color, title, and use_reverse_api.

30  {
31  data_address = nullptr;
32  m_data_address_isSet = false;
33  data_port = 0;
34  m_data_port_isSet = false;
35  rgb_color = 0;
36  m_rgb_color_isSet = false;
37  title = nullptr;
38  m_title_isSet = false;
39  use_reverse_api = 0;
41  reverse_api_address = nullptr;
43  reverse_api_port = 0;
49 }

◆ SWGRemoteSourceSettings() [2/2]

SWGSDRangel::SWGRemoteSourceSettings::SWGRemoteSourceSettings ( QString *  json)

Definition at line 25 of file SWGRemoteSourceSettings.cpp.

References fromJson(), and init().

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

◆ ~SWGRemoteSourceSettings()

SWGSDRangel::SWGRemoteSourceSettings::~SWGRemoteSourceSettings ( )
virtual

Definition at line 51 of file SWGRemoteSourceSettings.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGRemoteSourceSettings::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 128 of file SWGRemoteSourceSettings.cpp.

References asJsonObject().

129 {
130  QJsonObject* obj = this->asJsonObject();
131 
132  QJsonDocument doc(*obj);
133  QByteArray bytes = doc.toJson();
134  delete obj;
135  return QString(bytes);
136 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 139 of file SWGRemoteSourceSettings.cpp.

References data_address, data_port, m_data_port_isSet, m_reverse_api_channel_index_isSet, m_reverse_api_device_index_isSet, m_reverse_api_port_isSet, m_rgb_color_isSet, m_use_reverse_api_isSet, reverse_api_address, reverse_api_channel_index, reverse_api_device_index, reverse_api_port, rgb_color, title, SWGSDRangel::toJsonValue(), and use_reverse_api.

Referenced by asJson().

139  {
140  QJsonObject* obj = new QJsonObject();
141  if(data_address != nullptr && *data_address != QString("")){
142  toJsonValue(QString("dataAddress"), data_address, obj, QString("QString"));
143  }
144  if(m_data_port_isSet){
145  obj->insert("dataPort", QJsonValue(data_port));
146  }
147  if(m_rgb_color_isSet){
148  obj->insert("rgbColor", QJsonValue(rgb_color));
149  }
150  if(title != nullptr && *title != QString("")){
151  toJsonValue(QString("title"), title, obj, QString("QString"));
152  }
154  obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
155  }
156  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
157  toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
158  }
160  obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
161  }
163  obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
164  }
166  obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
167  }
168 
169  return obj;
170 }
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::SWGRemoteSourceSettings::cleanup ( )

Definition at line 78 of file SWGRemoteSourceSettings.cpp.

References data_address, reverse_api_address, and title.

Referenced by ~SWGRemoteSourceSettings().

78  {
79  if(data_address != nullptr) {
80  delete data_address;
81  }
82 
83 
84  if(title != nullptr) {
85  delete title;
86  }
87 
88  if(reverse_api_address != nullptr) {
89  delete reverse_api_address;
90  }
91 
92 
93 
94 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 97 of file SWGRemoteSourceSettings.cpp.

References fromJsonObject().

Referenced by SWGRemoteSourceSettings().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 106 of file SWGRemoteSourceSettings.cpp.

References data_address, data_port, reverse_api_address, reverse_api_channel_index, reverse_api_device_index, reverse_api_port, rgb_color, SWGSDRangel::setValue(), title, and use_reverse_api.

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

106  {
107  ::SWGSDRangel::setValue(&data_address, pJson["dataAddress"], "QString", "QString");
108 
109  ::SWGSDRangel::setValue(&data_port, pJson["dataPort"], "qint32", "");
110 
111  ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
112 
113  ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
114 
115  ::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
116 
117  ::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
118 
119  ::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
120 
121  ::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
122 
123  ::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
124 
125 }
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:

◆ getDataAddress()

QString * SWGSDRangel::SWGRemoteSourceSettings::getDataAddress ( )

Definition at line 173 of file SWGRemoteSourceSettings.cpp.

References data_address.

Referenced by RemoteSource::webapiFormatChannelSettings(), and RemoteSource::webapiSettingsPutPatch().

173  {
174  return data_address;
175 }
+ Here is the caller graph for this function:

◆ getDataPort()

qint32 SWGSDRangel::SWGRemoteSourceSettings::getDataPort ( )

Definition at line 183 of file SWGRemoteSourceSettings.cpp.

References data_port.

Referenced by RemoteSource::webapiSettingsPutPatch().

183  {
184  return data_port;
185 }
+ Here is the caller graph for this function:

◆ getReverseApiAddress()

QString * SWGSDRangel::SWGRemoteSourceSettings::getReverseApiAddress ( )

Definition at line 223 of file SWGRemoteSourceSettings.cpp.

References reverse_api_address.

Referenced by RemoteSource::webapiFormatChannelSettings(), and RemoteSource::webapiSettingsPutPatch().

223  {
224  return reverse_api_address;
225 }
+ Here is the caller graph for this function:

◆ getReverseApiChannelIndex()

qint32 SWGSDRangel::SWGRemoteSourceSettings::getReverseApiChannelIndex ( )

Definition at line 253 of file SWGRemoteSourceSettings.cpp.

References reverse_api_channel_index.

Referenced by RemoteSource::webapiSettingsPutPatch().

+ Here is the caller graph for this function:

◆ getReverseApiDeviceIndex()

qint32 SWGSDRangel::SWGRemoteSourceSettings::getReverseApiDeviceIndex ( )

Definition at line 243 of file SWGRemoteSourceSettings.cpp.

References reverse_api_device_index.

Referenced by RemoteSource::webapiSettingsPutPatch().

+ Here is the caller graph for this function:

◆ getReverseApiPort()

qint32 SWGSDRangel::SWGRemoteSourceSettings::getReverseApiPort ( )

Definition at line 233 of file SWGRemoteSourceSettings.cpp.

References reverse_api_port.

Referenced by RemoteSource::webapiSettingsPutPatch().

233  {
234  return reverse_api_port;
235 }
+ Here is the caller graph for this function:

◆ getRgbColor()

qint32 SWGSDRangel::SWGRemoteSourceSettings::getRgbColor ( )

Definition at line 193 of file SWGRemoteSourceSettings.cpp.

References rgb_color.

Referenced by RemoteSource::webapiSettingsPutPatch().

193  {
194  return rgb_color;
195 }
+ Here is the caller graph for this function:

◆ getTitle()

QString * SWGSDRangel::SWGRemoteSourceSettings::getTitle ( )

Definition at line 203 of file SWGRemoteSourceSettings.cpp.

References title.

Referenced by RemoteSource::webapiFormatChannelSettings(), and RemoteSource::webapiSettingsPutPatch().

203  {
204  return title;
205 }
+ Here is the caller graph for this function:

◆ getUseReverseApi()

qint32 SWGSDRangel::SWGRemoteSourceSettings::getUseReverseApi ( )

Definition at line 213 of file SWGRemoteSourceSettings.cpp.

References use_reverse_api.

Referenced by RemoteSource::webapiSettingsPutPatch().

213  {
214  return use_reverse_api;
215 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGRemoteSourceSettings::init ( )

Definition at line 56 of file SWGRemoteSourceSettings.cpp.

References data_address, data_port, m_data_address_isSet, m_data_port_isSet, m_reverse_api_address_isSet, m_reverse_api_channel_index_isSet, m_reverse_api_device_index_isSet, m_reverse_api_port_isSet, m_rgb_color_isSet, m_title_isSet, m_use_reverse_api_isSet, reverse_api_address, reverse_api_channel_index, reverse_api_device_index, reverse_api_port, rgb_color, title, and use_reverse_api.

Referenced by SWGRemoteSourceSettings(), and RemoteSource::webapiSettingsGet().

56  {
57  data_address = new QString("");
58  m_data_address_isSet = false;
59  data_port = 0;
60  m_data_port_isSet = false;
61  rgb_color = 0;
62  m_rgb_color_isSet = false;
63  title = new QString("");
64  m_title_isSet = false;
65  use_reverse_api = 0;
67  reverse_api_address = new QString("");
69  reverse_api_port = 0;
75 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGRemoteSourceSettings::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 264 of file SWGRemoteSourceSettings.cpp.

References data_address, m_data_port_isSet, m_reverse_api_channel_index_isSet, m_reverse_api_device_index_isSet, m_reverse_api_port_isSet, m_rgb_color_isSet, m_use_reverse_api_isSet, reverse_api_address, and title.

Referenced by SWGSDRangel::SWGChannelSettings::asJsonObject(), SWGSDRangel::SWGChannelSettings_2::asJsonObject(), SWGSDRangel::SWGChannelSettings_2::isSet(), and SWGSDRangel::SWGChannelSettings::isSet().

264  {
265  bool isObjectUpdated = false;
266  do{
267  if(data_address != nullptr && *data_address != QString("")){ isObjectUpdated = true; break;}
268  if(m_data_port_isSet){ isObjectUpdated = true; break;}
269  if(m_rgb_color_isSet){ isObjectUpdated = true; break;}
270  if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;}
271  if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
272  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ isObjectUpdated = true; break;}
273  if(m_reverse_api_port_isSet){ isObjectUpdated = true; break;}
274  if(m_reverse_api_device_index_isSet){ isObjectUpdated = true; break;}
275  if(m_reverse_api_channel_index_isSet){ isObjectUpdated = true; break;}
276  }while(false);
277  return isObjectUpdated;
278 }
+ Here is the caller graph for this function:

◆ setDataAddress()

void SWGSDRangel::SWGRemoteSourceSettings::setDataAddress ( QString *  data_address)

Definition at line 177 of file SWGRemoteSourceSettings.cpp.

References data_address, and m_data_address_isSet.

Referenced by RemoteSource::webapiFormatChannelSettings(), and RemoteSource::webapiReverseSendSettings().

+ Here is the caller graph for this function:

◆ setDataPort()

void SWGSDRangel::SWGRemoteSourceSettings::setDataPort ( qint32  data_port)

Definition at line 187 of file SWGRemoteSourceSettings.cpp.

References data_port, and m_data_port_isSet.

Referenced by RemoteSource::webapiFormatChannelSettings(), and RemoteSource::webapiReverseSendSettings().

+ Here is the caller graph for this function:

◆ setReverseApiAddress()

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

Definition at line 227 of file SWGRemoteSourceSettings.cpp.

References m_reverse_api_address_isSet, and reverse_api_address.

Referenced by RemoteSource::webapiFormatChannelSettings().

+ Here is the caller graph for this function:

◆ setReverseApiChannelIndex()

void SWGSDRangel::SWGRemoteSourceSettings::setReverseApiChannelIndex ( qint32  reverse_api_channel_index)

◆ setReverseApiDeviceIndex()

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

◆ setReverseApiPort()

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

Definition at line 237 of file SWGRemoteSourceSettings.cpp.

References m_reverse_api_port_isSet, and reverse_api_port.

Referenced by RemoteSource::webapiFormatChannelSettings().

+ Here is the caller graph for this function:

◆ setRgbColor()

void SWGSDRangel::SWGRemoteSourceSettings::setRgbColor ( qint32  rgb_color)

Definition at line 197 of file SWGRemoteSourceSettings.cpp.

References m_rgb_color_isSet, and rgb_color.

Referenced by RemoteSource::webapiFormatChannelSettings(), and RemoteSource::webapiReverseSendSettings().

+ Here is the caller graph for this function:

◆ setTitle()

void SWGSDRangel::SWGRemoteSourceSettings::setTitle ( QString *  title)

Definition at line 207 of file SWGRemoteSourceSettings.cpp.

References m_title_isSet, and title.

Referenced by RemoteSource::webapiFormatChannelSettings(), and RemoteSource::webapiReverseSendSettings().

+ Here is the caller graph for this function:

◆ setUseReverseApi()

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

Definition at line 217 of file SWGRemoteSourceSettings.cpp.

References m_use_reverse_api_isSet, and use_reverse_api.

Referenced by RemoteSource::webapiFormatChannelSettings().

+ Here is the caller graph for this function:

Member Data Documentation

◆ data_address

QString* SWGSDRangel::SWGRemoteSourceSettings::data_address
private

◆ data_port

qint32 SWGSDRangel::SWGRemoteSourceSettings::data_port
private

◆ m_data_address_isSet

bool SWGSDRangel::SWGRemoteSourceSettings::m_data_address_isSet
private

Definition at line 77 of file SWGRemoteSourceSettings.h.

Referenced by init(), setDataAddress(), and SWGRemoteSourceSettings().

◆ m_data_port_isSet

bool SWGSDRangel::SWGRemoteSourceSettings::m_data_port_isSet
private

◆ m_reverse_api_address_isSet

bool SWGSDRangel::SWGRemoteSourceSettings::m_reverse_api_address_isSet
private

Definition at line 92 of file SWGRemoteSourceSettings.h.

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

◆ m_reverse_api_channel_index_isSet

bool SWGSDRangel::SWGRemoteSourceSettings::m_reverse_api_channel_index_isSet
private

◆ m_reverse_api_device_index_isSet

bool SWGSDRangel::SWGRemoteSourceSettings::m_reverse_api_device_index_isSet
private

◆ m_reverse_api_port_isSet

bool SWGSDRangel::SWGRemoteSourceSettings::m_reverse_api_port_isSet
private

◆ m_rgb_color_isSet

bool SWGSDRangel::SWGRemoteSourceSettings::m_rgb_color_isSet
private

◆ m_title_isSet

bool SWGSDRangel::SWGRemoteSourceSettings::m_title_isSet
private

Definition at line 86 of file SWGRemoteSourceSettings.h.

Referenced by init(), setTitle(), and SWGRemoteSourceSettings().

◆ m_use_reverse_api_isSet

bool SWGSDRangel::SWGRemoteSourceSettings::m_use_reverse_api_isSet
private

◆ reverse_api_address

QString* SWGSDRangel::SWGRemoteSourceSettings::reverse_api_address
private

◆ reverse_api_channel_index

qint32 SWGSDRangel::SWGRemoteSourceSettings::reverse_api_channel_index
private

◆ reverse_api_device_index

qint32 SWGSDRangel::SWGRemoteSourceSettings::reverse_api_device_index
private

◆ reverse_api_port

qint32 SWGSDRangel::SWGRemoteSourceSettings::reverse_api_port
private

◆ rgb_color

qint32 SWGSDRangel::SWGRemoteSourceSettings::rgb_color
private

◆ title

QString* SWGSDRangel::SWGRemoteSourceSettings::title
private

◆ use_reverse_api

qint32 SWGSDRangel::SWGRemoteSourceSettings::use_reverse_api
private

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