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.
SWGRemoteOutputReport.cpp
Go to the documentation of this file.
1 
14 #include "SWGRemoteOutputReport.h"
15 
16 #include "SWGHelpers.h"
17 
18 #include <QJsonDocument>
19 #include <QJsonArray>
20 #include <QObject>
21 #include <QDebug>
22 
23 namespace SWGSDRangel {
24 
26  init();
27  this->fromJson(*json);
28 }
29 
31  buffer_rw_balance = 0.0f;
33  sample_count = 0;
34  m_sample_count_isSet = false;
35 }
36 
38  this->cleanup();
39 }
40 
41 void
43  buffer_rw_balance = 0.0f;
45  sample_count = 0;
46  m_sample_count_isSet = false;
47 }
48 
49 void
51 
52 
53 }
54 
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 }
63 
64 void
66  ::SWGSDRangel::setValue(&buffer_rw_balance, pJson["bufferRWBalance"], "float", "");
67 
68  ::SWGSDRangel::setValue(&sample_count, pJson["sampleCount"], "qint32", "");
69 
70 }
71 
72 QString
74 {
75  QJsonObject* obj = this->asJsonObject();
76 
77  QJsonDocument doc(*obj);
78  QByteArray bytes = doc.toJson();
79  delete obj;
80  return QString(bytes);
81 }
82 
83 QJsonObject*
85  QJsonObject* obj = new QJsonObject();
87  obj->insert("bufferRWBalance", QJsonValue(buffer_rw_balance));
88  }
90  obj->insert("sampleCount", QJsonValue(sample_count));
91  }
92 
93  return obj;
94 }
95 
96 float
98  return buffer_rw_balance;
99 }
100 void
102  this->buffer_rw_balance = buffer_rw_balance;
103  this->m_buffer_rw_balance_isSet = true;
104 }
105 
106 qint32
108  return sample_count;
109 }
110 void
112  this->sample_count = sample_count;
113  this->m_sample_count_isSet = true;
114 }
115 
116 
117 bool
119  bool isObjectUpdated = false;
120  do{
121  if(m_buffer_rw_balance_isSet){ isObjectUpdated = true; break;}
122  if(m_sample_count_isSet){ isObjectUpdated = true; break;}
123  }while(false);
124  return isObjectUpdated;
125 }
126 }
127 
virtual void fromJsonObject(QJsonObject &json) override
virtual QJsonObject * asJsonObject() override
void setBufferRwBalance(float buffer_rw_balance)
virtual SWGRemoteOutputReport * fromJson(QString &jsonString) override
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25