Added Swagger generated code and skeleton of webapi

This commit is contained in:
f4exb 2017-11-17 03:17:15 +01:00
parent dbfd38f314
commit b0eb838f15
63 changed files with 17185 additions and 1 deletions

View File

@ -190,6 +190,7 @@ add_subdirectory(sdrbase)
add_subdirectory(sdrgui)
add_subdirectory(httpserver)
add_subdirectory(logging)
add_subdirectory(swagger)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}

View File

@ -63,7 +63,9 @@ set(sdrbase_SOURCES
plugin/plugininterface.cpp
plugin/pluginapi.cpp
plugin/pluginmanager.cpp
plugin/pluginmanager.cpp
webapi/webapirequestmapper.cpp
)
set(sdrbase_HEADERS
@ -150,6 +152,9 @@ set(sdrbase_HEADERS
util/samplesourceserializer.h
util/simpleserializer.h
#util/spinlock.h
webapi/webapiadapterinterface.h
webapi/webapirequestmapper.h
)
set(sdrbase_SOURCES
@ -222,10 +227,13 @@ add_library(sdrbase SHARED
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
.
${CMAKE_SOURCE_DIR}/httpserver
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
)
target_link_libraries(sdrbase
${QT_LIBRARIES}
httpserver
)
if(FFTW3F_FOUND)

View File

@ -0,0 +1,39 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2017 Edouard Griffiths, F4EXB. //
// //
// Swagger server adapter interface //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef SDRBASE_WEBAPI_WEBAPIADAPTERINTERFACE_H_
#define SDRBASE_WEBAPI_WEBAPIADAPTERINTERFACE_H_
#include "SWGInstanceSummaryResponse.h"
#include "SWGErrorResponse.h"
#include "SWGErrorResponse.h"
class WebAPIAdapterInterface
{
public:
virtual ~WebAPIAdapterInterface() {}
virtual int instanceSummary(
Swagger::SWGInstanceSummaryResponse& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
{ return 0; }
};
#endif /* SDRBASE_WEBAPI_WEBAPIADAPTERINTERFACE_H_ */

View File

@ -0,0 +1,41 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2017 Edouard Griffiths, F4EXB. //
// //
// Swagger server adapter interface //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "webapirequestmapper.h"
WebAPIRequestMapper::WebAPIRequestMapper(QObject* parent) :
HttpRequestHandler(parent),
m_adapter(0)
{ }
void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response __attribute__((unused)))
{
if (m_adapter == 0) // format service unavailable if adapter is null
{
}
else // normal processing
{
QByteArray path=request.getPath();
if (path == "/sdrangel")
{
}
}
}

View File

@ -0,0 +1,38 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2017 Edouard Griffiths, F4EXB. //
// //
// Swagger server adapter interface //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef SDRBASE_WEBAPI_WEBAPIREQUESTMAPPER_H_
#define SDRBASE_WEBAPI_WEBAPIREQUESTMAPPER_H_
#include "httprequesthandler.h"
#include "httprequest.h"
#include "httpresponse.h"
#include "webapiadapterinterface.h"
class WebAPIRequestMapper : public qtwebapp::HttpRequestHandler {
Q_OBJECT
public:
WebAPIRequestMapper(QObject* parent=0);
void service(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
void setAdapter(WebAPIAdapterInterface *adapter) { m_adapter = adapter; }
private:
WebAPIAdapterInterface *m_adapter;
};
#endif /* SDRBASE_WEBAPI_WEBAPIREQUESTMAPPER_H_ */

36
swagger/CMakeLists.txt Normal file
View File

@ -0,0 +1,36 @@
project (swagger)
file(GLOB swagger_SOURCES
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client/*.cpp
)
file(GLOB swagger_HEADERS
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client/*.h
)
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_SHARED)
add_library(swagger SHARED
${swagger_SOURCES}
${swagger_HEADERS_MOC}
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
.
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
)
set_target_properties(swagger PROPERTIES COMPILE_FLAGS "-Wno-conversion-null -Wno-unused-variable -Wno-unused-parameter")
target_link_libraries(swagger
${QT_LIBRARIES}
)
set_target_properties(swagger PROPERTIES DEFINE_SYMBOL "sdrangel_EXPORTS")
target_compile_features(sdrbase PRIVATE cxx_generalized_initializers) # cmake >= 3.1.0
qt5_use_modules(swagger Core Network)
install(TARGETS swagger DESTINATION lib)

View File

@ -594,9 +594,11 @@ definitions:
latitude:
description: "Lautitude in decimal degrees positive to the north"
type: number
format: float
longitude:
description: "Longitude in decimal degrees positive to the east"
type: number
format: float
DVSeralDevices:
description: "List of DV serial devices available in the system"
required:
@ -652,6 +654,7 @@ definitions:
centerFrequency:
description: "Center freqeuency in MHz"
type: number
format: float
type:
description: "Type of device set (R: Rx, T: Tx)"
type: string
@ -668,6 +671,7 @@ definitions:
centerFrequency:
description: "Center freqeuency in MHz"
type: number
format: float
type:
description: "Type of device set (R: Rx, T: Tx)"
type: string

View File

@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,170 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGAudioDevices.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGAudioDevices::SWGAudioDevices(QString* json) {
init();
this->fromJson(*json);
}
SWGAudioDevices::SWGAudioDevices() {
init();
}
SWGAudioDevices::~SWGAudioDevices() {
this->cleanup();
}
void
SWGAudioDevices::init() {
nbInputDevices = NULL;
inputDevices = new QList<QString*>();
nbOutputDevices = NULL;
outputDevices = new QList<QString*>();
}
void
SWGAudioDevices::cleanup() {
if(inputDevices != NULL) {
QList<QString*>* arr = inputDevices;
foreach(QString* o, *arr) {
delete o;
}
delete inputDevices;
}
if(outputDevices != NULL) {
QList<QString*>* arr = outputDevices;
foreach(QString* o, *arr) {
delete o;
}
delete outputDevices;
}
}
SWGAudioDevices*
SWGAudioDevices::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGAudioDevices::fromJsonObject(QJsonObject &pJson) {
setValue(&nbInputDevices, pJson["nbInputDevices"], "qint32", "");
setValue(&inputDevices, pJson["inputDevices"], "QList", "QString");
setValue(&nbOutputDevices, pJson["nbOutputDevices"], "qint32", "");
setValue(&outputDevices, pJson["outputDevices"], "QList", "QString");
}
QString
SWGAudioDevices::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGAudioDevices::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("nbInputDevices", QJsonValue(nbInputDevices));
QList<QString*>* inputDevicesList = inputDevices;
QJsonArray inputDevicesJsonArray;
toJsonArray((QList<void*>*)inputDevices, &inputDevicesJsonArray, "inputDevices", "QString");
obj->insert("inputDevices", inputDevicesJsonArray);
obj->insert("nbOutputDevices", QJsonValue(nbOutputDevices));
QList<QString*>* outputDevicesList = outputDevices;
QJsonArray outputDevicesJsonArray;
toJsonArray((QList<void*>*)outputDevices, &outputDevicesJsonArray, "outputDevices", "QString");
obj->insert("outputDevices", outputDevicesJsonArray);
return obj;
}
qint32
SWGAudioDevices::getNbInputDevices() {
return nbInputDevices;
}
void
SWGAudioDevices::setNbInputDevices(qint32 nbInputDevices) {
this->nbInputDevices = nbInputDevices;
}
QList<QString*>*
SWGAudioDevices::getInputDevices() {
return inputDevices;
}
void
SWGAudioDevices::setInputDevices(QList<QString*>* inputDevices) {
this->inputDevices = inputDevices;
}
qint32
SWGAudioDevices::getNbOutputDevices() {
return nbOutputDevices;
}
void
SWGAudioDevices::setNbOutputDevices(qint32 nbOutputDevices) {
this->nbOutputDevices = nbOutputDevices;
}
QList<QString*>*
SWGAudioDevices::getOutputDevices() {
return outputDevices;
}
void
SWGAudioDevices::setOutputDevices(QList<QString*>* outputDevices) {
this->outputDevices = outputDevices;
}
} /* namespace Swagger */

View File

@ -0,0 +1,76 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGAudioDevices.h
*
* List of audio devices available in the system
*/
#ifndef SWGAudioDevices_H_
#define SWGAudioDevices_H_
#include <QJsonObject>
#include <QList>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGAudioDevices: public SWGObject {
public:
SWGAudioDevices();
SWGAudioDevices(QString* json);
virtual ~SWGAudioDevices();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGAudioDevices* fromJson(QString &jsonString);
qint32 getNbInputDevices();
void setNbInputDevices(qint32 nbInputDevices);
QList<QString*>* getInputDevices();
void setInputDevices(QList<QString*>* inputDevices);
qint32 getNbOutputDevices();
void setNbOutputDevices(qint32 nbOutputDevices);
QList<QString*>* getOutputDevices();
void setOutputDevices(QList<QString*>* outputDevices);
private:
qint32 nbInputDevices;
QList<QString*>* inputDevices;
qint32 nbOutputDevices;
QList<QString*>* outputDevices;
};
} /* namespace Swagger */
#endif /* SWGAudioDevices_H_ */

View File

@ -0,0 +1,130 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGAudioDevicesSelect.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGAudioDevicesSelect::SWGAudioDevicesSelect(QString* json) {
init();
this->fromJson(*json);
}
SWGAudioDevicesSelect::SWGAudioDevicesSelect() {
init();
}
SWGAudioDevicesSelect::~SWGAudioDevicesSelect() {
this->cleanup();
}
void
SWGAudioDevicesSelect::init() {
input = new QString("");
output = new QString("");
}
void
SWGAudioDevicesSelect::cleanup() {
if(input != NULL) {
delete input;
}
if(output != NULL) {
delete output;
}
}
SWGAudioDevicesSelect*
SWGAudioDevicesSelect::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGAudioDevicesSelect::fromJsonObject(QJsonObject &pJson) {
setValue(&input, pJson["input"], "QString", "QString");
setValue(&output, pJson["output"], "QString", "QString");
}
QString
SWGAudioDevicesSelect::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGAudioDevicesSelect::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("input"), input, obj, QString("QString"));
toJsonValue(QString("output"), output, obj, QString("QString"));
return obj;
}
QString*
SWGAudioDevicesSelect::getInput() {
return input;
}
void
SWGAudioDevicesSelect::setInput(QString* input) {
this->input = input;
}
QString*
SWGAudioDevicesSelect::getOutput() {
return output;
}
void
SWGAudioDevicesSelect::setOutput(QString* output) {
this->output = output;
}
} /* namespace Swagger */

View File

@ -0,0 +1,69 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGAudioDevicesSelect.h
*
* Audio devices selected
*/
#ifndef SWGAudioDevicesSelect_H_
#define SWGAudioDevicesSelect_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGAudioDevicesSelect: public SWGObject {
public:
SWGAudioDevicesSelect();
SWGAudioDevicesSelect(QString* json);
virtual ~SWGAudioDevicesSelect();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGAudioDevicesSelect* fromJson(QString &jsonString);
QString* getInput();
void setInput(QString* input);
QString* getOutput();
void setOutput(QString* output);
private:
QString* input;
QString* output;
};
} /* namespace Swagger */
#endif /* SWGAudioDevicesSelect_H_ */

View File

@ -0,0 +1,137 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGChannel.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGChannel::SWGChannel(QString* json) {
init();
this->fromJson(*json);
}
SWGChannel::SWGChannel() {
init();
}
SWGChannel::~SWGChannel() {
this->cleanup();
}
void
SWGChannel::init() {
index = NULL;
id = new QString("");
deltaFrequency = NULL;
}
void
SWGChannel::cleanup() {
if(id != NULL) {
delete id;
}
}
SWGChannel*
SWGChannel::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGChannel::fromJsonObject(QJsonObject &pJson) {
setValue(&index, pJson["index"], "qint32", "");
setValue(&id, pJson["id"], "QString", "QString");
setValue(&deltaFrequency, pJson["deltaFrequency"], "qint32", "");
}
QString
SWGChannel::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGChannel::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("index", QJsonValue(index));
toJsonValue(QString("id"), id, obj, QString("QString"));
obj->insert("deltaFrequency", QJsonValue(deltaFrequency));
return obj;
}
qint32
SWGChannel::getIndex() {
return index;
}
void
SWGChannel::setIndex(qint32 index) {
this->index = index;
}
QString*
SWGChannel::getId() {
return id;
}
void
SWGChannel::setId(QString* id) {
this->id = id;
}
qint32
SWGChannel::getDeltaFrequency() {
return deltaFrequency;
}
void
SWGChannel::setDeltaFrequency(qint32 deltaFrequency) {
this->deltaFrequency = deltaFrequency;
}
} /* namespace Swagger */

