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

#include <SWGRangeFloat.h>

+ Inheritance diagram for SWGSDRangel::SWGRangeFloat:
+ Collaboration diagram for SWGSDRangel::SWGRangeFloat:

Public Member Functions

 SWGRangeFloat ()
 
 SWGRangeFloat (QString *json)
 
virtual ~SWGRangeFloat ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGRangeFloatfromJson (QString &jsonString) override
 
float getMin ()
 
void setMin (float min)
 
float getMax ()
 
void setMax (float max)
 
float getStep ()
 
void setStep (float step)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

float min
 
bool m_min_isSet
 
float max
 
bool m_max_isSet
 
float step
 
bool m_step_isSet
 

Detailed Description

Definition at line 31 of file SWGRangeFloat.h.

Constructor & Destructor Documentation

◆ SWGRangeFloat() [1/2]

SWGSDRangel::SWGRangeFloat::SWGRangeFloat ( )

Definition at line 30 of file SWGRangeFloat.cpp.

References m_max_isSet, m_min_isSet, m_step_isSet, max, min, and step.

30  {
31  min = 0.0f;
32  m_min_isSet = false;
33  max = 0.0f;
34  m_max_isSet = false;
35  step = 0.0f;
36  m_step_isSet = false;
37 }

◆ SWGRangeFloat() [2/2]

SWGSDRangel::SWGRangeFloat::SWGRangeFloat ( QString *  json)

Definition at line 25 of file SWGRangeFloat.cpp.

References fromJson(), and init().

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

◆ ~SWGRangeFloat()

SWGSDRangel::SWGRangeFloat::~SWGRangeFloat ( )
virtual

Definition at line 39 of file SWGRangeFloat.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGRangeFloat::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 80 of file SWGRangeFloat.cpp.

References asJsonObject().

