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

#include <SWGFrequencyRange.h>

+ Inheritance diagram for SWGSDRangel::SWGFrequencyRange:
+ Collaboration diagram for SWGSDRangel::SWGFrequencyRange:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 31 of file SWGFrequencyRange.h.

Constructor & Destructor Documentation

◆ SWGFrequencyRange() [1/2]

SWGSDRangel::SWGFrequencyRange::SWGFrequencyRange ( )

◆ SWGFrequencyRange() [2/2]

SWGSDRangel::SWGFrequencyRange::SWGFrequencyRange ( QString *  json)

Definition at line 25 of file SWGFrequencyRange.cpp.

References fromJson(), and init().

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

◆ ~SWGFrequencyRange()

SWGSDRangel::SWGFrequencyRange::~SWGFrequencyRange ( )
virtual

Definition at line 39 of file SWGFrequencyRange.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGFrequencyRange::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 80 of file SWGFrequencyRange.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::SWGFrequencyRange::asJsonObject ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

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

Definition at line 54 of file SWGFrequencyRange.cpp.

Referenced by ~SWGFrequencyRange().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 61 of file SWGFrequencyRange.cpp.

References fromJsonObject().

Referenced by SWGFrequencyRange().

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::SWGFrequencyRange::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 70 of file SWGFrequencyRange.cpp.

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

Referenced by fromJson().

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

qint64 SWGSDRangel::SWGFrequencyRange::getMax ( )

Definition at line 117 of file SWGFrequencyRange.cpp.

References max.

117  {
118  return max;
119 }

◆ getMin()

qint64 SWGSDRangel::SWGFrequencyRange::getMin ( )

Definition at line 107 of file SWGFrequencyRange.cpp.

References min.

107  {
108  return min;
109 }

◆ getStep()

qint32 SWGSDRangel::SWGFrequencyRange::getStep ( )

Definition at line 127 of file SWGFrequencyRange.cpp.

References step.

127  {
128  return step;
129 }

◆ init()

void SWGSDRangel::SWGFrequencyRange::init ( )

Definition at line 44 of file SWGFrequencyRange.cpp.

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

Referenced by SWGFrequencyRange().

+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGFrequencyRange::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 138 of file SWGFrequencyRange.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::SWGFrequencyRange::setMax ( qint64  max)

Definition at line 121 of file SWGFrequencyRange.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::SWGFrequencyRange::setMin ( qint64  min)

Definition at line 111 of file SWGFrequencyRange.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::SWGFrequencyRange::setStep ( qint32  step)

Definition at line 131 of file SWGFrequencyRange.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::SWGFrequencyRange::m_max_isSet
private

Definition at line 61 of file SWGFrequencyRange.h.

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

◆ m_min_isSet

bool SWGSDRangel::SWGFrequencyRange::m_min_isSet
private

Definition at line 58 of file SWGFrequencyRange.h.

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

◆ m_step_isSet

bool SWGSDRangel::SWGFrequencyRange::m_step_isSet
private

Definition at line 64 of file SWGFrequencyRange.h.

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

◆ max

qint64 SWGSDRangel::SWGFrequencyRange::max
private

◆ min

qint64 SWGSDRangel::SWGFrequencyRange::min
private

◆ step

qint32 SWGSDRangel::SWGFrequencyRange::step
private

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