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

#include <SWGGain.h>

+ Inheritance diagram for SWGSDRangel::SWGGain:
+ Collaboration diagram for SWGSDRangel::SWGGain:

Public Member Functions

 SWGGain ()
 
 SWGGain (QString *json)
 
virtual ~SWGGain ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGGainfromJson (QString &jsonString) override
 
qint32 getGainCb ()
 
void setGainCb (qint32 gain_cb)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 gain_cb
 
bool m_gain_cb_isSet
 

Detailed Description

Definition at line 31 of file SWGGain.h.

Constructor & Destructor Documentation

◆ SWGGain() [1/2]

SWGSDRangel::SWGGain::SWGGain ( )

Definition at line 30 of file SWGGain.cpp.

References gain_cb, and m_gain_cb_isSet.

30  {
31  gain_cb = 0;
32  m_gain_cb_isSet = false;
33 }

◆ SWGGain() [2/2]

SWGSDRangel::SWGGain::SWGGain ( QString *  json)

Definition at line 25 of file SWGGain.cpp.

References fromJson(), and init().

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

◆ ~SWGGain()

SWGSDRangel::SWGGain::~SWGGain ( )
virtual

Definition at line 35 of file SWGGain.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGGain::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 66 of file SWGGain.cpp.

References asJsonObject().

67 {
68  QJsonObject* obj = this->asJsonObject();
69 
70  QJsonDocument doc(*obj);
71  QByteArray bytes = doc.toJson();
72  delete obj;
73  return QString(bytes);
74 }
virtual QJsonObject * asJsonObject() override
Definition: SWGGain.cpp:77
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 77 of file SWGGain.cpp.

References gain_cb, and m_gain_cb_isSet.

Referenced by asJson().

77  {
78  QJsonObject* obj = new QJsonObject();
79  if(m_gain_cb_isSet){
80  obj->insert("gainCB", QJsonValue(gain_cb));
81  }
82 
83  return obj;
84 }
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGGain::cleanup ( )

Definition at line 46 of file SWGGain.cpp.

Referenced by ~SWGGain().

46  {
47 
48 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 51 of file SWGGain.cpp.

References fromJsonObject().

Referenced by SWGGain().

51  {
52  QByteArray array (json.toStdString().c_str());
53  QJsonDocument doc = QJsonDocument::fromJson(array);
54  QJsonObject jsonObject = doc.object();
55  this->fromJsonObject(jsonObject);
56  return this;
57 }
virtual void fromJsonObject(QJsonObject &json) override
Definition: SWGGain.cpp:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 60 of file SWGGain.cpp.

References gain_cb, and SWGSDRangel::setValue().

Referenced by fromJson().

60  {
61  ::SWGSDRangel::setValue(&gain_cb, pJson["gainCB"], "qint32", "");
62 
63 }
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:

◆ getGainCb()

qint32 SWGSDRangel::SWGGain::getGainCb ( )

Definition at line 87 of file SWGGain.cpp.

References gain_cb.

87  {
88  return gain_cb;
89 }

◆ init()

void SWGSDRangel::SWGGain::init ( )

Definition at line 40 of file SWGGain.cpp.

References gain_cb, and m_gain_cb_isSet.

Referenced by SWGGain().

40  {
41  gain_cb = 0;
42  m_gain_cb_isSet = false;
43 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGGain::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 98 of file SWGGain.cpp.

References m_gain_cb_isSet.

98  {
99  bool isObjectUpdated = false;
100  do{
101  if(m_gain_cb_isSet){ isObjectUpdated = true; break;}
102  }while(false);
103  return isObjectUpdated;
104 }

◆ setGainCb()

void SWGSDRangel::SWGGain::setGainCb ( qint32  gain_cb)

Definition at line 91 of file SWGGain.cpp.

References gain_cb, and m_gain_cb_isSet.

91  {
92  this->gain_cb = gain_cb;
93  this->m_gain_cb_isSet = true;
94 }

Member Data Documentation

◆ gain_cb

qint32 SWGSDRangel::SWGGain::gain_cb
private

Definition at line 51 of file SWGGain.h.

Referenced by asJsonObject(), fromJsonObject(), getGainCb(), init(), setGainCb(), and SWGGain().

◆ m_gain_cb_isSet

bool SWGSDRangel::SWGGain::m_gain_cb_isSet
private

Definition at line 52 of file SWGGain.h.

Referenced by asJsonObject(), init(), isSet(), setGainCb(), and SWGGain().


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