From 0ace2e949970ead41899c427259cc6e765760d40 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 23 Aug 2018 16:06:47 +0200 Subject: [PATCH] SDRDaemon: replaced specific channel data settings by generic channel data settings --- sdrbase/resources/res.qrc | 1 + sdrbase/resources/webapi/doc/html2/index.html | 447 +++++++++--------- .../doc/swagger/include/SDRDaemonChannel.yaml | 15 + .../resources/webapi/doc/swagger/swagger.yaml | 46 +- sdrbase/webapi/webapirequestmapper.cpp | 9 + sdrdaemon/webapi/webapiadapterdaemon.cpp | 14 +- sdrdaemon/webapi/webapiadapterdaemon.h | 14 +- sdrdaemon/webapi/webapirequestmapper.cpp | 338 ++++++++++--- sdrdaemon/webapi/webapirequestmapper.h | 7 +- .../api/swagger/include/SDRDaemonChannel.yaml | 15 + swagger/sdrangel/api/swagger/swagger.yaml | 46 +- swagger/sdrangel/code/html2/index.html | 447 +++++++++--------- .../code/qt5/client/SWGChannelSettings.cpp | 23 + .../code/qt5/client/SWGChannelSettings.h | 7 + .../sdrangel/code/qt5/client/SWGDaemonApi.cpp | 48 +- .../sdrangel/code/qt5/client/SWGDaemonApi.h | 32 +- .../code/qt5/client/SWGModelFactory.h | 6 +- ...gs.cpp => SWGSDRDaemonChannelSettings.cpp} | 40 +- ...ttings.h => SWGSDRDaemonChannelSettings.h} | 18 +- 19 files changed, 921 insertions(+), 652 deletions(-) create mode 100644 sdrbase/resources/webapi/doc/swagger/include/SDRDaemonChannel.yaml create mode 100644 swagger/sdrangel/api/swagger/include/SDRDaemonChannel.yaml rename swagger/sdrangel/code/qt5/client/{SWGSDRDaemonDataSettings.cpp => SWGSDRDaemonChannelSettings.cpp} (81%) rename swagger/sdrangel/code/qt5/client/{SWGSDRDaemonDataSettings.h => SWGSDRDaemonChannelSettings.h} (85%) diff --git a/sdrbase/resources/res.qrc b/sdrbase/resources/res.qrc index 3af73f874..f5f346932 100644 --- a/sdrbase/resources/res.qrc +++ b/sdrbase/resources/res.qrc @@ -21,6 +21,7 @@ webapi/doc/swagger/include/Perseus.yaml webapi/doc/swagger/include/PlutoSdr.yaml webapi/doc/swagger/include/RtlSdr.yaml + webapi/doc/swagger/include/SDRDaemonChannel.yaml webapi/doc/swagger/include/SDRDaemonSource.yaml webapi/doc/swagger/include/SDRDaemonSink.yaml webapi/doc/swagger/include/SDRPlay.yaml diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index d1c41a364..20c65c84f 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1467,6 +1467,9 @@ margin-bottom: 20px; "NFMModSettings" : { "$ref" : "#/definitions/NFMModSettings" }, + "SDRDaemonChannelSettings" : { + "$ref" : "#/definitions/SDRDaemonChannelSettings" + }, "SSBModSettings" : { "$ref" : "#/definitions/SSBModSettings" }, @@ -3143,7 +3146,7 @@ margin-bottom: 20px; }, "description" : "RTLSDR" }; - defs.SDRDaemonDataSettings = { + defs.SDRDaemonChannelSettings = { "properties" : { "nbFECBlocks" : { "type" : "integer", @@ -4024,14 +4027,14 @@ margin-bottom: 20px; -
  • - daemonDataSettingsGet +
  • + daemonChannelSettingsGet
  • -
  • - daemonDataSettingsPatch +
  • + daemonChannelSettingsPatch
  • -
  • - daemonDataSettingsPut +
  • + daemonChannelSettingsPut
  • daemonDeviceReportGet @@ -4230,41 +4233,41 @@ margin-bottom: 20px;

    Daemon

    -
    -
    +
    +
    -

    daemonDataSettingsGet

    +

    daemonChannelSettingsGet

    -

    Get data handling details

    +

    Get channel handling details


    -
    /sdrdaemon/data/settings
    +
    /sdrdaemon/channel/settings

    Usage and SDK Samples

    -
    -
    curl -X GET "http://localhost/sdrdaemon/data/settings"
    +
    +
    curl -X GET "http://localhost/sdrdaemon/channel/settings"
    -
    +
    import SWGSDRangel.*;
     import SWGSDRangel.auth.*;
     import SWGSDRangel.model.*;
    @@ -4279,17 +4282,17 @@ public class DaemonApiExample {
             
             DaemonApi apiInstance = new DaemonApi();
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsGet();
    +            ChannelSettings result = apiInstance.daemonChannelSettingsGet();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsGet");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsGet");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    import SWGSDRangel.api.DaemonApi;
     
     public class DaemonApiExample {
    @@ -4297,25 +4300,25 @@ public class DaemonApiExample {
         public static void main(String[] args) {
             DaemonApi apiInstance = new DaemonApi();
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsGet();
    +            ChannelSettings result = apiInstance.daemonChannelSettingsGet();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsGet");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsGet");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    
     DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -[apiInstance daemonDataSettingsGetWithCompletionHandler: 
    -              ^(SDRDaemonDataSettings output, NSError* error) {
    +[apiInstance daemonChannelSettingsGetWithCompletionHandler: 
    +              ^(ChannelSettings output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -4326,7 +4329,7 @@ DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -
    +
    var SdRangel = require('sd_rangel');
     
     var api = new SdRangel.DaemonApi()
    @@ -4338,14 +4341,14 @@ var callback = function(error, data, response) {
         console.log('API called successfully. Returned data: ' + data);
       }
     };
    -api.daemonDataSettingsGet(callback);
    +api.daemonChannelSettingsGet(callback);
     
    - -
    +
    using System;
     using System.Diagnostics;
     using SWGSDRangel.Api;
    @@ -4354,7 +4357,7 @@ using SWGSDRangel.Model;
     
     namespace Example
     {
    -    public class daemonDataSettingsGetExample
    +    public class daemonChannelSettingsGetExample
         {
             public void main()
             {
    @@ -4363,12 +4366,12 @@ namespace Example
     
                 try
                 {
    -                SDRDaemonDataSettings result = apiInstance.daemonDataSettingsGet();
    +                ChannelSettings result = apiInstance.daemonChannelSettingsGet();
                     Debug.WriteLine(result);
                 }
                 catch (Exception e)
                 {
    -                Debug.Print("Exception when calling DaemonApi.daemonDataSettingsGet: " + e.Message );
    +                Debug.Print("Exception when calling DaemonApi.daemonChannelSettingsGet: " + e.Message );
                 }
             }
         }
    @@ -4376,22 +4379,22 @@ namespace Example
     
    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\Api\DaemonApi();
     
     try {
    -    $result = $api_instance->daemonDataSettingsGet();
    +    $result = $api_instance->daemonChannelSettingsGet();
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling DaemonApi->daemonDataSettingsGet: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling DaemonApi->daemonChannelSettingsGet: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use SWGSDRangel::Configuration;
     use SWGSDRangel::DaemonApi;
    @@ -4399,15 +4402,15 @@ use SWGSDRangel::DaemonApi;
     my $api_instance = SWGSDRangel::DaemonApi->new();
     
     eval { 
    -    my $result = $api_instance->daemonDataSettingsGet();
    +    my $result = $api_instance->daemonChannelSettingsGet();
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling DaemonApi->daemonDataSettingsGet: $@\n";
    +    warn "Exception when calling DaemonApi->daemonChannelSettingsGet: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_sdrangel
    @@ -4418,10 +4421,10 @@ from pprint import pprint
     api_instance = swagger_sdrangel.DaemonApi()
     
     try: 
    -    api_response = api_instance.daemon_data_settings_get()
    +    api_response = api_instance.daemon_channel_settings_get()
         pprint(api_response)
     except ApiException as e:
    -    print("Exception when calling DaemonApi->daemonDataSettingsGet: %s\n" % e)
    + print("Exception when calling DaemonApi->daemonChannelSettingsGet: %s\n" % e)
    @@ -4433,24 +4436,24 @@ except ApiException as e:

    Responses

    -

    Status: 200 - On success returns current data handling details

    +

    Status: 200 - On success return channel settings

    -
    -
    +
    +
    - +
    @@ -4480,14 +4483,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +
    @@ -4523,14 +4526,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +

    -
    -
    +
    +
    -

    daemonDataSettingsPatch

    +

    daemonChannelSettingsPatch

    -

    Apply data handling details differentially (no force)

    +

    Apply channel handling details differentially (no force)


    -
    /sdrdaemon/data/settings
    +
    /sdrdaemon/channel/settings

    Usage and SDK Samples

    -
    -
    curl -X PATCH "http://localhost/sdrdaemon/data/settings"
    +
    +
    curl -X PATCH "http://localhost/sdrdaemon/channel/settings"
    -
    +
    import SWGSDRangel.*;
     import SWGSDRangel.auth.*;
     import SWGSDRangel.model.*;
    @@ -4613,47 +4616,47 @@ public class DaemonApiExample {
         public static void main(String[] args) {
             
             DaemonApi apiInstance = new DaemonApi();
    -        SDRDaemonDataSettings body = ; // SDRDaemonDataSettings | Data handling detail to apply
    +        ChannelSettings body = ; // ChannelSettings | Data handling detail to apply
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPatch(body);
    +            ChannelSettings result = apiInstance.daemonChannelSettingsPatch(body);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsPatch");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsPatch");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    import SWGSDRangel.api.DaemonApi;
     
     public class DaemonApiExample {
     
         public static void main(String[] args) {
             DaemonApi apiInstance = new DaemonApi();
    -        SDRDaemonDataSettings body = ; // SDRDaemonDataSettings | Data handling detail to apply
    +        ChannelSettings body = ; // ChannelSettings | Data handling detail to apply
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPatch(body);
    +            ChannelSettings result = apiInstance.daemonChannelSettingsPatch(body);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsPatch");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsPatch");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    SDRDaemonDataSettings *body = ; // Data handling detail to apply
    +                            
    +
    ChannelSettings *body = ; // Data handling detail to apply
     
     DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -[apiInstance daemonDataSettingsPatchWith:body
    -              completionHandler: ^(SDRDaemonDataSettings output, NSError* error) {
    +[apiInstance daemonChannelSettingsPatchWith:body
    +              completionHandler: ^(ChannelSettings output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -4664,12 +4667,12 @@ DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -
    +
    var SdRangel = require('sd_rangel');
     
     var api = new SdRangel.DaemonApi()
     
    -var body = ; // {SDRDaemonDataSettings} Data handling detail to apply
    +var body = ; // {ChannelSettings} Data handling detail to apply
     
     
     var callback = function(error, data, response) {
    @@ -4679,14 +4682,14 @@ var callback = function(error, data, response) {
         console.log('API called successfully. Returned data: ' + data);
       }
     };
    -api.daemonDataSettingsPatch(body, callback);
    +api.daemonChannelSettingsPatch(body, callback);
     
    - -
    +
    using System;
     using System.Diagnostics;
     using SWGSDRangel.Api;
    @@ -4695,22 +4698,22 @@ using SWGSDRangel.Model;
     
     namespace Example
     {
    -    public class daemonDataSettingsPatchExample
    +    public class daemonChannelSettingsPatchExample
         {
             public void main()
             {
                 
                 var apiInstance = new DaemonApi();
    -            var body = new SDRDaemonDataSettings(); // SDRDaemonDataSettings | Data handling detail to apply
    +            var body = new ChannelSettings(); // ChannelSettings | Data handling detail to apply
     
                 try
                 {
    -                SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPatch(body);
    +                ChannelSettings result = apiInstance.daemonChannelSettingsPatch(body);
                     Debug.WriteLine(result);
                 }
                 catch (Exception e)
                 {
    -                Debug.Print("Exception when calling DaemonApi.daemonDataSettingsPatch: " + e.Message );
    +                Debug.Print("Exception when calling DaemonApi.daemonChannelSettingsPatch: " + e.Message );
                 }
             }
         }
    @@ -4718,40 +4721,40 @@ namespace Example
     
    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\Api\DaemonApi();
    -$body = ; // SDRDaemonDataSettings | Data handling detail to apply
    +$body = ; // ChannelSettings | Data handling detail to apply
     
     try {
    -    $result = $api_instance->daemonDataSettingsPatch($body);
    +    $result = $api_instance->daemonChannelSettingsPatch($body);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling DaemonApi->daemonDataSettingsPatch: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling DaemonApi->daemonChannelSettingsPatch: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use SWGSDRangel::Configuration;
     use SWGSDRangel::DaemonApi;
     
     my $api_instance = SWGSDRangel::DaemonApi->new();
    -my $body = SWGSDRangel::Object::SDRDaemonDataSettings->new(); # SDRDaemonDataSettings | Data handling detail to apply
    +my $body = SWGSDRangel::Object::ChannelSettings->new(); # ChannelSettings | Data handling detail to apply
     
     eval { 
    -    my $result = $api_instance->daemonDataSettingsPatch(body => $body);
    +    my $result = $api_instance->daemonChannelSettingsPatch(body => $body);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling DaemonApi->daemonDataSettingsPatch: $@\n";
    +    warn "Exception when calling DaemonApi->daemonChannelSettingsPatch: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_sdrangel
    @@ -4760,13 +4763,13 @@ from pprint import pprint
     
     # create an instance of the API class
     api_instance = swagger_sdrangel.DaemonApi()
    -body =  # SDRDaemonDataSettings | Data handling detail to apply
    +body =  # ChannelSettings | Data handling detail to apply
     
     try: 
    -    api_response = api_instance.daemon_data_settings_patch(body)
    +    api_response = api_instance.daemon_channel_settings_patch(body)
         pprint(api_response)
     except ApiException as e:
    -    print("Exception when calling DaemonApi->daemonDataSettingsPatch: %s\n" % e)
    + print("Exception when calling DaemonApi->daemonChannelSettingsPatch: %s\n" % e)
    @@ -4792,7 +4795,7 @@ $(document).ready(function() { "description" : "Data handling detail to apply", "required" : true, "schema" : { - "$ref" : "#/definitions/SDRDaemonDataSettings" + "$ref" : "#/definitions/ChannelSettings" } }; var schema = schemaWrapper.schema; @@ -4806,12 +4809,12 @@ $(document).ready(function() { } var view = new JSONSchemaView(schema,2,{isBodyParam: true}); - var result = $('#d2e199_daemonDataSettingsPatch_body'); + var result = $('#d2e199_daemonChannelSettingsPatch_body'); result.empty(); result.append(view.render()); }); -
    +
    @@ -4824,20 +4827,20 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +
    @@ -4867,14 +4870,14 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +
    @@ -4910,14 +4913,14 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +

    -
    -
    +
    +
    -

    daemonDataSettingsPut

    +

    daemonChannelSettingsPut

    -

    Apply data handling details unconditionally (force)

    +

    Apply channel handling details unconditionally (force)


    -
    /sdrdaemon/data/settings
    +
    /sdrdaemon/channel/settings

    Usage and SDK Samples

    -
    -
    curl -X PUT "http://localhost/sdrdaemon/data/settings"
    +
    +
    curl -X PUT "http://localhost/sdrdaemon/channel/settings"
    -
    +
    import SWGSDRangel.*;
     import SWGSDRangel.auth.*;
     import SWGSDRangel.model.*;
    @@ -5000,47 +5003,47 @@ public class DaemonApiExample {
         public static void main(String[] args) {
             
             DaemonApi apiInstance = new DaemonApi();
    -        SDRDaemonDataSettings body = ; // SDRDaemonDataSettings | Data handling details to apply
    +        ChannelSettings body = ; // ChannelSettings | Channel handling details to apply
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPut(body);
    +            ChannelSettings result = apiInstance.daemonChannelSettingsPut(body);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsPut");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsPut");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    import SWGSDRangel.api.DaemonApi;
     
     public class DaemonApiExample {
     
         public static void main(String[] args) {
             DaemonApi apiInstance = new DaemonApi();
    -        SDRDaemonDataSettings body = ; // SDRDaemonDataSettings | Data handling details to apply
    +        ChannelSettings body = ; // ChannelSettings | Channel handling details to apply
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPut(body);
    +            ChannelSettings result = apiInstance.daemonChannelSettingsPut(body);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsPut");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsPut");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    SDRDaemonDataSettings *body = ; // Data handling details to apply
    +                            
    +
    ChannelSettings *body = ; // Channel handling details to apply
     
     DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -[apiInstance daemonDataSettingsPutWith:body
    -              completionHandler: ^(SDRDaemonDataSettings output, NSError* error) {
    +[apiInstance daemonChannelSettingsPutWith:body
    +              completionHandler: ^(ChannelSettings output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -5051,12 +5054,12 @@ DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -
    +
    var SdRangel = require('sd_rangel');
     
     var api = new SdRangel.DaemonApi()
     
    -var body = ; // {SDRDaemonDataSettings} Data handling details to apply
    +var body = ; // {ChannelSettings} Channel handling details to apply
     
     
     var callback = function(error, data, response) {
    @@ -5066,14 +5069,14 @@ var callback = function(error, data, response) {
         console.log('API called successfully. Returned data: ' + data);
       }
     };
    -api.daemonDataSettingsPut(body, callback);
    +api.daemonChannelSettingsPut(body, callback);
     
    - -
    +
    using System;
     using System.Diagnostics;
     using SWGSDRangel.Api;
    @@ -5082,22 +5085,22 @@ using SWGSDRangel.Model;
     
     namespace Example
     {
    -    public class daemonDataSettingsPutExample
    +    public class daemonChannelSettingsPutExample
         {
             public void main()
             {
                 
                 var apiInstance = new DaemonApi();
    -            var body = new SDRDaemonDataSettings(); // SDRDaemonDataSettings | Data handling details to apply
    +            var body = new ChannelSettings(); // ChannelSettings | Channel handling details to apply
     
                 try
                 {
    -                SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPut(body);
    +                ChannelSettings result = apiInstance.daemonChannelSettingsPut(body);
                     Debug.WriteLine(result);
                 }
                 catch (Exception e)
                 {
    -                Debug.Print("Exception when calling DaemonApi.daemonDataSettingsPut: " + e.Message );
    +                Debug.Print("Exception when calling DaemonApi.daemonChannelSettingsPut: " + e.Message );
                 }
             }
         }
    @@ -5105,40 +5108,40 @@ namespace Example
     
    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\Api\DaemonApi();
    -$body = ; // SDRDaemonDataSettings | Data handling details to apply
    +$body = ; // ChannelSettings | Channel handling details to apply
     
     try {
    -    $result = $api_instance->daemonDataSettingsPut($body);
    +    $result = $api_instance->daemonChannelSettingsPut($body);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling DaemonApi->daemonDataSettingsPut: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling DaemonApi->daemonChannelSettingsPut: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use SWGSDRangel::Configuration;
     use SWGSDRangel::DaemonApi;
     
     my $api_instance = SWGSDRangel::DaemonApi->new();
    -my $body = SWGSDRangel::Object::SDRDaemonDataSettings->new(); # SDRDaemonDataSettings | Data handling details to apply
    +my $body = SWGSDRangel::Object::ChannelSettings->new(); # ChannelSettings | Channel handling details to apply
     
     eval { 
    -    my $result = $api_instance->daemonDataSettingsPut(body => $body);
    +    my $result = $api_instance->daemonChannelSettingsPut(body => $body);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling DaemonApi->daemonDataSettingsPut: $@\n";
    +    warn "Exception when calling DaemonApi->daemonChannelSettingsPut: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_sdrangel
    @@ -5147,13 +5150,13 @@ from pprint import pprint
     
     # create an instance of the API class
     api_instance = swagger_sdrangel.DaemonApi()
    -body =  # SDRDaemonDataSettings | Data handling details to apply
    +body =  # ChannelSettings | Channel handling details to apply
     
     try: 
    -    api_response = api_instance.daemon_data_settings_put(body)
    +    api_response = api_instance.daemon_channel_settings_put(body)
         pprint(api_response)
     except ApiException as e:
    -    print("Exception when calling DaemonApi->daemonDataSettingsPut: %s\n" % e)
    + print("Exception when calling DaemonApi->daemonChannelSettingsPut: %s\n" % e)
    @@ -5176,10 +5179,10 @@ $(document).ready(function() { var schemaWrapper = { "in" : "body", "name" : "body", - "description" : "Data handling details to apply", + "description" : "Channel handling details to apply", "required" : true, "schema" : { - "$ref" : "#/definitions/SDRDaemonDataSettings" + "$ref" : "#/definitions/ChannelSettings" } }; var schema = schemaWrapper.schema; @@ -5193,12 +5196,12 @@ $(document).ready(function() { } var view = new JSONSchemaView(schema,2,{isBodyParam: true}); - var result = $('#d2e199_daemonDataSettingsPut_body'); + var result = $('#d2e199_daemonChannelSettingsPut_body'); result.empty(); result.append(view.render()); }); -
    +
    @@ -5211,20 +5214,20 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +
    @@ -5254,14 +5257,14 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +
    @@ -5297,14 +5300,14 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +
    @@ -28212,7 +28215,7 @@ except ApiException as e:
    - Generated 2018-08-23T00:21:49.115+02:00 + Generated 2018-08-23T14:53:21.934+02:00
    diff --git a/sdrbase/resources/webapi/doc/swagger/include/SDRDaemonChannel.yaml b/sdrbase/resources/webapi/doc/swagger/include/SDRDaemonChannel.yaml new file mode 100644 index 000000000..332732524 --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger/include/SDRDaemonChannel.yaml @@ -0,0 +1,15 @@ +SDRDaemonChannelSettings: + description: "Data handling details for SDRDaemon" + properties: + nbFECBlocks: + description: "Number of FEC blocks per frame" + type: integer + dataAddress: + description: "Receiving USB data address" + type: string + dataPort: + description: "Receiving USB data port" + type: integer + txDelay: + description: "Minimum delay in ms between consecutive USB blocks transmissions" + type: integer diff --git a/sdrbase/resources/webapi/doc/swagger/swagger.yaml b/sdrbase/resources/webapi/doc/swagger/swagger.yaml index 6fce1d3ae..10ecf2699 100644 --- a/sdrbase/resources/webapi/doc/swagger/swagger.yaml +++ b/sdrbase/resources/webapi/doc/swagger/swagger.yaml @@ -1298,46 +1298,46 @@ paths: "501": $ref: "#/responses/Response_501" - /sdrdaemon/data/settings: + /sdrdaemon/channel/settings: x-swagger-router-controller: deviceset get: - description: Get data handling details - operationId: daemonDataSettingsGet + description: Get channel handling details + operationId: daemonChannelSettingsGet tags: - Daemon responses: "200": - description: On success returns current data handling details + description: On success return channel settings schema: - $ref: "#/definitions/SDRDaemonDataSettings" + $ref: "#/definitions/ChannelSettings" "500": $ref: "#/responses/Response_500" "501": $ref: "#/responses/Response_501" put: - description: Apply data handling details unconditionally (force) - operationId: daemonDataSettingsPut + description: Apply channel handling details unconditionally (force) + operationId: daemonChannelSettingsPut tags: - Daemon parameters: - name: body in: body - description: Data handling details to apply + description: Channel handling details to apply required: true schema: - $ref: "#/definitions/SDRDaemonDataSettings" + $ref: "#/definitions/ChannelSettings" responses: "200": description: On success returns new settings values schema: - $ref: "#/definitions/SDRDaemonDataSettings" + $ref: "#/definitions/ChannelSettings" "500": $ref: "#/responses/Response_500" "501": $ref: "#/responses/Response_501" patch: - description: Apply data handling details differentially (no force) - operationId: daemonDataSettingsPatch + description: Apply channel handling details differentially (no force) + operationId: daemonChannelSettingsPatch tags: - Daemon parameters: @@ -1346,12 +1346,12 @@ paths: description: Data handling detail to apply required: true schema: - $ref: "#/definitions/SDRDaemonDataSettings" + $ref: "#/definitions/ChannelSettings" responses: "200": description: On success returns new settings values schema: - $ref: "#/definitions/SDRDaemonDataSettings" + $ref: "#/definitions/ChannelSettings" "500": $ref: "#/responses/Response_500" "501": @@ -2194,6 +2194,8 @@ definitions: $ref: "/doc/swagger/include/NFMDemod.yaml#/NFMDemodSettings" NFMModSettings: $ref: "/doc/swagger/include/NFMMod.yaml#/NFMModSettings" + SDRDaemonChannelSettings: + $ref: "/doc/swagger/include/SDRDaemonChannel.yaml#/SDRDaemonChannelSettings" SSBModSettings: $ref: "/doc/swagger/include/SSBMod.yaml#/SSBModSettings" SSBDemodSettings: @@ -2244,22 +2246,6 @@ definitions: WFMModReport: $ref: "/doc/swagger/include/WFMMod.yaml#/WFMModReport" - SDRDaemonDataSettings: - description: "Data handling details for SDRDaemon" - properties: - nbFECBlocks: - description: "Number of FEC blocks per frame" - type: integer - dataAddress: - description: "Receiving USB data address" - type: string - dataPort: - description: "Receiving USB data port" - type: integer - txDelay: - description: "Minimum delay in ms between consecutive USB blocks transmissions" - type: integer - responses: Response_500: diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 3b0d1e8a4..96a2a31a5 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -2146,6 +2146,14 @@ bool WebAPIRequestMapper::validateChannelSettings( return false; } } + else if (*channelType == "SDRDaemonChannel") + { + QJsonObject sdrDaemonChannelSettingsJsonObject = jsonObject["SDRDaemonChannelSettings"].toObject(); + channelSettingsKeys = sdrDaemonChannelSettingsJsonObject.keys(); + channelSettings.setSdrDaemonChannelSettings(new SWGSDRangel::SWGSDRDaemonChannelSettings()); + channelSettings.getSdrDaemonChannelSettings()->fromJsonObject(sdrDaemonChannelSettingsJsonObject); + return true; + } else if (*channelType == "SSBDemod") { if (channelSettings.getTx() == 0) @@ -2384,6 +2392,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings& channelSettings.setDsdDemodSettings(0); channelSettings.setNfmDemodSettings(0); channelSettings.setNfmModSettings(0); + channelSettings.setSdrDaemonChannelSettings(0); channelSettings.setSsbDemodSettings(0); channelSettings.setSsbModSettings(0); channelSettings.setUdpSinkSettings(0); diff --git a/sdrdaemon/webapi/webapiadapterdaemon.cpp b/sdrdaemon/webapi/webapiadapterdaemon.cpp index 7d084edbd..2eae164f2 100644 --- a/sdrdaemon/webapi/webapiadapterdaemon.cpp +++ b/sdrdaemon/webapi/webapiadapterdaemon.cpp @@ -23,7 +23,7 @@ #include "SWGDeviceSettings.h" #include "SWGDeviceState.h" #include "SWGDeviceReport.h" -#include "SWGSDRDaemonDataSettings.h" +#include "SWGChannelSettings.h" #include "SWGErrorResponse.h" #include "dsp/dsptypes.h" @@ -39,7 +39,7 @@ QString WebAPIAdapterDaemon::daemonInstanceSummaryURL = "/sdrdaemon"; QString WebAPIAdapterDaemon::daemonInstanceLoggingURL = "/sdrdaemon/logging"; -QString WebAPIAdapterDaemon::daemonDataSettingsURL = "/sdrdaemon/data/settings"; +QString WebAPIAdapterDaemon::daemonChannelSettingsURL = "/sdrdaemon/channel/settings"; QString WebAPIAdapterDaemon::daemonDeviceSettingsURL = "/sdrdaemon/device/settings"; QString WebAPIAdapterDaemon::daemonDeviceReportURL = "/sdrdaemon/device/report"; QString WebAPIAdapterDaemon::daemonRunURL = "/sdrdaemon/run"; @@ -176,8 +176,8 @@ int WebAPIAdapterDaemon::daemonInstanceLoggingPut( return 200; } -int WebAPIAdapterDaemon::daemonDataSettingsGet( - SWGSDRangel::SWGSDRDaemonDataSettings& response __attribute__((unused)), +int WebAPIAdapterDaemon::daemonChannelSettingsGet( + SWGSDRangel::SWGChannelSettings& response __attribute__((unused)), SWGSDRangel::SWGErrorResponse& error) { error.init(); @@ -185,10 +185,10 @@ int WebAPIAdapterDaemon::daemonDataSettingsGet( return 501; } -int WebAPIAdapterDaemon::daemonDataSettingsPutPatch( +int WebAPIAdapterDaemon::daemonChannelSettingsPutPatch( bool force __attribute__((unused)), - const QStringList& dataSettingsKeys __attribute__((unused)), - SWGSDRangel::SWGSDRDaemonDataSettings& response __attribute__((unused)), + const QStringList& channelSettingsKeys __attribute__((unused)), + SWGSDRangel::SWGChannelSettings& response __attribute__((unused)), SWGSDRangel::SWGErrorResponse& error) { error.init(); diff --git a/sdrdaemon/webapi/webapiadapterdaemon.h b/sdrdaemon/webapi/webapiadapterdaemon.h index 6403900bf..df4c7c592 100644 --- a/sdrdaemon/webapi/webapiadapterdaemon.h +++ b/sdrdaemon/webapi/webapiadapterdaemon.h @@ -33,7 +33,7 @@ namespace SWGSDRangel class SWGSuccessResponse; class SWGErrorResponse; class SWGLoggingInfo; - class SWGSDRDaemonDataSettings; + class SWGChannelSettings; } class SDRDaemonMain; @@ -57,14 +57,14 @@ public: SWGSDRangel::SWGLoggingInfo& response, SWGSDRangel::SWGErrorResponse& error); - int daemonDataSettingsGet( - SWGSDRangel::SWGSDRDaemonDataSettings& response, + int daemonChannelSettingsGet( + SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGErrorResponse& error); - int daemonDataSettingsPutPatch( + int daemonChannelSettingsPutPatch( bool force, - const QStringList& dataSettingsKeys, - SWGSDRangel::SWGSDRDaemonDataSettings& response, + const QStringList& channelSettingsKeys, + SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGErrorResponse& error); int daemonDeviceSettingsGet( @@ -95,7 +95,7 @@ public: static QString daemonInstanceSummaryURL; static QString daemonInstanceLoggingURL; - static QString daemonDataSettingsURL; + static QString daemonChannelSettingsURL; static QString daemonDeviceSettingsURL; static QString daemonDeviceReportURL; static QString daemonRunURL; diff --git a/sdrdaemon/webapi/webapirequestmapper.cpp b/sdrdaemon/webapi/webapirequestmapper.cpp index a5a162208..ad4c4df62 100644 --- a/sdrdaemon/webapi/webapirequestmapper.cpp +++ b/sdrdaemon/webapi/webapirequestmapper.cpp @@ -26,7 +26,7 @@ #include "webapirequestmapper.h" #include "SWGDaemonSummaryResponse.h" #include "SWGInstanceDevicesResponse.h" -#include "SWGSDRDaemonDataSettings.h" +#include "SWGChannelSettings.h" #include "SWGDeviceSettings.h" #include "SWGDeviceState.h" #include "SWGDeviceReport.h" @@ -96,8 +96,8 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http daemonInstanceSummaryService(request, response); } else if (path == WebAPIAdapterDaemon::daemonInstanceLoggingURL) { daemonInstanceLoggingService(request, response); - } else if (path == WebAPIAdapterDaemon::daemonDataSettingsURL) { - daemonDataSettingsService(request, response); + } else if (path == WebAPIAdapterDaemon::daemonChannelSettingsURL) { + daemonChannelSettingsService(request, response); } else if (path == WebAPIAdapterDaemon::daemonDeviceSettingsURL) { daemonDeviceSettingsService(request, response); } else if (path == WebAPIAdapterDaemon::daemonDeviceReportURL) { @@ -191,27 +191,41 @@ void WebAPIRequestMapper::daemonInstanceLoggingService(qtwebapp::HttpRequest& re } } -void WebAPIRequestMapper::daemonDataSettingsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) +void WebAPIRequestMapper::daemonChannelSettingsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) { SWGSDRangel::SWGErrorResponse errorResponse; response.setHeader("Content-Type", "application/json"); response.setHeader("Access-Control-Allow-Origin", "*"); - if ((request.getMethod() == "PUT") || (request.getMethod() == "PATCH")) + if (request.getMethod() == "GET") + { + SWGSDRangel::SWGChannelSettings normalResponse; + resetChannelSettings(normalResponse); + int status = m_adapter->daemonChannelSettingsGet(normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else if ((request.getMethod() == "PUT") || (request.getMethod() == "PATCH")) { QString jsonStr = request.getBody(); QJsonObject jsonObject; if (parseJsonBody(jsonStr, jsonObject, response)) { - SWGSDRangel::SWGSDRDaemonDataSettings normalResponse; - QStringList dataSettingsKeys; + SWGSDRangel::SWGChannelSettings normalResponse; + resetChannelSettings(normalResponse); + QStringList channelSettingsKeys; - if (validateDataSettings(normalResponse, jsonObject, dataSettingsKeys)) + if (validateChannelSettings(normalResponse, jsonObject, channelSettingsKeys)) { - int status = m_adapter->daemonDataSettingsPutPatch( + int status = m_adapter->daemonChannelSettingsPutPatch( (request.getMethod() == "PUT"), // force settings on PUT - dataSettingsKeys, + channelSettingsKeys, normalResponse, errorResponse); response.setStatus(status); @@ -238,18 +252,6 @@ void WebAPIRequestMapper::daemonDataSettingsService(qtwebapp::HttpRequest& reque response.write(errorResponse.asJson().toUtf8()); } } - else if (request.getMethod() == "GET") - { - SWGSDRangel::SWGSDRDaemonDataSettings normalResponse; - int status = m_adapter->daemonDataSettingsGet(normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } else { response.setStatus(405,"Invalid HTTP method"); @@ -411,51 +413,248 @@ void WebAPIRequestMapper::daemonRunService(qtwebapp::HttpRequest& request, qtweb } } - -bool WebAPIRequestMapper::validateDataSettings(SWGSDRangel::SWGSDRDaemonDataSettings& dataSettings, QJsonObject& jsonObject, QStringList& dataSettingsKeys) +// TODO: put in library in common with SDRangel. Can be static. +bool WebAPIRequestMapper::validateChannelSettings( + SWGSDRangel::SWGChannelSettings& channelSettings, + QJsonObject& jsonObject, + QStringList& channelSettingsKeys) { - if (jsonObject.contains("nbFECBlocks")) - { - int nbFECBlocks = jsonObject["nbFECBlocks"].toInt(); - - if (nbFECBlocks >=0 && nbFECBlocks < 127) { - dataSettings.setNbFecBlocks(nbFECBlocks); - } else { - dataSettings.setNbFecBlocks(0); - } + if (jsonObject.contains("tx")) { + channelSettings.setTx(jsonObject["tx"].toInt()); + } else { + channelSettings.setTx(0); // assume Rx } - if (jsonObject.contains("dataPort")) - { - int dataPort = jsonObject["dataPort"].toInt(); - - if (dataPort > 1023 && dataPort < 65536) { - dataSettings.setDataPort(dataPort); - } else { - dataSettings.setDataPort(9090); - } - } - - if (jsonObject.contains("txDelay")) - { - int txDelay = jsonObject["txDelay"].toInt(); - - if (txDelay > 100) { - dataSettings.setTxDelay(txDelay); - } else { - dataSettings.setTxDelay(100); - } - } - - if (jsonObject.contains("dataAddress") && jsonObject["dataAddress"].isString()) { - dataSettings.setDataAddress(new QString(jsonObject["dataAddress"].toString())); + if (jsonObject.contains("channelType") && jsonObject["channelType"].isString()) { + channelSettings.setChannelType(new QString(jsonObject["channelType"].toString())); } else { return false; } - dataSettingsKeys = jsonObject.keys(); + QString *channelType = channelSettings.getChannelType(); - return true; + if (*channelType == "AMDemod") + { + if (channelSettings.getTx() == 0) + { + QJsonObject amDemodSettingsJsonObject = jsonObject["AMDemodSettings"].toObject(); + channelSettingsKeys = amDemodSettingsJsonObject.keys(); + channelSettings.setAmDemodSettings(new SWGSDRangel::SWGAMDemodSettings()); + channelSettings.getAmDemodSettings()->fromJsonObject(amDemodSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "AMMod") + { + if (channelSettings.getTx() != 0) + { + QJsonObject amModSettingsJsonObject = jsonObject["AMModSettings"].toObject(); + channelSettingsKeys = amModSettingsJsonObject.keys(); + + if (channelSettingsKeys.contains("cwKeyer")) + { + QJsonObject cwKeyerSettingsJsonObject; + appendSettingsSubKeys(amModSettingsJsonObject, cwKeyerSettingsJsonObject, "cwKeyer", channelSettingsKeys); + } + + channelSettings.setAmModSettings(new SWGSDRangel::SWGAMModSettings()); + channelSettings.getAmModSettings()->fromJsonObject(amModSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "ATVMod") + { + if (channelSettings.getTx() != 0) + { + QJsonObject atvModSettingsJsonObject = jsonObject["ATVModSettings"].toObject(); + channelSettingsKeys = atvModSettingsJsonObject.keys(); + channelSettings.setAtvModSettings(new SWGSDRangel::SWGATVModSettings()); + channelSettings.getAtvModSettings()->fromJsonObject(atvModSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "BFMDemod") + { + if (channelSettings.getTx() == 0) + { + QJsonObject bfmDemodSettingsJsonObject = jsonObject["BFMDemodSettings"].toObject(); + channelSettingsKeys = bfmDemodSettingsJsonObject.keys(); + channelSettings.setBfmDemodSettings(new SWGSDRangel::SWGBFMDemodSettings()); + channelSettings.getBfmDemodSettings()->fromJsonObject(bfmDemodSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "DSDDemod") + { + if (channelSettings.getTx() == 0) + { + QJsonObject dsdDemodSettingsJsonObject = jsonObject["DSDDemodSettings"].toObject(); + channelSettingsKeys = dsdDemodSettingsJsonObject.keys(); + channelSettings.setDsdDemodSettings(new SWGSDRangel::SWGDSDDemodSettings()); + channelSettings.getDsdDemodSettings()->fromJsonObject(dsdDemodSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "NFMDemod") + { + if (channelSettings.getTx() == 0) + { + QJsonObject nfmDemodSettingsJsonObject = jsonObject["NFMDemodSettings"].toObject(); + channelSettingsKeys = nfmDemodSettingsJsonObject.keys(); + channelSettings.setNfmDemodSettings(new SWGSDRangel::SWGNFMDemodSettings()); + channelSettings.getNfmDemodSettings()->fromJsonObject(nfmDemodSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "NFMMod") + { + if (channelSettings.getTx() != 0) + { + QJsonObject nfmModSettingsJsonObject = jsonObject["NFMModSettings"].toObject(); + channelSettingsKeys = nfmModSettingsJsonObject.keys(); + + if (channelSettingsKeys.contains("cwKeyer")) + { + QJsonObject cwKeyerSettingsJsonObject; + appendSettingsSubKeys(nfmModSettingsJsonObject, cwKeyerSettingsJsonObject, "cwKeyer", channelSettingsKeys); + } + + channelSettings.setNfmModSettings(new SWGSDRangel::SWGNFMModSettings()); + channelSettings.getNfmModSettings()->fromJsonObject(nfmModSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "SDRDaemonChannel") + { + QJsonObject sdrDaemonChannelSettingsJsonObject = jsonObject["SDRDaemonChannelSettings"].toObject(); + channelSettingsKeys = sdrDaemonChannelSettingsJsonObject.keys(); + channelSettings.setSdrDaemonChannelSettings(new SWGSDRangel::SWGSDRDaemonChannelSettings()); + channelSettings.getSdrDaemonChannelSettings()->fromJsonObject(sdrDaemonChannelSettingsJsonObject); + return true; + } + else if (*channelType == "SSBDemod") + { + if (channelSettings.getTx() == 0) + { + QJsonObject ssbDemodSettingsJsonObject = jsonObject["SSBDemodSettings"].toObject(); + channelSettingsKeys = ssbDemodSettingsJsonObject.keys(); + channelSettings.setSsbDemodSettings(new SWGSDRangel::SWGSSBDemodSettings()); + channelSettings.getSsbDemodSettings()->fromJsonObject(ssbDemodSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "SSBMod") + { + if (channelSettings.getTx() != 0) + { + QJsonObject ssbModSettingsJsonObject = jsonObject["SSBModSettings"].toObject(); + channelSettingsKeys = ssbModSettingsJsonObject.keys(); + + if (channelSettingsKeys.contains("cwKeyer")) + { + QJsonObject cwKeyerSettingsJsonObject; + appendSettingsSubKeys(ssbModSettingsJsonObject, cwKeyerSettingsJsonObject, "cwKeyer", channelSettingsKeys); + } + + channelSettings.setSsbModSettings(new SWGSDRangel::SWGSSBModSettings()); + channelSettings.getSsbModSettings()->fromJsonObject(ssbModSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "UDPSink") + { + if (channelSettings.getTx() != 0) + { + QJsonObject udpSinkSettingsJsonObject = jsonObject["UDPSinkSettings"].toObject(); + channelSettingsKeys = udpSinkSettingsJsonObject.keys(); + channelSettings.setUdpSinkSettings(new SWGSDRangel::SWGUDPSinkSettings()); + channelSettings.getUdpSinkSettings()->fromJsonObject(udpSinkSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "UDPSrc") + { + if (channelSettings.getTx() == 0) + { + QJsonObject udpSrcSettingsJsonObject = jsonObject["UDPSrcSettings"].toObject(); + channelSettingsKeys = udpSrcSettingsJsonObject.keys(); + channelSettings.setUdpSrcSettings(new SWGSDRangel::SWGUDPSrcSettings()); + channelSettings.getUdpSrcSettings()->fromJsonObject(udpSrcSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "WFMDemod") + { + if (channelSettings.getTx() == 0) + { + QJsonObject wfmDemodSettingsJsonObject = jsonObject["WFMDemodSettings"].toObject(); + channelSettingsKeys = wfmDemodSettingsJsonObject.keys(); + channelSettings.setWfmDemodSettings(new SWGSDRangel::SWGWFMDemodSettings()); + channelSettings.getWfmDemodSettings()->fromJsonObject(wfmDemodSettingsJsonObject); + return true; + } + else { + return false; + } + } + else if (*channelType == "WFMMod") + { + if (channelSettings.getTx() != 0) + { + QJsonObject wfmModSettingsJsonObject = jsonObject["WFMModSettings"].toObject(); + channelSettingsKeys = wfmModSettingsJsonObject.keys(); + + if (channelSettingsKeys.contains("cwKeyer")) + { + QJsonObject cwKeyerSettingsJsonObject; + appendSettingsSubKeys(wfmModSettingsJsonObject, cwKeyerSettingsJsonObject, "cwKeyer", channelSettingsKeys); + } + + channelSettings.setWfmModSettings(new SWGSDRangel::SWGWFMModSettings()); + channelSettings.getWfmModSettings()->fromJsonObject(wfmModSettingsJsonObject); + return true; + } + else { + return false; + } + } + else + { + return false; + } } // TODO: put in library in common with SDRangel. Can be static. @@ -774,6 +973,27 @@ bool WebAPIRequestMapper::parseJsonBody(QString& jsonStr, QJsonObject& jsonObjec } } +// TODO: put in library in common with SDRangel. Can be static. +void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings& channelSettings) +{ + channelSettings.cleanup(); + channelSettings.setChannelType(0); + channelSettings.setAmDemodSettings(0); + channelSettings.setAmModSettings(0); + channelSettings.setAtvModSettings(0); + channelSettings.setBfmDemodSettings(0); + channelSettings.setDsdDemodSettings(0); + channelSettings.setNfmDemodSettings(0); + channelSettings.setNfmModSettings(0); + channelSettings.setSdrDaemonChannelSettings(0); + channelSettings.setSsbDemodSettings(0); + channelSettings.setSsbModSettings(0); + channelSettings.setUdpSinkSettings(0); + channelSettings.setUdpSrcSettings(0); + channelSettings.setWfmDemodSettings(0); + channelSettings.setWfmModSettings(0); +} + // TODO: put in library in common with SDRangel. Can be static. void WebAPIRequestMapper::resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings) { diff --git a/sdrdaemon/webapi/webapirequestmapper.h b/sdrdaemon/webapi/webapirequestmapper.h index 927fa8fc9..49363493a 100644 --- a/sdrdaemon/webapi/webapirequestmapper.h +++ b/sdrdaemon/webapi/webapirequestmapper.h @@ -30,7 +30,7 @@ namespace SWGSDRangel { - class SWGSDRDaemonDataSettings; + class SWGChannelSettings; class SWGDeviceSettings; class SWGDeviceReport; } @@ -54,12 +54,12 @@ private: void daemonInstanceSummaryService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void daemonInstanceLoggingService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void daemonDataSettingsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); + void daemonChannelSettingsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void daemonDeviceSettingsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void daemonRunService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void daemonDeviceReportService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - bool validateDataSettings(SWGSDRangel::SWGSDRDaemonDataSettings& dataSettings, QJsonObject& jsonObject, QStringList& dataSettingsKeys); + bool validateChannelSettings(SWGSDRangel::SWGChannelSettings& channelSettings, QJsonObject& jsonObject, QStringList& channelSettingsKeys); bool validateDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings, QJsonObject& jsonObject, QStringList& deviceSettingsKeys); void appendSettingsSubKeys( @@ -70,6 +70,7 @@ private: bool parseJsonBody(QString& jsonStr, QJsonObject& jsonObject, qtwebapp::HttpResponse& response); + void resetChannelSettings(SWGSDRangel::SWGChannelSettings& channelSettings); void resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings); void resetDeviceReport(SWGSDRangel::SWGDeviceReport& deviceReport); }; diff --git a/swagger/sdrangel/api/swagger/include/SDRDaemonChannel.yaml b/swagger/sdrangel/api/swagger/include/SDRDaemonChannel.yaml new file mode 100644 index 000000000..332732524 --- /dev/null +++ b/swagger/sdrangel/api/swagger/include/SDRDaemonChannel.yaml @@ -0,0 +1,15 @@ +SDRDaemonChannelSettings: + description: "Data handling details for SDRDaemon" + properties: + nbFECBlocks: + description: "Number of FEC blocks per frame" + type: integer + dataAddress: + description: "Receiving USB data address" + type: string + dataPort: + description: "Receiving USB data port" + type: integer + txDelay: + description: "Minimum delay in ms between consecutive USB blocks transmissions" + type: integer diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index c6b1d8920..5f5147cf8 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -1298,46 +1298,46 @@ paths: "501": $ref: "#/responses/Response_501" - /sdrdaemon/data/settings: + /sdrdaemon/channel/settings: x-swagger-router-controller: deviceset get: - description: Get data handling details - operationId: daemonDataSettingsGet + description: Get channel handling details + operationId: daemonChannelSettingsGet tags: - Daemon responses: "200": - description: On success returns current data handling details + description: On success return channel settings schema: - $ref: "#/definitions/SDRDaemonDataSettings" + $ref: "#/definitions/ChannelSettings" "500": $ref: "#/responses/Response_500" "501": $ref: "#/responses/Response_501" put: - description: Apply data handling details unconditionally (force) - operationId: daemonDataSettingsPut + description: Apply channel handling details unconditionally (force) + operationId: daemonChannelSettingsPut tags: - Daemon parameters: - name: body in: body - description: Data handling details to apply + description: Channel handling details to apply required: true schema: - $ref: "#/definitions/SDRDaemonDataSettings" + $ref: "#/definitions/ChannelSettings" responses: "200": description: On success returns new settings values schema: - $ref: "#/definitions/SDRDaemonDataSettings" + $ref: "#/definitions/ChannelSettings" "500": $ref: "#/responses/Response_500" "501": $ref: "#/responses/Response_501" patch: - description: Apply data handling details differentially (no force) - operationId: daemonDataSettingsPatch + description: Apply channel handling details differentially (no force) + operationId: daemonChannelSettingsPatch tags: - Daemon parameters: @@ -1346,12 +1346,12 @@ paths: description: Data handling detail to apply required: true schema: - $ref: "#/definitions/SDRDaemonDataSettings" + $ref: "#/definitions/ChannelSettings" responses: "200": description: On success returns new settings values schema: - $ref: "#/definitions/SDRDaemonDataSettings" + $ref: "#/definitions/ChannelSettings" "500": $ref: "#/responses/Response_500" "501": @@ -2194,6 +2194,8 @@ definitions: $ref: "http://localhost:8081/api/swagger/include/NFMDemod.yaml#/NFMDemodSettings" NFMModSettings: $ref: "http://localhost:8081/api/swagger/include/NFMMod.yaml#/NFMModSettings" + SDRDaemonChannelSettings: + $ref: "http://localhost:8081/api/swagger/include/SDRDaemonChannel.yaml#/SDRDaemonChannelSettings" SSBModSettings: $ref: "http://localhost:8081/api/swagger/include/SSBMod.yaml#/SSBModSettings" SSBDemodSettings: @@ -2244,22 +2246,6 @@ definitions: WFMModReport: $ref: "http://localhost:8081/api/swagger/include/WFMMod.yaml#/WFMModReport" - SDRDaemonDataSettings: - description: "Data handling details for SDRDaemon" - properties: - nbFECBlocks: - description: "Number of FEC blocks per frame" - type: integer - dataAddress: - description: "Receiving USB data address" - type: string - dataPort: - description: "Receiving USB data port" - type: integer - txDelay: - description: "Minimum delay in ms between consecutive USB blocks transmissions" - type: integer - responses: Response_500: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index d1c41a364..20c65c84f 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1467,6 +1467,9 @@ margin-bottom: 20px; "NFMModSettings" : { "$ref" : "#/definitions/NFMModSettings" }, + "SDRDaemonChannelSettings" : { + "$ref" : "#/definitions/SDRDaemonChannelSettings" + }, "SSBModSettings" : { "$ref" : "#/definitions/SSBModSettings" }, @@ -3143,7 +3146,7 @@ margin-bottom: 20px; }, "description" : "RTLSDR" }; - defs.SDRDaemonDataSettings = { + defs.SDRDaemonChannelSettings = { "properties" : { "nbFECBlocks" : { "type" : "integer", @@ -4024,14 +4027,14 @@ margin-bottom: 20px; -
  • - daemonDataSettingsGet +
  • + daemonChannelSettingsGet
  • -
  • - daemonDataSettingsPatch +
  • + daemonChannelSettingsPatch
  • -
  • - daemonDataSettingsPut +
  • + daemonChannelSettingsPut
  • daemonDeviceReportGet @@ -4230,41 +4233,41 @@ margin-bottom: 20px;

    Daemon

    -
    -
    +
    +
    -

    daemonDataSettingsGet

    +

    daemonChannelSettingsGet

    -

    Get data handling details

    +

    Get channel handling details


    -
    /sdrdaemon/data/settings
    +
    /sdrdaemon/channel/settings

    Usage and SDK Samples

    -
    -
    curl -X GET "http://localhost/sdrdaemon/data/settings"
    +
    +
    curl -X GET "http://localhost/sdrdaemon/channel/settings"
    -
    +
    import SWGSDRangel.*;
     import SWGSDRangel.auth.*;
     import SWGSDRangel.model.*;
    @@ -4279,17 +4282,17 @@ public class DaemonApiExample {
             
             DaemonApi apiInstance = new DaemonApi();
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsGet();
    +            ChannelSettings result = apiInstance.daemonChannelSettingsGet();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsGet");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsGet");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    import SWGSDRangel.api.DaemonApi;
     
     public class DaemonApiExample {
    @@ -4297,25 +4300,25 @@ public class DaemonApiExample {
         public static void main(String[] args) {
             DaemonApi apiInstance = new DaemonApi();
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsGet();
    +            ChannelSettings result = apiInstance.daemonChannelSettingsGet();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsGet");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsGet");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    
     DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -[apiInstance daemonDataSettingsGetWithCompletionHandler: 
    -              ^(SDRDaemonDataSettings output, NSError* error) {
    +[apiInstance daemonChannelSettingsGetWithCompletionHandler: 
    +              ^(ChannelSettings output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -4326,7 +4329,7 @@ DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -
    +
    var SdRangel = require('sd_rangel');
     
     var api = new SdRangel.DaemonApi()
    @@ -4338,14 +4341,14 @@ var callback = function(error, data, response) {
         console.log('API called successfully. Returned data: ' + data);
       }
     };
    -api.daemonDataSettingsGet(callback);
    +api.daemonChannelSettingsGet(callback);
     
    - -
    +
    using System;
     using System.Diagnostics;
     using SWGSDRangel.Api;
    @@ -4354,7 +4357,7 @@ using SWGSDRangel.Model;
     
     namespace Example
     {
    -    public class daemonDataSettingsGetExample
    +    public class daemonChannelSettingsGetExample
         {
             public void main()
             {
    @@ -4363,12 +4366,12 @@ namespace Example
     
                 try
                 {
    -                SDRDaemonDataSettings result = apiInstance.daemonDataSettingsGet();
    +                ChannelSettings result = apiInstance.daemonChannelSettingsGet();
                     Debug.WriteLine(result);
                 }
                 catch (Exception e)
                 {
    -                Debug.Print("Exception when calling DaemonApi.daemonDataSettingsGet: " + e.Message );
    +                Debug.Print("Exception when calling DaemonApi.daemonChannelSettingsGet: " + e.Message );
                 }
             }
         }
    @@ -4376,22 +4379,22 @@ namespace Example
     
    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\Api\DaemonApi();
     
     try {
    -    $result = $api_instance->daemonDataSettingsGet();
    +    $result = $api_instance->daemonChannelSettingsGet();
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling DaemonApi->daemonDataSettingsGet: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling DaemonApi->daemonChannelSettingsGet: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use SWGSDRangel::Configuration;
     use SWGSDRangel::DaemonApi;
    @@ -4399,15 +4402,15 @@ use SWGSDRangel::DaemonApi;
     my $api_instance = SWGSDRangel::DaemonApi->new();
     
     eval { 
    -    my $result = $api_instance->daemonDataSettingsGet();
    +    my $result = $api_instance->daemonChannelSettingsGet();
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling DaemonApi->daemonDataSettingsGet: $@\n";
    +    warn "Exception when calling DaemonApi->daemonChannelSettingsGet: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_sdrangel
    @@ -4418,10 +4421,10 @@ from pprint import pprint
     api_instance = swagger_sdrangel.DaemonApi()
     
     try: 
    -    api_response = api_instance.daemon_data_settings_get()
    +    api_response = api_instance.daemon_channel_settings_get()
         pprint(api_response)
     except ApiException as e:
    -    print("Exception when calling DaemonApi->daemonDataSettingsGet: %s\n" % e)
    + print("Exception when calling DaemonApi->daemonChannelSettingsGet: %s\n" % e)
    @@ -4433,24 +4436,24 @@ except ApiException as e:

    Responses

    -

    Status: 200 - On success returns current data handling details

    +

    Status: 200 - On success return channel settings

    -
    -
    +
    +
    - +
    @@ -4480,14 +4483,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +
    @@ -4523,14 +4526,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +

    -
    -
    +
    +
    -

    daemonDataSettingsPatch

    +

    daemonChannelSettingsPatch

    -

    Apply data handling details differentially (no force)

    +

    Apply channel handling details differentially (no force)


    -
    /sdrdaemon/data/settings
    +
    /sdrdaemon/channel/settings

    Usage and SDK Samples

    -
    -
    curl -X PATCH "http://localhost/sdrdaemon/data/settings"
    +
    +
    curl -X PATCH "http://localhost/sdrdaemon/channel/settings"
    -
    +
    import SWGSDRangel.*;
     import SWGSDRangel.auth.*;
     import SWGSDRangel.model.*;
    @@ -4613,47 +4616,47 @@ public class DaemonApiExample {
         public static void main(String[] args) {
             
             DaemonApi apiInstance = new DaemonApi();
    -        SDRDaemonDataSettings body = ; // SDRDaemonDataSettings | Data handling detail to apply
    +        ChannelSettings body = ; // ChannelSettings | Data handling detail to apply
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPatch(body);
    +            ChannelSettings result = apiInstance.daemonChannelSettingsPatch(body);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsPatch");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsPatch");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    import SWGSDRangel.api.DaemonApi;
     
     public class DaemonApiExample {
     
         public static void main(String[] args) {
             DaemonApi apiInstance = new DaemonApi();
    -        SDRDaemonDataSettings body = ; // SDRDaemonDataSettings | Data handling detail to apply
    +        ChannelSettings body = ; // ChannelSettings | Data handling detail to apply
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPatch(body);
    +            ChannelSettings result = apiInstance.daemonChannelSettingsPatch(body);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsPatch");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsPatch");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    SDRDaemonDataSettings *body = ; // Data handling detail to apply
    +                            
    +
    ChannelSettings *body = ; // Data handling detail to apply
     
     DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -[apiInstance daemonDataSettingsPatchWith:body
    -              completionHandler: ^(SDRDaemonDataSettings output, NSError* error) {
    +[apiInstance daemonChannelSettingsPatchWith:body
    +              completionHandler: ^(ChannelSettings output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -4664,12 +4667,12 @@ DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -
    +
    var SdRangel = require('sd_rangel');
     
     var api = new SdRangel.DaemonApi()
     
    -var body = ; // {SDRDaemonDataSettings} Data handling detail to apply
    +var body = ; // {ChannelSettings} Data handling detail to apply
     
     
     var callback = function(error, data, response) {
    @@ -4679,14 +4682,14 @@ var callback = function(error, data, response) {
         console.log('API called successfully. Returned data: ' + data);
       }
     };
    -api.daemonDataSettingsPatch(body, callback);
    +api.daemonChannelSettingsPatch(body, callback);
     
    - -
    +
    using System;
     using System.Diagnostics;
     using SWGSDRangel.Api;
    @@ -4695,22 +4698,22 @@ using SWGSDRangel.Model;
     
     namespace Example
     {
    -    public class daemonDataSettingsPatchExample
    +    public class daemonChannelSettingsPatchExample
         {
             public void main()
             {
                 
                 var apiInstance = new DaemonApi();
    -            var body = new SDRDaemonDataSettings(); // SDRDaemonDataSettings | Data handling detail to apply
    +            var body = new ChannelSettings(); // ChannelSettings | Data handling detail to apply
     
                 try
                 {
    -                SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPatch(body);
    +                ChannelSettings result = apiInstance.daemonChannelSettingsPatch(body);
                     Debug.WriteLine(result);
                 }
                 catch (Exception e)
                 {
    -                Debug.Print("Exception when calling DaemonApi.daemonDataSettingsPatch: " + e.Message );
    +                Debug.Print("Exception when calling DaemonApi.daemonChannelSettingsPatch: " + e.Message );
                 }
             }
         }
    @@ -4718,40 +4721,40 @@ namespace Example
     
    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\Api\DaemonApi();
    -$body = ; // SDRDaemonDataSettings | Data handling detail to apply
    +$body = ; // ChannelSettings | Data handling detail to apply
     
     try {
    -    $result = $api_instance->daemonDataSettingsPatch($body);
    +    $result = $api_instance->daemonChannelSettingsPatch($body);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling DaemonApi->daemonDataSettingsPatch: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling DaemonApi->daemonChannelSettingsPatch: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use SWGSDRangel::Configuration;
     use SWGSDRangel::DaemonApi;
     
     my $api_instance = SWGSDRangel::DaemonApi->new();
    -my $body = SWGSDRangel::Object::SDRDaemonDataSettings->new(); # SDRDaemonDataSettings | Data handling detail to apply
    +my $body = SWGSDRangel::Object::ChannelSettings->new(); # ChannelSettings | Data handling detail to apply
     
     eval { 
    -    my $result = $api_instance->daemonDataSettingsPatch(body => $body);
    +    my $result = $api_instance->daemonChannelSettingsPatch(body => $body);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling DaemonApi->daemonDataSettingsPatch: $@\n";
    +    warn "Exception when calling DaemonApi->daemonChannelSettingsPatch: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_sdrangel
    @@ -4760,13 +4763,13 @@ from pprint import pprint
     
     # create an instance of the API class
     api_instance = swagger_sdrangel.DaemonApi()
    -body =  # SDRDaemonDataSettings | Data handling detail to apply
    +body =  # ChannelSettings | Data handling detail to apply
     
     try: 
    -    api_response = api_instance.daemon_data_settings_patch(body)
    +    api_response = api_instance.daemon_channel_settings_patch(body)
         pprint(api_response)
     except ApiException as e:
    -    print("Exception when calling DaemonApi->daemonDataSettingsPatch: %s\n" % e)
    + print("Exception when calling DaemonApi->daemonChannelSettingsPatch: %s\n" % e)
    @@ -4792,7 +4795,7 @@ $(document).ready(function() { "description" : "Data handling detail to apply", "required" : true, "schema" : { - "$ref" : "#/definitions/SDRDaemonDataSettings" + "$ref" : "#/definitions/ChannelSettings" } }; var schema = schemaWrapper.schema; @@ -4806,12 +4809,12 @@ $(document).ready(function() { } var view = new JSONSchemaView(schema,2,{isBodyParam: true}); - var result = $('#d2e199_daemonDataSettingsPatch_body'); + var result = $('#d2e199_daemonChannelSettingsPatch_body'); result.empty(); result.append(view.render()); }); -
    +
    @@ -4824,20 +4827,20 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +
    @@ -4867,14 +4870,14 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +
    @@ -4910,14 +4913,14 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +

    -
    -
    +
    +
    -

    daemonDataSettingsPut

    +

    daemonChannelSettingsPut

    -

    Apply data handling details unconditionally (force)

    +

    Apply channel handling details unconditionally (force)


    -
    /sdrdaemon/data/settings
    +
    /sdrdaemon/channel/settings

    Usage and SDK Samples

    -
    -
    curl -X PUT "http://localhost/sdrdaemon/data/settings"
    +
    +
    curl -X PUT "http://localhost/sdrdaemon/channel/settings"
    -
    +
    import SWGSDRangel.*;
     import SWGSDRangel.auth.*;
     import SWGSDRangel.model.*;
    @@ -5000,47 +5003,47 @@ public class DaemonApiExample {
         public static void main(String[] args) {
             
             DaemonApi apiInstance = new DaemonApi();
    -        SDRDaemonDataSettings body = ; // SDRDaemonDataSettings | Data handling details to apply
    +        ChannelSettings body = ; // ChannelSettings | Channel handling details to apply
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPut(body);
    +            ChannelSettings result = apiInstance.daemonChannelSettingsPut(body);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsPut");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsPut");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    import SWGSDRangel.api.DaemonApi;
     
     public class DaemonApiExample {
     
         public static void main(String[] args) {
             DaemonApi apiInstance = new DaemonApi();
    -        SDRDaemonDataSettings body = ; // SDRDaemonDataSettings | Data handling details to apply
    +        ChannelSettings body = ; // ChannelSettings | Channel handling details to apply
             try {
    -            SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPut(body);
    +            ChannelSettings result = apiInstance.daemonChannelSettingsPut(body);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling DaemonApi#daemonDataSettingsPut");
    +            System.err.println("Exception when calling DaemonApi#daemonChannelSettingsPut");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    SDRDaemonDataSettings *body = ; // Data handling details to apply
    +                            
    +
    ChannelSettings *body = ; // Channel handling details to apply
     
     DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -[apiInstance daemonDataSettingsPutWith:body
    -              completionHandler: ^(SDRDaemonDataSettings output, NSError* error) {
    +[apiInstance daemonChannelSettingsPutWith:body
    +              completionHandler: ^(ChannelSettings output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -5051,12 +5054,12 @@ DaemonApi *apiInstance = [[DaemonApi alloc] init];
     
    -
    +
    var SdRangel = require('sd_rangel');
     
     var api = new SdRangel.DaemonApi()
     
    -var body = ; // {SDRDaemonDataSettings} Data handling details to apply
    +var body = ; // {ChannelSettings} Channel handling details to apply
     
     
     var callback = function(error, data, response) {
    @@ -5066,14 +5069,14 @@ var callback = function(error, data, response) {
         console.log('API called successfully. Returned data: ' + data);
       }
     };
    -api.daemonDataSettingsPut(body, callback);
    +api.daemonChannelSettingsPut(body, callback);
     
    - -
    +
    using System;
     using System.Diagnostics;
     using SWGSDRangel.Api;
    @@ -5082,22 +5085,22 @@ using SWGSDRangel.Model;
     
     namespace Example
     {
    -    public class daemonDataSettingsPutExample
    +    public class daemonChannelSettingsPutExample
         {
             public void main()
             {
                 
                 var apiInstance = new DaemonApi();
    -            var body = new SDRDaemonDataSettings(); // SDRDaemonDataSettings | Data handling details to apply
    +            var body = new ChannelSettings(); // ChannelSettings | Channel handling details to apply
     
                 try
                 {
    -                SDRDaemonDataSettings result = apiInstance.daemonDataSettingsPut(body);
    +                ChannelSettings result = apiInstance.daemonChannelSettingsPut(body);
                     Debug.WriteLine(result);
                 }
                 catch (Exception e)
                 {
    -                Debug.Print("Exception when calling DaemonApi.daemonDataSettingsPut: " + e.Message );
    +                Debug.Print("Exception when calling DaemonApi.daemonChannelSettingsPut: " + e.Message );
                 }
             }
         }
    @@ -5105,40 +5108,40 @@ namespace Example
     
    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\Api\DaemonApi();
    -$body = ; // SDRDaemonDataSettings | Data handling details to apply
    +$body = ; // ChannelSettings | Channel handling details to apply
     
     try {
    -    $result = $api_instance->daemonDataSettingsPut($body);
    +    $result = $api_instance->daemonChannelSettingsPut($body);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling DaemonApi->daemonDataSettingsPut: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling DaemonApi->daemonChannelSettingsPut: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use SWGSDRangel::Configuration;
     use SWGSDRangel::DaemonApi;
     
     my $api_instance = SWGSDRangel::DaemonApi->new();
    -my $body = SWGSDRangel::Object::SDRDaemonDataSettings->new(); # SDRDaemonDataSettings | Data handling details to apply
    +my $body = SWGSDRangel::Object::ChannelSettings->new(); # ChannelSettings | Channel handling details to apply
     
     eval { 
    -    my $result = $api_instance->daemonDataSettingsPut(body => $body);
    +    my $result = $api_instance->daemonChannelSettingsPut(body => $body);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling DaemonApi->daemonDataSettingsPut: $@\n";
    +    warn "Exception when calling DaemonApi->daemonChannelSettingsPut: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_sdrangel
    @@ -5147,13 +5150,13 @@ from pprint import pprint
     
     # create an instance of the API class
     api_instance = swagger_sdrangel.DaemonApi()
    -body =  # SDRDaemonDataSettings | Data handling details to apply
    +body =  # ChannelSettings | Channel handling details to apply
     
     try: 
    -    api_response = api_instance.daemon_data_settings_put(body)
    +    api_response = api_instance.daemon_channel_settings_put(body)
         pprint(api_response)
     except ApiException as e:
    -    print("Exception when calling DaemonApi->daemonDataSettingsPut: %s\n" % e)
    + print("Exception when calling DaemonApi->daemonChannelSettingsPut: %s\n" % e)
    @@ -5176,10 +5179,10 @@ $(document).ready(function() { var schemaWrapper = { "in" : "body", "name" : "body", - "description" : "Data handling details to apply", + "description" : "Channel handling details to apply", "required" : true, "schema" : { - "$ref" : "#/definitions/SDRDaemonDataSettings" + "$ref" : "#/definitions/ChannelSettings" } }; var schema = schemaWrapper.schema; @@ -5193,12 +5196,12 @@ $(document).ready(function() { } var view = new JSONSchemaView(schema,2,{isBodyParam: true}); - var result = $('#d2e199_daemonDataSettingsPut_body'); + var result = $('#d2e199_daemonChannelSettingsPut_body'); result.empty(); result.append(view.render()); }); -
    +
    @@ -5211,20 +5214,20 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +
    @@ -5254,14 +5257,14 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +
    @@ -5297,14 +5300,14 @@ $(document).ready(function() {
    -
    -
    +
    +
    - +
    @@ -28212,7 +28215,7 @@ except ApiException as e:
    - Generated 2018-08-23T00:21:49.115+02:00 + Generated 2018-08-23T14:53:21.934+02:00
    diff --git a/swagger/sdrangel/code/qt5/client/SWGChannelSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGChannelSettings.cpp index 4efc140c8..1b3689f77 100644 --- a/swagger/sdrangel/code/qt5/client/SWGChannelSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGChannelSettings.cpp @@ -46,6 +46,8 @@ SWGChannelSettings::SWGChannelSettings() { m_nfm_demod_settings_isSet = false; nfm_mod_settings = nullptr; m_nfm_mod_settings_isSet = false; + sdr_daemon_channel_settings = nullptr; + m_sdr_daemon_channel_settings_isSet = false; ssb_mod_settings = nullptr; m_ssb_mod_settings_isSet = false; ssb_demod_settings = nullptr; @@ -84,6 +86,8 @@ SWGChannelSettings::init() { m_nfm_demod_settings_isSet = false; nfm_mod_settings = new SWGNFMModSettings(); m_nfm_mod_settings_isSet = false; + sdr_daemon_channel_settings = new SWGSDRDaemonChannelSettings(); + m_sdr_daemon_channel_settings_isSet = false; ssb_mod_settings = new SWGSSBModSettings(); m_ssb_mod_settings_isSet = false; ssb_demod_settings = new SWGSSBDemodSettings(); @@ -125,6 +129,9 @@ SWGChannelSettings::cleanup() { if(nfm_mod_settings != nullptr) { delete nfm_mod_settings; } + if(sdr_daemon_channel_settings != nullptr) { + delete sdr_daemon_channel_settings; + } if(ssb_mod_settings != nullptr) { delete ssb_mod_settings; } @@ -174,6 +181,8 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&nfm_mod_settings, pJson["NFMModSettings"], "SWGNFMModSettings", "SWGNFMModSettings"); + ::SWGSDRangel::setValue(&sdr_daemon_channel_settings, pJson["SDRDaemonChannelSettings"], "SWGSDRDaemonChannelSettings", "SWGSDRDaemonChannelSettings"); + ::SWGSDRangel::setValue(&ssb_mod_settings, pJson["SSBModSettings"], "SWGSSBModSettings", "SWGSSBModSettings"); ::SWGSDRangel::setValue(&ssb_demod_settings, pJson["SSBDemodSettings"], "SWGSSBDemodSettings", "SWGSSBDemodSettings"); @@ -229,6 +238,9 @@ SWGChannelSettings::asJsonObject() { if((nfm_mod_settings != nullptr) && (nfm_mod_settings->isSet())){ toJsonValue(QString("NFMModSettings"), nfm_mod_settings, obj, QString("SWGNFMModSettings")); } + if((sdr_daemon_channel_settings != nullptr) && (sdr_daemon_channel_settings->isSet())){ + toJsonValue(QString("SDRDaemonChannelSettings"), sdr_daemon_channel_settings, obj, QString("SWGSDRDaemonChannelSettings")); + } if((ssb_mod_settings != nullptr) && (ssb_mod_settings->isSet())){ toJsonValue(QString("SSBModSettings"), ssb_mod_settings, obj, QString("SWGSSBModSettings")); } @@ -341,6 +353,16 @@ SWGChannelSettings::setNfmModSettings(SWGNFMModSettings* nfm_mod_settings) { this->m_nfm_mod_settings_isSet = true; } +SWGSDRDaemonChannelSettings* +SWGChannelSettings::getSdrDaemonChannelSettings() { + return sdr_daemon_channel_settings; +} +void +SWGChannelSettings::setSdrDaemonChannelSettings(SWGSDRDaemonChannelSettings* sdr_daemon_channel_settings) { + this->sdr_daemon_channel_settings = sdr_daemon_channel_settings; + this->m_sdr_daemon_channel_settings_isSet = true; +} + SWGSSBModSettings* SWGChannelSettings::getSsbModSettings() { return ssb_mod_settings; @@ -415,6 +437,7 @@ SWGChannelSettings::isSet(){ if(dsd_demod_settings != nullptr && dsd_demod_settings->isSet()){ isObjectUpdated = true; break;} if(nfm_demod_settings != nullptr && nfm_demod_settings->isSet()){ isObjectUpdated = true; break;} if(nfm_mod_settings != nullptr && nfm_mod_settings->isSet()){ isObjectUpdated = true; break;} + if(sdr_daemon_channel_settings != nullptr && sdr_daemon_channel_settings->isSet()){ isObjectUpdated = true; break;} if(ssb_mod_settings != nullptr && ssb_mod_settings->isSet()){ isObjectUpdated = true; break;} if(ssb_demod_settings != nullptr && ssb_demod_settings->isSet()){ isObjectUpdated = true; break;} if(udp_sink_settings != nullptr && udp_sink_settings->isSet()){ isObjectUpdated = true; break;} diff --git a/swagger/sdrangel/code/qt5/client/SWGChannelSettings.h b/swagger/sdrangel/code/qt5/client/SWGChannelSettings.h index 600a707a7..9973ab3af 100644 --- a/swagger/sdrangel/code/qt5/client/SWGChannelSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGChannelSettings.h @@ -29,6 +29,7 @@ #include "SWGDSDDemodSettings.h" #include "SWGNFMDemodSettings.h" #include "SWGNFMModSettings.h" +#include "SWGSDRDaemonChannelSettings.h" #include "SWGSSBDemodSettings.h" #include "SWGSSBModSettings.h" #include "SWGUDPSinkSettings.h" @@ -82,6 +83,9 @@ public: SWGNFMModSettings* getNfmModSettings(); void setNfmModSettings(SWGNFMModSettings* nfm_mod_settings); + SWGSDRDaemonChannelSettings* getSdrDaemonChannelSettings(); + void setSdrDaemonChannelSettings(SWGSDRDaemonChannelSettings* sdr_daemon_channel_settings); + SWGSSBModSettings* getSsbModSettings(); void setSsbModSettings(SWGSSBModSettings* ssb_mod_settings); @@ -131,6 +135,9 @@ private: SWGNFMModSettings* nfm_mod_settings; bool m_nfm_mod_settings_isSet; + SWGSDRDaemonChannelSettings* sdr_daemon_channel_settings; + bool m_sdr_daemon_channel_settings_isSet; + SWGSSBModSettings* ssb_mod_settings; bool m_ssb_mod_settings_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGDaemonApi.cpp b/swagger/sdrangel/code/qt5/client/SWGDaemonApi.cpp index 1a8a6f613..23886faef 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDaemonApi.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGDaemonApi.cpp @@ -29,9 +29,9 @@ SWGDaemonApi::SWGDaemonApi(QString host, QString basePath) { } void -SWGDaemonApi::daemonDataSettingsGet() { +SWGDaemonApi::daemonChannelSettingsGet() { QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/data/settings"); + fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/channel/settings"); @@ -49,13 +49,13 @@ SWGDaemonApi::daemonDataSettingsGet() { connect(worker, &SWGHttpRequestWorker::on_execution_finished, this, - &SWGDaemonApi::daemonDataSettingsGetCallback); + &SWGDaemonApi::daemonChannelSettingsGetCallback); worker->execute(&input); } void -SWGDaemonApi::daemonDataSettingsGetCallback(SWGHttpRequestWorker * worker) { +SWGDaemonApi::daemonChannelSettingsGetCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -69,21 +69,21 @@ SWGDaemonApi::daemonDataSettingsGetCallback(SWGHttpRequestWorker * worker) { QString json(worker->response); - SWGSDRDaemonDataSettings* output = static_cast(create(json, QString("SWGSDRDaemonDataSettings"))); + SWGChannelSettings* output = static_cast(create(json, QString("SWGChannelSettings"))); worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { - emit daemonDataSettingsGetSignal(output); + emit daemonChannelSettingsGetSignal(output); } else { - emit daemonDataSettingsGetSignalE(output, error_type, error_str); - emit daemonDataSettingsGetSignalEFull(worker, error_type, error_str); + emit daemonChannelSettingsGetSignalE(output, error_type, error_str); + emit daemonChannelSettingsGetSignalEFull(worker, error_type, error_str); } } void -SWGDaemonApi::daemonDataSettingsPatch(SWGSDRDaemonDataSettings& body) { +SWGDaemonApi::daemonChannelSettingsPatch(SWGChannelSettings& body) { QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/data/settings"); + fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/channel/settings"); @@ -104,13 +104,13 @@ SWGDaemonApi::daemonDataSettingsPatch(SWGSDRDaemonDataSettings& body) { connect(worker, &SWGHttpRequestWorker::on_execution_finished, this, - &SWGDaemonApi::daemonDataSettingsPatchCallback); + &SWGDaemonApi::daemonChannelSettingsPatchCallback); worker->execute(&input); } void -SWGDaemonApi::daemonDataSettingsPatchCallback(SWGHttpRequestWorker * worker) { +SWGDaemonApi::daemonChannelSettingsPatchCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -124,21 +124,21 @@ SWGDaemonApi::daemonDataSettingsPatchCallback(SWGHttpRequestWorker * worker) { QString json(worker->response); - SWGSDRDaemonDataSettings* output = static_cast(create(json, QString("SWGSDRDaemonDataSettings"))); + SWGChannelSettings* output = static_cast(create(json, QString("SWGChannelSettings"))); worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { - emit daemonDataSettingsPatchSignal(output); + emit daemonChannelSettingsPatchSignal(output); } else { - emit daemonDataSettingsPatchSignalE(output, error_type, error_str); - emit daemonDataSettingsPatchSignalEFull(worker, error_type, error_str); + emit daemonChannelSettingsPatchSignalE(output, error_type, error_str); + emit daemonChannelSettingsPatchSignalEFull(worker, error_type, error_str); } } void -SWGDaemonApi::daemonDataSettingsPut(SWGSDRDaemonDataSettings& body) { +SWGDaemonApi::daemonChannelSettingsPut(SWGChannelSettings& body) { QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/data/settings"); + fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/channel/settings"); @@ -159,13 +159,13 @@ SWGDaemonApi::daemonDataSettingsPut(SWGSDRDaemonDataSettings& body) { connect(worker, &SWGHttpRequestWorker::on_execution_finished, this, - &SWGDaemonApi::daemonDataSettingsPutCallback); + &SWGDaemonApi::daemonChannelSettingsPutCallback); worker->execute(&input); } void -SWGDaemonApi::daemonDataSettingsPutCallback(SWGHttpRequestWorker * worker) { +SWGDaemonApi::daemonChannelSettingsPutCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -179,14 +179,14 @@ SWGDaemonApi::daemonDataSettingsPutCallback(SWGHttpRequestWorker * worker) { QString json(worker->response); - SWGSDRDaemonDataSettings* output = static_cast(create(json, QString("SWGSDRDaemonDataSettings"))); + SWGChannelSettings* output = static_cast(create(json, QString("SWGChannelSettings"))); worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { - emit daemonDataSettingsPutSignal(output); + emit daemonChannelSettingsPutSignal(output); } else { - emit daemonDataSettingsPutSignalE(output, error_type, error_str); - emit daemonDataSettingsPutSignalEFull(worker, error_type, error_str); + emit daemonChannelSettingsPutSignalE(output, error_type, error_str); + emit daemonChannelSettingsPutSignalEFull(worker, error_type, error_str); } } diff --git a/swagger/sdrangel/code/qt5/client/SWGDaemonApi.h b/swagger/sdrangel/code/qt5/client/SWGDaemonApi.h index 19cbba2e6..74b7083f6 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDaemonApi.h +++ b/swagger/sdrangel/code/qt5/client/SWGDaemonApi.h @@ -15,13 +15,13 @@ #include "SWGHttpRequest.h" +#include "SWGChannelSettings.h" #include "SWGDaemonSummaryResponse.h" #include "SWGDeviceReport.h" #include "SWGDeviceSettings.h" #include "SWGDeviceState.h" #include "SWGErrorResponse.h" #include "SWGLoggingInfo.h" -#include "SWGSDRDaemonDataSettings.h" #include @@ -39,9 +39,9 @@ public: QString basePath; QMap defaultHeaders; - void daemonDataSettingsGet(); - void daemonDataSettingsPatch(SWGSDRDaemonDataSettings& body); - void daemonDataSettingsPut(SWGSDRDaemonDataSettings& body); + void daemonChannelSettingsGet(); + void daemonChannelSettingsPatch(SWGChannelSettings& body); + void daemonChannelSettingsPut(SWGChannelSettings& body); void daemonDeviceReportGet(); void daemonDeviceSettingsGet(); void daemonDeviceSettingsPatch(SWGDeviceSettings& body); @@ -54,9 +54,9 @@ public: void daemonRunPost(); private: - void daemonDataSettingsGetCallback (SWGHttpRequestWorker * worker); - void daemonDataSettingsPatchCallback (SWGHttpRequestWorker * worker); - void daemonDataSettingsPutCallback (SWGHttpRequestWorker * worker); + void daemonChannelSettingsGetCallback (SWGHttpRequestWorker * worker); + void daemonChannelSettingsPatchCallback (SWGHttpRequestWorker * worker); + void daemonChannelSettingsPutCallback (SWGHttpRequestWorker * worker); void daemonDeviceReportGetCallback (SWGHttpRequestWorker * worker); void daemonDeviceSettingsGetCallback (SWGHttpRequestWorker * worker); void daemonDeviceSettingsPatchCallback (SWGHttpRequestWorker * worker); @@ -69,9 +69,9 @@ private: void daemonRunPostCallback (SWGHttpRequestWorker * worker); signals: - void daemonDataSettingsGetSignal(SWGSDRDaemonDataSettings* summary); - void daemonDataSettingsPatchSignal(SWGSDRDaemonDataSettings* summary); - void daemonDataSettingsPutSignal(SWGSDRDaemonDataSettings* summary); + void daemonChannelSettingsGetSignal(SWGChannelSettings* summary); + void daemonChannelSettingsPatchSignal(SWGChannelSettings* summary); + void daemonChannelSettingsPutSignal(SWGChannelSettings* summary); void daemonDeviceReportGetSignal(SWGDeviceReport* summary); void daemonDeviceSettingsGetSignal(SWGDeviceSettings* summary); void daemonDeviceSettingsPatchSignal(SWGDeviceSettings* summary); @@ -83,9 +83,9 @@ signals: void daemonRunGetSignal(SWGDeviceState* summary); void daemonRunPostSignal(SWGDeviceState* summary); - void daemonDataSettingsGetSignalE(SWGSDRDaemonDataSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void daemonDataSettingsPatchSignalE(SWGSDRDaemonDataSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void daemonDataSettingsPutSignalE(SWGSDRDaemonDataSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void daemonChannelSettingsGetSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void daemonChannelSettingsPatchSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void daemonChannelSettingsPutSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str); void daemonDeviceReportGetSignalE(SWGDeviceReport* summary, QNetworkReply::NetworkError error_type, QString& error_str); void daemonDeviceSettingsGetSignalE(SWGDeviceSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str); void daemonDeviceSettingsPatchSignalE(SWGDeviceSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str); @@ -97,9 +97,9 @@ signals: void daemonRunGetSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str); void daemonRunPostSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void daemonDataSettingsGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void daemonDataSettingsPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void daemonDataSettingsPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void daemonChannelSettingsGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void daemonChannelSettingsPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void daemonChannelSettingsPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void daemonDeviceReportGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void daemonDeviceSettingsGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void daemonDeviceSettingsPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 915d4b0c9..30a8a0985 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -89,7 +89,7 @@ #include "SWGRDSReport_altFrequencies.h" #include "SWGRtlSdrReport.h" #include "SWGRtlSdrSettings.h" -#include "SWGSDRDaemonDataSettings.h" +#include "SWGSDRDaemonChannelSettings.h" #include "SWGSDRPlayReport.h" #include "SWGSDRPlaySettings.h" #include "SWGSDRdaemonSinkReport.h" @@ -341,8 +341,8 @@ namespace SWGSDRangel { if(QString("SWGRtlSdrSettings").compare(type) == 0) { return new SWGRtlSdrSettings(); } - if(QString("SWGSDRDaemonDataSettings").compare(type) == 0) { - return new SWGSDRDaemonDataSettings(); + if(QString("SWGSDRDaemonChannelSettings").compare(type) == 0) { + return new SWGSDRDaemonChannelSettings(); } if(QString("SWGSDRPlayReport").compare(type) == 0) { return new SWGSDRPlayReport(); diff --git a/swagger/sdrangel/code/qt5/client/SWGSDRDaemonDataSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSettings.cpp similarity index 81% rename from swagger/sdrangel/code/qt5/client/SWGSDRDaemonDataSettings.cpp rename to swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSettings.cpp index 1a8925524..1d84efbac 100644 --- a/swagger/sdrangel/code/qt5/client/SWGSDRDaemonDataSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSettings.cpp @@ -11,7 +11,7 @@ */ -#include "SWGSDRDaemonDataSettings.h" +#include "SWGSDRDaemonChannelSettings.h" #include "SWGHelpers.h" @@ -22,12 +22,12 @@ namespace SWGSDRangel { -SWGSDRDaemonDataSettings::SWGSDRDaemonDataSettings(QString* json) { +SWGSDRDaemonChannelSettings::SWGSDRDaemonChannelSettings(QString* json) { init(); this->fromJson(*json); } -SWGSDRDaemonDataSettings::SWGSDRDaemonDataSettings() { +SWGSDRDaemonChannelSettings::SWGSDRDaemonChannelSettings() { nb_fec_blocks = 0; m_nb_fec_blocks_isSet = false; data_address = nullptr; @@ -38,12 +38,12 @@ SWGSDRDaemonDataSettings::SWGSDRDaemonDataSettings() { m_tx_delay_isSet = false; } -SWGSDRDaemonDataSettings::~SWGSDRDaemonDataSettings() { +SWGSDRDaemonChannelSettings::~SWGSDRDaemonChannelSettings() { this->cleanup(); } void -SWGSDRDaemonDataSettings::init() { +SWGSDRDaemonChannelSettings::init() { nb_fec_blocks = 0; m_nb_fec_blocks_isSet = false; data_address = new QString(""); @@ -55,7 +55,7 @@ SWGSDRDaemonDataSettings::init() { } void -SWGSDRDaemonDataSettings::cleanup() { +SWGSDRDaemonChannelSettings::cleanup() { if(data_address != nullptr) { delete data_address; @@ -64,8 +64,8 @@ SWGSDRDaemonDataSettings::cleanup() { } -SWGSDRDaemonDataSettings* -SWGSDRDaemonDataSettings::fromJson(QString &json) { +SWGSDRDaemonChannelSettings* +SWGSDRDaemonChannelSettings::fromJson(QString &json) { QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -74,7 +74,7 @@ SWGSDRDaemonDataSettings::fromJson(QString &json) { } void -SWGSDRDaemonDataSettings::fromJsonObject(QJsonObject &pJson) { +SWGSDRDaemonChannelSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&nb_fec_blocks, pJson["nbFECBlocks"], "qint32", ""); ::SWGSDRangel::setValue(&data_address, pJson["dataAddress"], "QString", "QString"); @@ -86,7 +86,7 @@ SWGSDRDaemonDataSettings::fromJsonObject(QJsonObject &pJson) { } QString -SWGSDRDaemonDataSettings::asJson () +SWGSDRDaemonChannelSettings::asJson () { QJsonObject* obj = this->asJsonObject(); @@ -97,7 +97,7 @@ SWGSDRDaemonDataSettings::asJson () } QJsonObject* -SWGSDRDaemonDataSettings::asJsonObject() { +SWGSDRDaemonChannelSettings::asJsonObject() { QJsonObject* obj = new QJsonObject(); if(m_nb_fec_blocks_isSet){ obj->insert("nbFECBlocks", QJsonValue(nb_fec_blocks)); @@ -116,48 +116,48 @@ SWGSDRDaemonDataSettings::asJsonObject() { } qint32 -SWGSDRDaemonDataSettings::getNbFecBlocks() { +SWGSDRDaemonChannelSettings::getNbFecBlocks() { return nb_fec_blocks; } void -SWGSDRDaemonDataSettings::setNbFecBlocks(qint32 nb_fec_blocks) { +SWGSDRDaemonChannelSettings::setNbFecBlocks(qint32 nb_fec_blocks) { this->nb_fec_blocks = nb_fec_blocks; this->m_nb_fec_blocks_isSet = true; } QString* -SWGSDRDaemonDataSettings::getDataAddress() { +SWGSDRDaemonChannelSettings::getDataAddress() { return data_address; } void -SWGSDRDaemonDataSettings::setDataAddress(QString* data_address) { +SWGSDRDaemonChannelSettings::setDataAddress(QString* data_address) { this->data_address = data_address; this->m_data_address_isSet = true; } qint32 -SWGSDRDaemonDataSettings::getDataPort() { +SWGSDRDaemonChannelSettings::getDataPort() { return data_port; } void -SWGSDRDaemonDataSettings::setDataPort(qint32 data_port) { +SWGSDRDaemonChannelSettings::setDataPort(qint32 data_port) { this->data_port = data_port; this->m_data_port_isSet = true; } qint32 -SWGSDRDaemonDataSettings::getTxDelay() { +SWGSDRDaemonChannelSettings::getTxDelay() { return tx_delay; } void -SWGSDRDaemonDataSettings::setTxDelay(qint32 tx_delay) { +SWGSDRDaemonChannelSettings::setTxDelay(qint32 tx_delay) { this->tx_delay = tx_delay; this->m_tx_delay_isSet = true; } bool -SWGSDRDaemonDataSettings::isSet(){ +SWGSDRDaemonChannelSettings::isSet(){ bool isObjectUpdated = false; do{ if(m_nb_fec_blocks_isSet){ isObjectUpdated = true; break;} diff --git a/swagger/sdrangel/code/qt5/client/SWGSDRDaemonDataSettings.h b/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSettings.h similarity index 85% rename from swagger/sdrangel/code/qt5/client/SWGSDRDaemonDataSettings.h rename to swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSettings.h index a0edbaf28..62106af4f 100644 --- a/swagger/sdrangel/code/qt5/client/SWGSDRDaemonDataSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGSDRDaemonChannelSettings.h @@ -11,13 +11,13 @@ */ /* - * SWGSDRDaemonDataSettings.h + * SWGSDRDaemonChannelSettings.h * * Data handling details for SDRDaemon */ -#ifndef SWGSDRDaemonDataSettings_H_ -#define SWGSDRDaemonDataSettings_H_ +#ifndef SWGSDRDaemonChannelSettings_H_ +#define SWGSDRDaemonChannelSettings_H_ #include @@ -29,18 +29,18 @@ namespace SWGSDRangel { -class SWG_API SWGSDRDaemonDataSettings: public SWGObject { +class SWG_API SWGSDRDaemonChannelSettings: public SWGObject { public: - SWGSDRDaemonDataSettings(); - SWGSDRDaemonDataSettings(QString* json); - virtual ~SWGSDRDaemonDataSettings(); + SWGSDRDaemonChannelSettings(); + SWGSDRDaemonChannelSettings(QString* json); + virtual ~SWGSDRDaemonChannelSettings(); void init(); void cleanup(); virtual QString asJson () override; virtual QJsonObject* asJsonObject() override; virtual void fromJsonObject(QJsonObject &json) override; - virtual SWGSDRDaemonDataSettings* fromJson(QString &jsonString) override; + virtual SWGSDRDaemonChannelSettings* fromJson(QString &jsonString) override; qint32 getNbFecBlocks(); void setNbFecBlocks(qint32 nb_fec_blocks); @@ -74,4 +74,4 @@ private: } -#endif /* SWGSDRDaemonDataSettings_H_ */ +#endif /* SWGSDRDaemonChannelSettings_H_ */