View File

@ -0,0 +1,72 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGChannel.h
*
* Channel summarized information
*/
#ifndef SWGChannel_H_
#define SWGChannel_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGChannel: public SWGObject {
public:
SWGChannel();
SWGChannel(QString* json);
virtual ~SWGChannel();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGChannel* fromJson(QString &jsonString);
qint32 getIndex();
void setIndex(qint32 index);
QString* getId();
void setId(QString* id);
qint32 getDeltaFrequency();
void setDeltaFrequency(qint32 deltaFrequency);
private:
qint32 index;
QString* id;
qint32 deltaFrequency;
};
} /* namespace Swagger */
#endif /* SWGChannel_H_ */

View File

@ -0,0 +1,162 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGChannelListItem.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGChannelListItem::SWGChannelListItem(QString* json) {
init();
this->fromJson(*json);
}
SWGChannelListItem::SWGChannelListItem() {
init();
}
SWGChannelListItem::~SWGChannelListItem() {
this->cleanup();
}
void
SWGChannelListItem::init() {
name = new QString("");
id = new QString("");
tx = false;
version = new QString("");
}
void
SWGChannelListItem::cleanup() {
if(name != NULL) {
delete name;
}
if(id != NULL) {
delete id;
}
if(version != NULL) {
delete version;
}
}
SWGChannelListItem*
SWGChannelListItem::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGChannelListItem::fromJsonObject(QJsonObject &pJson) {
setValue(&name, pJson["name"], "QString", "QString");
setValue(&id, pJson["id"], "QString", "QString");
setValue(&tx, pJson["tx"], "bool", "");
setValue(&version, pJson["version"], "QString", "QString");
}
QString
SWGChannelListItem::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGChannelListItem::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("name"), name, obj, QString("QString"));
toJsonValue(QString("id"), id, obj, QString("QString"));
obj->insert("tx", QJsonValue(tx));
toJsonValue(QString("version"), version, obj, QString("QString"));
return obj;
}
QString*
SWGChannelListItem::getName() {
return name;
}
void
SWGChannelListItem::setName(QString* name) {
this->name = name;
}
QString*
SWGChannelListItem::getId() {
return id;
}
void
SWGChannelListItem::setId(QString* id) {
this->id = id;
}
bool
SWGChannelListItem::getTx() {
return tx;
}
void
SWGChannelListItem::setTx(bool tx) {
this->tx = tx;
}
QString*
SWGChannelListItem::getVersion() {
return version;
}
void
SWGChannelListItem::setVersion(QString* version) {
this->version = version;
}
} /* namespace Swagger */

View File

@ -0,0 +1,75 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGChannelListItem.h
*
* Summarized information about channel plugin
*/
#ifndef SWGChannelListItem_H_
#define SWGChannelListItem_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGChannelListItem: public SWGObject {
public:
SWGChannelListItem();
SWGChannelListItem(QString* json);
virtual ~SWGChannelListItem();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGChannelListItem* fromJson(QString &jsonString);
QString* getName();
void setName(QString* name);
QString* getId();
void setId(QString* id);
bool getTx();
void setTx(bool tx);
QString* getVersion();
void setVersion(QString* version);
private:
QString* name;
QString* id;
bool tx;
QString* version;
};
} /* namespace Swagger */
#endif /* SWGChannelListItem_H_ */

View File

@ -0,0 +1,131 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGDVSeralDevices.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGDVSeralDevices::SWGDVSeralDevices(QString* json) {
init();
this->fromJson(*json);
}
SWGDVSeralDevices::SWGDVSeralDevices() {
init();
}
SWGDVSeralDevices::~SWGDVSeralDevices() {
this->cleanup();
}
void
SWGDVSeralDevices::init() {
nbDevices = NULL;
dvSerialDevices = new QList<QString*>();
}
void
SWGDVSeralDevices::cleanup() {
if(dvSerialDevices != NULL) {
QList<QString*>* arr = dvSerialDevices;
foreach(QString* o, *arr) {
delete o;
}
delete dvSerialDevices;
}
}
SWGDVSeralDevices*
SWGDVSeralDevices::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGDVSeralDevices::fromJsonObject(QJsonObject &pJson) {
setValue(&nbDevices, pJson["nbDevices"], "qint32", "");
setValue(&dvSerialDevices, pJson["dvSerialDevices"], "QList", "QString");
}
QString
SWGDVSeralDevices::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGDVSeralDevices::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("nbDevices", QJsonValue(nbDevices));
QList<QString*>* dvSerialDevicesList = dvSerialDevices;
QJsonArray dvSerialDevicesJsonArray;
toJsonArray((QList<void*>*)dvSerialDevices, &dvSerialDevicesJsonArray, "dvSerialDevices", "QString");
obj->insert("dvSerialDevices", dvSerialDevicesJsonArray);
return obj;
}
qint32
SWGDVSeralDevices::getNbDevices() {
return nbDevices;
}
void
SWGDVSeralDevices::setNbDevices(qint32 nbDevices) {
this->nbDevices = nbDevices;
}
QList<QString*>*
SWGDVSeralDevices::getDvSerialDevices() {
return dvSerialDevices;
}
void
SWGDVSeralDevices::setDvSerialDevices(QList<QString*>* dvSerialDevices) {
this->dvSerialDevices = dvSerialDevices;
}
} /* namespace Swagger */

View File

@ -0,0 +1,70 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGDVSeralDevices.h
*
* List of DV serial devices available in the system
*/
#ifndef SWGDVSeralDevices_H_
#define SWGDVSeralDevices_H_
#include <QJsonObject>
#include <QList>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGDVSeralDevices: public SWGObject {
public:
SWGDVSeralDevices();
SWGDVSeralDevices(QString* json);
virtual ~SWGDVSeralDevices();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGDVSeralDevices* fromJson(QString &jsonString);
qint32 getNbDevices();
void setNbDevices(qint32 nbDevices);
QList<QString*>* getDvSerialDevices();
void setDvSerialDevices(QList<QString*>* dvSerialDevices);
private:
qint32 nbDevices;
QList<QString*>* dvSerialDevices;
};
} /* namespace Swagger */
#endif /* SWGDVSeralDevices_H_ */

View File

@ -0,0 +1,844 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGDefaultApi.h"
#include "SWGHelpers.h"
#include "SWGModelFactory.h"
#include <QJsonArray>
#include <QJsonDocument>
namespace Swagger {
SWGDefaultApi::SWGDefaultApi() {}
SWGDefaultApi::~SWGDefaultApi() {}
SWGDefaultApi::SWGDefaultApi(QString host, QString basePath) {
this->host = host;
this->basePath = basePath;
}
void
SWGDefaultApi::instanceAudioGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/audio");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceAudioGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceAudioGetCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGAudioDevices* output = static_cast<SWGAudioDevices*>(create(json, QString("SWGAudioDevices")));
worker->deleteLater();
emit instanceAudioGetSignal(output);
}
void
SWGDefaultApi::instanceAudioPatch(SWGAudioDevicesSelect body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/audio");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PATCH");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceAudioPatchCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceAudioPatchCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGAudioDevicesSelect* output = static_cast<SWGAudioDevicesSelect*>(create(json, QString("SWGAudioDevicesSelect")));
worker->deleteLater();
emit instanceAudioPatchSignal(output);
}
void
SWGDefaultApi::instanceChannels(bool tx) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/channels");
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("tx"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(tx)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceChannelsCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceChannelsCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGInstanceChannelsResponse* output = static_cast<SWGInstanceChannelsResponse*>(create(json, QString("SWGInstanceChannelsResponse")));
worker->deleteLater();
emit instanceChannelsSignal(output);
}
void
SWGDefaultApi::instanceDVSerialPatch(bool dvserial) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/dvserial");
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("dvserial"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(dvserial)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PATCH");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDVSerialPatchCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDVSerialPatchCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGDVSeralDevices* output = static_cast<SWGDVSeralDevices*>(create(json, QString("SWGDVSeralDevices")));
worker->deleteLater();
emit instanceDVSerialPatchSignal(output);
}
void
SWGDefaultApi::instanceDeviceSetsDelete() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devicesets");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "DELETE");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDeviceSetsDeleteCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDeviceSetsDeleteCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGDeviceSetList* output = static_cast<SWGDeviceSetList*>(create(json, QString("SWGDeviceSetList")));
worker->deleteLater();
emit instanceDeviceSetsDeleteSignal(output);
}
void
SWGDefaultApi::instanceDeviceSetsGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devicesets");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDeviceSetsGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDeviceSetsGetCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGDeviceSetList* output = static_cast<SWGDeviceSetList*>(create(json, QString("SWGDeviceSetList")));
worker->deleteLater();
emit instanceDeviceSetsGetSignal(output);
}
void
SWGDefaultApi::instanceDeviceSetsPost(bool tx) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devicesets");
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("tx"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(tx)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDeviceSetsPostCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDeviceSetsPostCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGDeviceSet* output = static_cast<SWGDeviceSet*>(create(json, QString("SWGDeviceSet")));
worker->deleteLater();
emit instanceDeviceSetsPostSignal(output);
}
void
SWGDefaultApi::instanceDevices(bool tx) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devices");
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("tx"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(tx)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDevicesCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDevicesCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGInstanceDevicesResponse* output = static_cast<SWGInstanceDevicesResponse*>(create(json, QString("SWGInstanceDevicesResponse")));
worker->deleteLater();
emit instanceDevicesSignal(output);
}
void
SWGDefaultApi::instanceLocationGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/location");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLocationGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLocationGetCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGLocationInformation* output = static_cast<SWGLocationInformation*>(create(json, QString("SWGLocationInformation")));
worker->deleteLater();
emit instanceLocationGetSignal(output);
}
void
SWGDefaultApi::instanceLocationPut(SWGLocationInformation body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/location");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLocationPutCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLocationPutCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGLocationInformation* output = static_cast<SWGLocationInformation*>(create(json, QString("SWGLocationInformation")));
worker->deleteLater();
emit instanceLocationPutSignal(output);
}
void
SWGDefaultApi::instanceLoggingGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/logging");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLoggingGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLoggingGetCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGLoggingInfo* output = static_cast<SWGLoggingInfo*>(create(json, QString("SWGLoggingInfo")));
worker->deleteLater();
emit instanceLoggingGetSignal(output);
}
void
SWGDefaultApi::instanceLoggingPut(SWGLoggingInfo body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/logging");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLoggingPutCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLoggingPutCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGLoggingInfo* output = static_cast<SWGLoggingInfo*>(create(json, QString("SWGLoggingInfo")));
worker->deleteLater();
emit instanceLoggingPutSignal(output);
}
void
SWGDefaultApi::instancePresetDelete(SWGPresetIdentifier body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "DELETE");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetDeleteCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetDeleteCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGPresetIdentifier* output = static_cast<SWGPresetIdentifier*>(create(json, QString("SWGPresetIdentifier")));
worker->deleteLater();
emit instancePresetDeleteSignal(output);
}
void
SWGDefaultApi::instancePresetGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetGetCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGPresets* output = static_cast<SWGPresets*>(create(json, QString("SWGPresets")));
worker->deleteLater();
emit instancePresetGetSignal(output);
}
void
SWGDefaultApi::instancePresetPatch(SWGPresetTransfer body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PATCH");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetPatchCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetPatchCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGPresetIdentifier* output = static_cast<SWGPresetIdentifier*>(create(json, QString("SWGPresetIdentifier")));
worker->deleteLater();
emit instancePresetPatchSignal(output);
}
void
SWGDefaultApi::instancePresetPost(SWGPresetTransfer body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetPostCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetPostCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGPresetIdentifier* output = static_cast<SWGPresetIdentifier*>(create(json, QString("SWGPresetIdentifier")));
worker->deleteLater();
emit instancePresetPostSignal(output);
}
void
SWGDefaultApi::instancePresetPut(SWGPresetTransfer body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetPutCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetPutCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGPresetIdentifier* output = static_cast<SWGPresetIdentifier*>(create(json, QString("SWGPresetIdentifier")));
worker->deleteLater();
emit instancePresetPutSignal(output);
}
void
SWGDefaultApi::instanceSummary() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceSummaryCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceSummaryCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGInstanceSummaryResponse* output = static_cast<SWGInstanceSummaryResponse*>(create(json, QString("SWGInstanceSummaryResponse")));
worker->deleteLater();
emit instanceSummarySignal(output);
}
} /* namespace Swagger */

