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

#include <SWGRange.h>

+ Inheritance diagram for SWGSDRangel::SWGRange:
+ Collaboration diagram for SWGSDRangel::SWGRange:

Public Member Functions

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

Private Attributes

qint32 min
 
bool m_min_isSet
 
qint32 max
 
bool m_max_isSet
 
qint32 step
 
bool m_step_isSet
 

Detailed Description

Definition at line 31 of file SWGRange.h.

Constructor & Destructor Documentation

◆ SWGRange() [1/2]

SWGSDRangel::SWGRange::SWGRange ( )

Definition at line 30 of file SWGRange.cpp.

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

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

◆ SWGRange() [2/2]

SWGSDRangel::SWGRange::SWGRange ( QString *  json)

Definition at line 25 of file SWGRange.cpp.

References fromJson(), and init().

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

◆ ~SWGRange()

SWGSDRangel::SWGRange::~SWGRange ( )
virtual

Definition at line 39 of file SWGRange.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGRange::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 80 of file SWGRange.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
Definition: SWGRange.cpp:91
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 91 of file SWGRange.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::SWGRange::cleanup ( )

Definition at line 54 of file SWGRange.cpp.

Referenced by ~SWGRange().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 61 of file SWGRange.cpp.

References fromJsonObject().

Referenced by SWGRange().

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
Definition: SWGRange.cpp:70
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 70 of file SWGRange.cpp.

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

Referenced by fromJson().

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

qint32 SWGSDRangel::SWGRange::getMax ( )

Definition at line 117 of file SWGRange.cpp.

References max.

117  {
118  return max;
119 }

◆ getMin()

qint32 SWGSDRangel::SWGRange::getMin ( )

Definition at line 107 of file SWGRange.cpp.

References min.

107  {
108  return min;
109 }

◆ getStep()

qint32 SWGSDRangel::SWGRange::getStep ( )

Definition at line 127 of file SWGRange.cpp.

References step.

127  {
128  return step;
129 }

◆ init()

void SWGSDRangel::SWGRange::init ( )

Definition at line 44 of file SWGRange.cpp.

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

Referenced by SWGRange().

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

◆ isSet()

bool SWGSDRangel::SWGRange::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 138 of file SWGRange.cpp.

References m_max_isSet, m_min_isSet, and m_step_isSet.

Referenced by SWGSDRangel::SWGBladeRF2OutputReport::asJsonObject(), SWGSDRangel::SWGBladeRF2InputReport::asJsonObject(), SWGSDRangel::SWGBladeRF2OutputReport::isSet(), and SWGSDRangel::SWGBladeRF2InputReport::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::SWGRange::setMax ( qint32  max)

Definition at line 121 of file SWGRange.cpp.

References m_max_isSet, and max.

Referenced by BladeRF2Output::webapiFormatDeviceReport(), and BladeRF2Input::webapiFormatDeviceReport().

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

◆ setMin()

void SWGSDRangel::SWGRange::setMin ( qint32  min)

Definition at line 111 of file SWGRange.cpp.

References m_min_isSet, and min.

Referenced by BladeRF2Output::webapiFormatDeviceReport(), and BladeRF2Input::webapiFormatDeviceReport().

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

◆ setStep()

void SWGSDRangel::SWGRange::setStep ( qint32  step)

Definition at line 131 of file SWGRange.cpp.

References m_step_isSet, and step.

Referenced by BladeRF2Output::webapiFormatDeviceReport(), and BladeRF2Input::webapiFormatDeviceReport().

131  {
132  this->step = step;
133  this->m_step_isSet = true;
134 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_max_isSet

bool SWGSDRangel::SWGRange::m_max_isSet
private

Definition at line 61 of file SWGRange.h.

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

◆ m_min_isSet

bool SWGSDRangel::SWGRange::m_min_isSet
private

Definition at line 58 of file SWGRange.h.

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

◆ m_step_isSet

bool SWGSDRangel::SWGRange::m_step_isSet
private

Definition at line 64 of file SWGRange.h.

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

◆ max

qint32 SWGSDRangel::SWGRange::max
private

Definition at line 60 of file SWGRange.h.

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

◆ min

qint32 SWGSDRangel::SWGRange::min
private

Definition at line 57 of file SWGRange.h.

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

◆ step

qint32 SWGSDRangel::SWGRange::step
private

Definition at line 63 of file SWGRange.h.

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


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