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.
SWGDeviceSetApi.cpp
Go to the documentation of this file.
1 
13 #include "SWGDeviceSetApi.h"
14 #include "SWGHelpers.h"
15 #include "SWGModelFactory.h"
16 
17 #include <QJsonArray>
18 #include <QJsonDocument>
19 
20 namespace SWGSDRangel {
21 
23 
25 
27  this->host = host;
28  this->basePath = basePath;
29 }
30 
31 void
32 SWGDeviceSetApi::devicesetChannelDelete(qint32 device_set_index, qint32 channel_index) {
33  QString fullPath;
34  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}");
35 
36  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
37  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
38  QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
39  fullPath.replace(channel_indexPathParam, stringValue(channel_index));
40 
41 
43  SWGHttpRequestInput input(fullPath, "DELETE");
44 
45 
46 
47 
48 
49  foreach(QString key, this->defaultHeaders.keys()) {
50  input.headers.insert(key, this->defaultHeaders.value(key));
51  }
52 
53  connect(worker,
55  this,
57 
58  worker->execute(&input);
59 }
60 
61 void
63  QString msg;
64  QString error_str = worker->error_str;
65  QNetworkReply::NetworkError error_type = worker->error_type;
66 
67  if (worker->error_type == QNetworkReply::NoError) {
68  msg = QString("Success! %1 bytes").arg(worker->response.length());
69  }
70  else {
71  msg = "Error: " + worker->error_str;
72  }
73 
74 
75  QString json(worker->response);
76  SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
77  worker->deleteLater();
78 
79  if (worker->error_type == QNetworkReply::NoError) {
80  emit devicesetChannelDeleteSignal(output);
81  } else {
82  emit devicesetChannelDeleteSignalE(output, error_type, error_str);
83  emit devicesetChannelDeleteSignalEFull(worker, error_type, error_str);
84  }
85 }
86 
87 void
89  QString fullPath;
90  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel");
91 
92  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
93  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
94 
95 
97  SWGHttpRequestInput input(fullPath, "POST");
98 
99 
100 
101  QString output = body.asJson();
102  input.request_body.append(output);
103 
104 
105 
106  foreach(QString key, this->defaultHeaders.keys()) {
107  input.headers.insert(key, this->defaultHeaders.value(key));
108  }
109 
110  connect(worker,
112  this,
114 
115  worker->execute(&input);
116 }
117 
118 void
120  QString msg;
121  QString error_str = worker->error_str;
122  QNetworkReply::NetworkError error_type = worker->error_type;
123 
124  if (worker->error_type == QNetworkReply::NoError) {
125  msg = QString("Success! %1 bytes").arg(worker->response.length());
126  }
127  else {
128  msg = "Error: " + worker->error_str;
129  }
130 
131 
132  QString json(worker->response);
133  SWGSuccessResponse* output = static_cast<SWGSuccessResponse*>(create(json, QString("SWGSuccessResponse")));
134  worker->deleteLater();
135 
136  if (worker->error_type == QNetworkReply::NoError) {
137  emit devicesetChannelPostSignal(output);
138  } else {
139  emit devicesetChannelPostSignalE(output, error_type, error_str);
140  emit devicesetChannelPostSignalEFull(worker, error_type, error_str);
141  }
142 }
143 
144 void
145 SWGDeviceSetApi::devicesetChannelReportGet(qint32 device_set_index, qint32 channel_index) {
146  QString fullPath;
147  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/report");
148 
149  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
150  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
151  QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
152  fullPath.replace(channel_indexPathParam, stringValue(channel_index));
153 
154 
156  SWGHttpRequestInput input(fullPath, "GET");
157 
158 
159 
160 
161 
162  foreach(QString key, this->defaultHeaders.keys()) {
163  input.headers.insert(key, this->defaultHeaders.value(key));
164  }
165 
166  connect(worker,
168  this,
170 
171  worker->execute(&input);
172 }
173 
174 void
176  QString msg;
177  QString error_str = worker->error_str;
178  QNetworkReply::NetworkError error_type = worker->error_type;
179 
180  if (worker->error_type == QNetworkReply::NoError) {
181  msg = QString("Success! %1 bytes").arg(worker->response.length());
182  }
183  else {
184  msg = "Error: " + worker->error_str;
185  }
186 
187 
188  QString json(worker->response);
189  SWGChannelReport* output = static_cast<SWGChannelReport*>(create(json, QString("SWGChannelReport")));
190  worker->deleteLater();
191 
192  if (worker->error_type == QNetworkReply::NoError) {
193  emit devicesetChannelReportGetSignal(output);
194  } else {
195  emit devicesetChannelReportGetSignalE(output, error_type, error_str);
196  emit devicesetChannelReportGetSignalEFull(worker, error_type, error_str);
197  }
198 }
199 
200 void
201 SWGDeviceSetApi::devicesetChannelSettingsGet(qint32 device_set_index, qint32 channel_index) {
202  QString fullPath;
203  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings");
204 
205  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
206  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
207  QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
208  fullPath.replace(channel_indexPathParam, stringValue(channel_index));
209 
210 
212  SWGHttpRequestInput input(fullPath, "GET");
213 
214 
215 
216 
217 
218  foreach(QString key, this->defaultHeaders.keys()) {
219  input.headers.insert(key, this->defaultHeaders.value(key));
220  }
221 
222  connect(worker,
224  this,
226 
227  worker->execute(&input);
228 }
229 
230 void
232  QString msg;
233  QString error_str = worker->error_str;
234  QNetworkReply::NetworkError error_type = worker->error_type;
235 
236  if (worker->error_type == QNetworkReply::NoError) {
237  msg = QString("Success! %1 bytes").arg(worker->response.length());
238  }
239  else {
240  msg = "Error: " + worker->error_str;
241  }
242 
243 
244  QString json(worker->response);
245  SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
246  worker->deleteLater();
247 
248  if (worker->error_type == QNetworkReply::NoError) {
250  } else {
251  emit devicesetChannelSettingsGetSignalE(output, error_type, error_str);
252  emit devicesetChannelSettingsGetSignalEFull(worker, error_type, error_str);
253  }
254 }
255 
256 void
257 SWGDeviceSetApi::devicesetChannelSettingsPatch(qint32 device_set_index, qint32 channel_index, SWGChannelSettings& body) {
258  QString fullPath;
259  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings");
260 
261  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
262  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
263  QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
264  fullPath.replace(channel_indexPathParam, stringValue(channel_index));
265 
266 
268  SWGHttpRequestInput input(fullPath, "PATCH");
269 
270 
271 
272  QString output = body.asJson();
273  input.request_body.append(output);
274 
275 
276 
277  foreach(QString key, this->defaultHeaders.keys()) {
278  input.headers.insert(key, this->defaultHeaders.value(key));
279  }
280 
281  connect(worker,
283  this,
285 
286  worker->execute(&input);
287 }
288 
289 void
291  QString msg;
292  QString error_str = worker->error_str;
293  QNetworkReply::NetworkError error_type = worker->error_type;
294 
295  if (worker->error_type == QNetworkReply::NoError) {
296  msg = QString("Success! %1 bytes").arg(worker->response.length());
297  }
298  else {
299  msg = "Error: " + worker->error_str;
300  }
301 
302 
303  QString json(worker->response);
304  SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
305  worker->deleteLater();
306 
307  if (worker->error_type == QNetworkReply::NoError) {
309  } else {
310  emit devicesetChannelSettingsPatchSignalE(output, error_type, error_str);
311  emit devicesetChannelSettingsPatchSignalEFull(worker, error_type, error_str);
312  }
313 }
314 
315 void
316 SWGDeviceSetApi::devicesetChannelSettingsPut(qint32 device_set_index, qint32 channel_index, SWGChannelSettings& body) {
317  QString fullPath;
318  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings");
319 
320  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
321  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
322  QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
323  fullPath.replace(channel_indexPathParam, stringValue(channel_index));
324 
325 
327  SWGHttpRequestInput input(fullPath, "PUT");
328 
329 
330 
331  QString output = body.asJson();
332  input.request_body.append(output);
333 
334 
335 
336  foreach(QString key, this->defaultHeaders.keys()) {
337  input.headers.insert(key, this->defaultHeaders.value(key));
338  }
339 
340  connect(worker,
342  this,
344 
345  worker->execute(&input);
346 }
347 
348 void
350  QString msg;
351  QString error_str = worker->error_str;
352  QNetworkReply::NetworkError error_type = worker->error_type;
353 
354  if (worker->error_type == QNetworkReply::NoError) {
355  msg = QString("Success! %1 bytes").arg(worker->response.length());
356  }
357  else {
358  msg = "Error: " + worker->error_str;
359  }
360 
361 
362  QString json(worker->response);
363  SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
364  worker->deleteLater();
365 
366  if (worker->error_type == QNetworkReply::NoError) {
368  } else {
369  emit devicesetChannelSettingsPutSignalE(output, error_type, error_str);
370  emit devicesetChannelSettingsPutSignalEFull(worker, error_type, error_str);
371  }
372 }
373 
374 void
376  QString fullPath;
377  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channels/report");
378 
379  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
380  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
381 
382 
384  SWGHttpRequestInput input(fullPath, "GET");
385 
386 
387 
388 
389 
390  foreach(QString key, this->defaultHeaders.keys()) {
391  input.headers.insert(key, this->defaultHeaders.value(key));
392  }
393 
394  connect(worker,
396  this,
398 
399  worker->execute(&input);
400 }
401 
402 void
404  QString msg;
405  QString error_str = worker->error_str;
406  QNetworkReply::NetworkError error_type = worker->error_type;
407 
408  if (worker->error_type == QNetworkReply::NoError) {
409  msg = QString("Success! %1 bytes").arg(worker->response.length());
410  }
411  else {
412  msg = "Error: " + worker->error_str;
413  }
414 
415 
416  QString json(worker->response);
417  SWGChannelsDetail* output = static_cast<SWGChannelsDetail*>(create(json, QString("SWGChannelsDetail")));
418  worker->deleteLater();
419 
420  if (worker->error_type == QNetworkReply::NoError) {
422  } else {
423  emit devicesetChannelsReportGetSignalE(output, error_type, error_str);
424  emit devicesetChannelsReportGetSignalEFull(worker, error_type, error_str);
425  }
426 }
427 
428 void
430  QString fullPath;
431  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device");
432 
433  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
434  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
435 
436 
438  SWGHttpRequestInput input(fullPath, "PUT");
439 
440 
441 
442  QString output = body.asJson();
443  input.request_body.append(output);
444 
445 
446 
447  foreach(QString key, this->defaultHeaders.keys()) {
448  input.headers.insert(key, this->defaultHeaders.value(key));
449  }
450 
451  connect(worker,
453  this,
455 
456  worker->execute(&input);
457 }
458 
459 void
461  QString msg;
462  QString error_str = worker->error_str;
463  QNetworkReply::NetworkError error_type = worker->error_type;
464 
465  if (worker->error_type == QNetworkReply::NoError) {
466  msg = QString("Success! %1 bytes").arg(worker->response.length());
467  }
468  else {
469  msg = "Error: " + worker->error_str;
470  }
471 
472 
473  QString json(worker->response);
474  SWGDeviceListItem* output = static_cast<SWGDeviceListItem*>(create(json, QString("SWGDeviceListItem")));
475  worker->deleteLater();
476 
477  if (worker->error_type == QNetworkReply::NoError) {
478  emit devicesetDevicePutSignal(output);
479  } else {
480  emit devicesetDevicePutSignalE(output, error_type, error_str);
481  emit devicesetDevicePutSignalEFull(worker, error_type, error_str);
482  }
483 }
484 
485 void
487  QString fullPath;
488  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/report");
489 
490  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
491  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
492 
493 
495  SWGHttpRequestInput input(fullPath, "GET");
496 
497 
498 
499 
500 
501  foreach(QString key, this->defaultHeaders.keys()) {
502  input.headers.insert(key, this->defaultHeaders.value(key));
503  }
504 
505  connect(worker,
507  this,
509 
510  worker->execute(&input);
511 }
512 
513 void
515  QString msg;
516  QString error_str = worker->error_str;
517  QNetworkReply::NetworkError error_type = worker->error_type;
518 
519  if (worker->error_type == QNetworkReply::NoError) {
520  msg = QString("Success! %1 bytes").arg(worker->response.length());
521  }
522  else {
523  msg = "Error: " + worker->error_str;
524  }
525 
526 
527  QString json(worker->response);
528  SWGDeviceReport* output = static_cast<SWGDeviceReport*>(create(json, QString("SWGDeviceReport")));
529  worker->deleteLater();
530 
531  if (worker->error_type == QNetworkReply::NoError) {
532  emit devicesetDeviceReportGetSignal(output);
533  } else {
534  emit devicesetDeviceReportGetSignalE(output, error_type, error_str);
535  emit devicesetDeviceReportGetSignalEFull(worker, error_type, error_str);
536  }
537 }
538 
539 void
541  QString fullPath;
542  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/run");
543 
544  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
545  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
546 
547 
549  SWGHttpRequestInput input(fullPath, "DELETE");
550 
551 
552 
553  QString output = body.asJson();
554  input.request_body.append(output);
555 
556 
557 
558  foreach(QString key, this->defaultHeaders.keys()) {
559  input.headers.insert(key, this->defaultHeaders.value(key));
560  }
561 
562  connect(worker,
564  this,
566 
567  worker->execute(&input);
568 }
569 
570 void
572  QString msg;
573  QString error_str = worker->error_str;
574  QNetworkReply::NetworkError error_type = worker->error_type;
575 
576  if (worker->error_type == QNetworkReply::NoError) {
577  msg = QString("Success! %1 bytes").arg(worker->response.length());
578  }
579  else {
580  msg = "Error: " + worker->error_str;
581  }
582 
583 
584  QString json(worker->response);
585  SWGDeviceState* output = static_cast<SWGDeviceState*>(create(json, QString("SWGDeviceState")));
586  worker->deleteLater();
587 
588  if (worker->error_type == QNetworkReply::NoError) {
589  emit devicesetDeviceRunDeleteSignal(output);
590  } else {
591  emit devicesetDeviceRunDeleteSignalE(output, error_type, error_str);
592  emit devicesetDeviceRunDeleteSignalEFull(worker, error_type, error_str);
593  }
594 }
595 
596 void
597 SWGDeviceSetApi::devicesetDeviceRunGet(qint32 device_set_index) {
598  QString fullPath;
599  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/run");
600 
601  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
602  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
603 
604 
606  SWGHttpRequestInput input(fullPath, "GET");
607 
608 
609 
610 
611 
612  foreach(QString key, this->defaultHeaders.keys()) {
613  input.headers.insert(key, this->defaultHeaders.value(key));
614  }
615 
616  connect(worker,
618  this,
620 
621  worker->execute(&input);
622 }
623 
624 void
626  QString msg;
627  QString error_str = worker->error_str;
628  QNetworkReply::NetworkError error_type = worker->error_type;
629 
630  if (worker->error_type == QNetworkReply::NoError) {
631  msg = QString("Success! %1 bytes").arg(worker->response.length());
632  }
633  else {
634  msg = "Error: " + worker->error_str;
635  }
636 
637 
638  QString json(worker->response);
639  SWGDeviceState* output = static_cast<SWGDeviceState*>(create(json, QString("SWGDeviceState")));
640  worker->deleteLater();
641 
642  if (worker->error_type == QNetworkReply::NoError) {
643  emit devicesetDeviceRunGetSignal(output);
644  } else {
645  emit devicesetDeviceRunGetSignalE(output, error_type, error_str);
646  emit devicesetDeviceRunGetSignalEFull(worker, error_type, error_str);
647  }
648 }
649 
650 void
652  QString fullPath;
653  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/run");
654 
655  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
656  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
657 
658 
660  SWGHttpRequestInput input(fullPath, "POST");
661 
662 
663 
664  QString output = body.asJson();
665  input.request_body.append(output);
666 
667 
668 
669  foreach(QString key, this->defaultHeaders.keys()) {
670  input.headers.insert(key, this->defaultHeaders.value(key));
671  }
672 
673  connect(worker,
675  this,
677 
678  worker->execute(&input);
679 }
680 
681 void
683  QString msg;
684  QString error_str = worker->error_str;
685  QNetworkReply::NetworkError error_type = worker->error_type;
686 
687  if (worker->error_type == QNetworkReply::NoError) {
688  msg = QString("Success! %1 bytes").arg(worker->response.length());
689  }
690  else {
691  msg = "Error: " + worker->error_str;
692  }
693 
694 
695  QString json(worker->response);
696  SWGDeviceState* output = static_cast<SWGDeviceState*>(create(json, QString("SWGDeviceState")));
697  worker->deleteLater();
698 
699  if (worker->error_type == QNetworkReply::NoError) {
700  emit devicesetDeviceRunPostSignal(output);
701  } else {
702  emit devicesetDeviceRunPostSignalE(output, error_type, error_str);
703  emit devicesetDeviceRunPostSignalEFull(worker, error_type, error_str);
704  }
705 }
706 
707 void
709  QString fullPath;
710  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/settings");
711 
712  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
713  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
714 
715 
717  SWGHttpRequestInput input(fullPath, "GET");
718 
719 
720 
721 
722 
723  foreach(QString key, this->defaultHeaders.keys()) {
724  input.headers.insert(key, this->defaultHeaders.value(key));
725  }
726 
727  connect(worker,
729  this,
731 
732  worker->execute(&input);
733 }
734 
735 void
737  QString msg;
738  QString error_str = worker->error_str;
739  QNetworkReply::NetworkError error_type = worker->error_type;
740 
741  if (worker->error_type == QNetworkReply::NoError) {
742  msg = QString("Success! %1 bytes").arg(worker->response.length());
743  }
744  else {
745  msg = "Error: " + worker->error_str;
746  }
747 
748 
749  QString json(worker->response);
750  SWGDeviceSettings* output = static_cast<SWGDeviceSettings*>(create(json, QString("SWGDeviceSettings")));
751  worker->deleteLater();
752 
753  if (worker->error_type == QNetworkReply::NoError) {
755  } else {
756  emit devicesetDeviceSettingsGetSignalE(output, error_type, error_str);
757  emit devicesetDeviceSettingsGetSignalEFull(worker, error_type, error_str);
758  }
759 }
760 
761 void
763  QString fullPath;
764  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/settings");
765 
766  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
767  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
768 
769 
771  SWGHttpRequestInput input(fullPath, "PATCH");
772 
773 
774 
775  QString output = body.asJson();
776  input.request_body.append(output);
777 
778 
779 
780  foreach(QString key, this->defaultHeaders.keys()) {
781  input.headers.insert(key, this->defaultHeaders.value(key));
782  }
783 
784  connect(worker,
786  this,
788 
789  worker->execute(&input);
790 }
791 
792 void
794  QString msg;
795  QString error_str = worker->error_str;
796  QNetworkReply::NetworkError error_type = worker->error_type;
797 
798  if (worker->error_type == QNetworkReply::NoError) {
799  msg = QString("Success! %1 bytes").arg(worker->response.length());
800  }
801  else {
802  msg = "Error: " + worker->error_str;
803  }
804 
805 
806  QString json(worker->response);
807  SWGDeviceSettings* output = static_cast<SWGDeviceSettings*>(create(json, QString("SWGDeviceSettings")));
808  worker->deleteLater();
809 
810  if (worker->error_type == QNetworkReply::NoError) {
812  } else {
813  emit devicesetDeviceSettingsPatchSignalE(output, error_type, error_str);
814  emit devicesetDeviceSettingsPatchSignalEFull(worker, error_type, error_str);
815  }
816 }
817 
818 void
820  QString fullPath;
821  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/settings");
822 
823  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
824  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
825 
826 
828  SWGHttpRequestInput input(fullPath, "PUT");
829 
830 
831 
832  QString output = body.asJson();
833  input.request_body.append(output);
834 
835 
836 
837  foreach(QString key, this->defaultHeaders.keys()) {
838  input.headers.insert(key, this->defaultHeaders.value(key));
839  }
840 
841  connect(worker,
843  this,
845 
846  worker->execute(&input);
847 }
848 
849 void
851  QString msg;
852  QString error_str = worker->error_str;
853  QNetworkReply::NetworkError error_type = worker->error_type;
854 
855  if (worker->error_type == QNetworkReply::NoError) {
856  msg = QString("Success! %1 bytes").arg(worker->response.length());
857  }
858  else {
859  msg = "Error: " + worker->error_str;
860  }
861 
862 
863  QString json(worker->response);
864  SWGDeviceSettings* output = static_cast<SWGDeviceSettings*>(create(json, QString("SWGDeviceSettings")));
865  worker->deleteLater();
866 
867  if (worker->error_type == QNetworkReply::NoError) {
869  } else {
870  emit devicesetDeviceSettingsPutSignalE(output, error_type, error_str);
871  emit devicesetDeviceSettingsPutSignalEFull(worker, error_type, error_str);
872  }
873 }
874 
875 void
876 SWGDeviceSetApi::devicesetFocusPatch(qint32 device_set_index) {
877  QString fullPath;
878  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/focus");
879 
880  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
881  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
882 
883 
885  SWGHttpRequestInput input(fullPath, "PATCH");
886 
887 
888 
889 
890 
891  foreach(QString key, this->defaultHeaders.keys()) {
892  input.headers.insert(key, this->defaultHeaders.value(key));
893  }
894 
895  connect(worker,
897  this,
899 
900  worker->execute(&input);
901 }
902 
903 void
905  QString msg;
906  QString error_str = worker->error_str;
907  QNetworkReply::NetworkError error_type = worker->error_type;
908 
909  if (worker->error_type == QNetworkReply::NoError) {
910  msg = QString("Success! %1 bytes").arg(worker->response.length());
911  }
912  else {
913  msg = "Error: " + worker->error_str;
914  }
915 
916 
917  QString json(worker->response);
918  SWGSuccessResponse* output = static_cast<SWGSuccessResponse*>(create(json, QString("SWGSuccessResponse")));
919  worker->deleteLater();
920 
921  if (worker->error_type == QNetworkReply::NoError) {
922  emit devicesetFocusPatchSignal(output);
923  } else {
924  emit devicesetFocusPatchSignalE(output, error_type, error_str);
925  emit devicesetFocusPatchSignalEFull(worker, error_type, error_str);
926  }
927 }
928 
929 void
930 SWGDeviceSetApi::devicesetGet(qint32 device_set_index) {
931  QString fullPath;
932  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}");
933 
934  QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
935  fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
936 
937 
939  SWGHttpRequestInput input(fullPath, "GET");
940 
941 
942 
943 
944 
945  foreach(QString key, this->defaultHeaders.keys()) {
946  input.headers.insert(key, this->defaultHeaders.value(key));
947  }
948 
949  connect(worker,
951  this,
953 
954  worker->execute(&input);
955 }
956 
957 void
959  QString msg;
960  QString error_str = worker->error_str;
961  QNetworkReply::NetworkError error_type = worker->error_type;
962 
963  if (worker->error_type == QNetworkReply::NoError) {
964  msg = QString("Success! %1 bytes").arg(worker->response.length());
965  }
966  else {
967  msg = "Error: " + worker->error_str;
968  }
969 
970 
971  QString json(worker->response);
972  SWGDeviceSet* output = static_cast<SWGDeviceSet*>(create(json, QString("SWGDeviceSet")));
973  worker->deleteLater();
974 
975  if (worker->error_type == QNetworkReply::NoError) {
976  emit devicesetGetSignal(output);
977  } else {
978  emit devicesetGetSignalE(output, error_type, error_str);
979  emit devicesetGetSignalEFull(worker, error_type, error_str);
980  }
981 }
982 
983 void
985  QString fullPath;
986  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset");
987 
988 
989 
991  SWGHttpRequestInput input(fullPath, "DELETE");
992 
993 
994 
995 
996 
997  foreach(QString key, this->defaultHeaders.keys()) {
998  input.headers.insert(key, this->defaultHeaders.value(key));
999  }
1000 
1001  connect(worker,
1003  this,
1005 
1006  worker->execute(&input);
1007 }
1008 
1009 void
1011  QString msg;
1012  QString error_str = worker->error_str;
1013  QNetworkReply::NetworkError error_type = worker->error_type;
1014 
1015  if (worker->error_type == QNetworkReply::NoError) {
1016  msg = QString("Success! %1 bytes").arg(worker->response.length());
1017  }
1018  else {
1019  msg = "Error: " + worker->error_str;
1020  }
1021 
1022 
1023  QString json(worker->response);
1024  SWGSuccessResponse* output = static_cast<SWGSuccessResponse*>(create(json, QString("SWGSuccessResponse")));
1025  worker->deleteLater();
1026 
1027  if (worker->error_type == QNetworkReply::NoError) {
1028  emit instanceDeviceSetDeleteSignal(output);
1029  } else {
1030  emit instanceDeviceSetDeleteSignalE(output, error_type, error_str);
1031  emit instanceDeviceSetDeleteSignalEFull(worker, error_type, error_str);
1032  }
1033 }
1034 
1035 void
1037  QString fullPath;
1038  fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset");
1039 
1040 
1041  if (fullPath.indexOf("?") > 0)
1042  fullPath.append("&");
1043  else
1044  fullPath.append("?");
1045  fullPath.append(QUrl::toPercentEncoding("direction"))
1046  .append("=")
1047  .append(QUrl::toPercentEncoding(stringValue(direction)));
1048 
1049 
1051  SWGHttpRequestInput input(fullPath, "POST");
1052 
1053 
1054 
1055 
1056 
1057  foreach(QString key, this->defaultHeaders.keys()) {
1058  input.headers.insert(key, this->defaultHeaders.value(key));
1059  }
1060 
1061  connect(worker,
1063  this,
1065 
1066  worker->execute(&input);
1067 }
1068 
1069 void
1071  QString msg;
1072  QString error_str = worker->error_str;
1073  QNetworkReply::NetworkError error_type = worker->error_type;
1074 
1075  if (worker->error_type == QNetworkReply::NoError) {
1076  msg = QString("Success! %1 bytes").arg(worker->response.length());
1077  }
1078  else {
1079  msg = "Error: " + worker->error_str;
1080  }
1081 
1082 
1083  QString json(worker->response);
1084  SWGSuccessResponse* output = static_cast<SWGSuccessResponse*>(create(json, QString("SWGSuccessResponse")));
1085  worker->deleteLater();
1086 
1087  if (worker->error_type == QNetworkReply::NoError) {
1088  emit instanceDeviceSetPostSignal(output);
1089  } else {
1090  emit instanceDeviceSetPostSignalE(output, error_type, error_str);
1091  emit instanceDeviceSetPostSignalEFull(worker, error_type, error_str);
1092  }
1093 }
1094 
1095 
1096 }
void devicesetDeviceSettingsPutSignal(SWGDeviceSettings *summary)
void devicesetDevicePutSignal(SWGDeviceListItem *summary)
void devicesetChannelReportGetSignal(SWGChannelReport *summary)
void devicesetChannelDeleteCallback(SWGHttpRequestWorker *worker)
void instanceDeviceSetPostSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceRunGet(qint32 device_set_index)
void devicesetGetCallback(SWGHttpRequestWorker *worker)
void instanceDeviceSetPostSignal(SWGSuccessResponse *summary)
void execute(SWGHttpRequestInput *input)
void devicesetChannelSettingsPutSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceSettingsGetSignalE(SWGDeviceSettings *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceReportGetCallback(SWGHttpRequestWorker *worker)
void devicesetDeviceRunPostSignalE(SWGDeviceState *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelSettingsPatchSignal(SWGChannelSettings *summary)
void devicesetDeviceSettingsGetSignal(SWGDeviceSettings *summary)
void devicesetFocusPatchSignalE(SWGSuccessResponse *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceRunPost(qint32 device_set_index, SWGDeviceSettings &body)
void devicesetGetSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
virtual QString asJson() override
void devicesetChannelSettingsPatchCallback(SWGHttpRequestWorker *worker)
void devicesetChannelDeleteSignalE(SWGChannelSettings *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void on_execution_finished(SWGHttpRequestWorker *worker)
void devicesetChannelSettingsPatchSignalE(SWGChannelSettings *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceRunGetCallback(SWGHttpRequestWorker *worker)
void devicesetChannelSettingsGetSignal(SWGChannelSettings *summary)
void devicesetFocusPatchSignal(SWGSuccessResponse *summary)
void devicesetChannelSettingsGetSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelSettingsPutSignal(SWGChannelSettings *summary)
void devicesetDeviceReportGetSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelSettingsGetSignalE(SWGChannelSettings *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelReportGetCallback(SWGHttpRequestWorker *worker)
QMap< QString, QString > defaultHeaders
void devicesetDeviceReportGet(qint32 device_set_index)
void devicesetDeviceSettingsGet(qint32 device_set_index)
void devicesetDevicePut(qint32 device_set_index, SWGDeviceListItem &body)
void devicesetDeviceRunPostSignal(SWGDeviceState *summary)
void devicesetChannelsReportGetSignalE(SWGChannelsDetail *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelSettingsPatchSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetFocusPatchCallback(SWGHttpRequestWorker *worker)
void devicesetChannelReportGet(qint32 device_set_index, qint32 channel_index)
void devicesetGet(qint32 device_set_index)
void devicesetChannelDeleteSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceRunDeleteSignal(SWGDeviceState *summary)
void devicesetChannelSettingsPut(qint32 device_set_index, qint32 channel_index, SWGChannelSettings &body)
void devicesetChannelSettingsPutSignalE(SWGChannelSettings *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetGetSignal(SWGDeviceSet *summary)
void devicesetDeviceSettingsPutCallback(SWGHttpRequestWorker *worker)
void devicesetDevicePutCallback(SWGHttpRequestWorker *worker)
void instanceDeviceSetDeleteSignalE(SWGSuccessResponse *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceRunGetSignal(SWGDeviceState *summary)
void * create(QString type)
void devicesetGetSignalE(SWGDeviceSet *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelSettingsGetCallback(SWGHttpRequestWorker *worker)
void devicesetChannelPostSignal(SWGSuccessResponse *summary)
void devicesetDeviceSettingsPutSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelsReportGet(qint32 device_set_index)
void devicesetDeviceRunPostSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceSettingsPatchSignalE(SWGDeviceSettings *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void instanceDeviceSetPostCallback(SWGHttpRequestWorker *worker)
void devicesetChannelDeleteSignal(SWGChannelSettings *summary)
void instanceDeviceSetPostSignalE(SWGSuccessResponse *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceRunPostCallback(SWGHttpRequestWorker *worker)
void devicesetDeviceRunDeleteSignalE(SWGDeviceState *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDevicePutSignalE(SWGDeviceListItem *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelPostSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceReportGetSignalE(SWGDeviceReport *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void instanceDeviceSetDeleteSignal(SWGSuccessResponse *summary)
virtual QString asJson() override
void devicesetChannelReportGetSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelPost(qint32 device_set_index, SWGChannelSettings &body)
void devicesetDeviceSettingsPatchCallback(SWGHttpRequestWorker *worker)
void devicesetChannelDelete(qint32 device_set_index, qint32 channel_index)
void devicesetDeviceSettingsGetCallback(SWGHttpRequestWorker *worker)
void devicesetDeviceRunGetSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelSettingsPatch(qint32 device_set_index, qint32 channel_index, SWGChannelSettings &body)
virtual QString asJson() override
void devicesetDeviceSettingsPatchSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetFocusPatchSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelPostSignalE(SWGSuccessResponse *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDevicePutSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelSettingsGet(qint32 device_set_index, qint32 channel_index)
void devicesetChannelsReportGetCallback(SWGHttpRequestWorker *worker)
void devicesetDeviceReportGetSignal(SWGDeviceReport *summary)
void devicesetFocusPatch(qint32 device_set_index)
void devicesetDeviceRunDeleteSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void instanceDeviceSetPost(qint32 direction)
QMap< QString, QString > headers
void devicesetDeviceRunDeleteCallback(SWGHttpRequestWorker *worker)
void devicesetChannelSettingsPutCallback(SWGHttpRequestWorker *worker)
void devicesetDeviceRunDelete(qint32 device_set_index, SWGDeviceSettings &body)
void instanceDeviceSetDeleteSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetChannelPostCallback(SWGHttpRequestWorker *worker)
void devicesetDeviceSettingsGetSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceSettingsPut(qint32 device_set_index, SWGDeviceSettings &body)
void devicesetChannelReportGetSignalE(SWGChannelReport *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void instanceDeviceSetDeleteCallback(SWGHttpRequestWorker *worker)
void devicesetDeviceSettingsPutSignalE(SWGDeviceSettings *summary, QNetworkReply::NetworkError error_type, QString &error_str)
QNetworkReply::NetworkError error_type
void devicesetChannelsReportGetSignalEFull(SWGHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceSettingsPatch(qint32 device_set_index, SWGDeviceSettings &body)
void devicesetChannelsReportGetSignal(SWGChannelsDetail *summary)
QString stringValue(QString *value)
Definition: SWGHelpers.cpp:578
void devicesetDeviceRunGetSignalE(SWGDeviceState *summary, QNetworkReply::NetworkError error_type, QString &error_str)
void devicesetDeviceSettingsPatchSignal(SWGDeviceSettings *summary)