View File

@ -0,0 +1,121 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _SWG_SWGDefaultApi_H_
#define _SWG_SWGDefaultApi_H_
#include "SWGHttpRequest.h"
#include "SWGErrorResponse.h"
#include "SWGAudioDevices.h"
#include "SWGAudioDevicesSelect.h"
#include "SWGInstanceChannelsResponse.h"
#include "SWGDVSeralDevices.h"
#include "SWGDeviceSetList.h"
#include "SWGDeviceSet.h"
#include "SWGInstanceDevicesResponse.h"
#include "SWGLocationInformation.h"
#include "SWGLoggingInfo.h"
#include "SWGPresetIdentifier.h"
#include "SWGPresets.h"
#include "SWGPresetTransfer.h"
#include "SWGInstanceSummaryResponse.h"
#include <QObject>
namespace Swagger {
class SWGDefaultApi: public QObject {
Q_OBJECT
public:
SWGDefaultApi();
SWGDefaultApi(QString host, QString basePath);
~SWGDefaultApi();
QString host;
QString basePath;
void instanceAudioGet();
void instanceAudioPatch(SWGAudioDevicesSelect body);
void instanceChannels(bool tx);
void instanceDVSerialPatch(bool dvserial);
void instanceDeviceSetsDelete();
void instanceDeviceSetsGet();
void instanceDeviceSetsPost(bool tx);
void instanceDevices(bool tx);
void instanceLocationGet();
void instanceLocationPut(SWGLocationInformation body);
void instanceLoggingGet();
void instanceLoggingPut(SWGLoggingInfo body);
void instancePresetDelete(SWGPresetIdentifier body);
void instancePresetGet();
void instancePresetPatch(SWGPresetTransfer body);
void instancePresetPost(SWGPresetTransfer body);
void instancePresetPut(SWGPresetTransfer body);
void instanceSummary();
private:
void instanceAudioGetCallback (HttpRequestWorker * worker);
void instanceAudioPatchCallback (HttpRequestWorker * worker);
void instanceChannelsCallback (HttpRequestWorker * worker);
void instanceDVSerialPatchCallback (HttpRequestWorker * worker);
void instanceDeviceSetsDeleteCallback (HttpRequestWorker * worker);
void instanceDeviceSetsGetCallback (HttpRequestWorker * worker);
void instanceDeviceSetsPostCallback (HttpRequestWorker * worker);
void instanceDevicesCallback (HttpRequestWorker * worker);
void instanceLocationGetCallback (HttpRequestWorker * worker);
void instanceLocationPutCallback (HttpRequestWorker * worker);
void instanceLoggingGetCallback (HttpRequestWorker * worker);
void instanceLoggingPutCallback (HttpRequestWorker * worker);
void instancePresetDeleteCallback (HttpRequestWorker * worker);
void instancePresetGetCallback (HttpRequestWorker * worker);
void instancePresetPatchCallback (HttpRequestWorker * worker);
void instancePresetPostCallback (HttpRequestWorker * worker);
void instancePresetPutCallback (HttpRequestWorker * worker);
void instanceSummaryCallback (HttpRequestWorker * worker);
signals:
void instanceAudioGetSignal(SWGAudioDevices* summary);
void instanceAudioPatchSignal(SWGAudioDevicesSelect* summary);
void instanceChannelsSignal(SWGInstanceChannelsResponse* summary);
void instanceDVSerialPatchSignal(SWGDVSeralDevices* summary);
void instanceDeviceSetsDeleteSignal(SWGDeviceSetList* summary);
void instanceDeviceSetsGetSignal(SWGDeviceSetList* summary);
void instanceDeviceSetsPostSignal(SWGDeviceSet* summary);
void instanceDevicesSignal(SWGInstanceDevicesResponse* summary);
void instanceLocationGetSignal(SWGLocationInformation* summary);
void instanceLocationPutSignal(SWGLocationInformation* summary);
void instanceLoggingGetSignal(SWGLoggingInfo* summary);
void instanceLoggingPutSignal(SWGLoggingInfo* summary);
void instancePresetDeleteSignal(SWGPresetIdentifier* summary);
void instancePresetGetSignal(SWGPresets* summary);
void instancePresetPatchSignal(SWGPresetIdentifier* summary);
void instancePresetPostSignal(SWGPresetIdentifier* summary);
void instancePresetPutSignal(SWGPresetIdentifier* summary);
void instanceSummarySignal(SWGInstanceSummaryResponse* summary);
};
}
#endif

View File

@ -0,0 +1,182 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGDeviceListItem.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGDeviceListItem::SWGDeviceListItem(QString* json) {
init();
this->fromJson(*json);
}
SWGDeviceListItem::SWGDeviceListItem() {
init();
}
SWGDeviceListItem::~SWGDeviceListItem() {
this->cleanup();
}
void
SWGDeviceListItem::init() {
hwType = new QString("");
tx = false;
nbStreams = NULL;
streamIndex = NULL;
sequence = NULL;
serial = new QString("");
}
void
SWGDeviceListItem::cleanup() {
if(hwType != NULL) {
delete hwType;
}
if(serial != NULL) {
delete serial;
}
}
SWGDeviceListItem*
SWGDeviceListItem::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGDeviceListItem::fromJsonObject(QJsonObject &pJson) {
setValue(&hwType, pJson["hwType"], "QString", "QString");
setValue(&tx, pJson["tx"], "bool", "");
setValue(&nbStreams, pJson["nbStreams"], "qint32", "");
setValue(&streamIndex, pJson["streamIndex"], "qint32", "");
setValue(&sequence, pJson["sequence"], "qint32", "");
setValue(&serial, pJson["serial"], "QString", "QString");
}
QString
SWGDeviceListItem::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGDeviceListItem::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("hwType"), hwType, obj, QString("QString"));
obj->insert("tx", QJsonValue(tx));
obj->insert("nbStreams", QJsonValue(nbStreams));
obj->insert("streamIndex", QJsonValue(streamIndex));
obj->insert("sequence", QJsonValue(sequence));
toJsonValue(QString("serial"), serial, obj, QString("QString"));
return obj;
}
QString*
SWGDeviceListItem::getHwType() {
return hwType;
}
void
SWGDeviceListItem::setHwType(QString* hwType) {
this->hwType = hwType;
}
bool
SWGDeviceListItem::getTx() {
return tx;
}
void
SWGDeviceListItem::setTx(bool tx) {
this->tx = tx;
}
qint32
SWGDeviceListItem::getNbStreams() {
return nbStreams;
}
void
SWGDeviceListItem::setNbStreams(qint32 nbStreams) {
this->nbStreams = nbStreams;
}
qint32
SWGDeviceListItem::getStreamIndex() {
return streamIndex;
}
void
SWGDeviceListItem::setStreamIndex(qint32 streamIndex) {
this->streamIndex = streamIndex;
}
qint32
SWGDeviceListItem::getSequence() {
return sequence;
}
void
SWGDeviceListItem::setSequence(qint32 sequence) {
this->sequence = sequence;
}
QString*
SWGDeviceListItem::getSerial() {
return serial;
}
void
SWGDeviceListItem::setSerial(QString* serial) {
this->serial = serial;
}
} /* namespace Swagger */

View File

@ -0,0 +1,81 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGDeviceListItem.h
*
* Summarized information about attached hardware device
*/
#ifndef SWGDeviceListItem_H_
#define SWGDeviceListItem_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGDeviceListItem: public SWGObject {
public:
SWGDeviceListItem();
SWGDeviceListItem(QString* json);
virtual ~SWGDeviceListItem();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGDeviceListItem* fromJson(QString &jsonString);
QString* getHwType();
void setHwType(QString* hwType);
bool getTx();
void setTx(bool tx);
qint32 getNbStreams();
void setNbStreams(qint32 nbStreams);
qint32 getStreamIndex();
void setStreamIndex(qint32 streamIndex);
qint32 getSequence();
void setSequence(qint32 sequence);
QString* getSerial();
void setSerial(QString* serial);
private:
QString* hwType;
bool tx;
qint32 nbStreams;
qint32 streamIndex;
qint32 sequence;
QString* serial;
};
} /* namespace Swagger */
#endif /* SWGDeviceListItem_H_ */

View File

@ -0,0 +1,150 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGDeviceSet.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGDeviceSet::SWGDeviceSet(QString* json) {
init();
this->fromJson(*json);
}
SWGDeviceSet::SWGDeviceSet() {
init();
}
SWGDeviceSet::~SWGDeviceSet() {
this->cleanup();
}
void
SWGDeviceSet::init() {
samplingDevice = new SWGSamplingDevice();
channelcount = NULL;
channels = new QList<SWGChannel*>();
}
void
SWGDeviceSet::cleanup() {
if(samplingDevice != NULL) {
delete samplingDevice;
}
if(channels != NULL) {
QList<SWGChannel*>* arr = channels;
foreach(SWGChannel* o, *arr) {
delete o;
}
delete channels;
}
}
SWGDeviceSet*
SWGDeviceSet::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGDeviceSet::fromJsonObject(QJsonObject &pJson) {
setValue(&samplingDevice, pJson["samplingDevice"], "SWGSamplingDevice", "SWGSamplingDevice");
setValue(&channelcount, pJson["channelcount"], "qint32", "");
setValue(&channels, pJson["channels"], "QList", "SWGChannel");
}
QString
SWGDeviceSet::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGDeviceSet::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("samplingDevice"), samplingDevice, obj, QString("SWGSamplingDevice"));
obj->insert("channelcount", QJsonValue(channelcount));
QList<SWGChannel*>* channelsList = channels;
QJsonArray channelsJsonArray;
toJsonArray((QList<void*>*)channels, &channelsJsonArray, "channels", "SWGChannel");
obj->insert("channels", channelsJsonArray);
return obj;
}
SWGSamplingDevice*
SWGDeviceSet::getSamplingDevice() {
return samplingDevice;
}
void
SWGDeviceSet::setSamplingDevice(SWGSamplingDevice* samplingDevice) {
this->samplingDevice = samplingDevice;
}
qint32
SWGDeviceSet::getChannelcount() {
return channelcount;
}
void
SWGDeviceSet::setChannelcount(qint32 channelcount) {
this->channelcount = channelcount;
}
QList<SWGChannel*>*
SWGDeviceSet::getChannels() {
return channels;
}
void
SWGDeviceSet::setChannels(QList<SWGChannel*>* channels) {
this->channels = channels;
}
} /* namespace Swagger */

View File

@ -0,0 +1,74 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGDeviceSet.h
*
* Sampling device and its associated channels
*/
#ifndef SWGDeviceSet_H_
#define SWGDeviceSet_H_
#include <QJsonObject>
#include "SWGChannel.h"
#include "SWGSamplingDevice.h"
#include <QList>
#include "SWGObject.h"
namespace Swagger {
class SWGDeviceSet: public SWGObject {
public:
SWGDeviceSet();
SWGDeviceSet(QString* json);
virtual ~SWGDeviceSet();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGDeviceSet* fromJson(QString &jsonString);
SWGSamplingDevice* getSamplingDevice();
void setSamplingDevice(SWGSamplingDevice* samplingDevice);
qint32 getChannelcount();
void setChannelcount(qint32 channelcount);
QList<SWGChannel*>* getChannels();
void setChannels(QList<SWGChannel*>* channels);
private:
SWGSamplingDevice* samplingDevice;
qint32 channelcount;
QList<SWGChannel*>* channels;
};
} /* namespace Swagger */
#endif /* SWGDeviceSet_H_ */

