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.
SWGATVModSettings.cpp
Go to the documentation of this file.
1 
14 #include "SWGATVModSettings.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 
33  rf_bandwidth = 0.0f;
34  m_rf_bandwidth_isSet = false;
35  rf_opp_bandwidth = 0.0f;
37  atv_std = 0;
38  m_atv_std_isSet = false;
39  nb_lines = 0;
40  m_nb_lines_isSet = false;
41  fps = 0;
42  m_fps_isSet = false;
43  atv_mod_input = 0;
44  m_atv_mod_input_isSet = false;
45  uniform_level = 0.0f;
46  m_uniform_level_isSet = false;
47  atv_modulation = 0;
48  m_atv_modulation_isSet = false;
49  video_play_loop = 0;
51  video_play = 0;
52  m_video_play_isSet = false;
53  camera_play = 0;
54  m_camera_play_isSet = false;
55  channel_mute = 0;
56  m_channel_mute_isSet = false;
57  inverted_video = 0;
58  m_inverted_video_isSet = false;
59  rf_scaling_factor = 0.0f;
61  fm_excursion = 0.0f;
62  m_fm_excursion_isSet = false;
63  force_decimator = 0;
67  overlay_text = nullptr;
68  m_overlay_text_isSet = false;
69  rgb_color = 0;
70  m_rgb_color_isSet = false;
71  title = nullptr;
72  m_title_isSet = false;
73  image_file_name = nullptr;
75  video_file_name = nullptr;
77  use_reverse_api = 0;
79  reverse_api_address = nullptr;
81  reverse_api_port = 0;
87 }
88 
90  this->cleanup();
91 }
92 
93 void
97  rf_bandwidth = 0.0f;
98  m_rf_bandwidth_isSet = false;
99  rf_opp_bandwidth = 0.0f;
100  m_rf_opp_bandwidth_isSet = false;
101  atv_std = 0;
102  m_atv_std_isSet = false;
103  nb_lines = 0;
104  m_nb_lines_isSet = false;
105  fps = 0;
106  m_fps_isSet = false;
107  atv_mod_input = 0;
108  m_atv_mod_input_isSet = false;
109  uniform_level = 0.0f;
110  m_uniform_level_isSet = false;
111  atv_modulation = 0;
112  m_atv_modulation_isSet = false;
113  video_play_loop = 0;
114  m_video_play_loop_isSet = false;
115  video_play = 0;
116  m_video_play_isSet = false;
117  camera_play = 0;
118  m_camera_play_isSet = false;
119  channel_mute = 0;
120  m_channel_mute_isSet = false;
121  inverted_video = 0;
122  m_inverted_video_isSet = false;
123  rf_scaling_factor = 0.0f;
125  fm_excursion = 0.0f;
126  m_fm_excursion_isSet = false;
127  force_decimator = 0;
128  m_force_decimator_isSet = false;
129  show_overlay_text = 0;
131  overlay_text = new QString("");
132  m_overlay_text_isSet = false;
133  rgb_color = 0;
134  m_rgb_color_isSet = false;
135  title = new QString("");
136  m_title_isSet = false;
137  image_file_name = new QString("");
138  m_image_file_name_isSet = false;
139  video_file_name = new QString("");
140  m_video_file_name_isSet = false;
141  use_reverse_api = 0;
142  m_use_reverse_api_isSet = false;
143  reverse_api_address = new QString("");
145  reverse_api_port = 0;
146  m_reverse_api_port_isSet = false;
151 }
152 
153 void
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
171 
172 
173  if(overlay_text != nullptr) {
174  delete overlay_text;
175  }
176 
177  if(title != nullptr) {
178  delete title;
179  }
180  if(image_file_name != nullptr) {
181  delete image_file_name;
182  }
183  if(video_file_name != nullptr) {
184  delete video_file_name;
185  }
186 
187  if(reverse_api_address != nullptr) {
188  delete reverse_api_address;
189  }
190 
191 
192 
193 }
194 
197  QByteArray array (json.toStdString().c_str());
198  QJsonDocument doc = QJsonDocument::fromJson(array);
199  QJsonObject jsonObject = doc.object();
200  this->fromJsonObject(jsonObject);
201  return this;
202 }
203 
204 void
206  ::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
207 
208  ::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
209 
210  ::SWGSDRangel::setValue(&rf_opp_bandwidth, pJson["rfOppBandwidth"], "float", "");
211 
212  ::SWGSDRangel::setValue(&atv_std, pJson["atvStd"], "qint32", "");
213 
214  ::SWGSDRangel::setValue(&nb_lines, pJson["nbLines"], "qint32", "");
215 
216  ::SWGSDRangel::setValue(&fps, pJson["fps"], "qint32", "");
217 
218  ::SWGSDRangel::setValue(&atv_mod_input, pJson["atvModInput"], "qint32", "");
219 
220  ::SWGSDRangel::setValue(&uniform_level, pJson["uniformLevel"], "float", "");
221 
222  ::SWGSDRangel::setValue(&atv_modulation, pJson["atvModulation"], "qint32", "");
223 
224  ::SWGSDRangel::setValue(&video_play_loop, pJson["videoPlayLoop"], "qint32", "");
225 
226  ::SWGSDRangel::setValue(&video_play, pJson["videoPlay"], "qint32", "");
227 
228  ::SWGSDRangel::setValue(&camera_play, pJson["cameraPlay"], "qint32", "");
229 
230  ::SWGSDRangel::setValue(&channel_mute, pJson["channelMute"], "qint32", "");
231 
232  ::SWGSDRangel::setValue(&inverted_video, pJson["invertedVideo"], "qint32", "");
233 
234  ::SWGSDRangel::setValue(&rf_scaling_factor, pJson["rfScalingFactor"], "float", "");
235 
236  ::SWGSDRangel::setValue(&fm_excursion, pJson["fmExcursion"], "float", "");
237 
238  ::SWGSDRangel::setValue(&force_decimator, pJson["forceDecimator"], "qint32", "");
239 
240  ::SWGSDRangel::setValue(&show_overlay_text, pJson["showOverlayText"], "qint32", "");
241 
242  ::SWGSDRangel::setValue(&overlay_text, pJson["overlayText"], "QString", "QString");
243 
244  ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
245 
246  ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
247 
248  ::SWGSDRangel::setValue(&image_file_name, pJson["imageFileName"], "QString", "QString");
249 
250  ::SWGSDRangel::setValue(&video_file_name, pJson["videoFileName"], "QString", "QString");
251 
252  ::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
253 
254  ::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
255 
256  ::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
257 
258  ::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
259 
260  ::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
261 
262 }
263 
264 QString
266 {
267  QJsonObject* obj = this->asJsonObject();
268 
269  QJsonDocument doc(*obj);
270  QByteArray bytes = doc.toJson();
271  delete obj;
272  return QString(bytes);
273 }
274 
275 QJsonObject*
277  QJsonObject* obj = new QJsonObject();
279  obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
280  }
282  obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
283  }
285  obj->insert("rfOppBandwidth", QJsonValue(rf_opp_bandwidth));
286  }
287  if(m_atv_std_isSet){
288  obj->insert("atvStd", QJsonValue(atv_std));
289  }
290  if(m_nb_lines_isSet){
291  obj->insert("nbLines", QJsonValue(nb_lines));
292  }
293  if(m_fps_isSet){
294  obj->insert("fps", QJsonValue(fps));
295  }
297  obj->insert("atvModInput", QJsonValue(atv_mod_input));
298  }
300  obj->insert("uniformLevel", QJsonValue(uniform_level));
301  }
303  obj->insert("atvModulation", QJsonValue(atv_modulation));
304  }
306  obj->insert("videoPlayLoop", QJsonValue(video_play_loop));
307  }
308  if(m_video_play_isSet){
309  obj->insert("videoPlay", QJsonValue(video_play));
310  }
312  obj->insert("cameraPlay", QJsonValue(camera_play));
313  }
315  obj->insert("channelMute", QJsonValue(channel_mute));
316  }
318  obj->insert("invertedVideo", QJsonValue(inverted_video));
319  }
321  obj->insert("rfScalingFactor", QJsonValue(rf_scaling_factor));
322  }
324  obj->insert("fmExcursion", QJsonValue(fm_excursion));
325  }
327  obj->insert("forceDecimator", QJsonValue(force_decimator));
328  }
330  obj->insert("showOverlayText", QJsonValue(show_overlay_text));
331  }
332  if(overlay_text != nullptr && *overlay_text != QString("")){
333  toJsonValue(QString("overlayText"), overlay_text, obj, QString("QString"));
334  }
335  if(m_rgb_color_isSet){
336  obj->insert("rgbColor", QJsonValue(rgb_color));
337  }
338  if(title != nullptr && *title != QString("")){
339  toJsonValue(QString("title"), title, obj, QString("QString"));
340  }
341  if(image_file_name != nullptr && *image_file_name != QString("")){
342  toJsonValue(QString("imageFileName"), image_file_name, obj, QString("QString"));
343  }
344  if(video_file_name != nullptr && *video_file_name != QString("")){
345  toJsonValue(QString("videoFileName"), video_file_name, obj, QString("QString"));
346  }
348  obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
349  }
350  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
351  toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
352  }
354  obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
355  }
357  obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
358  }
360  obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
361  }
362 
363  return obj;
364 }
365 
366 qint64
368  return input_frequency_offset;
369 }
370 void
372  this->input_frequency_offset = input_frequency_offset;
373  this->m_input_frequency_offset_isSet = true;
374 }
375 
376 float
378  return rf_bandwidth;
379 }
380 void
382  this->rf_bandwidth = rf_bandwidth;
383  this->m_rf_bandwidth_isSet = true;
384 }
385 
386 float
388  return rf_opp_bandwidth;
389 }
390 void
392  this->rf_opp_bandwidth = rf_opp_bandwidth;
393  this->m_rf_opp_bandwidth_isSet = true;
394 }
395 
396 qint32
398  return atv_std;
399 }
400 void
402  this->atv_std = atv_std;
403  this->m_atv_std_isSet = true;
404 }
405 
406 qint32
408  return nb_lines;
409 }
410 void
412  this->nb_lines = nb_lines;
413  this->m_nb_lines_isSet = true;
414 }
415 
416 qint32
418  return fps;
419 }
420 void
422  this->fps = fps;
423  this->m_fps_isSet = true;
424 }
425 
426 qint32
428  return atv_mod_input;
429 }
430 void
432  this->atv_mod_input = atv_mod_input;
433  this->m_atv_mod_input_isSet = true;
434 }
435 
436 float
438  return uniform_level;
439 }
440 void
442  this->uniform_level = uniform_level;
443  this->m_uniform_level_isSet = true;
444 }
445 
446 qint32
448  return atv_modulation;
449 }
450 void
452  this->atv_modulation = atv_modulation;
453  this->m_atv_modulation_isSet = true;
454 }
455 
456 qint32
458  return video_play_loop;
459 }
460 void
462  this->video_play_loop = video_play_loop;
463  this->m_video_play_loop_isSet = true;
464 }
465 
466 qint32
468  return video_play;
469 }
470 void
472  this->video_play = video_play;
473  this->m_video_play_isSet = true;
474 }
475 
476 qint32
478  return camera_play;
479 }
480 void
482  this->camera_play = camera_play;
483  this->m_camera_play_isSet = true;
484 }
485 
486 qint32
488  return channel_mute;
489 }
490 void
492  this->channel_mute = channel_mute;
493  this->m_channel_mute_isSet = true;
494 }
495 
496 qint32
498  return inverted_video;
499 }
500 void
502  this->inverted_video = inverted_video;
503  this->m_inverted_video_isSet = true;
504 }
505 
506 float
508  return rf_scaling_factor;
509 }
510 void
512  this->rf_scaling_factor = rf_scaling_factor;
513  this->m_rf_scaling_factor_isSet = true;
514 }
515 
516 float
518  return fm_excursion;
519 }
520 void
522  this->fm_excursion = fm_excursion;
523  this->m_fm_excursion_isSet = true;
524 }
525 
526 qint32
528  return force_decimator;
529 }
530 void
532  this->force_decimator = force_decimator;
533  this->m_force_decimator_isSet = true;
534 }
535 
536 qint32
538  return show_overlay_text;
539 }
540 void
542  this->show_overlay_text = show_overlay_text;
543  this->m_show_overlay_text_isSet = true;
544 }
545 
546 QString*
548  return overlay_text;
549 }
550 void
552  this->overlay_text = overlay_text;
553  this->m_overlay_text_isSet = true;
554 }
555 
556 qint32
558  return rgb_color;
559 }
560 void
562  this->rgb_color = rgb_color;
563  this->m_rgb_color_isSet = true;
564 }
565 
566 QString*
568  return title;
569 }
570 void
572  this->title = title;
573  this->m_title_isSet = true;
574 }
575 
576 QString*
578  return image_file_name;
579 }
580 void
582  this->image_file_name = image_file_name;
583  this->m_image_file_name_isSet = true;
584 }
585 
586 QString*
588  return video_file_name;
589 }
590 void
592  this->video_file_name = video_file_name;
593  this->m_video_file_name_isSet = true;
594 }
595 
596 qint32
598  return use_reverse_api;
599 }
600 void
602  this->use_reverse_api = use_reverse_api;
603  this->m_use_reverse_api_isSet = true;
604 }
605 
606 QString*
608  return reverse_api_address;
609 }
610 void
612  this->reverse_api_address = reverse_api_address;
613  this->m_reverse_api_address_isSet = true;
614 }
615 
616 qint32
618  return reverse_api_port;
619 }
620 void
622  this->reverse_api_port = reverse_api_port;
623  this->m_reverse_api_port_isSet = true;
624 }
625 
626 qint32
629 }
630 void
632  this->reverse_api_device_index = reverse_api_device_index;
634 }
635 
636 qint32
639 }
640 void
642  this->reverse_api_channel_index = reverse_api_channel_index;
644 }
645 
646 
647 bool
649  bool isObjectUpdated = false;
650  do{
651  if(m_input_frequency_offset_isSet){ isObjectUpdated = true; break;}
652  if(m_rf_bandwidth_isSet){ isObjectUpdated = true; break;}
653  if(m_rf_opp_bandwidth_isSet){ isObjectUpdated = true; break;}
654  if(m_atv_std_isSet){ isObjectUpdated = true; break;}
655  if(m_nb_lines_isSet){ isObjectUpdated = true; break;}
656  if(m_fps_isSet){ isObjectUpdated = true; break;}
657  if(m_atv_mod_input_isSet){ isObjectUpdated = true; break;}
658  if(m_uniform_level_isSet){ isObjectUpdated = true; break;}
659  if(m_atv_modulation_isSet){ isObjectUpdated = true; break;}
660  if(m_video_play_loop_isSet){ isObjectUpdated = true; break;}
661  if(m_video_play_isSet){ isObjectUpdated = true; break;}
662  if(m_camera_play_isSet){ isObjectUpdated = true; break;}
663  if(m_channel_mute_isSet){ isObjectUpdated = true; break;}
664  if(m_inverted_video_isSet){ isObjectUpdated = true; break;}
665  if(m_rf_scaling_factor_isSet){ isObjectUpdated = true; break;}
666  if(m_fm_excursion_isSet){ isObjectUpdated = true; break;}
667  if(m_force_decimator_isSet){ isObjectUpdated = true; break;}
668  if(m_show_overlay_text_isSet){ isObjectUpdated = true; break;}
669  if(overlay_text != nullptr && *overlay_text != QString("")){ isObjectUpdated = true; break;}
670  if(m_rgb_color_isSet){ isObjectUpdated = true; break;}
671  if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;}
672  if(image_file_name != nullptr && *image_file_name != QString("")){ isObjectUpdated = true; break;}
673  if(video_file_name != nullptr && *video_file_name != QString("")){ isObjectUpdated = true; break;}
674  if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
675  if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ isObjectUpdated = true; break;}
676  if(m_reverse_api_port_isSet){ isObjectUpdated = true; break;}
677  if(m_reverse_api_device_index_isSet){ isObjectUpdated = true; break;}
678  if(m_reverse_api_channel_index_isSet){ isObjectUpdated = true; break;}
679  }while(false);
680  return isObjectUpdated;
681 }
682 }
683 
void setUseReverseApi(qint32 use_reverse_api)
void setInvertedVideo(qint32 inverted_video)
void setCameraPlay(qint32 camera_play)
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
void setAtvModInput(qint32 atv_mod_input)
void setOverlayText(QString *overlay_text)
void setReverseApiAddress(QString *reverse_api_address)
void setFmExcursion(float fm_excursion)
void setUniformLevel(float uniform_level)
void setVideoPlay(qint32 video_play)
void setReverseApiChannelIndex(qint32 reverse_api_channel_index)
void setShowOverlayText(qint32 show_overlay_text)
void setForceDecimator(qint32 force_decimator)
virtual void fromJsonObject(QJsonObject &json) override
void setVideoFileName(QString *video_file_name)
void setRfOppBandwidth(float rf_opp_bandwidth)
void setRfBandwidth(float rf_bandwidth)
void setImageFileName(QString *image_file_name)
void setVideoPlayLoop(qint32 video_play_loop)
void setRgbColor(qint32 rgb_color)
virtual QString asJson() override
void setInputFrequencyOffset(qint64 input_frequency_offset)
void setChannelMute(qint32 channel_mute)
void setAtvModulation(qint32 atv_modulation)
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
void setRfScalingFactor(float rf_scaling_factor)
virtual QJsonObject * asJsonObject() override
void setReverseApiPort(qint32 reverse_api_port)
void setReverseApiDeviceIndex(qint32 reverse_api_device_index)
virtual SWGATVModSettings * fromJson(QString &jsonString) override