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.
SWGFCDProSettings.cpp
Go to the documentation of this file.
1 
14 #include "SWGFCDProSettings.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  center_frequency = 0L;
33  l_oppm_tenths = 0;
34  m_l_oppm_tenths_isSet = false;
35  lna_gain_index = 0;
36  m_lna_gain_index_isSet = false;
37  rf_filter_index = 0;
41  band_index = 0;
42  m_band_index_isSet = false;
43  mixer_gain_index = 0;
49  mode_index = 0;
50  m_mode_index_isSet = false;
51  gain1_index = 0;
52  m_gain1_index_isSet = false;
53  rc_filter_index = 0;
55  gain2_index = 0;
56  m_gain2_index_isSet = false;
57  gain3_index = 0;
58  m_gain3_index_isSet = false;
59  gain4_index = 0;
60  m_gain4_index_isSet = false;
61  if_filter_index = 0;
63  gain5_index = 0;
64  m_gain5_index_isSet = false;
65  gain6_index = 0;
66  m_gain6_index_isSet = false;
67  log2_decim = 0;
68  m_log2_decim_isSet = false;
69  fc_pos = 0;
70  m_fc_pos_isSet = false;
71  dc_block = 0;
72  m_dc_block_isSet = false;
73  iq_correction = 0;
74  m_iq_correction_isSet = false;
75  transverter_mode = 0;
79  file_record_name = nullptr;
81  use_reverse_api = 0;
83  reverse_api_address = nullptr;
85  reverse_api_port = 0;
89 }
90 
92  this->cleanup();
93 }
94 
95 void
97  center_frequency = 0L;
99  l_oppm_tenths = 0;
100  m_l_oppm_tenths_isSet = false;
101  lna_gain_index = 0;
102  m_lna_gain_index_isSet = false;
103  rf_filter_index = 0;
104  m_rf_filter_index_isSet = false;
105  lna_enhance_index = 0;
107  band_index = 0;
108  m_band_index_isSet = false;
109  mixer_gain_index = 0;
110  m_mixer_gain_index_isSet = false;
111  mixer_filter_index = 0;
113  bias_current_index = 0;
115  mode_index = 0;
116  m_mode_index_isSet = false;
117  gain1_index = 0;
118  m_gain1_index_isSet = false;
119  rc_filter_index = 0;
120  m_rc_filter_index_isSet = false;
121  gain2_index = 0;
122  m_gain2_index_isSet = false;
123  gain3_index = 0;
124  m_gain3_index_isSet = false;
125  gain4_index = 0;
126  m_gain4_index_isSet = false;
127  if_filter_index = 0;
128  m_if_filter_index_isSet = false;
129  gain5_index = 0;
130  m_gain5_index_isSet = false;
131  gain6_index = 0;
132  m_gain6_index_isSet = false;
133  log2_decim = 0;
134  m_log2_decim_isSet = false;
135  fc_pos = 0;
136  m_fc_pos_isSet = false;
137  dc_block = 0;
138  m_dc_block_isSet = false;
139  iq_correction = 0;
140  m_iq_correction_isSet = false;
141  transverter_mode = 0;
142  m_transverter_mode_isSet = false;
145  file_record_name = new QString("");
146  m_file_record_name_isSet = false;
147  use_reverse_api = 0;
148  m_use_reverse_api_isSet = false;
149  reverse_api_address = new QString("");
151  reverse_api_port = 0;
152  m_reverse_api_port_isSet = false;
155 }
156 
157 void
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
171 
172 
173 
174 
175 
176 
177 
178 
179 
180 
181 
182 
183  if(file_record_name != nullptr) {
184  delete file_record_name;
185  }
186 
187  if(reverse_api_address != nullptr) {
188  delete reverse_api_address;
189  }
190 
191 
192 }
193 
196  QByteArray array (json.toStdString().c_str());
197  QJsonDocument doc = QJsonDocument::fromJson(array);
198  QJsonObject jsonObject = doc.object();
199  this->fromJsonObject(jsonObject);
200  return this;
201 }
202 
203 void
205  ::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
206 
207  ::SWGSDRangel::setValue(&l_oppm_tenths, pJson["LOppmTenths"], "qint32", "");
208 
209  ::SWGSDRangel::setValue(&lna_gain_index, pJson["lnaGainIndex"], "qint32", "");
210 
211  ::SWGSDRangel::setValue(&rf_filter_index, pJson["rfFilterIndex"], "qint32", "");
212 
213  ::SWGSDRangel::setValue(&lna_enhance_index, pJson["lnaEnhanceIndex"], "qint32", "");
214 
215  ::SWGSDRangel::setValue(&band_index, pJson["bandIndex"], "qint32", "");
216 
217  ::SWGSDRangel::setValue(&mixer_gain_index, pJson["mixerGainIndex"], "qint32", "");
218 
219  ::SWGSDRangel::setValue(&mixer_filter_index, pJson["mixerFilterIndex"], "qint32", "");
220 
221  ::SWGSDRangel::setValue(&bias_current_index, pJson["biasCurrentIndex"], "qint32", "");
222 
223  ::SWGSDRangel::setValue(&mode_index, pJson["modeIndex"], "qint32", "");
224 
225  ::SWGSDRangel::setValue(&gain1_index, pJson["gain1Index"], "qint32", "");
226 
227  ::SWGSDRangel::setValue(&rc_filter_index, pJson["rcFilterIndex"], "qint32", "");
228 
229  ::SWGSDRangel::setValue(&gain2_index, pJson["gain2Index"], "qint32", "");
230 
231  ::SWGSDRangel::setValue(&gain3_index, pJson["gain3Index"], "qint32", "");
232 
233  ::SWGSDRangel::setValue(&gain4_index, pJson["gain4Index"], "qint32", "");
234 
235  ::SWGSDRangel::setValue(&if_filter_index, pJson["ifFilterIndex"], "qint32", "");
236 
237  ::SWGSDRangel::setValue(&gain5_index, pJson["gain5Index"], "qint32", "");
238 
239  ::SWGSDRangel::setValue(&gain6_index, pJson["gain6Index"], "qint32", "");
240 
241  ::SWGSDRangel::setValue(&log2_decim, pJson["log2Decim"], "qint32", "");
242 
243  ::SWGSDRangel::setValue(&fc_pos, pJson["fcPos"], "qint32", "");
244 
245  ::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", "");
246 
247  ::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", "");
248 
249  ::SWGSDRangel::setValue(&transverter_mode, pJson["transverterMode"], "qint32", "");
250 
251  ::SWGSDRangel::setValue(&transverter_delta_frequency, pJson["transverterDeltaFrequency"], "qint64", "");
252 
253  ::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
254 
255  ::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
256 
257  ::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
258 
259  ::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
260 
261  ::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
262 
263 }
264 
265 QString
267 {
268  QJsonObject* obj = this->asJsonObject();
269 
270  QJsonDocument doc(*obj);
271  QByteArray bytes = doc.toJson();
272  delete obj;
273  return QString(bytes);
274 }
275 
276 QJsonObject*
278  QJsonObject* obj = new QJsonObject();
280  obj->insert("centerFrequency", QJsonValue(center_frequency));
281  }
283  obj->insert("LOppmTenths", QJsonValue(l_oppm_tenths));
284  }
286  obj->insert("lnaGainIndex", QJsonValue(lna_gain_index));
287  }
289  obj->insert("rfFilterIndex", QJsonValue(rf_filter_index));
290  }
292  obj->insert("lnaEnhanceIndex", QJsonValue(lna_enhance_index));
293  }
294  if(m_band_index_isSet){
295  obj->insert("bandIndex", QJsonValue(band_index));
296  }
298  obj->insert("mixerGainIndex", QJsonValue(mixer_gain_index));
299  }
301  obj->insert("mixerFilterIndex", QJsonValue(mixer_filter_index));
302  }
304  obj->insert("biasCurrentIndex", QJsonValue(bias_current_index));
305  }
306  if(m_mode_index_isSet){
307  obj->insert("modeIndex", QJsonValue(mode_index));
308  }
310  obj->insert("gain1Index", QJsonValue(gain1_index));
311  }
313  obj->insert("rcFilterIndex", QJsonValue(rc_filter_index));
314  }
316  obj->insert("gain2Index", QJsonValue(gain2_index));
317  }
319  obj->insert("gain3Index", QJsonValue(gain3_index));
320  }
322  obj->insert("gain4Index", QJsonValue(gain4_index));
323  }
325  obj->insert("ifFilterIndex", QJsonValue(if_filter_index));
326  }
328  obj->insert("gain5Index", QJsonValue(gain5_index));
329  }
331  obj->insert("gain6Index", QJsonValue(gain6_index));
332  }
333  if(m_log2_decim_isSet){
334  obj->insert("log2Decim", QJsonValue(log2_decim));
335  }
336  if(m_fc_pos_isSet){
337  obj->insert("fcPos", QJsonValue(fc_pos));
338  }
339  if(m_dc_block_isSet){
340  obj->insert("dcBlock", QJsonValue(dc_block));
341  }
343  obj->insert("iqCorrection", QJsonValue(iq_correction));
344  }
346  obj->insert("transverterMode", QJsonValue(transverter_mode));
347  }
349  obj->insert("transverterDeltaFrequency", QJsonValue(transverter_delta_frequency));
350  }
351  if(file_record_name != nullptr && *file_record_name != QString("")){
352  toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
353  }
355  obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
356  }
357  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
358  toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
359  }
361  obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
362  }
364  obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
365  }
366 
367  return obj;
368 }
369 
370 qint64
372  return center_frequency;
373 }
374 void
376  this->center_frequency = center_frequency;
377  this->m_center_frequency_isSet = true;
378 }
379 
380 qint32
382  return l_oppm_tenths;
383 }
384 void
386  this->l_oppm_tenths = l_oppm_tenths;
387  this->m_l_oppm_tenths_isSet = true;
388 }
389 
390 qint32
392  return lna_gain_index;
393 }
394 void
396  this->lna_gain_index = lna_gain_index;
397  this->m_lna_gain_index_isSet = true;
398 }
399 
400 qint32
402  return rf_filter_index;
403 }
404 void
406  this->rf_filter_index = rf_filter_index;
407  this->m_rf_filter_index_isSet = true;
408 }
409 
410 qint32
412  return lna_enhance_index;
413 }
414 void
416  this->lna_enhance_index = lna_enhance_index;
417  this->m_lna_enhance_index_isSet = true;
418 }
419 
420 qint32
422  return band_index;
423 }
424 void
426  this->band_index = band_index;
427  this->m_band_index_isSet = true;
428 }
429 
430 qint32
432  return mixer_gain_index;
433 }
434 void
436  this->mixer_gain_index = mixer_gain_index;
437  this->m_mixer_gain_index_isSet = true;
438 }
439 
440 qint32
442  return mixer_filter_index;
443 }
444 void
446  this->mixer_filter_index = mixer_filter_index;
447  this->m_mixer_filter_index_isSet = true;
448 }
449 
450 qint32
452  return bias_current_index;
453 }
454 void
456  this->bias_current_index = bias_current_index;
457  this->m_bias_current_index_isSet = true;
458 }
459 
460 qint32
462  return mode_index;
463 }
464 void
466  this->mode_index = mode_index;
467  this->m_mode_index_isSet = true;
468 }
469 
470 qint32
472  return gain1_index;
473 }
474 void
476  this->gain1_index = gain1_index;
477  this->m_gain1_index_isSet = true;
478 }
479 
480 qint32
482  return rc_filter_index;
483 }
484 void
486  this->rc_filter_index = rc_filter_index;
487  this->m_rc_filter_index_isSet = true;
488 }
489 
490 qint32
492  return gain2_index;
493 }
494 void
496  this->gain2_index = gain2_index;
497  this->m_gain2_index_isSet = true;
498 }
499 
500 qint32
502  return gain3_index;
503 }
504 void
506  this->gain3_index = gain3_index;
507  this->m_gain3_index_isSet = true;
508 }
509 
510 qint32
512  return gain4_index;
513 }
514 void
516  this->gain4_index = gain4_index;
517  this->m_gain4_index_isSet = true;
518 }
519 
520 qint32
522  return if_filter_index;
523 }
524 void
526  this->if_filter_index = if_filter_index;
527  this->m_if_filter_index_isSet = true;
528 }
529 
530 qint32
532  return gain5_index;
533 }
534 void
536  this->gain5_index = gain5_index;
537  this->m_gain5_index_isSet = true;
538 }
539 
540 qint32
542  return gain6_index;
543 }
544 void
546  this->gain6_index = gain6_index;
547  this->m_gain6_index_isSet = true;
548 }
549 
550 qint32
552  return log2_decim;
553 }
554 void
556  this->log2_decim = log2_decim;
557  this->m_log2_decim_isSet = true;
558 }
559 
560 qint32
562  return fc_pos;
563 }
564 void
566  this->fc_pos = fc_pos;
567  this->m_fc_pos_isSet = true;
568 }
569 
570 qint32
572  return dc_block;
573 }
574 void
576  this->dc_block = dc_block;
577  this->m_dc_block_isSet = true;
578 }
579 
580 qint32
582  return iq_correction;
583 }
584 void
586  this->iq_correction = iq_correction;
587  this->m_iq_correction_isSet = true;
588 }
589 
590 qint32
592  return transverter_mode;
593 }
594 void
596  this->transverter_mode = transverter_mode;
597  this->m_transverter_mode_isSet = true;
598 }
599 
600 qint64
603 }
604 void
606  this->transverter_delta_frequency = transverter_delta_frequency;
608 }
609 
610 QString*
612  return file_record_name;
613 }
614 void
616  this->file_record_name = file_record_name;
617  this->m_file_record_name_isSet = true;
618 }
619 
620 qint32
622  return use_reverse_api;
623 }
624 void
626  this->use_reverse_api = use_reverse_api;
627  this->m_use_reverse_api_isSet = true;
628 }
629 
630 QString*
632  return reverse_api_address;
633 }
634 void
636  this->reverse_api_address = reverse_api_address;
637  this->m_reverse_api_address_isSet = true;
638 }
639 
640 qint32
642  return reverse_api_port;
643 }
644 void
646  this->reverse_api_port = reverse_api_port;
647  this->m_reverse_api_port_isSet = true;
648 }
649 
650 qint32
653 }
654 void
656  this->reverse_api_device_index = reverse_api_device_index;
658 }
659 
660 
661 bool
663  bool isObjectUpdated = false;
664  do{
665  if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
666  if(m_l_oppm_tenths_isSet){ isObjectUpdated = true; break;}
667  if(m_lna_gain_index_isSet){ isObjectUpdated = true; break;}
668  if(m_rf_filter_index_isSet){ isObjectUpdated = true; break;}
669  if(m_lna_enhance_index_isSet){ isObjectUpdated = true; break;}
670  if(m_band_index_isSet){ isObjectUpdated = true; break;}
671  if(m_mixer_gain_index_isSet){ isObjectUpdated = true; break;}
672  if(m_mixer_filter_index_isSet){ isObjectUpdated = true; break;}
673  if(m_bias_current_index_isSet){ isObjectUpdated = true; break;}
674  if(m_mode_index_isSet){ isObjectUpdated = true; break;}
675  if(m_gain1_index_isSet){ isObjectUpdated = true; break;}
676  if(m_rc_filter_index_isSet){ isObjectUpdated = true; break;}
677  if(m_gain2_index_isSet){ isObjectUpdated = true; break;}
678  if(m_gain3_index_isSet){ isObjectUpdated = true; break;}
679  if(m_gain4_index_isSet){ isObjectUpdated = true; break;}
680  if(m_if_filter_index_isSet){ isObjectUpdated = true; break;}
681  if(m_gain5_index_isSet){ isObjectUpdated = true; break;}
682  if(m_gain6_index_isSet){ isObjectUpdated = true; break;}
683  if(m_log2_decim_isSet){ isObjectUpdated = true; break;}
684  if(m_fc_pos_isSet){ isObjectUpdated = true; break;}
685  if(m_dc_block_isSet){ isObjectUpdated = true; break;}
686  if(m_iq_correction_isSet){ isObjectUpdated = true; break;}
687  if(m_transverter_mode_isSet){ isObjectUpdated = true; break;}
688  if(m_transverter_delta_frequency_isSet){ isObjectUpdated = true; break;}
689  if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
690  if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
691  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ isObjectUpdated = true; break;}
692  if(m_reverse_api_port_isSet){ isObjectUpdated = true; break;}
693  if(m_reverse_api_device_index_isSet){ isObjectUpdated = true; break;}
694  }while(false);
695  return isObjectUpdated;
696 }
697 }
698 
void setGain1Index(qint32 gain1_index)
void setMixerFilterIndex(qint32 mixer_filter_index)
void setGain6Index(qint32 gain6_index)
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
void setIqCorrection(qint32 iq_correction)
void setGain5Index(qint32 gain5_index)
void setLOppmTenths(qint32 l_oppm_tenths)
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency)
virtual SWGFCDProSettings * fromJson(QString &jsonString) override
void setReverseApiDeviceIndex(qint32 reverse_api_device_index)
void setRfFilterIndex(qint32 rf_filter_index)
void setCenterFrequency(qint64 center_frequency)
void setBandIndex(qint32 band_index)
void setGain2Index(qint32 gain2_index)
void setGain4Index(qint32 gain4_index)
void setModeIndex(qint32 mode_index)
void setRcFilterIndex(qint32 rc_filter_index)
void setBiasCurrentIndex(qint32 bias_current_index)
void setGain3Index(qint32 gain3_index)
virtual void fromJsonObject(QJsonObject &json) override
void setLnaGainIndex(qint32 lna_gain_index)
virtual QJsonObject * asJsonObject() override
void setMixerGainIndex(qint32 mixer_gain_index)
void setUseReverseApi(qint32 use_reverse_api)
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
void setLnaEnhanceIndex(qint32 lna_enhance_index)
void setFileRecordName(QString *file_record_name)
void setTransverterMode(qint32 transverter_mode)
void setReverseApiPort(qint32 reverse_api_port)
void setReverseApiAddress(QString *reverse_api_address)
void setLog2Decim(qint32 log2_decim)
virtual QString asJson() override
void setIfFilterIndex(qint32 if_filter_index)