View File

@ -0,0 +1,131 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGDeviceSetList.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGDeviceSetList::SWGDeviceSetList(QString* json) {
init();
this->fromJson(*json);
}
SWGDeviceSetList::SWGDeviceSetList() {
init();
}
SWGDeviceSetList::~SWGDeviceSetList() {
this->cleanup();
}
void
SWGDeviceSetList::init() {
devicesetcount = NULL;
deviceSets = new QList<SWGDeviceSet*>();
}
void
SWGDeviceSetList::cleanup() {
if(deviceSets != NULL) {
QList<SWGDeviceSet*>* arr = deviceSets;
foreach(SWGDeviceSet* o, *arr) {
delete o;
}
delete deviceSets;
}
}
SWGDeviceSetList*
SWGDeviceSetList::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGDeviceSetList::fromJsonObject(QJsonObject &pJson) {
setValue(&devicesetcount, pJson["devicesetcount"], "qint32", "");
setValue(&deviceSets, pJson["deviceSets"], "QList", "SWGDeviceSet");
}
QString
SWGDeviceSetList::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGDeviceSetList::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("devicesetcount", QJsonValue(devicesetcount));
QList<SWGDeviceSet*>* deviceSetsList = deviceSets;
QJsonArray deviceSetsJsonArray;
toJsonArray((QList<void*>*)deviceSets, &deviceSetsJsonArray, "deviceSets", "SWGDeviceSet");
obj->insert("deviceSets", deviceSetsJsonArray);
return obj;
}
qint32
SWGDeviceSetList::getDevicesetcount() {
return devicesetcount;
}
void
SWGDeviceSetList::setDevicesetcount(qint32 devicesetcount) {
this->devicesetcount = devicesetcount;
}
QList<SWGDeviceSet*>*
SWGDeviceSetList::getDeviceSets() {
return deviceSets;
}
void
SWGDeviceSetList::setDeviceSets(QList<SWGDeviceSet*>* deviceSets) {
this->deviceSets = deviceSets;
}
} /* namespace Swagger */

View File

@ -0,0 +1,70 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGDeviceSetList.h
*
* List of device sets opened in this instance
*/
#ifndef SWGDeviceSetList_H_
#define SWGDeviceSetList_H_
#include <QJsonObject>
#include "SWGDeviceSet.h"
#include <QList>
#include "SWGObject.h"
namespace Swagger {
class SWGDeviceSetList: public SWGObject {
public:
SWGDeviceSetList();
SWGDeviceSetList(QString* json);
virtual ~SWGDeviceSetList();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGDeviceSetList* fromJson(QString &jsonString);
qint32 getDevicesetcount();
void setDevicesetcount(qint32 devicesetcount);
QList<SWGDeviceSet*>* getDeviceSets();
void setDeviceSets(QList<SWGDeviceSet*>* deviceSets);
private:
qint32 devicesetcount;
QList<SWGDeviceSet*>* deviceSets;
};
} /* namespace Swagger */
#endif /* SWGDeviceSetList_H_ */

View File

@ -0,0 +1,111 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGErrorResponse.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGErrorResponse::SWGErrorResponse(QString* json) {
init();
this->fromJson(*json);
}
SWGErrorResponse::SWGErrorResponse() {
init();
}
SWGErrorResponse::~SWGErrorResponse() {
this->cleanup();
}
void
SWGErrorResponse::init() {
message = new QString("");
}
void
SWGErrorResponse::cleanup() {
if(message != NULL) {
delete message;
}
}
SWGErrorResponse*
SWGErrorResponse::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGErrorResponse::fromJsonObject(QJsonObject &pJson) {
setValue(&message, pJson["message"], "QString", "QString");
}
QString
SWGErrorResponse::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGErrorResponse::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("message"), message, obj, QString("QString"));
return obj;
}
QString*
SWGErrorResponse::getMessage() {
return message;
}
void
SWGErrorResponse::setMessage(QString* message) {
this->message = message;
}
} /* namespace Swagger */

View File

@ -0,0 +1,66 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGErrorResponse.h
*
*
*/
#ifndef SWGErrorResponse_H_
#define SWGErrorResponse_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGErrorResponse: public SWGObject {
public:
SWGErrorResponse();
SWGErrorResponse(QString* json);
virtual ~SWGErrorResponse();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGErrorResponse* fromJson(QString &jsonString);
QString* getMessage();
void setMessage(QString* message);
private:
QString* message;
};
} /* namespace Swagger */
#endif /* SWGErrorResponse_H_ */

View File

@ -0,0 +1,305 @@
#include <QDateTime>
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGHelpers.h"
#include "SWGModelFactory.h"
#include "SWGObject.h"
#include <QDebug>
#include <QJsonArray>
#include <QJsonValue>
namespace Swagger {
void
setValue(void* value, QJsonValue obj, QString type, QString complexType) {
if(value == NULL) {
// can't set value with a null pointer
return;
}
if(QStringLiteral("bool").compare(type) == 0) {
bool * val = static_cast<bool*>(value);
*val = obj.toBool();
}
else if(QStringLiteral("qint32").compare(type) == 0) {
qint32 *val = static_cast<qint32*>(value);
*val = obj.toInt();
}
else if(QStringLiteral("qint64").compare(type) == 0) {
qint64 *val = static_cast<qint64*>(value);
*val = obj.toVariant().toLongLong();
}
else if(QStringLiteral("float").compare(type) == 0) {
float *val = static_cast<float*>(value);
*val = obj.toDouble();
}
else if(QStringLiteral("double").compare(type) == 0) {
double *val = static_cast<double*>(value);
*val = obj.toDouble();
}
else if (QStringLiteral("QString").compare(type) == 0) {
QString **val = static_cast<QString**>(value);
if(val != NULL) {
if(!obj.isNull()) {
// create a new value and return
delete *val;
*val = new QString(obj.toString());
return;
}
else {
// set target to NULL
delete *val;
*val = NULL;
}
}
else {
qDebug() << "Can't set value because the target pointer is NULL";
}
}
else if (QStringLiteral("QDateTime").compare(type) == 0) {
QDateTime **val = static_cast<QDateTime**>(value);
if(val != NULL) {
if(!obj.isNull()) {
// create a new value and return
delete *val;
*val = new QDateTime(QDateTime::fromString(obj.toString(), Qt::ISODate));
return;
}
else {
// set target to NULL
delete *val;
*val = NULL;
}
}
else {
qDebug() << "Can't set value because the target pointer is NULL";
}
}
else if (QStringLiteral("QDate").compare(type) == 0) {
QDate **val = static_cast<QDate**>(value);
if(val != NULL) {
if(!obj.isNull()) {
// create a new value and return
delete *val;
*val = new QDate(QDate::fromString(obj.toString(), Qt::ISODate));
return;
}
else {
// set target to NULL
delete *val;
*val = NULL;
}
}
else {
qDebug() << "Can't set value because the target pointer is NULL";
}
}
else if (QStringLiteral("QByteArray").compare(type) == 0) {
QByteArray **val = static_cast<QByteArray**>(value);
if(val != NULL) {
if(!obj.isNull()) {
// create a new value and return
delete *val;
*val = new QByteArray(QByteArray::fromBase64(QByteArray::fromStdString(obj.toString().toStdString())));
return;
}
else {
// set target to NULL
delete *val;
*val = NULL;
}
}
else {
qDebug() << "Can't set value because the target pointer is NULL";
}
}
else if(type.startsWith("SWG") && obj.isObject()) {
// complex type
QJsonObject jsonObj = obj.toObject();
SWGObject * so = (SWGObject*)Swagger::create(type);
if(so != NULL) {
so->fromJsonObject(jsonObj);
SWGObject **val = static_cast<SWGObject**>(value);
delete *val;
*val = so;
}
}
else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) {
// list of values
QList<void*>* output = new QList<void*>();
QJsonArray arr = obj.toArray();
foreach (const QJsonValue & jval, arr) {
if(complexType.startsWith("SWG")) {
// it's an object
SWGObject * val = (SWGObject*)create(complexType);
QJsonObject t = jval.toObject();
val->fromJsonObject(t);
output->append(val);
}
else {
// primitives
if(QStringLiteral("qint32").compare(complexType) == 0) {
qint32 val;
setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral(""));
output->append((void*)&val);
}
else if(QStringLiteral("qint64").compare(complexType) == 0) {
qint64 val;
setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral(""));
output->append((void*)&val);
}
else if(QStringLiteral("bool").compare(complexType) == 0) {
bool val;
setValue(&val, jval, QStringLiteral("bool"), QStringLiteral(""));
output->append((void*)&val);
}
else if(QStringLiteral("float").compare(complexType) == 0) {
float val;
setValue(&val, jval, QStringLiteral("float"), QStringLiteral(""));
output->append((void*)&val);
}
else if(QStringLiteral("double").compare(complexType) == 0) {
double val;
setValue(&val, jval, QStringLiteral("double"), QStringLiteral(""));
output->append((void*)&val);
}
else if(QStringLiteral("QString").compare(complexType) == 0) {
QString val;
setValue(&val, jval, QStringLiteral("QString"), QStringLiteral(""));
output->append((void*)&val);
}
else if(QStringLiteral("QDate").compare(complexType) == 0) {
QDate val;
setValue(&val, jval, QStringLiteral("QDate"), QStringLiteral(""));
output->append((void*)&val);
}
else if(QStringLiteral("QDateTime").compare(complexType) == 0) {
QDateTime val;
setValue(&val, jval, QStringLiteral("QDateTime"), QStringLiteral(""));
output->append((void*)&val);
}
}
}
QList<void*> **val = static_cast<QList<void*>**>(value);
delete *val;
*val = output;
}
}
void
toJsonValue(QString name, void* value, QJsonObject* output, QString type) {
if(value == NULL) {
return;
}
if(type.startsWith("SWG")) {
SWGObject *swgObject = reinterpret_cast<SWGObject *>(value);
if(swgObject != NULL) {
QJsonObject* o = (*swgObject).asJsonObject();
if(name != NULL) {
output->insert(name, *o);
delete o;
}
else {
output->empty();
foreach(QString key, o->keys()) {
output->insert(key, o->value(key));
}
}
}
}
else if(QStringLiteral("QString").compare(type) == 0) {
QString* str = static_cast<QString*>(value);
output->insert(name, QJsonValue(*str));
}
else if(QStringLiteral("qint32").compare(type) == 0) {
qint32* str = static_cast<qint32*>(value);
output->insert(name, QJsonValue(*str));
}
else if(QStringLiteral("qint64").compare(type) == 0) {
qint64* str = static_cast<qint64*>(value);
output->insert(name, QJsonValue(*str));
}
else if(QStringLiteral("bool").compare(type) == 0) {
bool* str = static_cast<bool*>(value);
output->insert(name, QJsonValue(*str));
}
else if(QStringLiteral("float").compare(type) == 0) {
float* str = static_cast<float*>(value);
output->insert(name, QJsonValue((double)*str));
}
else if(QStringLiteral("double").compare(type) == 0) {
double* str = static_cast<double*>(value);
output->insert(name, QJsonValue(*str));
}
else if(QStringLiteral("QDate").compare(type) == 0) {
QDate* date = static_cast<QDate*>(value);
output->insert(name, QJsonValue(date->toString(Qt::ISODate)));
}
else if(QStringLiteral("QDateTime").compare(type) == 0) {
QDateTime* datetime = static_cast<QDateTime*>(value);
output->insert(name, QJsonValue(datetime->toString(Qt::ISODate)));
}
else if(QStringLiteral("QByteArray").compare(type) == 0) {
QByteArray* byteArray = static_cast<QByteArray*>(value);
output->insert(name, QJsonValue(QString(byteArray->toBase64())));
}
}
void
toJsonArray(QList<void*>* value, QJsonArray* output, QString innerName, QString innerType) {
foreach(void* obj, *value) {
QJsonObject element;
toJsonValue(NULL, obj, &element, innerType);
output->append(element);
}
}
QString
stringValue(QString* value) {
QString* str = static_cast<QString*>(value);
return QString(*str);
}
QString
stringValue(qint32 value) {
return QString::number(value);
}
QString
stringValue(qint64 value) {
return QString::number(value);
}
QString
stringValue(bool value) {
return QString(value ? "true" : "false");
}
} /* namespace Swagger */