81 {
82  QJsonObject* obj = this->asJsonObject();
83 
84  QJsonDocument doc(*obj);
85  QByteArray bytes = doc.toJson();
86  delete obj;
87  return QString(bytes);
88 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 91 of file SWGRangeFloat.cpp.

References m_max_isSet, m_min_isSet, m_step_isSet, max, min, and step.

Referenced by asJson().

91  {
92  QJsonObject* obj = new QJsonObject();
93  if(m_min_isSet){
94  obj->insert("min", QJsonValue(min));
95  }
96  if(m_max_isSet){
97  obj->insert("max", QJsonValue(max));
98  }
99  if(m_step_isSet){
100  obj->insert("step", QJsonValue(step));
101  }
102 
103  return obj;
104 }
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGRangeFloat::cleanup ( )

Definition at line 54 of file SWGRangeFloat.cpp.

Referenced by ~SWGRangeFloat().

54  {
55 
56 
57 
58 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 61 of file SWGRangeFloat.cpp.

References fromJsonObject().

Referenced by SWGRangeFloat().

61  {
62  QByteArray array (json.toStdString().c_str());
63  QJsonDocument doc = QJsonDocument::fromJson(array);
64  QJsonObject jsonObject = doc.object();
65  this->fromJsonObject(jsonObject);
66  return this;
67 }
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::SWGRangeFloat::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 70 of file SWGRangeFloat.cpp.

References max, min, SWGSDRangel::setValue(), and step.

Referenced by fromJson().

70  {
71  ::SWGSDRangel::setValue(&min, pJson["min"], "float", "");
72 
73  ::SWGSDRangel::setValue(&max, pJson["max"], "float", "");
74 
75  ::SWGSDRangel::setValue(&step, pJson["step"], "float", "");
76 
77 }
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:

◆ getMax()

float SWGSDRangel::SWGRangeFloat::getMax ( )

Definition at line 117 of file SWGRangeFloat.cpp.

References max.

117  {
118  return max;
119 }

◆ getMin()

float SWGSDRangel::SWGRangeFloat::getMin ( )

Definition at line 107 of file SWGRangeFloat.cpp.

References min.

107  {
108  return min;
109 }

◆ getStep()

float SWGSDRangel::SWGRangeFloat::getStep ( )

Definition at line 127 of file SWGRangeFloat.cpp.

References step.

127  {
128  return step;
129 }

◆ init()

void SWGSDRangel::SWGRangeFloat::init ( )

Definition at line 44 of file SWGRangeFloat.cpp.

References m_max_isSet, m_min_isSet, m_step_isSet, max, min, and step.

Referenced by SWGRangeFloat().

44  {
45  min = 0.0f;
46  m_min_isSet = false;
47  max = 0.0f;
48  m_max_isSet = false;
49  step = 0.0f;
50  m_step_isSet = false;
51 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGRangeFloat::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 138 of file SWGRangeFloat.cpp.

References m_max_isSet, m_min_isSet, and m_step_isSet.

Referenced by SWGSDRangel::SWGSoapySDRGainSetting::asJsonObject(), SWGSDRangel::SWGArgInfo::asJsonObject(), SWGSDRangel::SWGSoapySDRReport::asJsonObject(), SWGSDRangel::SWGSoapySDRGainSetting::isSet(), SWGSDRangel::SWGArgInfo::isSet(), and SWGSDRangel::SWGSoapySDRReport::isSet().

138  {
139  bool isObjectUpdated = false;
140  do{
141  if(m_min_isSet){ isObjectUpdated = true; break;}
142  if(m_max_isSet){ isObjectUpdated = true; break;}
143  if(m_step_isSet){ isObjectUpdated = true; break;}
144  }while(false);
145  return isObjectUpdated;
146 }
+ Here is the caller graph for this function:

◆ setMax()

void SWGSDRangel::SWGRangeFloat::setMax ( float  max)

Definition at line 121 of file SWGRangeFloat.cpp.

References m_max_isSet, and max.

Referenced by SoapySDROutput::webapiFormatArgInfo(), SoapySDRInput::webapiFormatArgInfo(), SoapySDROutput::webapiFormatDeviceReport(), and SoapySDRInput::webapiFormatDeviceReport().

121  {
122  this->max = max;
123  this->m_max_isSet = true;
124 }
+ Here is the caller graph for this function:

◆ setMin()

void SWGSDRangel::SWGRangeFloat::setMin ( float  min)

Definition at line 111 of file SWGRangeFloat.cpp.

References m_min_isSet, and min.

Referenced by SoapySDROutput::webapiFormatArgInfo(), SoapySDRInput::webapiFormatArgInfo(), SoapySDROutput::webapiFormatDeviceReport(), and SoapySDRInput::webapiFormatDeviceReport().

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

◆ setStep()

void SWGSDRangel::SWGRangeFloat::setStep ( float  step)

Definition at line 131 of file SWGRangeFloat.cpp.

References m_step_isSet, and step.

131  {
132  this->step = step;
133  this->m_step_isSet = true;
134 }

Member Data Documentation

◆ m_max_isSet

bool SWGSDRangel::SWGRangeFloat::m_max_isSet
private

Definition at line 61 of file SWGRangeFloat.h.

Referenced by asJsonObject(), init(), isSet(), setMax(), and SWGRangeFloat().

◆ m_min_isSet

bool SWGSDRangel::SWGRangeFloat::m_min_isSet
private

Definition at line 58 of file SWGRangeFloat.h.

Referenced by asJsonObject(), init(), isSet(), setMin(), and SWGRangeFloat().

◆ m_step_isSet

bool SWGSDRangel::SWGRangeFloat::m_step_isSet
private

Definition at line 64 of file SWGRangeFloat.h.

Referenced by asJsonObject(), init(), isSet(), setStep(), and SWGRangeFloat().

◆ max

float SWGSDRangel::SWGRangeFloat::max
private

Definition at line 60 of file SWGRangeFloat.h.

Referenced by asJsonObject(), fromJsonObject(), getMax(), init(), setMax(), and SWGRangeFloat().

◆ min

float SWGSDRangel::SWGRangeFloat::min
private

Definition at line 57 of file SWGRangeFloat.h.

Referenced by asJsonObject(), fromJsonObject(), getMin(), init(), setMin(), and SWGRangeFloat().

◆ step

float SWGSDRangel::SWGRangeFloat::step
private

Definition at line 63 of file SWGRangeFloat.h.

Referenced by asJsonObject(), fromJsonObject(), getStep(), init(), setStep(), and SWGRangeFloat().


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