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

#include <SWGComplex.h>

+ Inheritance diagram for SWGSDRangel::SWGComplex:
+ Collaboration diagram for SWGSDRangel::SWGComplex:

Public Member Functions

 SWGComplex ()
 
 SWGComplex (QString *json)
 
virtual ~SWGComplex ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGComplexfromJson (QString &jsonString) override
 
float getReal ()
 
void setReal (float real)
 
float getImag ()
 
void setImag (float imag)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

float real
 
bool m_real_isSet
 
float imag
 
bool m_imag_isSet
 

Detailed Description

Definition at line 31 of file SWGComplex.h.

Constructor & Destructor Documentation

◆ SWGComplex() [1/2]

SWGSDRangel::SWGComplex::SWGComplex ( )

Definition at line 30 of file SWGComplex.cpp.

References imag, m_imag_isSet, m_real_isSet, and real.

30  {
31  real = 0.0f;
32  m_real_isSet = false;
33  imag = 0.0f;
34  m_imag_isSet = false;
35 }

◆ SWGComplex() [2/2]

SWGSDRangel::SWGComplex::SWGComplex ( QString *  json)

Definition at line 25 of file SWGComplex.cpp.

References fromJson(), and init().

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

◆ ~SWGComplex()

SWGSDRangel::SWGComplex::~SWGComplex ( )
virtual

Definition at line 37 of file SWGComplex.cpp.

References cleanup().

37  {
38  this->cleanup();
39 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGComplex::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 73 of file SWGComplex.cpp.

References asJsonObject().

74 {
75  QJsonObject* obj = this->asJsonObject();
76 
77  QJsonDocument doc(*obj);
78  QByteArray bytes = doc.toJson();
79  delete obj;
80  return QString(bytes);
81 }
virtual QJsonObject * asJsonObject() override
Definition: SWGComplex.cpp:84
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 84 of file SWGComplex.cpp.

References imag, m_imag_isSet, m_real_isSet, and real.

Referenced by asJson().

84  {
85  QJsonObject* obj = new QJsonObject();
86  if(m_real_isSet){
87  obj->insert("real", QJsonValue(real));
88  }
89  if(m_imag_isSet){
90  obj->insert("imag", QJsonValue(imag));
91  }
92 
93  return obj;
94 }
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGComplex::cleanup ( )

Definition at line 50 of file SWGComplex.cpp.

Referenced by ~SWGComplex().

50  {
51 
52 
53 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 56 of file SWGComplex.cpp.

References fromJsonObject().

Referenced by SWGComplex().

56  {
57  QByteArray array (json.toStdString().c_str());
58  QJsonDocument doc = QJsonDocument::fromJson(array);
59  QJsonObject jsonObject = doc.object();
60  this->fromJsonObject(jsonObject);
61  return this;
62 }
virtual void fromJsonObject(QJsonObject &json) override
Definition: SWGComplex.cpp:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

void SWGSDRangel::SWGComplex::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 65 of file SWGComplex.cpp.

References imag, real, and SWGSDRangel::setValue().

Referenced by fromJson().

65  {
66  ::SWGSDRangel::setValue(&real, pJson["real"], "float", "");
67 
68  ::SWGSDRangel::setValue(&imag, pJson["imag"], "float", "");
69 
70 }
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:

◆ getImag()

float SWGSDRangel::SWGComplex::getImag ( )

Definition at line 107 of file SWGComplex.cpp.

References imag.

Referenced by SoapySDROutput::webapiSettingsPutPatch(), and SoapySDRInput::webapiSettingsPutPatch().

107  {
108  return imag;
109 }
+ Here is the caller graph for this function:

◆ getReal()

float SWGSDRangel::SWGComplex::getReal ( )

Definition at line 97 of file SWGComplex.cpp.

References real.

Referenced by SoapySDROutput::webapiSettingsPutPatch(), and SoapySDRInput::webapiSettingsPutPatch().

97  {
98  return real;
99 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGComplex::init ( )

Definition at line 42 of file SWGComplex.cpp.

References imag, m_imag_isSet, m_real_isSet, and real.

Referenced by SWGComplex().

42  {
43  real = 0.0f;
44  m_real_isSet = false;
45  imag = 0.0f;
46  m_imag_isSet = false;
47 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGComplex::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 118 of file SWGComplex.cpp.

References m_imag_isSet, and m_real_isSet.

Referenced by SWGSDRangel::SWGSoapySDRInputSettings::asJsonObject(), SWGSDRangel::SWGSoapySDROutputSettings::asJsonObject(), SWGSDRangel::SWGSoapySDROutputSettings::isSet(), and SWGSDRangel::SWGSoapySDRInputSettings::isSet().

118  {
119  bool isObjectUpdated = false;
120  do{
121  if(m_real_isSet){ isObjectUpdated = true; break;}
122  if(m_imag_isSet){ isObjectUpdated = true; break;}
123  }while(false);
124  return isObjectUpdated;
125 }
+ Here is the caller graph for this function:

◆ setImag()

void SWGSDRangel::SWGComplex::setImag ( float  imag)

Definition at line 111 of file SWGComplex.cpp.

References imag, and m_imag_isSet.

Referenced by SoapySDROutput::webapiFormatDeviceSettings(), SoapySDRInput::webapiFormatDeviceSettings(), SoapySDROutput::webapiReverseSendSettings(), and SoapySDRInput::webapiReverseSendSettings().

111  {
112  this->imag = imag;
113  this->m_imag_isSet = true;
114 }
+ Here is the caller graph for this function:

◆ setReal()

void SWGSDRangel::SWGComplex::setReal ( float  real)

Definition at line 101 of file SWGComplex.cpp.

References m_real_isSet, and real.

Referenced by SoapySDROutput::webapiFormatDeviceSettings(), SoapySDRInput::webapiFormatDeviceSettings(), SoapySDROutput::webapiReverseSendSettings(), and SoapySDRInput::webapiReverseSendSettings().

101  {
102  this->real = real;
103  this->m_real_isSet = true;
104 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ imag

float SWGSDRangel::SWGComplex::imag
private

Definition at line 57 of file SWGComplex.h.

Referenced by asJsonObject(), fromJsonObject(), getImag(), init(), setImag(), and SWGComplex().

◆ m_imag_isSet

bool SWGSDRangel::SWGComplex::m_imag_isSet
private

Definition at line 58 of file SWGComplex.h.

Referenced by asJsonObject(), init(), isSet(), setImag(), and SWGComplex().

◆ m_real_isSet

bool SWGSDRangel::SWGComplex::m_real_isSet
private

Definition at line 55 of file SWGComplex.h.

Referenced by asJsonObject(), init(), isSet(), setReal(), and SWGComplex().

◆ real

float SWGSDRangel::SWGComplex::real
private

Definition at line 54 of file SWGComplex.h.

Referenced by asJsonObject(), fromJsonObject(), getReal(), init(), setReal(), and SWGComplex().


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