View File

@ -0,0 +1,41 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef SWGHELPERS_H
#define SWGHELPERS_H
#include <QJsonValue>
namespace Swagger {
void setValue(void* value, QJsonValue obj, QString type, QString complexType);
void toJsonArray(QList<void*>* value, QJsonArray* output, QString innerName, QString innerType);
void toJsonValue(QString name, void* value, QJsonObject* output, QString type);
bool isCompatibleJsonValue(QString type);
QString stringValue(QString* value);
QString stringValue(qint32 value);
QString stringValue(qint64 value);
QString stringValue(bool value);
}
#endif // SWGHELPERS_H

View File

@ -0,0 +1,323 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGHttpRequest.h"
#include <QDateTime>
#include <QUrl>
#include <QFileInfo>
#include <QBuffer>
HttpRequestInput::HttpRequestInput() {
initialize();
}
HttpRequestInput::HttpRequestInput(QString v_url_str, QString v_http_method) {
initialize();
url_str = v_url_str;
http_method = v_http_method;
}
void HttpRequestInput::initialize() {
var_layout = NOT_SET;
url_str = "";
http_method = "GET";
}
void HttpRequestInput::add_var(QString key, QString value) {
vars[key] = value;
}
void HttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) {
SWGHttpRequestInputFileElement file;
file.variable_name = variable_name;
file.local_filename = local_filename;
file.request_filename = request_filename;
file.mime_type = mime_type;
files.append(file);
}
HttpRequestWorker::HttpRequestWorker(QObject *parent)
: QObject(parent), manager(NULL)
{
qsrand(QDateTime::currentDateTime().toTime_t());
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(on_manager_finished(QNetworkReply*)));
}
HttpRequestWorker::~HttpRequestWorker() {
}
QString HttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) {
// result structure follows RFC 5987
bool need_utf_encoding = false;
QString result = "";
QByteArray input_c = input.toLocal8Bit();
char c;
for (int i = 0; i < input_c.length(); i++) {
c = input_c.at(i);
if (c == '\\' || c == '/' || c == '\0' || c < ' ' || c > '~') {
// ignore and request utf-8 version
need_utf_encoding = true;
}
else if (c == '"') {
result += "\\\"";
}
else {
result += c;
}
}
if (result.length() == 0) {
need_utf_encoding = true;
}
if (!need_utf_encoding) {
// return simple version
return QString("%1=\"%2\"").arg(attribute_name, result);
}
QString result_utf8 = "";
for (int i = 0; i < input_c.length(); i++) {
c = input_c.at(i);
if (
(c >= '0' && c <= '9')
|| (c >= 'A' && c <= 'Z')
|| (c >= 'a' && c <= 'z')
) {
result_utf8 += c;
}
else {
result_utf8 += "%" + QString::number(static_cast<unsigned char>(input_c.at(i)), 16).toUpper();
}
}
// return enhanced version with UTF-8 support
return QString("%1=\"%2\"; %1*=utf-8''%3").arg(attribute_name, result, result_utf8);
}
void HttpRequestWorker::execute(HttpRequestInput *input) {
// reset variables
QByteArray request_content = "";
response = "";
error_type = QNetworkReply::NoError;
error_str = "";
bool isFormData = false;
// decide on the variable layout
if (input->files.length() > 0) {
input->var_layout = MULTIPART;
}
if (input->var_layout == NOT_SET) {
input->var_layout = input->http_method == "GET" || input->http_method == "HEAD" ? ADDRESS : URL_ENCODED;
}
// prepare request content
QString boundary = "";
if (input->var_layout == ADDRESS || input->var_layout == URL_ENCODED) {
// variable layout is ADDRESS or URL_ENCODED
if (input->vars.count() > 0) {
bool first = true;
isFormData = true;
foreach (QString key, input->vars.keys()) {
if (!first) {
request_content.append("&");
}
first = false;
request_content.append(QUrl::toPercentEncoding(key));
request_content.append("=");
request_content.append(QUrl::toPercentEncoding(input->vars.value(key)));
}
if (input->var_layout == ADDRESS) {
input->url_str += "?" + request_content;
request_content = "";
}
}
}
else {
// variable layout is MULTIPART
boundary = "__-----------------------"
+ QString::number(QDateTime::currentDateTime().toTime_t())
+ QString::number(qrand());
QString boundary_delimiter = "--";
QString new_line = "\r\n";
// add variables
foreach (QString key, input->vars.keys()) {
// add boundary
request_content.append(boundary_delimiter);
request_content.append(boundary);
request_content.append(new_line);
// add header
request_content.append("Content-Disposition: form-data; ");
request_content.append(http_attribute_encode("name", key));
request_content.append(new_line);
request_content.append("Content-Type: text/plain");
request_content.append(new_line);
// add header to body splitter
request_content.append(new_line);
// add variable content
request_content.append(input->vars.value(key));
request_content.append(new_line);
}
// add files
for (QList<SWGHttpRequestInputFileElement>::iterator file_info = input->files.begin(); file_info != input->files.end(); file_info++) {
QFileInfo fi(file_info->local_filename);
// ensure necessary variables are available
if (
file_info->local_filename == NULL || file_info->local_filename.isEmpty()
|| file_info->variable_name == NULL || file_info->variable_name.isEmpty()
|| !fi.exists() || !fi.isFile() || !fi.isReadable()
) {
// silent abort for the current file
continue;
}
QFile file(file_info->local_filename);
if (!file.open(QIODevice::ReadOnly)) {
// silent abort for the current file
continue;
}
// ensure filename for the request
if (file_info->request_filename == NULL || file_info->request_filename.isEmpty()) {
file_info->request_filename = fi.fileName();
if (file_info->request_filename.isEmpty()) {
file_info->request_filename = "file";
}
}
// add boundary
request_content.append(boundary_delimiter);
request_content.append(boundary);
request_content.append(new_line);
// add header
request_content.append(QString("Content-Disposition: form-data; %1; %2").arg(
http_attribute_encode("name", file_info->variable_name),
http_attribute_encode("filename", file_info->request_filename)
));
request_content.append(new_line);
if (file_info->mime_type != NULL && !file_info->mime_type.isEmpty()) {
request_content.append("Content-Type: ");
request_content.append(file_info->mime_type);
request_content.append(new_line);
}
request_content.append("Content-Transfer-Encoding: binary");
request_content.append(new_line);
// add header to body splitter
request_content.append(new_line);
// add file content
request_content.append(file.readAll());
request_content.append(new_line);
file.close();
}
// add end of body
request_content.append(boundary_delimiter);
request_content.append(boundary);
request_content.append(boundary_delimiter);
}
if(input->request_body.size() > 0) {
qDebug() << "got a request body";
request_content.clear();
request_content.append(input->request_body);
}
// prepare connection
QNetworkRequest request = QNetworkRequest(QUrl(input->url_str));
request.setRawHeader("User-Agent", "Swagger-Client");
foreach(QString key, input->headers.keys()) {
request.setRawHeader(key.toStdString().c_str(), input->headers.value(key).toStdString().c_str());
}
if (request_content.size() > 0 && !isFormData) {
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
}
else if (input->var_layout == URL_ENCODED) {
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
}
else if (input->var_layout == MULTIPART) {
request.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=" + boundary);
}
if (input->http_method == "GET") {
manager->get(request);
}
else if (input->http_method == "POST") {
manager->post(request, request_content);
}
else if (input->http_method == "PUT") {
manager->put(request, request_content);
}
else if (input->http_method == "HEAD") {
manager->head(request);
}
else if (input->http_method == "DELETE") {
manager->deleteResource(request);
}
else {
QBuffer buff(&request_content);
manager->sendCustomRequest(request, input->http_method.toLatin1(), &buff);
}
}
void HttpRequestWorker::on_manager_finished(QNetworkReply *reply) {
error_type = reply->error();
if (error_type == QNetworkReply::NoError) {
response = reply->readAll();
}
else {
error_str = reply->errorString();
}
reply->deleteLater();
emit on_execution_finished(this);
}

View File

@ -0,0 +1,99 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Based on http://www.creativepulse.gr/en/blog/2014/restful-api-requests-using-qt-cpp-for-linux-mac-osx-ms-windows
* By Alex Stylianos
*
**/
#ifndef HTTPREQUESTWORKER_H
#define HTTPREQUESTWORKER_H
#include <QObject>
#include <QString>
#include <QMap>
#include <QNetworkAccessManager>
#include <QNetworkReply>
enum HttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART};
class SWGHttpRequestInputFileElement {
public:
QString variable_name;
QString local_filename;
QString request_filename;
QString mime_type;
};
class HttpRequestInput {
public:
QString url_str;
QString http_method;
HttpRequestVarLayout var_layout;
QMap<QString, QString> vars;
QMap<QString, QString> headers;
QList<SWGHttpRequestInputFileElement> files;
QByteArray request_body;
HttpRequestInput();
HttpRequestInput(QString v_url_str, QString v_http_method);
void initialize();
void add_var(QString key, QString value);
void add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type);
};
class HttpRequestWorker : public QObject {
Q_OBJECT
public:
QByteArray response;
QNetworkReply::NetworkError error_type;
QString error_str;
explicit HttpRequestWorker(QObject *parent = 0);
virtual ~HttpRequestWorker();
QString http_attribute_encode(QString attribute_name, QString input);
void execute(HttpRequestInput *input);
signals:
void on_execution_finished(HttpRequestWorker *worker);
private:
QNetworkAccessManager *manager;
private slots:
void on_manager_finished(QNetworkReply *reply);
};
#endif // HTTPREQUESTWORKER_H

View File

@ -0,0 +1,131 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGInstanceChannelsResponse.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGInstanceChannelsResponse::SWGInstanceChannelsResponse(QString* json) {
init();
this->fromJson(*json);
}
SWGInstanceChannelsResponse::SWGInstanceChannelsResponse() {
init();
}
SWGInstanceChannelsResponse::~SWGInstanceChannelsResponse() {
this->cleanup();
}
void
SWGInstanceChannelsResponse::init() {
channelcount = NULL;
channels = new QList<SWGChannelListItem*>();
}
void
SWGInstanceChannelsResponse::cleanup() {
if(channels != NULL) {
QList<SWGChannelListItem*>* arr = channels;
foreach(SWGChannelListItem* o, *arr) {
delete o;
}
delete channels;
}
}
SWGInstanceChannelsResponse*
SWGInstanceChannelsResponse::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGInstanceChannelsResponse::fromJsonObject(QJsonObject &pJson) {
setValue(&channelcount, pJson["channelcount"], "qint32", "");
setValue(&channels, pJson["channels"], "QList", "SWGChannelListItem");
}
QString
SWGInstanceChannelsResponse::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGInstanceChannelsResponse::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("channelcount", QJsonValue(channelcount));
QList<SWGChannelListItem*>* channelsList = channels;
QJsonArray channelsJsonArray;
toJsonArray((QList<void*>*)channels, &channelsJsonArray, "channels", "SWGChannelListItem");
obj->insert("channels", channelsJsonArray);
return obj;
}
qint32
SWGInstanceChannelsResponse::getChannelcount() {
return channelcount;
}
void
SWGInstanceChannelsResponse::setChannelcount(qint32 channelcount) {
this->channelcount = channelcount;
}
QList<SWGChannelListItem*>*
SWGInstanceChannelsResponse::getChannels() {
return channels;
}
void
SWGInstanceChannelsResponse::setChannels(QList<SWGChannelListItem*>* channels) {
this->channels = channels;
}
} /* namespace Swagger */

View File

@ -0,0 +1,70 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGInstanceChannelsResponse.h
*
* Summarized information about channel plugins available in this SDRangel instance
*/
#ifndef SWGInstanceChannelsResponse_H_
#define SWGInstanceChannelsResponse_H_
#include <QJsonObject>
#include "SWGChannelListItem.h"
#include <QList>
#include "SWGObject.h"
namespace Swagger {
class SWGInstanceChannelsResponse: public SWGObject {
public:
SWGInstanceChannelsResponse();
SWGInstanceChannelsResponse(QString* json);
virtual ~SWGInstanceChannelsResponse();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGInstanceChannelsResponse* fromJson(QString &jsonString);
qint32 getChannelcount();
void setChannelcount(qint32 channelcount);
QList<SWGChannelListItem*>* getChannels();
void setChannels(QList<SWGChannelListItem*>* channels);
private:
qint32 channelcount;
QList<SWGChannelListItem*>* channels;
};
} /* namespace Swagger */
#endif /* SWGInstanceChannelsResponse_H_ */

