From d6b156a8d3f7cfaa7280ee1e61bc9b6b9e3338aa Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 6 Dec 2017 08:25:04 +0100 Subject: [PATCH] Web API: added FileSource settings. Generated code and up to date documentation --- sdrbase/resources/index.html | 534 +++++++++++++++++- swagger/sdrangel/code/html2/index.html | 534 +++++++++++++++++- .../code/qt5/client/SWGDeviceSettingsImpl.cpp | 17 + .../code/qt5/client/SWGDeviceSettingsImpl.h | 5 + .../code/qt5/client/SWGFileSourceSettings.cpp | 95 ++++ .../code/qt5/client/SWGFileSourceSettings.h | 55 ++ .../code/qt5/client/SWGModelFactory.h | 4 + 7 files changed, 1242 insertions(+), 2 deletions(-) create mode 100644 swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.h diff --git a/sdrbase/resources/index.html b/sdrbase/resources/index.html index 0ad35d958..2776c4bfe 100644 --- a/sdrbase/resources/index.html +++ b/sdrbase/resources/index.html @@ -924,6 +924,37 @@ margin-bottom: 20px; } }, "description" : "List of device sets opened in this instance" +}; + defs.DeviceSettings = { + "required" : [ "deviceType" ], + "discriminator" : "deviceType", + "properties" : { + "deviceType" : { + "type" : "string" + }, + "data" : { + "type" : "object", + "properties" : { } + } + }, + "description" : "Base device settings" +}; + defs.DeviceSettingsImpl = { + "properties" : { + "fileSource" : { + "$ref" : "#/definitions/FileSourceSettings" + }, + "rtlsdr" : { + "$ref" : "#/definitions/RtlSdrSettings" + }, + "limesdrInput" : { + "$ref" : "#/definitions/LimeSdrInputSettings" + }, + "limesdrOutput" : { + "$ref" : "#/definitions/LimeSdrOutputSettings" + } + }, + "description" : "dummy structure to handle all devices settings" }; defs.ErrorResponse = { "required" : [ "message" ], @@ -932,6 +963,13 @@ margin-bottom: 20px; "type" : "string" } } +}; + defs.FileSourceSettings = { + "properties" : { + "fileName" : { + "type" : "string" + } + } }; defs.InstanceChannelsResponse = { "required" : [ "channelcount" ], @@ -983,6 +1021,112 @@ margin-bottom: 20px; } }, "description" : "Summarized information about this SDRangel instance" +}; + defs.LimeSdrInputSettings = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "devSampleRate" : { + "type" : "integer" + }, + "log2HardDecim" : { + "type" : "integer" + }, + "dcBlock" : { + "type" : "integer" + }, + "iqCorrection" : { + "type" : "integer" + }, + "log2SoftDecim" : { + "type" : "integer" + }, + "lpfBW" : { + "type" : "integer" + }, + "lpfFIREnable" : { + "type" : "integer" + }, + "lpfFIRBW" : { + "type" : "integer" + }, + "gain" : { + "type" : "integer" + }, + "ncoEnable" : { + "type" : "integer" + }, + "ncoFrequency" : { + "type" : "integer" + }, + "antennaPath" : { + "type" : "integer" + }, + "gainMode" : { + "type" : "integer" + }, + "lnaGain" : { + "type" : "integer" + }, + "tiaGain" : { + "type" : "integer" + }, + "pgaGain" : { + "type" : "integer" + }, + "extClock" : { + "type" : "integer" + }, + "extClockFreq" : { + "type" : "integer" + } + } +}; + defs.LimeSdrOutputSettings = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "devSampleRate" : { + "type" : "integer" + }, + "log2HardInterp" : { + "type" : "integer" + }, + "log2SoftInterp" : { + "type" : "integer" + }, + "lpfBW" : { + "type" : "integer" + }, + "lpfFIREnable" : { + "type" : "integer" + }, + "lpfFIRBW" : { + "type" : "integer" + }, + "gain" : { + "type" : "integer" + }, + "ncoEnable" : { + "type" : "integer" + }, + "ncoFrequency" : { + "type" : "integer" + }, + "antennaPath" : { + "type" : "integer" + }, + "extClock" : { + "type" : "integer" + }, + "extClockFreq" : { + "type" : "integer" + } + } }; defs.LocationInformation = { "required" : [ "latitude", "longitude" ], @@ -1111,6 +1255,51 @@ margin-bottom: 20px; } }, "description" : "Settings presets" +}; + defs.RtlSdrSettings = { + "properties" : { + "devSampleRate" : { + "type" : "integer" + }, + "lowSampleRate" : { + "type" : "integer" + }, + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "gain" : { + "type" : "integer" + }, + "loPpmCorrection" : { + "type" : "integer" + }, + "log2Decim" : { + "type" : "integer" + }, + "fcPos" : { + "type" : "integer" + }, + "dcBlock" : { + "type" : "integer" + }, + "iqImbalance" : { + "type" : "integer" + }, + "agc" : { + "type" : "integer" + }, + "noModMode" : { + "type" : "integer" + }, + "transverterMode" : { + "type" : "integer" + }, + "transverterDeltaFrequency" : { + "type" : "integer", + "format" : "int64" + } + } }; defs.SamplingDevice = { "required" : [ "bandwidth", "centerFrequency", "hwType", "index", "sequence", "serial", "state", "streamIndex" ], @@ -1187,6 +1376,9 @@ margin-bottom: 20px; +
  • + devicesetDeviceGet +
  • devicesetDevicePut
  • @@ -1269,6 +1461,346 @@ margin-bottom: 20px;

    DeviceSet

    +
    +
    +
    +

    devicesetDeviceGet

    +

    +
    +
    +
    +

    +

    Get device settings

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/device
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://localhost:8091/sdrangel/deviceset/{deviceSetIndex}/device"
    +
    +
    +
    import SWGSDRangel.*;
    +import SWGSDRangel.auth.*;
    +import SWGSDRangel.model.*;
    +import SWGSDRangel.api.DeviceSetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DeviceSetApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DeviceSetApi apiInstance = new DeviceSetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSettings result = apiInstance.devicesetDeviceGet(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DeviceSetApi#devicesetDeviceGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.DeviceSetApi;
    +
    +public class DeviceSetApiExample {
    +
    +    public static void main(String[] args) {
    +        DeviceSetApi apiInstance = new DeviceSetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSettings result = apiInstance.devicesetDeviceGet(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DeviceSetApi#devicesetDeviceGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +
    +DeviceSetApi *apiInstance = [[DeviceSetApi alloc] init];
    +
    +[apiInstance devicesetDeviceGetWith:deviceSetIndex
    +              completionHandler: ^(DeviceSettings output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DeviceSetApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetDeviceGet(deviceSetIndex, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class devicesetDeviceGetExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DeviceSetApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +
    +            try
    +            {
    +                DeviceSettings result = apiInstance.devicesetDeviceGet(deviceSetIndex);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DeviceSetApi.devicesetDeviceGet: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DeviceSetApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +
    +try {
    +    $result = $api_instance->devicesetDeviceGet($deviceSetIndex);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DeviceSetApi->devicesetDeviceGet: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::DeviceSetApi;
    +
    +my $api_instance = SWGSDRangel::DeviceSetApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +
    +eval { 
    +    my $result = $api_instance->devicesetDeviceGet(deviceSetIndex => $deviceSetIndex);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DeviceSetApi->devicesetDeviceGet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_sdrangel
    +from swagger_sdrangel.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_sdrangel.DeviceSetApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +
    +try: 
    +    api_response = api_instance.deviceset_device_get(deviceSetIndex)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DeviceSetApi->devicesetDeviceGet: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    deviceSetIndex* + + +
    +
    +
    + + Integer + + +
    + Index of device set in the device set list +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 200 - On success returns current settings values

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    + +
    +
    +
    @@ -8544,7 +9076,7 @@ except ApiException as e:
    - Generated 2017-12-02T05:26:15.665+01:00 + Generated 2017-12-06T08:23:29.921+01:00
    diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 0ad35d958..2776c4bfe 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -924,6 +924,37 @@ margin-bottom: 20px; } }, "description" : "List of device sets opened in this instance" +}; + defs.DeviceSettings = { + "required" : [ "deviceType" ], + "discriminator" : "deviceType", + "properties" : { + "deviceType" : { + "type" : "string" + }, + "data" : { + "type" : "object", + "properties" : { } + } + }, + "description" : "Base device settings" +}; + defs.DeviceSettingsImpl = { + "properties" : { + "fileSource" : { + "$ref" : "#/definitions/FileSourceSettings" + }, + "rtlsdr" : { + "$ref" : "#/definitions/RtlSdrSettings" + }, + "limesdrInput" : { + "$ref" : "#/definitions/LimeSdrInputSettings" + }, + "limesdrOutput" : { + "$ref" : "#/definitions/LimeSdrOutputSettings" + } + }, + "description" : "dummy structure to handle all devices settings" }; defs.ErrorResponse = { "required" : [ "message" ], @@ -932,6 +963,13 @@ margin-bottom: 20px; "type" : "string" } } +}; + defs.FileSourceSettings = { + "properties" : { + "fileName" : { + "type" : "string" + } + } }; defs.InstanceChannelsResponse = { "required" : [ "channelcount" ], @@ -983,6 +1021,112 @@ margin-bottom: 20px; } }, "description" : "Summarized information about this SDRangel instance" +}; + defs.LimeSdrInputSettings = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "devSampleRate" : { + "type" : "integer" + }, + "log2HardDecim" : { + "type" : "integer" + }, + "dcBlock" : { + "type" : "integer" + }, + "iqCorrection" : { + "type" : "integer" + }, + "log2SoftDecim" : { + "type" : "integer" + }, + "lpfBW" : { + "type" : "integer" + }, + "lpfFIREnable" : { + "type" : "integer" + }, + "lpfFIRBW" : { + "type" : "integer" + }, + "gain" : { + "type" : "integer" + }, + "ncoEnable" : { + "type" : "integer" + }, + "ncoFrequency" : { + "type" : "integer" + }, + "antennaPath" : { + "type" : "integer" + }, + "gainMode" : { + "type" : "integer" + }, + "lnaGain" : { + "type" : "integer" + }, + "tiaGain" : { + "type" : "integer" + }, + "pgaGain" : { + "type" : "integer" + }, + "extClock" : { + "type" : "integer" + }, + "extClockFreq" : { + "type" : "integer" + } + } +}; + defs.LimeSdrOutputSettings = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "devSampleRate" : { + "type" : "integer" + }, + "log2HardInterp" : { + "type" : "integer" + }, + "log2SoftInterp" : { + "type" : "integer" + }, + "lpfBW" : { + "type" : "integer" + }, + "lpfFIREnable" : { + "type" : "integer" + }, + "lpfFIRBW" : { + "type" : "integer" + }, + "gain" : { + "type" : "integer" + }, + "ncoEnable" : { + "type" : "integer" + }, + "ncoFrequency" : { + "type" : "integer" + }, + "antennaPath" : { + "type" : "integer" + }, + "extClock" : { + "type" : "integer" + }, + "extClockFreq" : { + "type" : "integer" + } + } }; defs.LocationInformation = { "required" : [ "latitude", "longitude" ], @@ -1111,6 +1255,51 @@ margin-bottom: 20px; } }, "description" : "Settings presets" +}; + defs.RtlSdrSettings = { + "properties" : { + "devSampleRate" : { + "type" : "integer" + }, + "lowSampleRate" : { + "type" : "integer" + }, + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "gain" : { + "type" : "integer" + }, + "loPpmCorrection" : { + "type" : "integer" + }, + "log2Decim" : { + "type" : "integer" + }, + "fcPos" : { + "type" : "integer" + }, + "dcBlock" : { + "type" : "integer" + }, + "iqImbalance" : { + "type" : "integer" + }, + "agc" : { + "type" : "integer" + }, + "noModMode" : { + "type" : "integer" + }, + "transverterMode" : { + "type" : "integer" + }, + "transverterDeltaFrequency" : { + "type" : "integer", + "format" : "int64" + } + } }; defs.SamplingDevice = { "required" : [ "bandwidth", "centerFrequency", "hwType", "index", "sequence", "serial", "state", "streamIndex" ], @@ -1187,6 +1376,9 @@ margin-bottom: 20px; +
  • + devicesetDeviceGet +
  • devicesetDevicePut
  • @@ -1269,6 +1461,346 @@ margin-bottom: 20px;

    DeviceSet

    +
    +
    +
    +

    devicesetDeviceGet

    +

    +
    +
    +
    +

    +

    Get device settings

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/device
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://localhost:8091/sdrangel/deviceset/{deviceSetIndex}/device"
    +
    +
    +
    import SWGSDRangel.*;
    +import SWGSDRangel.auth.*;
    +import SWGSDRangel.model.*;
    +import SWGSDRangel.api.DeviceSetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DeviceSetApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DeviceSetApi apiInstance = new DeviceSetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSettings result = apiInstance.devicesetDeviceGet(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DeviceSetApi#devicesetDeviceGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.DeviceSetApi;
    +
    +public class DeviceSetApiExample {
    +
    +    public static void main(String[] args) {
    +        DeviceSetApi apiInstance = new DeviceSetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSettings result = apiInstance.devicesetDeviceGet(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DeviceSetApi#devicesetDeviceGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +
    +DeviceSetApi *apiInstance = [[DeviceSetApi alloc] init];
    +
    +[apiInstance devicesetDeviceGetWith:deviceSetIndex
    +              completionHandler: ^(DeviceSettings output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DeviceSetApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetDeviceGet(deviceSetIndex, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class devicesetDeviceGetExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DeviceSetApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +
    +            try
    +            {
    +                DeviceSettings result = apiInstance.devicesetDeviceGet(deviceSetIndex);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DeviceSetApi.devicesetDeviceGet: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DeviceSetApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +
    +try {
    +    $result = $api_instance->devicesetDeviceGet($deviceSetIndex);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DeviceSetApi->devicesetDeviceGet: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::DeviceSetApi;
    +
    +my $api_instance = SWGSDRangel::DeviceSetApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +
    +eval { 
    +    my $result = $api_instance->devicesetDeviceGet(deviceSetIndex => $deviceSetIndex);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DeviceSetApi->devicesetDeviceGet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_sdrangel
    +from swagger_sdrangel.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_sdrangel.DeviceSetApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +
    +try: 
    +    api_response = api_instance.deviceset_device_get(deviceSetIndex)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DeviceSetApi->devicesetDeviceGet: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    deviceSetIndex* + + +
    +
    +
    + + Integer + + +
    + Index of device set in the device set list +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 200 - On success returns current settings values

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    + +
    +
    +
    @@ -8544,7 +9076,7 @@ except ApiException as e:
    - Generated 2017-12-02T05:26:15.665+01:00 + Generated 2017-12-06T08:23:29.921+01:00
    diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceSettingsImpl.cpp b/swagger/sdrangel/code/qt5/client/SWGDeviceSettingsImpl.cpp index 5fe46456a..c025a5ada 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceSettingsImpl.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceSettingsImpl.cpp @@ -37,6 +37,7 @@ SWGDeviceSettingsImpl::~SWGDeviceSettingsImpl() { void SWGDeviceSettingsImpl::init() { + file_source = new SWGFileSourceSettings(); rtlsdr = new SWGRtlSdrSettings(); limesdr_input = new SWGLimeSdrInputSettings(); limesdr_output = new SWGLimeSdrOutputSettings(); @@ -45,6 +46,10 @@ SWGDeviceSettingsImpl::init() { void SWGDeviceSettingsImpl::cleanup() { + if(file_source != nullptr) { + delete file_source; + } + if(rtlsdr != nullptr) { delete rtlsdr; } @@ -69,6 +74,7 @@ SWGDeviceSettingsImpl::fromJson(QString &json) { void SWGDeviceSettingsImpl::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&file_source, pJson["fileSource"], "SWGFileSourceSettings", "SWGFileSourceSettings"); ::SWGSDRangel::setValue(&rtlsdr, pJson["rtlsdr"], "SWGRtlSdrSettings", "SWGRtlSdrSettings"); ::SWGSDRangel::setValue(&limesdr_input, pJson["limesdrInput"], "SWGLimeSdrInputSettings", "SWGLimeSdrInputSettings"); ::SWGSDRangel::setValue(&limesdr_output, pJson["limesdrOutput"], "SWGLimeSdrOutputSettings", "SWGLimeSdrOutputSettings"); @@ -88,6 +94,8 @@ QJsonObject* SWGDeviceSettingsImpl::asJsonObject() { QJsonObject* obj = new QJsonObject(); + toJsonValue(QString("fileSource"), file_source, obj, QString("SWGFileSourceSettings")); + toJsonValue(QString("rtlsdr"), rtlsdr, obj, QString("SWGRtlSdrSettings")); toJsonValue(QString("limesdrInput"), limesdr_input, obj, QString("SWGLimeSdrInputSettings")); @@ -97,6 +105,15 @@ SWGDeviceSettingsImpl::asJsonObject() { return obj; } +SWGFileSourceSettings* +SWGDeviceSettingsImpl::getFileSource() { + return file_source; +} +void +SWGDeviceSettingsImpl::setFileSource(SWGFileSourceSettings* file_source) { + this->file_source = file_source; +} + SWGRtlSdrSettings* SWGDeviceSettingsImpl::getRtlsdr() { return rtlsdr; diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceSettingsImpl.h b/swagger/sdrangel/code/qt5/client/SWGDeviceSettingsImpl.h index d241f037d..73fae8538 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceSettingsImpl.h +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceSettingsImpl.h @@ -22,6 +22,7 @@ #include +#include "SWGFileSourceSettings.h" #include "SWGLimeSdrInputSettings.h" #include "SWGLimeSdrOutputSettings.h" #include "SWGRtlSdrSettings.h" @@ -44,6 +45,9 @@ public: void fromJsonObject(QJsonObject &json); SWGDeviceSettingsImpl* fromJson(QString &jsonString); + SWGFileSourceSettings* getFileSource(); + void setFileSource(SWGFileSourceSettings* file_source); + SWGRtlSdrSettings* getRtlsdr(); void setRtlsdr(SWGRtlSdrSettings* rtlsdr); @@ -55,6 +59,7 @@ public: private: + SWGFileSourceSettings* file_source; SWGRtlSdrSettings* rtlsdr; SWGLimeSdrInputSettings* limesdr_input; SWGLimeSdrOutputSettings* limesdr_output; diff --git a/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.cpp new file mode 100644 index 000000000..acf26c748 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.cpp @@ -0,0 +1,95 @@ +/** + * 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. + */ + + +#include "SWGFileSourceSettings.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGFileSourceSettings::SWGFileSourceSettings(QString* json) { + init(); + this->fromJson(*json); +} + +SWGFileSourceSettings::SWGFileSourceSettings() { + init(); +} + +SWGFileSourceSettings::~SWGFileSourceSettings() { + this->cleanup(); +} + +void +SWGFileSourceSettings::init() { + file_name = new QString(""); +} + +void +SWGFileSourceSettings::cleanup() { + + if(file_name != nullptr) { + delete file_name; + } +} + +SWGFileSourceSettings* +SWGFileSourceSettings::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGFileSourceSettings::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&file_name, pJson["fileName"], "QString", "QString"); +} + +QString +SWGFileSourceSettings::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject* +SWGFileSourceSettings::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + + toJsonValue(QString("fileName"), file_name, obj, QString("QString")); + + return obj; +} + +QString* +SWGFileSourceSettings::getFileName() { + return file_name; +} +void +SWGFileSourceSettings::setFileName(QString* file_name) { + this->file_name = file_name; +} + + +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.h b/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.h new file mode 100644 index 000000000..858058e35 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFileSourceSettings.h @@ -0,0 +1,55 @@ +/** + * 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. + */ + +/* + * SWGFileSourceSettings.h + * + * + */ + +#ifndef SWGFileSourceSettings_H_ +#define SWGFileSourceSettings_H_ + +#include + + +#include + +#include "SWGObject.h" + + +namespace SWGSDRangel { + +class SWGFileSourceSettings: public SWGObject { +public: + SWGFileSourceSettings(); + SWGFileSourceSettings(QString* json); + virtual ~SWGFileSourceSettings(); + void init(); + void cleanup(); + + QString asJson (); + QJsonObject* asJsonObject(); + void fromJsonObject(QJsonObject &json); + SWGFileSourceSettings* fromJson(QString &jsonString); + + QString* getFileName(); + void setFileName(QString* file_name); + + +private: + QString* file_name; +}; + +} + +#endif /* SWGFileSourceSettings_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 1c230b11d..31fd646af 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -27,6 +27,7 @@ #include "SWGDeviceSettings.h" #include "SWGDeviceSettingsImpl.h" #include "SWGErrorResponse.h" +#include "SWGFileSourceSettings.h" #include "SWGInstanceChannelsResponse.h" #include "SWGInstanceDevicesResponse.h" #include "SWGInstanceSummaryResponse.h" @@ -85,6 +86,9 @@ namespace SWGSDRangel { if(QString("SWGErrorResponse").compare(type) == 0) { return new SWGErrorResponse(); } + if(QString("SWGFileSourceSettings").compare(type) == 0) { + return new SWGFileSourceSettings(); + } if(QString("SWGInstanceChannelsResponse").compare(type) == 0) { return new SWGInstanceChannelsResponse(); }