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

#include <SWGLocalOutputSettings.h>

+ Inheritance diagram for SWGSDRangel::SWGLocalOutputSettings:
+ Collaboration diagram for SWGSDRangel::SWGLocalOutputSettings:

Public Member Functions

 SWGLocalOutputSettings ()
 
 SWGLocalOutputSettings (QString *json)
 
virtual ~SWGLocalOutputSettings ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGLocalOutputSettingsfromJson (QString &jsonString) override
 
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)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

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
 

Detailed Description

Definition at line 32 of file SWGLocalOutputSettings.h.

Constructor & Destructor Documentation

◆ SWGLocalOutputSettings() [1/2]

SWGSDRangel::SWGLocalOutputSettings::SWGLocalOutputSettings ( )

Definition at line 30 of file SWGLocalOutputSettings.cpp.

References m_reverse_api_address_isSet, 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, and use_reverse_api.

◆ SWGLocalOutputSettings() [2/2]

SWGSDRangel::SWGLocalOutputSettings::SWGLocalOutputSettings ( QString *  json)

Definition at line 25 of file SWGLocalOutputSettings.cpp.

References fromJson(), and init().

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

◆ ~SWGLocalOutputSettings()

SWGSDRangel::SWGLocalOutputSettings::~SWGLocalOutputSettings ( )
virtual

Definition at line 41 of file SWGLocalOutputSettings.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGLocalOutputSettings::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 89 of file SWGLocalOutputSettings.cpp.

References asJsonObject().

90 {
91  QJsonObject* obj = this->asJsonObject();
92 
93  QJsonDocument doc(*obj);
94  QByteArray bytes = doc.toJson();
95  delete obj;
96  return QString(bytes);
97 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 100 of file SWGLocalOutputSettings.cpp.

References 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, SWGSDRangel::toJsonValue(), and use_reverse_api.

Referenced by asJson().

100  {
101  QJsonObject* obj = new QJsonObject();
103  obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
104  }
105  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
106  toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
107  }
109  obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
110  }
112  obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
113  }
114 
115  return obj;
116 }
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::SWGLocalOutputSettings::cleanup ( )

Definition at line 58 of file SWGLocalOutputSettings.cpp.

References reverse_api_address.

Referenced by ~SWGLocalOutputSettings().

58  {
59 
60  if(reverse_api_address != nullptr) {
61  delete reverse_api_address;
62  }
63 
64 
65 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 68 of file SWGLocalOutputSettings.cpp.

References fromJsonObject().

Referenced by SWGLocalOutputSettings().

68  {
69  QByteArray array (json.toStdString().c_str());
70  QJsonDocument doc = QJsonDocument::fromJson(array);
71  QJsonObject jsonObject = doc.object();
72  this->fromJsonObject(jsonObject);
73  return this;
74 }
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::SWGLocalOutputSettings::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 77 of file SWGLocalOutputSettings.cpp.

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

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

77  {
78  ::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
79 
80  ::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
81 
82  ::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
83 
84  ::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
85 
86 }
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:

◆ getReverseApiAddress()

QString * SWGSDRangel::SWGLocalOutputSettings::getReverseApiAddress ( )

Definition at line 129 of file SWGLocalOutputSettings.cpp.

References reverse_api_address.

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

129  {
130  return reverse_api_address;
131 }
+ Here is the caller graph for this function:

◆ getReverseApiDeviceIndex()

qint32 SWGSDRangel::SWGLocalOutputSettings::getReverseApiDeviceIndex ( )

Definition at line 149 of file SWGLocalOutputSettings.cpp.

References reverse_api_device_index.

Referenced by LocalOutput::webapiSettingsPutPatch().

+ Here is the caller graph for this function:

◆ getReverseApiPort()

qint32 SWGSDRangel::SWGLocalOutputSettings::getReverseApiPort ( )

Definition at line 139 of file SWGLocalOutputSettings.cpp.

References reverse_api_port.

Referenced by LocalOutput::webapiSettingsPutPatch().

139  {
140  return reverse_api_port;
141 }
+ Here is the caller graph for this function:

◆ getUseReverseApi()

qint32 SWGSDRangel::SWGLocalOutputSettings::getUseReverseApi ( )

Definition at line 119 of file SWGLocalOutputSettings.cpp.

References use_reverse_api.

Referenced by LocalOutput::webapiSettingsPutPatch().

119  {
120  return use_reverse_api;
121 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGLocalOutputSettings::init ( )

Definition at line 46 of file SWGLocalOutputSettings.cpp.

References m_reverse_api_address_isSet, 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, and use_reverse_api.

Referenced by SWGLocalOutputSettings(), and LocalOutput::webapiSettingsGet().

+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGLocalOutputSettings::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 160 of file SWGLocalOutputSettings.cpp.

References m_reverse_api_device_index_isSet, m_reverse_api_port_isSet, m_use_reverse_api_isSet, and reverse_api_address.

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

160  {
161  bool isObjectUpdated = false;
162  do{
163  if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
164  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ isObjectUpdated = true; break;}
165  if(m_reverse_api_port_isSet){ isObjectUpdated = true; break;}
166  if(m_reverse_api_device_index_isSet){ isObjectUpdated = true; break;}
167  }while(false);
168  return isObjectUpdated;
169 }
+ Here is the caller graph for this function:

◆ setReverseApiAddress()

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

Definition at line 133 of file SWGLocalOutputSettings.cpp.

References m_reverse_api_address_isSet, and reverse_api_address.

Referenced by LocalOutput::webapiFormatDeviceSettings().

+ Here is the caller graph for this function:

◆ setReverseApiDeviceIndex()

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

◆ setReverseApiPort()

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

Definition at line 143 of file SWGLocalOutputSettings.cpp.

References m_reverse_api_port_isSet, and reverse_api_port.

Referenced by LocalOutput::webapiFormatDeviceSettings().

+ Here is the caller graph for this function:

◆ setUseReverseApi()

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

Definition at line 123 of file SWGLocalOutputSettings.cpp.

References m_use_reverse_api_isSet, and use_reverse_api.

Referenced by LocalOutput::webapiFormatDeviceSettings().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_reverse_api_address_isSet

bool SWGSDRangel::SWGLocalOutputSettings::m_reverse_api_address_isSet
private

Definition at line 65 of file SWGLocalOutputSettings.h.

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

◆ m_reverse_api_device_index_isSet

bool SWGSDRangel::SWGLocalOutputSettings::m_reverse_api_device_index_isSet
private

◆ m_reverse_api_port_isSet

bool SWGSDRangel::SWGLocalOutputSettings::m_reverse_api_port_isSet
private

◆ m_use_reverse_api_isSet

bool SWGSDRangel::SWGLocalOutputSettings::m_use_reverse_api_isSet
private

◆ reverse_api_address

QString* SWGSDRangel::SWGLocalOutputSettings::reverse_api_address
private

◆ reverse_api_device_index

qint32 SWGSDRangel::SWGLocalOutputSettings::reverse_api_device_index
private

◆ reverse_api_port

qint32 SWGSDRangel::SWGLocalOutputSettings::reverse_api_port
private

◆ use_reverse_api

qint32 SWGSDRangel::SWGLocalOutputSettings::use_reverse_api
private

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