View File

@ -0,0 +1,131 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGInstanceDevicesResponse.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGInstanceDevicesResponse::SWGInstanceDevicesResponse(QString* json) {
init();
this->fromJson(*json);
}
SWGInstanceDevicesResponse::SWGInstanceDevicesResponse() {
init();
}
SWGInstanceDevicesResponse::~SWGInstanceDevicesResponse() {
this->cleanup();
}
void
SWGInstanceDevicesResponse::init() {
devicecount = NULL;
devices = new QList<SWGDeviceListItem*>();
}
void
SWGInstanceDevicesResponse::cleanup() {
if(devices != NULL) {
QList<SWGDeviceListItem*>* arr = devices;
foreach(SWGDeviceListItem* o, *arr) {
delete o;
}
delete devices;
}
}
SWGInstanceDevicesResponse*
SWGInstanceDevicesResponse::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGInstanceDevicesResponse::fromJsonObject(QJsonObject &pJson) {
setValue(&devicecount, pJson["devicecount"], "qint32", "");
setValue(&devices, pJson["devices"], "QList", "SWGDeviceListItem");
}
QString
SWGInstanceDevicesResponse::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGInstanceDevicesResponse::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("devicecount", QJsonValue(devicecount));
QList<SWGDeviceListItem*>* devicesList = devices;
QJsonArray devicesJsonArray;
toJsonArray((QList<void*>*)devices, &devicesJsonArray, "devices", "SWGDeviceListItem");
obj->insert("devices", devicesJsonArray);
return obj;
}
qint32
SWGInstanceDevicesResponse::getDevicecount() {
return devicecount;
}
void
SWGInstanceDevicesResponse::setDevicecount(qint32 devicecount) {
this->devicecount = devicecount;
}
QList<SWGDeviceListItem*>*
SWGInstanceDevicesResponse::getDevices() {
return devices;
}
void
SWGInstanceDevicesResponse::setDevices(QList<SWGDeviceListItem*>* devices) {
this->devices = devices;
}
} /* namespace Swagger */

View File

@ -0,0 +1,70 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGInstanceDevicesResponse.h
*
* Summarized information about logical devices from hardware devices attached to this SDRangel instance
*/
#ifndef SWGInstanceDevicesResponse_H_
#define SWGInstanceDevicesResponse_H_
#include <QJsonObject>
#include "SWGDeviceListItem.h"
#include <QList>
#include "SWGObject.h"
namespace Swagger {
class SWGInstanceDevicesResponse: public SWGObject {
public:
SWGInstanceDevicesResponse();
SWGInstanceDevicesResponse(QString* json);
virtual ~SWGInstanceDevicesResponse();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGInstanceDevicesResponse* fromJson(QString &jsonString);
qint32 getDevicecount();
void setDevicecount(qint32 devicecount);
QList<SWGDeviceListItem*>* getDevices();
void setDevices(QList<SWGDeviceListItem*>* devices);
private:
qint32 devicecount;
QList<SWGDeviceListItem*>* devices;
};
} /* namespace Swagger */
#endif /* SWGInstanceDevicesResponse_H_ */

View File

@ -0,0 +1,168 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGInstanceSummaryResponse.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGInstanceSummaryResponse::SWGInstanceSummaryResponse(QString* json) {
init();
this->fromJson(*json);
}
SWGInstanceSummaryResponse::SWGInstanceSummaryResponse() {
init();
}
SWGInstanceSummaryResponse::~SWGInstanceSummaryResponse() {
this->cleanup();
}
void
SWGInstanceSummaryResponse::init() {
version = new QString("");
logging = new SWGLoggingInfo();
devicesetlist = new SWGDeviceSetList();
user = new SWGUser();
}
void
SWGInstanceSummaryResponse::cleanup() {
if(version != NULL) {
delete version;
}
if(logging != NULL) {
delete logging;
}
if(devicesetlist != NULL) {
delete devicesetlist;
}
if(user != NULL) {
delete user;
}
}
SWGInstanceSummaryResponse*
SWGInstanceSummaryResponse::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGInstanceSummaryResponse::fromJsonObject(QJsonObject &pJson) {
setValue(&version, pJson["version"], "QString", "QString");
setValue(&logging, pJson["logging"], "SWGLoggingInfo", "SWGLoggingInfo");
setValue(&devicesetlist, pJson["devicesetlist"], "SWGDeviceSetList", "SWGDeviceSetList");
setValue(&user, pJson["user"], "SWGUser", "SWGUser");
}
QString
SWGInstanceSummaryResponse::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGInstanceSummaryResponse::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("version"), version, obj, QString("QString"));
toJsonValue(QString("logging"), logging, obj, QString("SWGLoggingInfo"));
toJsonValue(QString("devicesetlist"), devicesetlist, obj, QString("SWGDeviceSetList"));
toJsonValue(QString("user"), user, obj, QString("SWGUser"));
return obj;
}
QString*
SWGInstanceSummaryResponse::getVersion() {
return version;
}
void
SWGInstanceSummaryResponse::setVersion(QString* version) {
this->version = version;
}
SWGLoggingInfo*
SWGInstanceSummaryResponse::getLogging() {
return logging;
}
void
SWGInstanceSummaryResponse::setLogging(SWGLoggingInfo* logging) {
this->logging = logging;
}
SWGDeviceSetList*
SWGInstanceSummaryResponse::getDevicesetlist() {
return devicesetlist;
}
void
SWGInstanceSummaryResponse::setDevicesetlist(SWGDeviceSetList* devicesetlist) {
this->devicesetlist = devicesetlist;
}
SWGUser*
SWGInstanceSummaryResponse::getUser() {
return user;
}
void
SWGInstanceSummaryResponse::setUser(SWGUser* user) {
this->user = user;
}
} /* namespace Swagger */

View File

@ -0,0 +1,78 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGInstanceSummaryResponse.h
*
* Summarized information about this SDRangel instance
*/
#ifndef SWGInstanceSummaryResponse_H_
#define SWGInstanceSummaryResponse_H_
#include <QJsonObject>
#include "SWGDeviceSetList.h"
#include "SWGLoggingInfo.h"
#include "SWGUser.h"
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGInstanceSummaryResponse: public SWGObject {
public:
SWGInstanceSummaryResponse();
SWGInstanceSummaryResponse(QString* json);
virtual ~SWGInstanceSummaryResponse();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGInstanceSummaryResponse* fromJson(QString &jsonString);
QString* getVersion();
void setVersion(QString* version);
SWGLoggingInfo* getLogging();
void setLogging(SWGLoggingInfo* logging);
SWGDeviceSetList* getDevicesetlist();
void setDevicesetlist(SWGDeviceSetList* devicesetlist);
SWGUser* getUser();
void setUser(SWGUser* user);
private:
QString* version;
SWGLoggingInfo* logging;
SWGDeviceSetList* devicesetlist;
SWGUser* user;
};
} /* namespace Swagger */
#endif /* SWGInstanceSummaryResponse_H_ */

View File

@ -0,0 +1,118 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGLocationInformation.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGLocationInformation::SWGLocationInformation(QString* json) {
init();
this->fromJson(*json);
}
SWGLocationInformation::SWGLocationInformation() {
init();
}
SWGLocationInformation::~SWGLocationInformation() {
this->cleanup();
}
void
SWGLocationInformation::init() {
latitude = 0.0f;
longitude = 0.0f;
}
void
SWGLocationInformation::cleanup() {
}
SWGLocationInformation*
SWGLocationInformation::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGLocationInformation::fromJsonObject(QJsonObject &pJson) {
setValue(&latitude, pJson["latitude"], "float", "");
setValue(&longitude, pJson["longitude"], "float", "");
}
QString
SWGLocationInformation::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGLocationInformation::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("latitude", QJsonValue(latitude));
obj->insert("longitude", QJsonValue(longitude));
return obj;
}
float
SWGLocationInformation::getLatitude() {
return latitude;
}
void
SWGLocationInformation::setLatitude(float latitude) {
this->latitude = latitude;
}
float
SWGLocationInformation::getLongitude() {
return longitude;
}
void
SWGLocationInformation::setLongitude(float longitude) {
this->longitude = longitude;
}
} /* namespace Swagger */

View File

@ -0,0 +1,68 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGLocationInformation.h
*
* Instance geolocation information
*/
#ifndef SWGLocationInformation_H_
#define SWGLocationInformation_H_
#include <QJsonObject>
#include "SWGObject.h"
namespace Swagger {
class SWGLocationInformation: public SWGObject {
public:
SWGLocationInformation();
SWGLocationInformation(QString* json);
virtual ~SWGLocationInformation();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGLocationInformation* fromJson(QString &jsonString);
float getLatitude();
void setLatitude(float latitude);
float getLongitude();
void setLongitude(float longitude);
private:
float latitude;
float longitude;
};
} /* namespace Swagger */
#endif /* SWGLocationInformation_H_ */

View File

@ -0,0 +1,162 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGLoggingInfo.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGLoggingInfo::SWGLoggingInfo(QString* json) {
init();
this->fromJson(*json);
}
SWGLoggingInfo::SWGLoggingInfo() {
init();
}
SWGLoggingInfo::~SWGLoggingInfo() {
this->cleanup();
}
void
SWGLoggingInfo::init() {
consoleLevel = new QString("");
fileLevel = new QString("");
dumpToFile = false;
fileName = new QString("");
}
void
SWGLoggingInfo::cleanup() {
if(consoleLevel != NULL) {
delete consoleLevel;
}
if(fileLevel != NULL) {
delete fileLevel;
}
if(fileName != NULL) {
delete fileName;
}
}
SWGLoggingInfo*
SWGLoggingInfo::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGLoggingInfo::fromJsonObject(QJsonObject &pJson) {
setValue(&consoleLevel, pJson["consoleLevel"], "QString", "QString");
setValue(&fileLevel, pJson["fileLevel"], "QString", "QString");
setValue(&dumpToFile, pJson["dumpToFile"], "bool", "");
setValue(&fileName, pJson["fileName"], "QString", "QString");
}
QString
SWGLoggingInfo::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGLoggingInfo::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("consoleLevel"), consoleLevel, obj, QString("QString"));
toJsonValue(QString("fileLevel"), fileLevel, obj, QString("QString"));
obj->insert("dumpToFile", QJsonValue(dumpToFile));
toJsonValue(QString("fileName"), fileName, obj, QString("QString"));
return obj;
}
QString*
SWGLoggingInfo::getConsoleLevel() {
return consoleLevel;
}
void
SWGLoggingInfo::setConsoleLevel(QString* consoleLevel) {
this->consoleLevel = consoleLevel;
}
QString*
SWGLoggingInfo::getFileLevel() {
return fileLevel;
}
void
SWGLoggingInfo::setFileLevel(QString* fileLevel) {
this->fileLevel = fileLevel;
}
bool
SWGLoggingInfo::getDumpToFile() {
return dumpToFile;
}
void
SWGLoggingInfo::setDumpToFile(bool dumpToFile) {
this->dumpToFile = dumpToFile;
}
QString*
SWGLoggingInfo::getFileName() {
return fileName;
}
void
SWGLoggingInfo::setFileName(QString* fileName) {
this->fileName = fileName;
}
} /* namespace Swagger */

View File

@ -0,0 +1,75 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGLoggingInfo.h
*
* Logging parameters setting
*/
#ifndef SWGLoggingInfo_H_
#define SWGLoggingInfo_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGLoggingInfo: public SWGObject {
public:
SWGLoggingInfo();
SWGLoggingInfo(QString* json);
virtual ~SWGLoggingInfo();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGLoggingInfo* fromJson(QString &jsonString);
QString* getConsoleLevel();
void setConsoleLevel(QString* consoleLevel);
QString* getFileLevel();
void setFileLevel(QString* fileLevel);
bool getDumpToFile();
void setDumpToFile(bool dumpToFile);
QString* getFileName();
void setFileName(QString* fileName);
private:
QString* consoleLevel;
QString* fileLevel;
bool dumpToFile;
QString* fileName;
};
} /* namespace Swagger */
#endif /* SWGLoggingInfo_H_ */

