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.
SWGPlutoSdrOutputSettings.cpp
Go to the documentation of this file.
1 
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  center_frequency = 0L;
33  dev_sample_rate = 0;
35  l_oppm_tenths = 0;
36  m_l_oppm_tenths_isSet = false;
37  lpf_fir_enable = 0;
38  m_lpf_fir_enable_isSet = false;
39  lpf_firbw = 0;
40  m_lpf_firbw_isSet = false;
43  lpf_fir_gain = 0;
44  m_lpf_fir_gain_isSet = false;
45  log2_interp = 0;
46  m_log2_interp_isSet = false;
47  lpf_bw = 0;
48  m_lpf_bw_isSet = false;
49  att = 0;
50  m_att_isSet = false;
51  antenna_path = 0;
52  m_antenna_path_isSet = false;
53  transverter_mode = 0;
57  use_reverse_api = 0;
59  reverse_api_address = nullptr;
61  reverse_api_port = 0;
65 }
66 
68  this->cleanup();
69 }
70 
71 void
73  center_frequency = 0L;
75  dev_sample_rate = 0;
77  l_oppm_tenths = 0;
78  m_l_oppm_tenths_isSet = false;
79  lpf_fir_enable = 0;
80  m_lpf_fir_enable_isSet = false;
81  lpf_firbw = 0;
82  m_lpf_firbw_isSet = false;
85  lpf_fir_gain = 0;
86  m_lpf_fir_gain_isSet = false;
87  log2_interp = 0;
88  m_log2_interp_isSet = false;
89  lpf_bw = 0;
90  m_lpf_bw_isSet = false;
91  att = 0;
92  m_att_isSet = false;
93  antenna_path = 0;
94  m_antenna_path_isSet = false;
95  transverter_mode = 0;
99  use_reverse_api = 0;
100  m_use_reverse_api_isSet = false;
101  reverse_api_address = new QString("");
103  reverse_api_port = 0;
104  m_reverse_api_port_isSet = false;
107 }
108 
109 void
111 
112 
113 
114 
115 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125  if(reverse_api_address != nullptr) {
126  delete reverse_api_address;
127  }
128 
129 
130 }
131 
134  QByteArray array (json.toStdString().c_str());
135  QJsonDocument doc = QJsonDocument::fromJson(array);
136  QJsonObject jsonObject = doc.object();
137  this->fromJsonObject(jsonObject);
138  return this;
139 }
140 
141 void
143  ::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
144 
145  ::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", "");
146 
147  ::SWGSDRangel::setValue(&l_oppm_tenths, pJson["LOppmTenths"], "qint32", "");
148 
149  ::SWGSDRangel::setValue(&lpf_fir_enable, pJson["lpfFIREnable"], "qint32", "");
150 
151  ::SWGSDRangel::setValue(&lpf_firbw, pJson["lpfFIRBW"], "qint32", "");
152 
153  ::SWGSDRangel::setValue(&lpf_fi_rlog2_interp, pJson["lpfFIRlog2Interp"], "qint32", "");
154 
155  ::SWGSDRangel::setValue(&lpf_fir_gain, pJson["lpfFIRGain"], "qint32", "");
156 
157  ::SWGSDRangel::setValue(&log2_interp, pJson["log2Interp"], "qint32", "");
158 
159  ::SWGSDRangel::setValue(&lpf_bw, pJson["lpfBW"], "qint32", "");
160 
161  ::SWGSDRangel::setValue(&att, pJson["att"], "qint32", "");
162 
163  ::SWGSDRangel::setValue(&antenna_path, pJson["antennaPath"], "qint32", "");
164 
165  ::SWGSDRangel::setValue(&transverter_mode, pJson["transverterMode"], "qint32", "");
166 
167  ::SWGSDRangel::setValue(&transverter_delta_frequency, pJson["transverterDeltaFrequency"], "qint64", "");
168 
169  ::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
170 
171  ::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
172 
173  ::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
174 
175  ::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
176 
177 }
178 
179 QString
181 {
182  QJsonObject* obj = this->asJsonObject();
183 
184  QJsonDocument doc(*obj);
185  QByteArray bytes = doc.toJson();
186  delete obj;
187  return QString(bytes);
188 }
189 
190 QJsonObject*
192  QJsonObject* obj = new QJsonObject();
194  obj->insert("centerFrequency", QJsonValue(center_frequency));
195  }
197  obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
198  }
200  obj->insert("LOppmTenths", QJsonValue(l_oppm_tenths));
201  }
203  obj->insert("lpfFIREnable", QJsonValue(lpf_fir_enable));
204  }
205  if(m_lpf_firbw_isSet){
206  obj->insert("lpfFIRBW", QJsonValue(lpf_firbw));
207  }
209  obj->insert("lpfFIRlog2Interp", QJsonValue(lpf_fi_rlog2_interp));
210  }
212  obj->insert("lpfFIRGain", QJsonValue(lpf_fir_gain));
213  }
215  obj->insert("log2Interp", QJsonValue(log2_interp));
216  }
217  if(m_lpf_bw_isSet){
218  obj->insert("lpfBW", QJsonValue(lpf_bw));
219  }
220  if(m_att_isSet){
221  obj->insert("att", QJsonValue(att));
222  }
224  obj->insert("antennaPath", QJsonValue(antenna_path));
225  }
227  obj->insert("transverterMode", QJsonValue(transverter_mode));
228  }
230  obj->insert("transverterDeltaFrequency", QJsonValue(transverter_delta_frequency));
231  }
233  obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
234  }
235  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
236  toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
237  }
239  obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
240  }
242  obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
243  }
244 
245  return obj;
246 }
247 
248 qint64
250  return center_frequency;
251 }
252 void
254  this->center_frequency = center_frequency;
255  this->m_center_frequency_isSet = true;
256 }
257 
258 qint32
260  return dev_sample_rate;
261 }
262 void
264  this->dev_sample_rate = dev_sample_rate;
265  this->m_dev_sample_rate_isSet = true;
266 }
267 
268 qint32
270  return l_oppm_tenths;
271 }
272 void
274  this->l_oppm_tenths = l_oppm_tenths;
275  this->m_l_oppm_tenths_isSet = true;
276 }
277 
278 qint32
280  return lpf_fir_enable;
281 }
282 void
284  this->lpf_fir_enable = lpf_fir_enable;
285  this->m_lpf_fir_enable_isSet = true;
286 }
287 
288 qint32
290  return lpf_firbw;
291 }
292 void
294  this->lpf_firbw = lpf_firbw;
295  this->m_lpf_firbw_isSet = true;
296 }
297 
298 qint32
300  return lpf_fi_rlog2_interp;
301 }
302 void
304  this->lpf_fi_rlog2_interp = lpf_fi_rlog2_interp;
305  this->m_lpf_fi_rlog2_interp_isSet = true;
306 }
307 
308 qint32
310  return lpf_fir_gain;
311 }
312 void
314  this->lpf_fir_gain = lpf_fir_gain;
315  this->m_lpf_fir_gain_isSet = true;
316 }
317 
318 qint32
320  return log2_interp;
321 }
322 void
324  this->log2_interp = log2_interp;
325  this->m_log2_interp_isSet = true;
326 }
327 
328 qint32
330  return lpf_bw;
331 }
332 void
334  this->lpf_bw = lpf_bw;
335  this->m_lpf_bw_isSet = true;
336 }
337 
338 qint32
340  return att;
341 }
342 void
344  this->att = att;
345  this->m_att_isSet = true;
346 }
347 
348 qint32
350  return antenna_path;
351 }
352 void
354  this->antenna_path = antenna_path;
355  this->m_antenna_path_isSet = true;
356 }
357 
358 qint32
360  return transverter_mode;
361 }
362 void
364  this->transverter_mode = transverter_mode;
365  this->m_transverter_mode_isSet = true;
366 }
367 
368 qint64
371 }
372 void
374  this->transverter_delta_frequency = transverter_delta_frequency;
376 }
377 
378 qint32
380  return use_reverse_api;
381 }
382 void
384  this->use_reverse_api = use_reverse_api;
385  this->m_use_reverse_api_isSet = true;
386 }
387 
388 QString*
390  return reverse_api_address;
391 }
392 void
394  this->reverse_api_address = reverse_api_address;
395  this->m_reverse_api_address_isSet = true;
396 }
397 
398 qint32
400  return reverse_api_port;
401 }
402 void
404  this->reverse_api_port = reverse_api_port;
405  this->m_reverse_api_port_isSet = true;
406 }
407 
408 qint32
411 }
412 void
414  this->reverse_api_device_index = reverse_api_device_index;
416 }
417 
418 
419 bool
421  bool isObjectUpdated = false;
422  do{
423  if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
424  if(m_dev_sample_rate_isSet){ isObjectUpdated = true; break;}
425  if(m_l_oppm_tenths_isSet){ isObjectUpdated = true; break;}
426  if(m_lpf_fir_enable_isSet){ isObjectUpdated = true; break;}
427  if(m_lpf_firbw_isSet){ isObjectUpdated = true; break;}
428  if(m_lpf_fi_rlog2_interp_isSet){ isObjectUpdated = true; break;}
429  if(m_lpf_fir_gain_isSet){ isObjectUpdated = true; break;}
430  if(m_log2_interp_isSet){ isObjectUpdated = true; break;}
431  if(m_lpf_bw_isSet){ isObjectUpdated = true; break;}
432  if(m_att_isSet){ isObjectUpdated = true; break;}
433  if(m_antenna_path_isSet){ isObjectUpdated = true; break;}
434  if(m_transverter_mode_isSet){ isObjectUpdated = true; break;}
435  if(m_transverter_delta_frequency_isSet){ isObjectUpdated = true; break;}
436  if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
437  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ isObjectUpdated = true; break;}
438  if(m_reverse_api_port_isSet){ isObjectUpdated = true; break;}
439  if(m_reverse_api_device_index_isSet){ isObjectUpdated = true; break;}
440  }while(false);
441  return isObjectUpdated;
442 }
443 }
444 
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
void setReverseApiAddress(QString *reverse_api_address)
void setLpfFiRlog2Interp(qint32 lpf_fi_rlog2_interp)
virtual QJsonObject * asJsonObject() override
virtual void fromJsonObject(QJsonObject &json) override
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency)
virtual SWGPlutoSdrOutputSettings * fromJson(QString &jsonString) override
void setReverseApiDeviceIndex(qint32 reverse_api_device_index)