From 2184425311381b2eec6e5ff97db795e9f457fb41 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 27 May 2018 19:54:33 +0200 Subject: [PATCH] Web API: put some array items in their own classes --- plugins/samplesource/airspy/airspyinput.cpp | 6 +- .../samplesource/airspyhf/airspyhfinput.cpp | 6 +- plugins/samplesource/perseus/perseusinput.cpp | 6 +- plugins/samplesource/rtlsdr/rtlsdrinput.cpp | 6 +- plugins/samplesource/sdrplay/sdrplayinput.cpp | 26 +-- sdrbase/resources/res.qrc | 5 +- sdrbase/resources/webapi/doc/html2/index.html | 111 +++++++------ .../webapi/doc/swagger/include/Airspy.yaml | 6 +- .../webapi/doc/swagger/include/AirspyHF.yaml | 6 +- .../webapi/doc/swagger/include/Perseus.yaml | 6 +- .../webapi/doc/swagger/include/RtlSdr.yaml | 5 +- .../webapi/doc/swagger/include/SDRPlay.yaml | 26 +-- .../webapi/doc/swagger/include/Structs.yaml | 34 ++++ .../sdrangel/api/swagger/include/Airspy.yaml | 6 +- .../api/swagger/include/AirspyHF.yaml | 6 +- .../sdrangel/api/swagger/include/Perseus.yaml | 6 +- .../sdrangel/api/swagger/include/RtlSdr.yaml | 5 +- .../sdrangel/api/swagger/include/SDRPlay.yaml | 26 +-- .../sdrangel/api/swagger/include/Structs.yaml | 34 ++++ swagger/sdrangel/code/html2/index.html | 111 +++++++------ .../code/qt5/client/SWGAirspyHFReport.cpp | 10 +- .../code/qt5/client/SWGAirspyHFReport.h | 8 +- .../code/qt5/client/SWGAirspyReport.cpp | 10 +- .../code/qt5/client/SWGAirspyReport.h | 8 +- .../sdrangel/code/qt5/client/SWGBandwidth.cpp | 106 +++++++++++++ .../sdrangel/code/qt5/client/SWGBandwidth.h | 58 +++++++ .../sdrangel/code/qt5/client/SWGFrequency.cpp | 106 +++++++++++++ .../sdrangel/code/qt5/client/SWGFrequency.h | 58 +++++++ .../code/qt5/client/SWGFrequencyBand.cpp | 150 ++++++++++++++++++ .../code/qt5/client/SWGFrequencyBand.h | 71 +++++++++ swagger/sdrangel/code/qt5/client/SWGGain.cpp | 106 +++++++++++++ swagger/sdrangel/code/qt5/client/SWGGain.h | 58 +++++++ .../code/qt5/client/SWGModelFactory.h | 40 ++--- .../code/qt5/client/SWGPerseusReport.cpp | 10 +- .../code/qt5/client/SWGPerseusReport.h | 8 +- .../code/qt5/client/SWGRtlSdrReport.cpp | 10 +- .../code/qt5/client/SWGRtlSdrReport.h | 8 +- .../code/qt5/client/SWGSDRPlayReport.cpp | 40 ++--- .../code/qt5/client/SWGSDRPlayReport.h | 32 ++-- .../code/qt5/client/SWGSampleRate.cpp | 106 +++++++++++++ .../sdrangel/code/qt5/client/SWGSampleRate.h | 58 +++++++ 41 files changed, 1192 insertions(+), 312 deletions(-) create mode 100644 sdrbase/resources/webapi/doc/swagger/include/Structs.yaml create mode 100644 swagger/sdrangel/api/swagger/include/Structs.yaml create mode 100644 swagger/sdrangel/code/qt5/client/SWGBandwidth.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGBandwidth.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGFrequency.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGFrequency.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGFrequencyBand.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGFrequencyBand.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGGain.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGGain.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGSampleRate.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGSampleRate.h diff --git a/plugins/samplesource/airspy/airspyinput.cpp b/plugins/samplesource/airspy/airspyinput.cpp index 78396f660..a78ab4ff3 100644 --- a/plugins/samplesource/airspy/airspyinput.cpp +++ b/plugins/samplesource/airspy/airspyinput.cpp @@ -741,11 +741,11 @@ void AirspyInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& res void AirspyInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response) { - response.getAirspyReport()->setSampleRates(new QList); + response.getAirspyReport()->setSampleRates(new QList); for (std::vector::const_iterator it = getSampleRates().begin(); it != getSampleRates().end(); ++it) { - response.getAirspyReport()->getSampleRates()->append(new SWGSDRangel::SWGAirspyReport_sampleRates); - response.getAirspyReport()->getSampleRates()->back()->setSampleRate(*it); + response.getAirspyReport()->getSampleRates()->append(new SWGSDRangel::SWGSampleRate); + response.getAirspyReport()->getSampleRates()->back()->setRate(*it); } } diff --git a/plugins/samplesource/airspyhf/airspyhfinput.cpp b/plugins/samplesource/airspyhf/airspyhfinput.cpp index 0009ddc8f..93c468621 100644 --- a/plugins/samplesource/airspyhf/airspyhfinput.cpp +++ b/plugins/samplesource/airspyhf/airspyhfinput.cpp @@ -565,12 +565,12 @@ void AirspyHFInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& r void AirspyHFInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response) { - response.getAirspyHfReport()->setSampleRates(new QList); + response.getAirspyHfReport()->setSampleRates(new QList); for (std::vector::const_iterator it = getSampleRates().begin(); it != getSampleRates().end(); ++it) { - response.getAirspyHfReport()->getSampleRates()->append(new SWGSDRangel::SWGAirspyReport_sampleRates); - response.getAirspyHfReport()->getSampleRates()->back()->setSampleRate(*it); + response.getAirspyHfReport()->getSampleRates()->append(new SWGSDRangel::SWGSampleRate); + response.getAirspyHfReport()->getSampleRates()->back()->setRate(*it); } } diff --git a/plugins/samplesource/perseus/perseusinput.cpp b/plugins/samplesource/perseus/perseusinput.cpp index 91ab52cc2..aaf431566 100644 --- a/plugins/samplesource/perseus/perseusinput.cpp +++ b/plugins/samplesource/perseus/perseusinput.cpp @@ -525,12 +525,12 @@ void PerseusInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re void PerseusInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response) { - response.getPerseusReport()->setSampleRates(new QList); + response.getPerseusReport()->setSampleRates(new QList); for (std::vector::const_iterator it = getSampleRates().begin(); it != getSampleRates().end(); ++it) { - response.getPerseusReport()->getSampleRates()->append(new SWGSDRangel::SWGAirspyReport_sampleRates); - response.getPerseusReport()->getSampleRates()->back()->setSampleRate(*it); + response.getPerseusReport()->getSampleRates()->append(new SWGSDRangel::SWGSampleRate); + response.getPerseusReport()->getSampleRates()->back()->setRate(*it); } } diff --git a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp index 2b1125fe9..e742458b2 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp +++ b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp @@ -668,12 +668,12 @@ int RTLSDRInput::webapiReportGet( void RTLSDRInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response) { - response.getRtlSdrReport()->setGains(new QList); + response.getRtlSdrReport()->setGains(new QList); for (std::vector::const_iterator it = getGains().begin(); it != getGains().end(); ++it) { - response.getRtlSdrReport()->getGains()->append(new SWGSDRangel::SWGRtlSdrReport_gains); - response.getRtlSdrReport()->getGains()->back()->setGain(*it); + response.getRtlSdrReport()->getGains()->append(new SWGSDRangel::SWGGain); + response.getRtlSdrReport()->getGains()->back()->setGainCb(*it); } } diff --git a/plugins/samplesource/sdrplay/sdrplayinput.cpp b/plugins/samplesource/sdrplay/sdrplayinput.cpp index 98c846291..c43f9bba9 100644 --- a/plugins/samplesource/sdrplay/sdrplayinput.cpp +++ b/plugins/samplesource/sdrplay/sdrplayinput.cpp @@ -662,38 +662,38 @@ int SDRPlayInput::webapiReportGet( void SDRPlayInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response) { - response.getSdrPlayReport()->setSampleRates(new QList); + response.getSdrPlayReport()->setSampleRates(new QList); for (unsigned int i = 0; i < SDRPlaySampleRates::getNbRates(); i++) { - response.getSdrPlayReport()->getSampleRates()->append(new SWGSDRangel::SWGAirspyReport_sampleRates); - response.getSdrPlayReport()->getSampleRates()->back()->setSampleRate(SDRPlaySampleRates::getRate(i)); + response.getSdrPlayReport()->getSampleRates()->append(new SWGSDRangel::SWGSampleRate); + response.getSdrPlayReport()->getSampleRates()->back()->setRate(SDRPlaySampleRates::getRate(i)); } - response.getSdrPlayReport()->setIntermediateFrequencies(new QList); + response.getSdrPlayReport()->setIntermediateFrequencies(new QList); for (unsigned int i = 0; i < SDRPlayIF::getNbIFs(); i++) { - response.getSdrPlayReport()->getIntermediateFrequencies()->append(new SWGSDRangel::SWGSDRPlayReport_intermediateFrequencies); - response.getSdrPlayReport()->getIntermediateFrequencies()->back()->setIntermediateFrequency(SDRPlayIF::getIF(i)); + response.getSdrPlayReport()->getIntermediateFrequencies()->append(new SWGSDRangel::SWGFrequency); + response.getSdrPlayReport()->getIntermediateFrequencies()->back()->setFrequency(SDRPlayIF::getIF(i)); } - response.getSdrPlayReport()->setBandwidths(new QList); + response.getSdrPlayReport()->setBandwidths(new QList); for (unsigned int i = 0; i < SDRPlayBandwidths::getNbBandwidths(); i++) { - response.getSdrPlayReport()->getBandwidths()->append(new SWGSDRangel::SWGSDRPlayReport_bandwidths); + response.getSdrPlayReport()->getBandwidths()->append(new SWGSDRangel::SWGBandwidth); response.getSdrPlayReport()->getBandwidths()->back()->setBandwidth(SDRPlayBandwidths::getBandwidth(i)); } - response.getSdrPlayReport()->setFrequencyBands(new QList); + response.getSdrPlayReport()->setFrequencyBands(new QList); for (unsigned int i = 0; i < SDRPlayBands::getNbBands(); i++) { - response.getSdrPlayReport()->getFrequencyBands()->append(new SWGSDRangel::SWGSDRPlayReport_frequencyBands); - response.getSdrPlayReport()->getFrequencyBands()->back()->setBandName(new QString(SDRPlayBands::getBandName(i))); - response.getSdrPlayReport()->getFrequencyBands()->back()->setBandLow(SDRPlayBands::getBandLow(i)); - response.getSdrPlayReport()->getFrequencyBands()->back()->setBandHigh(SDRPlayBands::getBandHigh(i)); + response.getSdrPlayReport()->getFrequencyBands()->append(new SWGSDRangel::SWGFrequencyBand); + response.getSdrPlayReport()->getFrequencyBands()->back()->setName(new QString(SDRPlayBands::getBandName(i))); + response.getSdrPlayReport()->getFrequencyBands()->back()->setLowerBound(SDRPlayBands::getBandLow(i)); + response.getSdrPlayReport()->getFrequencyBands()->back()->setHigherBound(SDRPlayBands::getBandHigh(i)); } } diff --git a/sdrbase/resources/res.qrc b/sdrbase/resources/res.qrc index 40ed2f324..b4e926d0b 100644 --- a/sdrbase/resources/res.qrc +++ b/sdrbase/resources/res.qrc @@ -21,8 +21,11 @@ webapi/doc/swagger/include/Perseus.yaml webapi/doc/swagger/include/PlutoSdr.yaml webapi/doc/swagger/include/RtlSdr.yaml + webapi/doc/swagger/include/SDRDaemonSource.yaml + webapi/doc/swagger/include/SDRPlay.yaml webapi/doc/swagger/include/SSBDemod.yaml - webapi/doc/swagger/include/SSBMod.yaml + webapi/doc/swagger/include/SSBMod.yaml + webapi/doc/swagger/include/Structs.yaml webapi/doc/swagger/include/UDPSink.yaml webapi/doc/swagger/include/UDPSrc.yaml webapi/doc/swagger/include/WFMDemod.yaml diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 13e3d1406..61e42cd5a 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -917,7 +917,7 @@ margin-bottom: 20px; "sampleRates" : { "type" : "array", "items" : { - "$ref" : "#/definitions/AirspyReport_sampleRates" + "$ref" : "#/definitions/SampleRate" } } }, @@ -959,19 +959,11 @@ margin-bottom: 20px; "sampleRates" : { "type" : "array", "items" : { - "$ref" : "#/definitions/AirspyReport_sampleRates" + "$ref" : "#/definitions/SampleRate" } } }, "description" : "Airspy" -}; - defs.AirspyReport_sampleRates = { - "properties" : { - "sampleRate" : { - "type" : "integer", - "description" : "sample rate in S/s" - } - } }; defs.AirspySettings = { "properties" : { @@ -1212,6 +1204,14 @@ margin-bottom: 20px; } }, "description" : "BFMDemod" +}; + defs.Bandwidth = { + "properties" : { + "bandwidth" : { + "type" : "integer" + } + }, + "description" : "A bandwidth expressed in Hertz (Hz)" }; defs.BladeRFInputSettings = { "properties" : { @@ -2037,6 +2037,36 @@ margin-bottom: 20px; } }, "description" : "FileSource" +}; + defs.Frequency = { + "properties" : { + "frequency" : { + "type" : "integer" + } + }, + "description" : "A frequency expressed in Hertz (Hz)" +}; + defs.FrequencyBand = { + "properties" : { + "name" : { + "type" : "string" + }, + "lowerBound" : { + "type" : "integer" + }, + "higherBound" : { + "type" : "integer" + } + }, + "description" : "A band of frequencies given its boudaries in Hertz (Hz)" +}; + defs.Gain = { + "properties" : { + "gainCB" : { + "type" : "integer" + } + }, + "description" : "A gain expressed in centi-Bels (tenths of dB)" }; defs.HackRFInputSettings = { "properties" : { @@ -2596,7 +2626,7 @@ margin-bottom: 20px; "sampleRates" : { "type" : "array", "items" : { - "$ref" : "#/definitions/AirspyReport_sampleRates" + "$ref" : "#/definitions/SampleRate" } } }, @@ -2994,19 +3024,11 @@ margin-bottom: 20px; "gains" : { "type" : "array", "items" : { - "$ref" : "#/definitions/RtlSdrReport_gains" + "$ref" : "#/definitions/Gain" } } }, "description" : "RTLSDR" -}; - defs.RtlSdrReport_gains = { - "properties" : { - "gain" : { - "type" : "integer", - "description" : "gain in centi Bels" - } - } }; defs.RtlSdrSettings = { "properties" : { @@ -3065,60 +3087,29 @@ margin-bottom: 20px; "sampleRates" : { "type" : "array", "items" : { - "$ref" : "#/definitions/AirspyReport_sampleRates" + "$ref" : "#/definitions/SampleRate" } }, "bandwidths" : { "type" : "array", "items" : { - "$ref" : "#/definitions/SDRPlayReport_bandwidths" + "$ref" : "#/definitions/Bandwidth" } }, "intermediateFrequencies" : { "type" : "array", "items" : { - "$ref" : "#/definitions/SDRPlayReport_intermediateFrequencies" + "$ref" : "#/definitions/Frequency" } }, "frequencyBands" : { "type" : "array", "items" : { - "$ref" : "#/definitions/SDRPlayReport_frequencyBands" + "$ref" : "#/definitions/FrequencyBand" } } }, "description" : "SDRplay1" -}; - defs.SDRPlayReport_bandwidths = { - "properties" : { - "bandwidth" : { - "type" : "integer", - "description" : "bandwidth in Hz" - } - } -}; - defs.SDRPlayReport_frequencyBands = { - "properties" : { - "bandName" : { - "type" : "string" - }, - "bandLow" : { - "type" : "integer", - "description" : "lower frequency bound in Hz" - }, - "bandHigh" : { - "type" : "integer", - "description" : "higher frequency bound in Hz" - } - } -}; - defs.SDRPlayReport_intermediateFrequencies = { - "properties" : { - "intermediateFrequency" : { - "type" : "integer", - "description" : "frequency in Hz" - } - } }; defs.SDRPlaySettings = { "properties" : { @@ -3438,6 +3429,14 @@ margin-bottom: 20px; } }, "description" : "SSBMod" +}; + defs.SampleRate = { + "properties" : { + "rate" : { + "type" : "integer" + } + }, + "description" : "A sample rate expressed in samples per second (S/s)" }; defs.SamplingDevice = { "required" : [ "bandwidth", "centerFrequency", "hwType", "index", "sequence", "serial", "state", "streamIndex" ], @@ -22495,7 +22494,7 @@ except ApiException as e:
- Generated 2018-05-27T11:38:07.698+02:00 + Generated 2018-05-27T13:20:33.079+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/Airspy.yaml b/sdrbase/resources/webapi/doc/swagger/include/Airspy.yaml index ebb14bd7d..532e6e0e6 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/Airspy.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/Airspy.yaml @@ -46,9 +46,5 @@ AirspyReport: sampleRates: type: array items: - properties: - sampleRate: - description: sample rate in S/s - type: integer - + $ref: "/doc/swagger/include/Structs.yaml#/SampleRate" \ No newline at end of file diff --git a/sdrbase/resources/webapi/doc/swagger/include/AirspyHF.yaml b/sdrbase/resources/webapi/doc/swagger/include/AirspyHF.yaml index e0317e414..023146e7d 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/AirspyHF.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/AirspyHF.yaml @@ -26,9 +26,5 @@ AirspyHFReport: sampleRates: type: array items: - properties: - sampleRate: - description: sample rate in S/s - type: integer - + $ref: "/doc/swagger/include/Structs.yaml#/SampleRate" \ No newline at end of file diff --git a/sdrbase/resources/webapi/doc/swagger/include/Perseus.yaml b/sdrbase/resources/webapi/doc/swagger/include/Perseus.yaml index 79e075806..a8a8a3881 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/Perseus.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/Perseus.yaml @@ -36,9 +36,5 @@ PerseusReport: sampleRates: type: array items: - properties: - sampleRate: - description: sample rate in S/s - type: integer - + $ref: "/doc/swagger/include/Structs.yaml#/SampleRate" \ No newline at end of file diff --git a/sdrbase/resources/webapi/doc/swagger/include/RtlSdr.yaml b/sdrbase/resources/webapi/doc/swagger/include/RtlSdr.yaml index bc27d1981..566866e1a 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/RtlSdr.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/RtlSdr.yaml @@ -40,7 +40,4 @@ RtlSdrReport: gains: type: array items: - properties: - gain: - description: gain in centi Bels - type: integer + $ref: "/doc/swagger/include/Structs.yaml#/Gain" \ No newline at end of file diff --git a/sdrbase/resources/webapi/doc/swagger/include/SDRPlay.yaml b/sdrbase/resources/webapi/doc/swagger/include/SDRPlay.yaml index a54937f24..10377d623 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/SDRPlay.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/SDRPlay.yaml @@ -44,34 +44,16 @@ SDRPlayReport: sampleRates: type: array items: - properties: - sampleRate: - description: sample rate in S/s - type: integer + $ref: "/doc/swagger/include/Structs.yaml#/SampleRate" bandwidths: type: array items: - properties: - bandwidth: - description: bandwidth in Hz - type: integer + $ref: "/doc/swagger/include/Structs.yaml#/Bandwidth" intermediateFrequencies: type: array items: - properties: - intermediateFrequency: - description: frequency in Hz - type: integer + $ref: "/doc/swagger/include/Structs.yaml#/Frequency" frequencyBands: type: array items: - properties: - bandName: - type: string - bandLow: - description: lower frequency bound in Hz - type: integer - bandHigh: - description: higher frequency bound in Hz - type: integer - \ No newline at end of file + $ref: "/doc/swagger/include/Structs.yaml#/FrequencyBand" diff --git a/sdrbase/resources/webapi/doc/swagger/include/Structs.yaml b/sdrbase/resources/webapi/doc/swagger/include/Structs.yaml new file mode 100644 index 000000000..58b6cf8ed --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger/include/Structs.yaml @@ -0,0 +1,34 @@ +SampleRate: + description: A sample rate expressed in samples per second (S/s) + properties: + rate: + type: integer + +Bandwidth: + description: A bandwidth expressed in Hertz (Hz) + properties: + bandwidth: + type: integer + +Frequency: + description: A frequency expressed in Hertz (Hz) + properties: + frequency: + type: integer + +FrequencyBand: + description: A band of frequencies given its boudaries in Hertz (Hz) + properties: + name: + type: string + lowerBound: + type: integer + higherBound: + type: integer + +Gain: + description: A gain expressed in centi-Bels (tenths of dB) + properties: + gainCB: + type: integer + \ No newline at end of file diff --git a/swagger/sdrangel/api/swagger/include/Airspy.yaml b/swagger/sdrangel/api/swagger/include/Airspy.yaml index ebb14bd7d..e7f03c8e5 100644 --- a/swagger/sdrangel/api/swagger/include/Airspy.yaml +++ b/swagger/sdrangel/api/swagger/include/Airspy.yaml @@ -46,9 +46,5 @@ AirspyReport: sampleRates: type: array items: - properties: - sampleRate: - description: sample rate in S/s - type: integer - + $ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/SampleRate" \ No newline at end of file diff --git a/swagger/sdrangel/api/swagger/include/AirspyHF.yaml b/swagger/sdrangel/api/swagger/include/AirspyHF.yaml index e0317e414..2835f21ce 100644 --- a/swagger/sdrangel/api/swagger/include/AirspyHF.yaml +++ b/swagger/sdrangel/api/swagger/include/AirspyHF.yaml @@ -26,9 +26,5 @@ AirspyHFReport: sampleRates: type: array items: - properties: - sampleRate: - description: sample rate in S/s - type: integer - + $ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/SampleRate" \ No newline at end of file diff --git a/swagger/sdrangel/api/swagger/include/Perseus.yaml b/swagger/sdrangel/api/swagger/include/Perseus.yaml index 79e075806..6ed9052b8 100644 --- a/swagger/sdrangel/api/swagger/include/Perseus.yaml +++ b/swagger/sdrangel/api/swagger/include/Perseus.yaml @@ -36,9 +36,5 @@ PerseusReport: sampleRates: type: array items: - properties: - sampleRate: - description: sample rate in S/s - type: integer - + $ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/SampleRate" \ No newline at end of file diff --git a/swagger/sdrangel/api/swagger/include/RtlSdr.yaml b/swagger/sdrangel/api/swagger/include/RtlSdr.yaml index bc27d1981..848b5a61f 100644 --- a/swagger/sdrangel/api/swagger/include/RtlSdr.yaml +++ b/swagger/sdrangel/api/swagger/include/RtlSdr.yaml @@ -40,7 +40,4 @@ RtlSdrReport: gains: type: array items: - properties: - gain: - description: gain in centi Bels - type: integer + $ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/Gain" \ No newline at end of file diff --git a/swagger/sdrangel/api/swagger/include/SDRPlay.yaml b/swagger/sdrangel/api/swagger/include/SDRPlay.yaml index a54937f24..3f74929e5 100644 --- a/swagger/sdrangel/api/swagger/include/SDRPlay.yaml +++ b/swagger/sdrangel/api/swagger/include/SDRPlay.yaml @@ -44,34 +44,16 @@ SDRPlayReport: sampleRates: type: array items: - properties: - sampleRate: - description: sample rate in S/s - type: integer + $ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/SampleRate" bandwidths: type: array items: - properties: - bandwidth: - description: bandwidth in Hz - type: integer + $ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/Bandwidth" intermediateFrequencies: type: array items: - properties: - intermediateFrequency: - description: frequency in Hz - type: integer + $ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/Frequency" frequencyBands: type: array items: - properties: - bandName: - type: string - bandLow: - description: lower frequency bound in Hz - type: integer - bandHigh: - description: higher frequency bound in Hz - type: integer - \ No newline at end of file + $ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/FrequencyBand" diff --git a/swagger/sdrangel/api/swagger/include/Structs.yaml b/swagger/sdrangel/api/swagger/include/Structs.yaml new file mode 100644 index 000000000..58b6cf8ed --- /dev/null +++ b/swagger/sdrangel/api/swagger/include/Structs.yaml @@ -0,0 +1,34 @@ +SampleRate: + description: A sample rate expressed in samples per second (S/s) + properties: + rate: + type: integer + +Bandwidth: + description: A bandwidth expressed in Hertz (Hz) + properties: + bandwidth: + type: integer + +Frequency: + description: A frequency expressed in Hertz (Hz) + properties: + frequency: + type: integer + +FrequencyBand: + description: A band of frequencies given its boudaries in Hertz (Hz) + properties: + name: + type: string + lowerBound: + type: integer + higherBound: + type: integer + +Gain: + description: A gain expressed in centi-Bels (tenths of dB) + properties: + gainCB: + type: integer + \ No newline at end of file diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 13e3d1406..61e42cd5a 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -917,7 +917,7 @@ margin-bottom: 20px; "sampleRates" : { "type" : "array", "items" : { - "$ref" : "#/definitions/AirspyReport_sampleRates" + "$ref" : "#/definitions/SampleRate" } } }, @@ -959,19 +959,11 @@ margin-bottom: 20px; "sampleRates" : { "type" : "array", "items" : { - "$ref" : "#/definitions/AirspyReport_sampleRates" + "$ref" : "#/definitions/SampleRate" } } }, "description" : "Airspy" -}; - defs.AirspyReport_sampleRates = { - "properties" : { - "sampleRate" : { - "type" : "integer", - "description" : "sample rate in S/s" - } - } }; defs.AirspySettings = { "properties" : { @@ -1212,6 +1204,14 @@ margin-bottom: 20px; } }, "description" : "BFMDemod" +}; + defs.Bandwidth = { + "properties" : { + "bandwidth" : { + "type" : "integer" + } + }, + "description" : "A bandwidth expressed in Hertz (Hz)" }; defs.BladeRFInputSettings = { "properties" : { @@ -2037,6 +2037,36 @@ margin-bottom: 20px; } }, "description" : "FileSource" +}; + defs.Frequency = { + "properties" : { + "frequency" : { + "type" : "integer" + } + }, + "description" : "A frequency expressed in Hertz (Hz)" +}; + defs.FrequencyBand = { + "properties" : { + "name" : { + "type" : "string" + }, + "lowerBound" : { + "type" : "integer" + }, + "higherBound" : { + "type" : "integer" + } + }, + "description" : "A band of frequencies given its boudaries in Hertz (Hz)" +}; + defs.Gain = { + "properties" : { + "gainCB" : { + "type" : "integer" + } + }, + "description" : "A gain expressed in centi-Bels (tenths of dB)" }; defs.HackRFInputSettings = { "properties" : { @@ -2596,7 +2626,7 @@ margin-bottom: 20px; "sampleRates" : { "type" : "array", "items" : { - "$ref" : "#/definitions/AirspyReport_sampleRates" + "$ref" : "#/definitions/SampleRate" } } }, @@ -2994,19 +3024,11 @@ margin-bottom: 20px; "gains" : { "type" : "array", "items" : { - "$ref" : "#/definitions/RtlSdrReport_gains" + "$ref" : "#/definitions/Gain" } } }, "description" : "RTLSDR" -}; - defs.RtlSdrReport_gains = { - "properties" : { - "gain" : { - "type" : "integer", - "description" : "gain in centi Bels" - } - } }; defs.RtlSdrSettings = { "properties" : { @@ -3065,60 +3087,29 @@ margin-bottom: 20px; "sampleRates" : { "type" : "array", "items" : { - "$ref" : "#/definitions/AirspyReport_sampleRates" + "$ref" : "#/definitions/SampleRate" } }, "bandwidths" : { "type" : "array", "items" : { - "$ref" : "#/definitions/SDRPlayReport_bandwidths" + "$ref" : "#/definitions/Bandwidth" } }, "intermediateFrequencies" : { "type" : "array", "items" : { - "$ref" : "#/definitions/SDRPlayReport_intermediateFrequencies" + "$ref" : "#/definitions/Frequency" } }, "frequencyBands" : { "type" : "array", "items" : { - "$ref" : "#/definitions/SDRPlayReport_frequencyBands" + "$ref" : "#/definitions/FrequencyBand" } } }, "description" : "SDRplay1" -}; - defs.SDRPlayReport_bandwidths = { - "properties" : { - "bandwidth" : { - "type" : "integer", - "description" : "bandwidth in Hz" - } - } -}; - defs.SDRPlayReport_frequencyBands = { - "properties" : { - "bandName" : { - "type" : "string" - }, - "bandLow" : { - "type" : "integer", - "description" : "lower frequency bound in Hz" - }, - "bandHigh" : { - "type" : "integer", - "description" : "higher frequency bound in Hz" - } - } -}; - defs.SDRPlayReport_intermediateFrequencies = { - "properties" : { - "intermediateFrequency" : { - "type" : "integer", - "description" : "frequency in Hz" - } - } }; defs.SDRPlaySettings = { "properties" : { @@ -3438,6 +3429,14 @@ margin-bottom: 20px; } }, "description" : "SSBMod" +}; + defs.SampleRate = { + "properties" : { + "rate" : { + "type" : "integer" + } + }, + "description" : "A sample rate expressed in samples per second (S/s)" }; defs.SamplingDevice = { "required" : [ "bandwidth", "centerFrequency", "hwType", "index", "sequence", "serial", "state", "streamIndex" ], @@ -22495,7 +22494,7 @@ except ApiException as e:
- Generated 2018-05-27T11:38:07.698+02:00 + Generated 2018-05-27T13:20:33.079+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGAirspyHFReport.cpp b/swagger/sdrangel/code/qt5/client/SWGAirspyHFReport.cpp index e7e1da594..497e318e2 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAirspyHFReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGAirspyHFReport.cpp @@ -38,7 +38,7 @@ SWGAirspyHFReport::~SWGAirspyHFReport() { void SWGAirspyHFReport::init() { - sample_rates = new QList(); + sample_rates = new QList(); m_sample_rates_isSet = false; } @@ -65,7 +65,7 @@ SWGAirspyHFReport::fromJson(QString &json) { void SWGAirspyHFReport::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGAirspyReport_sampleRates"); + ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGSampleRate"); } QString @@ -83,18 +83,18 @@ QJsonObject* SWGAirspyHFReport::asJsonObject() { QJsonObject* obj = new QJsonObject(); if(sample_rates->size() > 0){ - toJsonArray((QList*)sample_rates, obj, "sampleRates", "SWGAirspyReport_sampleRates"); + toJsonArray((QList*)sample_rates, obj, "sampleRates", "SWGSampleRate"); } return obj; } -QList* +QList* SWGAirspyHFReport::getSampleRates() { return sample_rates; } void -SWGAirspyHFReport::setSampleRates(QList* sample_rates) { +SWGAirspyHFReport::setSampleRates(QList* sample_rates) { this->sample_rates = sample_rates; this->m_sample_rates_isSet = true; } diff --git a/swagger/sdrangel/code/qt5/client/SWGAirspyHFReport.h b/swagger/sdrangel/code/qt5/client/SWGAirspyHFReport.h index 668dd2c50..e4e707e31 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAirspyHFReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGAirspyHFReport.h @@ -22,7 +22,7 @@ #include -#include "SWGAirspyReport_sampleRates.h" +#include "SWGSampleRate.h" #include #include "SWGObject.h" @@ -43,14 +43,14 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGAirspyHFReport* fromJson(QString &jsonString) override; - QList* getSampleRates(); - void setSampleRates(QList* sample_rates); + QList* getSampleRates(); + void setSampleRates(QList* sample_rates); virtual bool isSet() override; private: - QList* sample_rates; + QList* sample_rates; bool m_sample_rates_isSet; }; diff --git a/swagger/sdrangel/code/qt5/client/SWGAirspyReport.cpp b/swagger/sdrangel/code/qt5/client/SWGAirspyReport.cpp index 21bd1abf5..defe0192e 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAirspyReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGAirspyReport.cpp @@ -38,7 +38,7 @@ SWGAirspyReport::~SWGAirspyReport() { void SWGAirspyReport::init() { - sample_rates = new QList(); + sample_rates = new QList(); m_sample_rates_isSet = false; } @@ -65,7 +65,7 @@ SWGAirspyReport::fromJson(QString &json) { void SWGAirspyReport::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGAirspyReport_sampleRates"); + ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGSampleRate"); } QString @@ -83,18 +83,18 @@ QJsonObject* SWGAirspyReport::asJsonObject() { QJsonObject* obj = new QJsonObject(); if(sample_rates->size() > 0){ - toJsonArray((QList*)sample_rates, obj, "sampleRates", "SWGAirspyReport_sampleRates"); + toJsonArray((QList*)sample_rates, obj, "sampleRates", "SWGSampleRate"); } return obj; } -QList* +QList* SWGAirspyReport::getSampleRates() { return sample_rates; } void -SWGAirspyReport::setSampleRates(QList* sample_rates) { +SWGAirspyReport::setSampleRates(QList* sample_rates) { this->sample_rates = sample_rates; this->m_sample_rates_isSet = true; } diff --git a/swagger/sdrangel/code/qt5/client/SWGAirspyReport.h b/swagger/sdrangel/code/qt5/client/SWGAirspyReport.h index 290307372..3bb0f3ee4 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAirspyReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGAirspyReport.h @@ -22,7 +22,7 @@ #include -#include "SWGAirspyReport_sampleRates.h" +#include "SWGSampleRate.h" #include #include "SWGObject.h" @@ -43,14 +43,14 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGAirspyReport* fromJson(QString &jsonString) override; - QList* getSampleRates(); - void setSampleRates(QList* sample_rates); + QList* getSampleRates(); + void setSampleRates(QList* sample_rates); virtual bool isSet() override; private: - QList* sample_rates; + QList* sample_rates; bool m_sample_rates_isSet; }; diff --git a/swagger/sdrangel/code/qt5/client/SWGBandwidth.cpp b/swagger/sdrangel/code/qt5/client/SWGBandwidth.cpp new file mode 100644 index 000000000..95ba9cf27 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGBandwidth.cpp @@ -0,0 +1,106 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * 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. + */ + + +#include "SWGBandwidth.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGBandwidth::SWGBandwidth(QString* json) { + init(); + this->fromJson(*json); +} + +SWGBandwidth::SWGBandwidth() { + bandwidth = 0; + m_bandwidth_isSet = false; +} + +SWGBandwidth::~SWGBandwidth() { + this->cleanup(); +} + +void +SWGBandwidth::init() { + bandwidth = 0; + m_bandwidth_isSet = false; +} + +void +SWGBandwidth::cleanup() { + +} + +SWGBandwidth* +SWGBandwidth::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGBandwidth::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", ""); + +} + +QString +SWGBandwidth::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGBandwidth::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_bandwidth_isSet){ + obj->insert("bandwidth", QJsonValue(bandwidth)); + } + + return obj; +} + +qint32 +SWGBandwidth::getBandwidth() { + return bandwidth; +} +void +SWGBandwidth::setBandwidth(qint32 bandwidth) { + this->bandwidth = bandwidth; + this->m_bandwidth_isSet = true; +} + + +bool +SWGBandwidth::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_bandwidth_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGBandwidth.h b/swagger/sdrangel/code/qt5/client/SWGBandwidth.h new file mode 100644 index 000000000..98f885f07 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGBandwidth.h @@ -0,0 +1,58 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * 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. + */ + +/* + * SWGBandwidth.h + * + * A bandwidth expressed in Hertz (Hz) + */ + +#ifndef SWGBandwidth_H_ +#define SWGBandwidth_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGBandwidth: public SWGObject { +public: + SWGBandwidth(); + SWGBandwidth(QString* json); + virtual ~SWGBandwidth(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGBandwidth* fromJson(QString &jsonString) override; + + qint32 getBandwidth(); + void setBandwidth(qint32 bandwidth); + + + virtual bool isSet() override; + +private: + qint32 bandwidth; + bool m_bandwidth_isSet; + +}; + +} + +#endif /* SWGBandwidth_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGFrequency.cpp b/swagger/sdrangel/code/qt5/client/SWGFrequency.cpp new file mode 100644 index 000000000..41a8e1117 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFrequency.cpp @@ -0,0 +1,106 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * 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. + */ + + +#include "SWGFrequency.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGFrequency::SWGFrequency(QString* json) { + init(); + this->fromJson(*json); +} + +SWGFrequency::SWGFrequency() { + frequency = 0; + m_frequency_isSet = false; +} + +SWGFrequency::~SWGFrequency() { + this->cleanup(); +} + +void +SWGFrequency::init() { + frequency = 0; + m_frequency_isSet = false; +} + +void +SWGFrequency::cleanup() { + +} + +SWGFrequency* +SWGFrequency::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGFrequency::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&frequency, pJson["frequency"], "qint32", ""); + +} + +QString +SWGFrequency::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGFrequency::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_frequency_isSet){ + obj->insert("frequency", QJsonValue(frequency)); + } + + return obj; +} + +qint32 +SWGFrequency::getFrequency() { + return frequency; +} +void +SWGFrequency::setFrequency(qint32 frequency) { + this->frequency = frequency; + this->m_frequency_isSet = true; +} + + +bool +SWGFrequency::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_frequency_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGFrequency.h b/swagger/sdrangel/code/qt5/client/SWGFrequency.h new file mode 100644 index 000000000..08718a9ac --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFrequency.h @@ -0,0 +1,58 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * 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. + */ + +/* + * SWGFrequency.h + * + * A frequency expressed in Hertz (Hz) + */ + +#ifndef SWGFrequency_H_ +#define SWGFrequency_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGFrequency: public SWGObject { +public: + SWGFrequency(); + SWGFrequency(QString* json); + virtual ~SWGFrequency(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGFrequency* fromJson(QString &jsonString) override; + + qint32 getFrequency(); + void setFrequency(qint32 frequency); + + + virtual bool isSet() override; + +private: + qint32 frequency; + bool m_frequency_isSet; + +}; + +} + +#endif /* SWGFrequency_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGFrequencyBand.cpp b/swagger/sdrangel/code/qt5/client/SWGFrequencyBand.cpp new file mode 100644 index 000000000..3c516f363 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFrequencyBand.cpp @@ -0,0 +1,150 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * 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. + */ + + +#include "SWGFrequencyBand.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGFrequencyBand::SWGFrequencyBand(QString* json) { + init(); + this->fromJson(*json); +} + +SWGFrequencyBand::SWGFrequencyBand() { + name = nullptr; + m_name_isSet = false; + lower_bound = 0; + m_lower_bound_isSet = false; + higher_bound = 0; + m_higher_bound_isSet = false; +} + +SWGFrequencyBand::~SWGFrequencyBand() { + this->cleanup(); +} + +void +SWGFrequencyBand::init() { + name = new QString(""); + m_name_isSet = false; + lower_bound = 0; + m_lower_bound_isSet = false; + higher_bound = 0; + m_higher_bound_isSet = false; +} + +void +SWGFrequencyBand::cleanup() { + if(name != nullptr) { + delete name; + } + + +} + +SWGFrequencyBand* +SWGFrequencyBand::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGFrequencyBand::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString"); + + ::SWGSDRangel::setValue(&lower_bound, pJson["lowerBound"], "qint32", ""); + + ::SWGSDRangel::setValue(&higher_bound, pJson["higherBound"], "qint32", ""); + +} + +QString +SWGFrequencyBand::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGFrequencyBand::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(name != nullptr && *name != QString("")){ + toJsonValue(QString("name"), name, obj, QString("QString")); + } + if(m_lower_bound_isSet){ + obj->insert("lowerBound", QJsonValue(lower_bound)); + } + if(m_higher_bound_isSet){ + obj->insert("higherBound", QJsonValue(higher_bound)); + } + + return obj; +} + +QString* +SWGFrequencyBand::getName() { + return name; +} +void +SWGFrequencyBand::setName(QString* name) { + this->name = name; + this->m_name_isSet = true; +} + +qint32 +SWGFrequencyBand::getLowerBound() { + return lower_bound; +} +void +SWGFrequencyBand::setLowerBound(qint32 lower_bound) { + this->lower_bound = lower_bound; + this->m_lower_bound_isSet = true; +} + +qint32 +SWGFrequencyBand::getHigherBound() { + return higher_bound; +} +void +SWGFrequencyBand::setHigherBound(qint32 higher_bound) { + this->higher_bound = higher_bound; + this->m_higher_bound_isSet = true; +} + + +bool +SWGFrequencyBand::isSet(){ + bool isObjectUpdated = false; + do{ + if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;} + if(m_lower_bound_isSet){ isObjectUpdated = true; break;} + if(m_higher_bound_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGFrequencyBand.h b/swagger/sdrangel/code/qt5/client/SWGFrequencyBand.h new file mode 100644 index 000000000..39e194249 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFrequencyBand.h @@ -0,0 +1,71 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * 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. + */ + +/* + * SWGFrequencyBand.h + * + * A band of frequencies given its boudaries in Hertz (Hz) + */ + +#ifndef SWGFrequencyBand_H_ +#define SWGFrequencyBand_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGFrequencyBand: public SWGObject { +public: + SWGFrequencyBand(); + SWGFrequencyBand(QString* json); + virtual ~SWGFrequencyBand(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGFrequencyBand* fromJson(QString &jsonString) override; + + QString* getName(); + void setName(QString* name); + + qint32 getLowerBound(); + void setLowerBound(qint32 lower_bound); + + qint32 getHigherBound(); + void setHigherBound(qint32 higher_bound); + + + virtual bool isSet() override; + +private: + QString* name; + bool m_name_isSet; + + qint32 lower_bound; + bool m_lower_bound_isSet; + + qint32 higher_bound; + bool m_higher_bound_isSet; + +}; + +} + +#endif /* SWGFrequencyBand_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGGain.cpp b/swagger/sdrangel/code/qt5/client/SWGGain.cpp new file mode 100644 index 000000000..2baf4f7ea --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGGain.cpp @@ -0,0 +1,106 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * 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. + */ + + +#include "SWGGain.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGGain::SWGGain(QString* json) { + init(); + this->fromJson(*json); +} + +SWGGain::SWGGain() { + gain_cb = 0; + m_gain_cb_isSet = false; +} + +SWGGain::~SWGGain() { + this->cleanup(); +} + +void +SWGGain::init() { + gain_cb = 0; + m_gain_cb_isSet = false; +} + +void +SWGGain::cleanup() { + +} + +SWGGain* +SWGGain::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGGain::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&gain_cb, pJson["gainCB"], "qint32", ""); + +} + +QString +SWGGain::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGGain::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_gain_cb_isSet){ + obj->insert("gainCB", QJsonValue(gain_cb)); + } + + return obj; +} + +qint32 +SWGGain::getGainCb() { + return gain_cb; +} +void +SWGGain::setGainCb(qint32 gain_cb) { + this->gain_cb = gain_cb; + this->m_gain_cb_isSet = true; +} + + +bool +SWGGain::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_gain_cb_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGGain.h b/swagger/sdrangel/code/qt5/client/SWGGain.h new file mode 100644 index 000000000..5be40e4bb --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGGain.h @@ -0,0 +1,58 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * 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. + */ + +/* + * SWGGain.h + * + * A gain expressed in centi-Bels (tenths of dB) + */ + +#ifndef SWGGain_H_ +#define SWGGain_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGGain: public SWGObject { +public: + SWGGain(); + SWGGain(QString* json); + virtual ~SWGGain(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGGain* fromJson(QString &jsonString) override; + + qint32 getGainCb(); + void setGainCb(qint32 gain_cb); + + + virtual bool isSet() override; + +private: + qint32 gain_cb; + bool m_gain_cb_isSet; + +}; + +} + +#endif /* SWGGain_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index c9f9f2718..0e797f2f4 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -23,13 +23,13 @@ #include "SWGAirspyHFReport.h" #include "SWGAirspyHFSettings.h" #include "SWGAirspyReport.h" -#include "SWGAirspyReport_sampleRates.h" #include "SWGAirspySettings.h" #include "SWGAudioDevices.h" #include "SWGAudioInputDevice.h" #include "SWGAudioOutputDevice.h" #include "SWGBFMDemodReport.h" #include "SWGBFMDemodSettings.h" +#include "SWGBandwidth.h" #include "SWGBladeRFInputSettings.h" #include "SWGBladeRFOutputSettings.h" #include "SWGCWKeyerSettings.h" @@ -53,6 +53,9 @@ #include "SWGFCDProSettings.h" #include "SWGFileSourceReport.h" #include "SWGFileSourceSettings.h" +#include "SWGFrequency.h" +#include "SWGFrequencyBand.h" +#include "SWGGain.h" #include "SWGHackRFInputSettings.h" #include "SWGHackRFOutputSettings.h" #include "SWGInstanceChannelsResponse.h" @@ -84,12 +87,8 @@ #include "SWGRDSReport.h" #include "SWGRDSReport_altFrequencies.h" #include "SWGRtlSdrReport.h" -#include "SWGRtlSdrReport_gains.h" #include "SWGRtlSdrSettings.h" #include "SWGSDRPlayReport.h" -#include "SWGSDRPlayReport_bandwidths.h" -#include "SWGSDRPlayReport_frequencyBands.h" -#include "SWGSDRPlayReport_intermediateFrequencies.h" #include "SWGSDRPlaySettings.h" #include "SWGSDRdaemonSourceReport.h" #include "SWGSDRdaemonSourceSettings.h" @@ -97,6 +96,7 @@ #include "SWGSSBDemodSettings.h" #include "SWGSSBModReport.h" #include "SWGSSBModSettings.h" +#include "SWGSampleRate.h" #include "SWGSamplingDevice.h" #include "SWGSuccessResponse.h" #include "SWGUDPSinkReport.h" @@ -138,9 +138,6 @@ namespace SWGSDRangel { if(QString("SWGAirspyReport").compare(type) == 0) { return new SWGAirspyReport(); } - if(QString("SWGAirspyReport_sampleRates").compare(type) == 0) { - return new SWGAirspyReport_sampleRates(); - } if(QString("SWGAirspySettings").compare(type) == 0) { return new SWGAirspySettings(); } @@ -159,6 +156,9 @@ namespace SWGSDRangel { if(QString("SWGBFMDemodSettings").compare(type) == 0) { return new SWGBFMDemodSettings(); } + if(QString("SWGBandwidth").compare(type) == 0) { + return new SWGBandwidth(); + } if(QString("SWGBladeRFInputSettings").compare(type) == 0) { return new SWGBladeRFInputSettings(); } @@ -228,6 +228,15 @@ namespace SWGSDRangel { if(QString("SWGFileSourceSettings").compare(type) == 0) { return new SWGFileSourceSettings(); } + if(QString("SWGFrequency").compare(type) == 0) { + return new SWGFrequency(); + } + if(QString("SWGFrequencyBand").compare(type) == 0) { + return new SWGFrequencyBand(); + } + if(QString("SWGGain").compare(type) == 0) { + return new SWGGain(); + } if(QString("SWGHackRFInputSettings").compare(type) == 0) { return new SWGHackRFInputSettings(); } @@ -321,24 +330,12 @@ namespace SWGSDRangel { if(QString("SWGRtlSdrReport").compare(type) == 0) { return new SWGRtlSdrReport(); } - if(QString("SWGRtlSdrReport_gains").compare(type) == 0) { - return new SWGRtlSdrReport_gains(); - } if(QString("SWGRtlSdrSettings").compare(type) == 0) { return new SWGRtlSdrSettings(); } if(QString("SWGSDRPlayReport").compare(type) == 0) { return new SWGSDRPlayReport(); } - if(QString("SWGSDRPlayReport_bandwidths").compare(type) == 0) { - return new SWGSDRPlayReport_bandwidths(); - } - if(QString("SWGSDRPlayReport_frequencyBands").compare(type) == 0) { - return new SWGSDRPlayReport_frequencyBands(); - } - if(QString("SWGSDRPlayReport_intermediateFrequencies").compare(type) == 0) { - return new SWGSDRPlayReport_intermediateFrequencies(); - } if(QString("SWGSDRPlaySettings").compare(type) == 0) { return new SWGSDRPlaySettings(); } @@ -360,6 +357,9 @@ namespace SWGSDRangel { if(QString("SWGSSBModSettings").compare(type) == 0) { return new SWGSSBModSettings(); } + if(QString("SWGSampleRate").compare(type) == 0) { + return new SWGSampleRate(); + } if(QString("SWGSamplingDevice").compare(type) == 0) { return new SWGSamplingDevice(); } diff --git a/swagger/sdrangel/code/qt5/client/SWGPerseusReport.cpp b/swagger/sdrangel/code/qt5/client/SWGPerseusReport.cpp index dada1aa3a..8254287b6 100644 --- a/swagger/sdrangel/code/qt5/client/SWGPerseusReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGPerseusReport.cpp @@ -38,7 +38,7 @@ SWGPerseusReport::~SWGPerseusReport() { void SWGPerseusReport::init() { - sample_rates = new QList(); + sample_rates = new QList(); m_sample_rates_isSet = false; } @@ -65,7 +65,7 @@ SWGPerseusReport::fromJson(QString &json) { void SWGPerseusReport::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGAirspyReport_sampleRates"); + ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGSampleRate"); } QString @@ -83,18 +83,18 @@ QJsonObject* SWGPerseusReport::asJsonObject() { QJsonObject* obj = new QJsonObject(); if(sample_rates->size() > 0){ - toJsonArray((QList*)sample_rates, obj, "sampleRates", "SWGAirspyReport_sampleRates"); + toJsonArray((QList*)sample_rates, obj, "sampleRates", "SWGSampleRate"); } return obj; } -QList* +QList* SWGPerseusReport::getSampleRates() { return sample_rates; } void -SWGPerseusReport::setSampleRates(QList* sample_rates) { +SWGPerseusReport::setSampleRates(QList* sample_rates) { this->sample_rates = sample_rates; this->m_sample_rates_isSet = true; } diff --git a/swagger/sdrangel/code/qt5/client/SWGPerseusReport.h b/swagger/sdrangel/code/qt5/client/SWGPerseusReport.h index 091090da1..5d118602b 100644 --- a/swagger/sdrangel/code/qt5/client/SWGPerseusReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGPerseusReport.h @@ -22,7 +22,7 @@ #include -#include "SWGAirspyReport_sampleRates.h" +#include "SWGSampleRate.h" #include #include "SWGObject.h" @@ -43,14 +43,14 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGPerseusReport* fromJson(QString &jsonString) override; - QList* getSampleRates(); - void setSampleRates(QList* sample_rates); + QList* getSampleRates(); + void setSampleRates(QList* sample_rates); virtual bool isSet() override; private: - QList* sample_rates; + QList* sample_rates; bool m_sample_rates_isSet; }; diff --git a/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.cpp b/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.cpp index 824ff9dae..61095fbbb 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.cpp @@ -38,7 +38,7 @@ SWGRtlSdrReport::~SWGRtlSdrReport() { void SWGRtlSdrReport::init() { - gains = new QList(); + gains = new QList(); m_gains_isSet = false; } @@ -65,7 +65,7 @@ SWGRtlSdrReport::fromJson(QString &json) { void SWGRtlSdrReport::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&gains, pJson["gains"], "QList", "SWGRtlSdrReport_gains"); + ::SWGSDRangel::setValue(&gains, pJson["gains"], "QList", "SWGGain"); } QString @@ -83,18 +83,18 @@ QJsonObject* SWGRtlSdrReport::asJsonObject() { QJsonObject* obj = new QJsonObject(); if(gains->size() > 0){ - toJsonArray((QList*)gains, obj, "gains", "SWGRtlSdrReport_gains"); + toJsonArray((QList*)gains, obj, "gains", "SWGGain"); } return obj; } -QList* +QList* SWGRtlSdrReport::getGains() { return gains; } void -SWGRtlSdrReport::setGains(QList* gains) { +SWGRtlSdrReport::setGains(QList* gains) { this->gains = gains; this->m_gains_isSet = true; } diff --git a/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.h b/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.h index f6fa9a371..6d2cb4958 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.h @@ -22,7 +22,7 @@ #include -#include "SWGRtlSdrReport_gains.h" +#include "SWGGain.h" #include #include "SWGObject.h" @@ -43,14 +43,14 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGRtlSdrReport* fromJson(QString &jsonString) override; - QList* getGains(); - void setGains(QList* gains); + QList* getGains(); + void setGains(QList* gains); virtual bool isSet() override; private: - QList* gains; + QList* gains; bool m_gains_isSet; }; diff --git a/swagger/sdrangel/code/qt5/client/SWGSDRPlayReport.cpp b/swagger/sdrangel/code/qt5/client/SWGSDRPlayReport.cpp index d339f4a83..e7a429872 100644 --- a/swagger/sdrangel/code/qt5/client/SWGSDRPlayReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGSDRPlayReport.cpp @@ -44,13 +44,13 @@ SWGSDRPlayReport::~SWGSDRPlayReport() { void SWGSDRPlayReport::init() { - sample_rates = new QList(); + sample_rates = new QList(); m_sample_rates_isSet = false; - bandwidths = new QList(); + bandwidths = new QList(); m_bandwidths_isSet = false; - intermediate_frequencies = new QList(); + intermediate_frequencies = new QList(); m_intermediate_frequencies_isSet = false; - frequency_bands = new QList(); + frequency_bands = new QList(); m_frequency_bands_isSet = false; } @@ -98,13 +98,13 @@ SWGSDRPlayReport::fromJson(QString &json) { void SWGSDRPlayReport::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGAirspyReport_sampleRates"); + ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGSampleRate"); - ::SWGSDRangel::setValue(&bandwidths, pJson["bandwidths"], "QList", "SWGSDRPlayReport_bandwidths"); + ::SWGSDRangel::setValue(&bandwidths, pJson["bandwidths"], "QList", "SWGBandwidth"); - ::SWGSDRangel::setValue(&intermediate_frequencies, pJson["intermediateFrequencies"], "QList", "SWGSDRPlayReport_intermediateFrequencies"); + ::SWGSDRangel::setValue(&intermediate_frequencies, pJson["intermediateFrequencies"], "QList", "SWGFrequency"); - ::SWGSDRangel::setValue(&frequency_bands, pJson["frequencyBands"], "QList", "SWGSDRPlayReport_frequencyBands"); + ::SWGSDRangel::setValue(&frequency_bands, pJson["frequencyBands"], "QList", "SWGFrequencyBand"); } QString @@ -122,57 +122,57 @@ QJsonObject* SWGSDRPlayReport::asJsonObject() { QJsonObject* obj = new QJsonObject(); if(sample_rates->size() > 0){ - toJsonArray((QList*)sample_rates, obj, "sampleRates", "SWGAirspyReport_sampleRates"); + toJsonArray((QList*)sample_rates, obj, "sampleRates", "SWGSampleRate"); } if(bandwidths->size() > 0){ - toJsonArray((QList*)bandwidths, obj, "bandwidths", "SWGSDRPlayReport_bandwidths"); + toJsonArray((QList*)bandwidths, obj, "bandwidths", "SWGBandwidth"); } if(intermediate_frequencies->size() > 0){ - toJsonArray((QList*)intermediate_frequencies, obj, "intermediateFrequencies", "SWGSDRPlayReport_intermediateFrequencies"); + toJsonArray((QList*)intermediate_frequencies, obj, "intermediateFrequencies", "SWGFrequency"); } if(frequency_bands->size() > 0){ - toJsonArray((QList*)frequency_bands, obj, "frequencyBands", "SWGSDRPlayReport_frequencyBands"); + toJsonArray((QList*)frequency_bands, obj, "frequencyBands", "SWGFrequencyBand"); } return obj; } -QList* +QList* SWGSDRPlayReport::getSampleRates() { return sample_rates; } void -SWGSDRPlayReport::setSampleRates(QList* sample_rates) { +SWGSDRPlayReport::setSampleRates(QList* sample_rates) { this->sample_rates = sample_rates; this->m_sample_rates_isSet = true; } -QList* +QList* SWGSDRPlayReport::getBandwidths() { return bandwidths; } void -SWGSDRPlayReport::setBandwidths(QList* bandwidths) { +SWGSDRPlayReport::setBandwidths(QList* bandwidths) { this->bandwidths = bandwidths; this->m_bandwidths_isSet = true; } -QList* +QList* SWGSDRPlayReport::getIntermediateFrequencies() { return intermediate_frequencies; } void -SWGSDRPlayReport::setIntermediateFrequencies(QList* intermediate_frequencies) { +SWGSDRPlayReport::setIntermediateFrequencies(QList* intermediate_frequencies) { this->intermediate_frequencies = intermediate_frequencies; this->m_intermediate_frequencies_isSet = true; } -QList* +QList* SWGSDRPlayReport::getFrequencyBands() { return frequency_bands; } void -SWGSDRPlayReport::setFrequencyBands(QList* frequency_bands) { +SWGSDRPlayReport::setFrequencyBands(QList* frequency_bands) { this->frequency_bands = frequency_bands; this->m_frequency_bands_isSet = true; } diff --git a/swagger/sdrangel/code/qt5/client/SWGSDRPlayReport.h b/swagger/sdrangel/code/qt5/client/SWGSDRPlayReport.h index 3fd62716c..4a9590c46 100644 --- a/swagger/sdrangel/code/qt5/client/SWGSDRPlayReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGSDRPlayReport.h @@ -22,10 +22,10 @@ #include -#include "SWGAirspyReport_sampleRates.h" -#include "SWGSDRPlayReport_bandwidths.h" -#include "SWGSDRPlayReport_frequencyBands.h" -#include "SWGSDRPlayReport_intermediateFrequencies.h" +#include "SWGBandwidth.h" +#include "SWGFrequency.h" +#include "SWGFrequencyBand.h" +#include "SWGSampleRate.h" #include #include "SWGObject.h" @@ -46,32 +46,32 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGSDRPlayReport* fromJson(QString &jsonString) override; - QList* getSampleRates(); - void setSampleRates(QList* sample_rates); + QList* getSampleRates(); + void setSampleRates(QList* sample_rates); - QList* getBandwidths(); - void setBandwidths(QList* bandwidths); + QList* getBandwidths(); + void setBandwidths(QList* bandwidths); - QList* getIntermediateFrequencies(); - void setIntermediateFrequencies(QList* intermediate_frequencies); + QList* getIntermediateFrequencies(); + void setIntermediateFrequencies(QList* intermediate_frequencies); - QList* getFrequencyBands(); - void setFrequencyBands(QList* frequency_bands); + QList* getFrequencyBands(); + void setFrequencyBands(QList* frequency_bands); virtual bool isSet() override; private: - QList* sample_rates; + QList* sample_rates; bool m_sample_rates_isSet; - QList* bandwidths; + QList* bandwidths; bool m_bandwidths_isSet; - QList* intermediate_frequencies; + QList* intermediate_frequencies; bool m_intermediate_frequencies_isSet; - QList* frequency_bands; + QList* frequency_bands; bool m_frequency_bands_isSet; }; diff --git a/swagger/sdrangel/code/qt5/client/SWGSampleRate.cpp b/swagger/sdrangel/code/qt5/client/SWGSampleRate.cpp new file mode 100644 index 000000000..e3316dd27 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGSampleRate.cpp @@ -0,0 +1,106 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * 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. + */ + + +#include "SWGSampleRate.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGSampleRate::SWGSampleRate(QString* json) { + init(); + this->fromJson(*json); +} + +SWGSampleRate::SWGSampleRate() { + rate = 0; + m_rate_isSet = false; +} + +SWGSampleRate::~SWGSampleRate() { + this->cleanup(); +} + +void +SWGSampleRate::init() { + rate = 0; + m_rate_isSet = false; +} + +void +SWGSampleRate::cleanup() { + +} + +SWGSampleRate* +SWGSampleRate::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGSampleRate::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&rate, pJson["rate"], "qint32", ""); + +} + +QString +SWGSampleRate::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGSampleRate::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_rate_isSet){ + obj->insert("rate", QJsonValue(rate)); + } + + return obj; +} + +qint32 +SWGSampleRate::getRate() { + return rate; +} +void +SWGSampleRate::setRate(qint32 rate) { + this->rate = rate; + this->m_rate_isSet = true; +} + + +bool +SWGSampleRate::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_rate_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGSampleRate.h b/swagger/sdrangel/code/qt5/client/SWGSampleRate.h new file mode 100644 index 000000000..11bd10e8a --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGSampleRate.h @@ -0,0 +1,58 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * 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. + */ + +/* + * SWGSampleRate.h + * + * A sample rate expressed in samples per second (S/s) + */ + +#ifndef SWGSampleRate_H_ +#define SWGSampleRate_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGSampleRate: public SWGObject { +public: + SWGSampleRate(); + SWGSampleRate(QString* json); + virtual ~SWGSampleRate(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGSampleRate* fromJson(QString &jsonString) override; + + qint32 getRate(); + void setRate(qint32 rate); + + + virtual bool isSet() override; + +private: + qint32 rate; + bool m_rate_isSet; + +}; + +} + +#endif /* SWGSampleRate_H_ */