View File

@ -0,0 +1,133 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ModelFactory_H_
#define ModelFactory_H_
#include "SWGAudioDevices.h"
#include "SWGAudioDevicesSelect.h"
#include "SWGChannel.h"
#include "SWGChannelListItem.h"
#include "SWGDVSeralDevices.h"
#include "SWGDeviceListItem.h"
#include "SWGDeviceSet.h"
#include "SWGDeviceSetList.h"
#include "SWGErrorResponse.h"
#include "SWGInstanceChannelsResponse.h"
#include "SWGInstanceDevicesResponse.h"
#include "SWGInstanceSummaryResponse.h"
#include "SWGLocationInformation.h"
#include "SWGLoggingInfo.h"
#include "SWGPresetGroup.h"
#include "SWGPresetIdentifier.h"
#include "SWGPresetItem.h"
#include "SWGPresetTransfer.h"
#include "SWGPresets.h"
#include "SWGSamplingDevice.h"
#include "SWGUser.h"
namespace Swagger {
inline void* create(QString type) {
if(QString("SWGAudioDevices").compare(type) == 0) {
return new SWGAudioDevices();
}
if(QString("SWGAudioDevicesSelect").compare(type) == 0) {
return new SWGAudioDevicesSelect();
}
if(QString("SWGChannel").compare(type) == 0) {
return new SWGChannel();
}
if(QString("SWGChannelListItem").compare(type) == 0) {
return new SWGChannelListItem();
}
if(QString("SWGDVSeralDevices").compare(type) == 0) {
return new SWGDVSeralDevices();
}
if(QString("SWGDeviceListItem").compare(type) == 0) {
return new SWGDeviceListItem();
}
if(QString("SWGDeviceSet").compare(type) == 0) {
return new SWGDeviceSet();
}
if(QString("SWGDeviceSetList").compare(type) == 0) {
return new SWGDeviceSetList();
}
if(QString("SWGErrorResponse").compare(type) == 0) {
return new SWGErrorResponse();
}
if(QString("SWGInstanceChannelsResponse").compare(type) == 0) {
return new SWGInstanceChannelsResponse();
}
if(QString("SWGInstanceDevicesResponse").compare(type) == 0) {
return new SWGInstanceDevicesResponse();
}
if(QString("SWGInstanceSummaryResponse").compare(type) == 0) {
return new SWGInstanceSummaryResponse();
}
if(QString("SWGLocationInformation").compare(type) == 0) {
return new SWGLocationInformation();
}
if(QString("SWGLoggingInfo").compare(type) == 0) {
return new SWGLoggingInfo();
}
if(QString("SWGPresetGroup").compare(type) == 0) {
return new SWGPresetGroup();
}
if(QString("SWGPresetIdentifier").compare(type) == 0) {
return new SWGPresetIdentifier();
}
if(QString("SWGPresetItem").compare(type) == 0) {
return new SWGPresetItem();
}
if(QString("SWGPresetTransfer").compare(type) == 0) {
return new SWGPresetTransfer();
}
if(QString("SWGPresets").compare(type) == 0) {
return new SWGPresets();
}
if(QString("SWGSamplingDevice").compare(type) == 0) {
return new SWGSamplingDevice();
}
if(QString("SWGUser").compare(type) == 0) {
return new SWGUser();
}
return NULL;
}
inline void* create(QString json, QString type) {
void* val = create(type);
if(val != NULL) {
SWGObject* obj = static_cast<SWGObject*>(val);
return obj->fromJson(json);
}
if(type.startsWith("QString")) {
return new QString();
}
return NULL;
}
} /* namespace Swagger */
#endif /* ModelFactory_H_ */

View File

@ -0,0 +1,48 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _SWG_OBJECT_H_
#define _SWG_OBJECT_H_
#include <QJsonValue>
class SWGObject {
public:
virtual QJsonObject* asJsonObject() {
return NULL;
}
virtual ~SWGObject() {}
virtual SWGObject* fromJson(QString &jsonString) {
Q_UNUSED(jsonString);
return NULL;
}
virtual void fromJsonObject(QJsonObject &json) {
Q_UNUSED(json);
}
virtual QString asJson() {
return QString("");
}
};
#endif /* _SWG_OBJECT_H_ */

View File

@ -0,0 +1,150 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGPresetGroup.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGPresetGroup::SWGPresetGroup(QString* json) {
init();
this->fromJson(*json);
}
SWGPresetGroup::SWGPresetGroup() {
init();
}
SWGPresetGroup::~SWGPresetGroup() {
this->cleanup();
}
void
SWGPresetGroup::init() {
groupName = new QString("");
nbPresets = NULL;
presets = new QList<SWGPresetItem*>();
}
void
SWGPresetGroup::cleanup() {
if(groupName != NULL) {
delete groupName;
}
if(presets != NULL) {
QList<SWGPresetItem*>* arr = presets;
foreach(SWGPresetItem* o, *arr) {
delete o;
}
delete presets;
}
}
SWGPresetGroup*
SWGPresetGroup::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGPresetGroup::fromJsonObject(QJsonObject &pJson) {
setValue(&groupName, pJson["groupName"], "QString", "QString");
setValue(&nbPresets, pJson["nbPresets"], "qint32", "");
setValue(&presets, pJson["presets"], "QList", "SWGPresetItem");
}
QString
SWGPresetGroup::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGPresetGroup::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("groupName"), groupName, obj, QString("QString"));
obj->insert("nbPresets", QJsonValue(nbPresets));
QList<SWGPresetItem*>* presetsList = presets;
QJsonArray presetsJsonArray;
toJsonArray((QList<void*>*)presets, &presetsJsonArray, "presets", "SWGPresetItem");
obj->insert("presets", presetsJsonArray);
return obj;
}
QString*
SWGPresetGroup::getGroupName() {
return groupName;
}
void
SWGPresetGroup::setGroupName(QString* groupName) {
this->groupName = groupName;
}
qint32
SWGPresetGroup::getNbPresets() {
return nbPresets;
}
void
SWGPresetGroup::setNbPresets(qint32 nbPresets) {
this->nbPresets = nbPresets;
}
QList<SWGPresetItem*>*
SWGPresetGroup::getPresets() {
return presets;
}
void
SWGPresetGroup::setPresets(QList<SWGPresetItem*>* presets) {
this->presets = presets;
}
} /* namespace Swagger */

View File

@ -0,0 +1,74 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGPresetGroup.h
*
* Group of presets
*/
#ifndef SWGPresetGroup_H_
#define SWGPresetGroup_H_
#include <QJsonObject>
#include "SWGPresetItem.h"
#include <QList>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGPresetGroup: public SWGObject {
public:
SWGPresetGroup();
SWGPresetGroup(QString* json);
virtual ~SWGPresetGroup();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGPresetGroup* fromJson(QString &jsonString);
QString* getGroupName();
void setGroupName(QString* groupName);
qint32 getNbPresets();
void setNbPresets(qint32 nbPresets);
QList<SWGPresetItem*>* getPresets();
void setPresets(QList<SWGPresetItem*>* presets);
private:
QString* groupName;
qint32 nbPresets;
QList<SWGPresetItem*>* presets;
};
} /* namespace Swagger */
#endif /* SWGPresetGroup_H_ */

View File

@ -0,0 +1,162 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGPresetIdentifier.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGPresetIdentifier::SWGPresetIdentifier(QString* json) {
init();
this->fromJson(*json);
}
SWGPresetIdentifier::SWGPresetIdentifier() {
init();
}
SWGPresetIdentifier::~SWGPresetIdentifier() {
this->cleanup();
}
void
SWGPresetIdentifier::init() {
groupName = new QString("");
centerFrequency = 0.0f;
type = new QString("");
name = new QString("");
}
void
SWGPresetIdentifier::cleanup() {
if(groupName != NULL) {
delete groupName;
}
if(type != NULL) {
delete type;
}
if(name != NULL) {
delete name;
}
}
SWGPresetIdentifier*
SWGPresetIdentifier::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGPresetIdentifier::fromJsonObject(QJsonObject &pJson) {
setValue(&groupName, pJson["groupName"], "QString", "QString");
setValue(&centerFrequency, pJson["centerFrequency"], "float", "");
setValue(&type, pJson["type"], "QString", "QString");
setValue(&name, pJson["name"], "QString", "QString");
}
QString
SWGPresetIdentifier::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGPresetIdentifier::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("groupName"), groupName, obj, QString("QString"));
obj->insert("centerFrequency", QJsonValue(centerFrequency));
toJsonValue(QString("type"), type, obj, QString("QString"));
toJsonValue(QString("name"), name, obj, QString("QString"));
return obj;
}
QString*
SWGPresetIdentifier::getGroupName() {
return groupName;
}
void
SWGPresetIdentifier::setGroupName(QString* groupName) {
this->groupName = groupName;
}
float
SWGPresetIdentifier::getCenterFrequency() {
return centerFrequency;
}
void
SWGPresetIdentifier::setCenterFrequency(float centerFrequency) {
this->centerFrequency = centerFrequency;
}
QString*
SWGPresetIdentifier::getType() {
return type;
}
void
SWGPresetIdentifier::setType(QString* type) {
this->type = type;
}
QString*
SWGPresetIdentifier::getName() {
return name;
}
void
SWGPresetIdentifier::setName(QString* name) {
this->name = name;
}
} /* namespace Swagger */

View File

@ -0,0 +1,75 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGPresetIdentifier.h
*
* Settings preset item
*/
#ifndef SWGPresetIdentifier_H_
#define SWGPresetIdentifier_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGPresetIdentifier: public SWGObject {
public:
SWGPresetIdentifier();
SWGPresetIdentifier(QString* json);
virtual ~SWGPresetIdentifier();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGPresetIdentifier* fromJson(QString &jsonString);
QString* getGroupName();
void setGroupName(QString* groupName);
float getCenterFrequency();
void setCenterFrequency(float centerFrequency);
QString* getType();
void setType(QString* type);
QString* getName();
void setName(QString* name);
private:
QString* groupName;
float centerFrequency;
QString* type;
QString* name;
};
} /* namespace Swagger */
#endif /* SWGPresetIdentifier_H_ */

View File

@ -0,0 +1,143 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGPresetItem.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGPresetItem::SWGPresetItem(QString* json) {
init();
this->fromJson(*json);
}
SWGPresetItem::SWGPresetItem() {
init();
}
SWGPresetItem::~SWGPresetItem() {
this->cleanup();
}
void
SWGPresetItem::init() {
centerFrequency = 0.0f;
type = new QString("");
name = new QString("");
}
void
SWGPresetItem::cleanup() {
if(type != NULL) {
delete type;
}
if(name != NULL) {
delete name;
}
}
SWGPresetItem*
SWGPresetItem::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGPresetItem::fromJsonObject(QJsonObject &pJson) {
setValue(&centerFrequency, pJson["centerFrequency"], "float", "");
setValue(&type, pJson["type"], "QString", "QString");
setValue(&name, pJson["name"], "QString", "QString");
}
QString
SWGPresetItem::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGPresetItem::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("centerFrequency", QJsonValue(centerFrequency));
toJsonValue(QString("type"), type, obj, QString("QString"));
toJsonValue(QString("name"), name, obj, QString("QString"));
return obj;
}
float
SWGPresetItem::getCenterFrequency() {
return centerFrequency;
}
void
SWGPresetItem::setCenterFrequency(float centerFrequency) {
this->centerFrequency = centerFrequency;
}
QString*
SWGPresetItem::getType() {
return type;
}
void
SWGPresetItem::setType(QString* type) {
this->type = type;
}
QString*
SWGPresetItem::getName() {
return name;
}
void
SWGPresetItem::setName(QString* name) {
this->name = name;
}
} /* namespace Swagger */

View File

@ -0,0 +1,72 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGPresetItem.h
*
* Settings preset item
*/
#ifndef SWGPresetItem_H_
#define SWGPresetItem_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGPresetItem: public SWGObject {
public:
SWGPresetItem();
SWGPresetItem(QString* json);
virtual ~SWGPresetItem();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGPresetItem* fromJson(QString &jsonString);
float getCenterFrequency();
void setCenterFrequency(float centerFrequency);
QString* getType();
void setType(QString* type);
QString* getName();
void setName(QString* name);
private:
float centerFrequency;
QString* type;
QString* name;
};
} /* namespace Swagger */
#endif /* SWGPresetItem_H_ */

View File

@ -0,0 +1,124 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGPresetTransfer.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGPresetTransfer::SWGPresetTransfer(QString* json) {
init();
this->fromJson(*json);
}
SWGPresetTransfer::SWGPresetTransfer() {
init();
}
SWGPresetTransfer::~SWGPresetTransfer() {
this->cleanup();
}
void
SWGPresetTransfer::init() {
deviceSetIndex = NULL;
preset = new SWGPresetIdentifier();
}
void
SWGPresetTransfer::cleanup() {
if(preset != NULL) {
delete preset;
}
}
SWGPresetTransfer*
SWGPresetTransfer::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGPresetTransfer::fromJsonObject(QJsonObject &pJson) {
setValue(&deviceSetIndex, pJson["deviceSetIndex"], "qint32", "");
setValue(&preset, pJson["preset"], "SWGPresetIdentifier", "SWGPresetIdentifier");
}
QString
SWGPresetTransfer::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGPresetTransfer::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("deviceSetIndex", QJsonValue(deviceSetIndex));
toJsonValue(QString("preset"), preset, obj, QString("SWGPresetIdentifier"));
return obj;
}
qint32
SWGPresetTransfer::getDeviceSetIndex() {
return deviceSetIndex;
}
void
SWGPresetTransfer::setDeviceSetIndex(qint32 deviceSetIndex) {
this->deviceSetIndex = deviceSetIndex;
}
SWGPresetIdentifier*
SWGPresetTransfer::getPreset() {
return preset;
}
void
SWGPresetTransfer::setPreset(SWGPresetIdentifier* preset) {
this->preset = preset;
}
} /* namespace Swagger */

View File

@ -0,0 +1,69 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGPresetTransfer.h
*
* Preset transfer to or from a device set
*/
#ifndef SWGPresetTransfer_H_
#define SWGPresetTransfer_H_
#include <QJsonObject>
#include "SWGPresetIdentifier.h"
#include "SWGObject.h"
namespace Swagger {
class SWGPresetTransfer: public SWGObject {
public:
SWGPresetTransfer();
SWGPresetTransfer(QString* json);
virtual ~SWGPresetTransfer();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGPresetTransfer* fromJson(QString &jsonString);
qint32 getDeviceSetIndex();
void setDeviceSetIndex(qint32 deviceSetIndex);
SWGPresetIdentifier* getPreset();
void setPreset(SWGPresetIdentifier* preset);
private:
qint32 deviceSetIndex;
SWGPresetIdentifier* preset;
};
} /* namespace Swagger */
#endif /* SWGPresetTransfer_H_ */

View File

@ -0,0 +1,131 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGPresets.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGPresets::SWGPresets(QString* json) {
init();
this->fromJson(*json);
}
SWGPresets::SWGPresets() {
init();
}
SWGPresets::~SWGPresets() {
this->cleanup();
}
void
SWGPresets::init() {
nbGroups = NULL;
groups = new QList<SWGPresetGroup*>();
}
void
SWGPresets::cleanup() {
if(groups != NULL) {
QList<SWGPresetGroup*>* arr = groups;
foreach(SWGPresetGroup* o, *arr) {
delete o;
}
delete groups;
}
}
SWGPresets*
SWGPresets::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGPresets::fromJsonObject(QJsonObject &pJson) {
setValue(&nbGroups, pJson["nbGroups"], "qint32", "");
setValue(&groups, pJson["groups"], "QList", "SWGPresetGroup");
}
QString
SWGPresets::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGPresets::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("nbGroups", QJsonValue(nbGroups));
QList<SWGPresetGroup*>* groupsList = groups;
QJsonArray groupsJsonArray;
toJsonArray((QList<void*>*)groups, &groupsJsonArray, "groups", "SWGPresetGroup");
obj->insert("groups", groupsJsonArray);
return obj;
}
qint32
SWGPresets::getNbGroups() {
return nbGroups;
}
void
SWGPresets::setNbGroups(qint32 nbGroups) {
this->nbGroups = nbGroups;
}
QList<SWGPresetGroup*>*
SWGPresets::getGroups() {
return groups;
}
void
SWGPresets::setGroups(QList<SWGPresetGroup*>* groups) {
this->groups = groups;
}
} /* namespace Swagger */

View File

@ -0,0 +1,70 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGPresets.h
*
* Settings presets
*/
#ifndef SWGPresets_H_
#define SWGPresets_H_
#include <QJsonObject>
#include "SWGPresetGroup.h"
#include <QList>
#include "SWGObject.h"
namespace Swagger {
class SWGPresets: public SWGObject {
public:
SWGPresets();
SWGPresets(QString* json);
virtual ~SWGPresets();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGPresets* fromJson(QString &jsonString);
qint32 getNbGroups();
void setNbGroups(qint32 nbGroups);
QList<SWGPresetGroup*>* getGroups();
void setGroups(QList<SWGPresetGroup*>* groups);
private:
qint32 nbGroups;
QList<SWGPresetGroup*>* groups;
};
} /* namespace Swagger */
#endif /* SWGPresets_H_ */

View File

@ -0,0 +1,221 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGSamplingDevice.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGSamplingDevice::SWGSamplingDevice(QString* json) {
init();
this->fromJson(*json);
}
SWGSamplingDevice::SWGSamplingDevice() {
init();
}
SWGSamplingDevice::~SWGSamplingDevice() {
this->cleanup();
}
void
SWGSamplingDevice::init() {
index = NULL;
hwType = new QString("");
tx = false;
nbStreams = NULL;
streamIndex = NULL;
sequence = NULL;
serial = new QString("");
centerFrequency = 0L;
bandwidth = NULL;
}
void
SWGSamplingDevice::cleanup() {
if(hwType != NULL) {
delete hwType;
}
if(serial != NULL) {
delete serial;
}
}
SWGSamplingDevice*
SWGSamplingDevice::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGSamplingDevice::fromJsonObject(QJsonObject &pJson) {
setValue(&index, pJson["index"], "qint32", "");
setValue(&hwType, pJson["hwType"], "QString", "QString");
setValue(&tx, pJson["tx"], "bool", "");
setValue(&nbStreams, pJson["nbStreams"], "qint32", "");
setValue(&streamIndex, pJson["streamIndex"], "qint32", "");
setValue(&sequence, pJson["sequence"], "qint32", "");
setValue(&serial, pJson["serial"], "QString", "QString");
setValue(&centerFrequency, pJson["centerFrequency"], "qint64", "");
setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
}
QString
SWGSamplingDevice::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGSamplingDevice::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("index", QJsonValue(index));
toJsonValue(QString("hwType"), hwType, obj, QString("QString"));
obj->insert("tx", QJsonValue(tx));
obj->insert("nbStreams", QJsonValue(nbStreams));
obj->insert("streamIndex", QJsonValue(streamIndex));
obj->insert("sequence", QJsonValue(sequence));
toJsonValue(QString("serial"), serial, obj, QString("QString"));
obj->insert("centerFrequency", QJsonValue(centerFrequency));
obj->insert("bandwidth", QJsonValue(bandwidth));
return obj;
}
qint32
SWGSamplingDevice::getIndex() {
return index;
}
void
SWGSamplingDevice::setIndex(qint32 index) {
this->index = index;
}
QString*
SWGSamplingDevice::getHwType() {
return hwType;
}
void
SWGSamplingDevice::setHwType(QString* hwType) {
this->hwType = hwType;
}
bool
SWGSamplingDevice::getTx() {
return tx;
}
void
SWGSamplingDevice::setTx(bool tx) {
this->tx = tx;
}
qint32
SWGSamplingDevice::getNbStreams() {
return nbStreams;
}
void
SWGSamplingDevice::setNbStreams(qint32 nbStreams) {
this->nbStreams = nbStreams;
}
qint32
SWGSamplingDevice::getStreamIndex() {
return streamIndex;
}
void
SWGSamplingDevice::setStreamIndex(qint32 streamIndex) {
this->streamIndex = streamIndex;
}
qint32
SWGSamplingDevice::getSequence() {
return sequence;
}
void
SWGSamplingDevice::setSequence(qint32 sequence) {
this->sequence = sequence;
}
QString*
SWGSamplingDevice::getSerial() {
return serial;
}
void
SWGSamplingDevice::setSerial(QString* serial) {
this->serial = serial;
}
qint64
SWGSamplingDevice::getCenterFrequency() {
return centerFrequency;
}
void
SWGSamplingDevice::setCenterFrequency(qint64 centerFrequency) {
this->centerFrequency = centerFrequency;
}
qint32
SWGSamplingDevice::getBandwidth() {
return bandwidth;
}
void
SWGSamplingDevice::setBandwidth(qint32 bandwidth) {
this->bandwidth = bandwidth;
}
} /* namespace Swagger */

View File

@ -0,0 +1,90 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGSamplingDevice.h
*
* Information about a logical device available from an attached hardware device that can be used as a sampling device
*/
#ifndef SWGSamplingDevice_H_
#define SWGSamplingDevice_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGSamplingDevice: public SWGObject {
public:
SWGSamplingDevice();
SWGSamplingDevice(QString* json);
virtual ~SWGSamplingDevice();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGSamplingDevice* fromJson(QString &jsonString);
qint32 getIndex();
void setIndex(qint32 index);
QString* getHwType();
void setHwType(QString* hwType);
bool getTx();
void setTx(bool tx);
qint32 getNbStreams();
void setNbStreams(qint32 nbStreams);
qint32 getStreamIndex();
void setStreamIndex(qint32 streamIndex);
qint32 getSequence();
void setSequence(qint32 sequence);
QString* getSerial();
void setSerial(QString* serial);
qint64 getCenterFrequency();
void setCenterFrequency(qint64 centerFrequency);
qint32 getBandwidth();
void setBandwidth(qint32 bandwidth);
private:
qint32 index;
QString* hwType;
bool tx;
qint32 nbStreams;
qint32 streamIndex;
qint32 sequence;
QString* serial;
qint64 centerFrequency;
qint32 bandwidth;
};
} /* namespace Swagger */
#endif /* SWGSamplingDevice_H_ */

View File

@ -0,0 +1,124 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGUser.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGUser::SWGUser(QString* json) {
init();
this->fromJson(*json);
}
SWGUser::SWGUser() {
init();
}
SWGUser::~SWGUser() {
this->cleanup();
}
void
SWGUser::init() {
index = NULL;
name = new QString("");
}
void
SWGUser::cleanup() {
if(name != NULL) {
delete name;
}
}
SWGUser*
SWGUser::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGUser::fromJsonObject(QJsonObject &pJson) {
setValue(&index, pJson["index"], "qint32", "");
setValue(&name, pJson["name"], "QString", "QString");
}
QString
SWGUser::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGUser::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("index", QJsonValue(index));
toJsonValue(QString("name"), name, obj, QString("QString"));
return obj;
}
qint32
SWGUser::getIndex() {
return index;
}
void
SWGUser::setIndex(qint32 index) {
this->index = index;
}
QString*
SWGUser::getName() {
return name;
}
void
SWGUser::setName(QString* name) {
this->name = name;
}
} /* namespace Swagger */

View File

@ -0,0 +1,69 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* SWGUser.h
*
*
*/
#ifndef SWGUser_H_
#define SWGUser_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGUser: public SWGObject {
public:
SWGUser();
SWGUser(QString* json);
virtual ~SWGUser();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGUser* fromJson(QString &jsonString);
qint32 getIndex();
void setIndex(qint32 index);
QString* getName();
void setName(QString* name);
private:
qint32 index;
QString* name;
};
} /* namespace Swagger */
#endif /* SWGUser_H_ */

View File

@ -0,0 +1,2 @@
#!/bin/sh
sed -i '1s/^/#include <QDateTime>\n/' ${1}