From 4eba3bb8716eb6fa445e816945ccff778a8e626f Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 4 May 2022 13:27:13 +0200 Subject: [PATCH] v7: removed feature set index from API. Implements #1231 --- sdrbase/resources/webapi/doc/html2/index.html | 1159 ++++------------- .../resources/webapi/doc/swagger/swagger.yaml | 148 +-- sdrbase/webapi/webapiadapter.cpp | 7 +- sdrbase/webapi/webapiadapter.h | 2 +- sdrbase/webapi/webapiadapterinterface.cpp | 16 +- sdrbase/webapi/webapiadapterinterface.h | 10 +- sdrbase/webapi/webapirequestmapper.cpp | 327 ++--- sdrbase/webapi/webapirequestmapper.h | 16 +- swagger/sdrangel/api/swagger/swagger.yaml | 148 +-- swagger/sdrangel/code/html2/index.html | 1159 ++++------------- .../code/qt5/client/SWGFeatureSet.cpp | 23 - .../sdrangel/code/qt5/client/SWGFeatureSet.h | 6 - .../code/qt5/client/SWGFeatureSetApi.cpp | 84 +- .../code/qt5/client/SWGFeatureSetApi.h | 28 +- 14 files changed, 751 insertions(+), 2382 deletions(-) diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index b58b5a96e..e764b24ef 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -5351,12 +5351,8 @@ margin-bottom: 20px; "description" : "Base feature report. Only the feature report corresponding to the feature specified in the featureType field is or should be present." }; defs.FeatureSet = { - "required" : [ "featurecount", "index" ], + "required" : [ "featurecount" ], "properties" : { - "index" : { - "type" : "integer", - "description" : "Index in the list of feature sets opened in this instance" - }, "featurecount" : { "type" : "integer", "description" : "Number of features in the set" @@ -29027,7 +29023,7 @@ except ApiException as e:

apply all settings unconditionally (force)


-
/sdrangel/featureset/{featureSetIndex}/feature/{featureIndex}/settings
+
/sdrangel/featureset/feature/{featureIndex}/settings

Usage and SDK Samples

@@ -29047,7 +29043,7 @@ except ApiException as e:
-
curl -X PUT "http://localhost/sdrangel/featureset/{featureSetIndex}/feature/{featureIndex}/settings"
+
curl -X PUT "http://localhost/sdrangel/featureset/feature/{featureIndex}/settings"
import SWGSDRangel.*;
@@ -29063,11 +29059,10 @@ public class FeatureSetApiExample {
     public static void main(String[] args) {
         
         FeatureSetApi apiInstance = new FeatureSetApi();
-        Integer featureSetIndex = 56; // Integer | Index of feature set in the feature set list
-        Integer featureIndex = 56; // Integer | Index of the feature in the features list for this feature set
+        Integer featureIndex = 56; // Integer | Index of the feature in the features list
         FeatureSettings body = ; // FeatureSettings | Feature settings to apply
         try {
-            FeatureSettings result = apiInstance.featuresetFEatureSettingsPut(featureSetIndex, featureIndex, body);
+            FeatureSettings result = apiInstance.featuresetFEatureSettingsPut(featureIndex, body);
             System.out.println(result);
         } catch (ApiException e) {
             System.err.println("Exception when calling FeatureSetApi#featuresetFEatureSettingsPut");
@@ -29084,11 +29079,10 @@ public class FeatureSetApiExample {
 
     public static void main(String[] args) {
         FeatureSetApi apiInstance = new FeatureSetApi();
-        Integer featureSetIndex = 56; // Integer | Index of feature set in the feature set list
-        Integer featureIndex = 56; // Integer | Index of the feature in the features list for this feature set
+        Integer featureIndex = 56; // Integer | Index of the feature in the features list
         FeatureSettings body = ; // FeatureSettings | Feature settings to apply
         try {
-            FeatureSettings result = apiInstance.featuresetFEatureSettingsPut(featureSetIndex, featureIndex, body);
+            FeatureSettings result = apiInstance.featuresetFEatureSettingsPut(featureIndex, body);
             System.out.println(result);
         } catch (ApiException e) {
             System.err.println("Exception when calling FeatureSetApi#featuresetFEatureSettingsPut");
@@ -29102,14 +29096,12 @@ public class FeatureSetApiExample {
   
Coming Soon!
-->
-
Integer *featureSetIndex = 56; // Index of feature set in the feature set list
-Integer *featureIndex = 56; // Index of the feature in the features list for this feature set
+                              
Integer *featureIndex = 56; // Index of the feature in the features list
 FeatureSettings *body = ; // Feature settings to apply
 
 FeatureSetApi *apiInstance = [[FeatureSetApi alloc] init];
 
-[apiInstance featuresetFEatureSettingsPutWith:featureSetIndex
-    featureIndex:featureIndex
+[apiInstance featuresetFEatureSettingsPutWith:featureIndex
     body:body
               completionHandler: ^(FeatureSettings output, NSError* error) {
                             if (output) {
@@ -29127,9 +29119,7 @@ FeatureSetApi *apiInstance = [[FeatureSetApi alloc] init];
 
 var api = new SdRangel.FeatureSetApi()
 
-var featureSetIndex = 56; // {Integer} Index of feature set in the feature set list
-
-var featureIndex = 56; // {Integer} Index of the feature in the features list for this feature set
+var featureIndex = 56; // {Integer} Index of the feature in the features list
 
 var body = ; // {FeatureSettings} Feature settings to apply
 
@@ -29141,7 +29131,7 @@ var callback = function(error, data, response) {
     console.log('API called successfully. Returned data: ' + data);
   }
 };
-api.featuresetFEatureSettingsPut(featureSetIndex, featureIndex, body, callback);
+api.featuresetFEatureSettingsPut(featureIndex, body, callback);
 
@@ -29163,13 +29153,12 @@ namespace Example { var apiInstance = new FeatureSetApi(); - var featureSetIndex = 56; // Integer | Index of feature set in the feature set list - var featureIndex = 56; // Integer | Index of the feature in the features list for this feature set + var featureIndex = 56; // Integer | Index of the feature in the features list var body = new FeatureSettings(); // FeatureSettings | Feature settings to apply try { - FeatureSettings result = apiInstance.featuresetFEatureSettingsPut(featureSetIndex, featureIndex, body); + FeatureSettings result = apiInstance.featuresetFEatureSettingsPut(featureIndex, body); Debug.WriteLine(result); } catch (Exception e) @@ -29187,12 +29176,11 @@ namespace Example require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new Swagger\Client\Api\FeatureSetApi(); -$featureSetIndex = 56; // Integer | Index of feature set in the feature set list -$featureIndex = 56; // Integer | Index of the feature in the features list for this feature set +$featureIndex = 56; // Integer | Index of the feature in the features list $body = ; // FeatureSettings | Feature settings to apply try { - $result = $api_instance->featuresetFEatureSettingsPut($featureSetIndex, $featureIndex, $body); + $result = $api_instance->featuresetFEatureSettingsPut($featureIndex, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling FeatureSetApi->featuresetFEatureSettingsPut: ', $e->getMessage(), PHP_EOL; @@ -29206,12 +29194,11 @@ use SWGSDRangel::Configuration; use SWGSDRangel::FeatureSetApi; my $api_instance = SWGSDRangel::FeatureSetApi->new(); -my $featureSetIndex = 56; # Integer | Index of feature set in the feature set list -my $featureIndex = 56; # Integer | Index of the feature in the features list for this feature set +my $featureIndex = 56; # Integer | Index of the feature in the features list my $body = SWGSDRangel::Object::FeatureSettings->new(); # FeatureSettings | Feature settings to apply eval { - my $result = $api_instance->featuresetFEatureSettingsPut(featureSetIndex => $featureSetIndex, featureIndex => $featureIndex, body => $body); + my $result = $api_instance->featuresetFEatureSettingsPut(featureIndex => $featureIndex, body => $body); print Dumper($result); }; if ($@) { @@ -29228,12 +29215,11 @@ from pprint import pprint # create an instance of the API class api_instance = swagger_sdrangel.FeatureSetApi() -featureSetIndex = 56 # Integer | Index of feature set in the feature set list -featureIndex = 56 # Integer | Index of the feature in the features list for this feature set +featureIndex = 56 # Integer | Index of the feature in the features list body = # FeatureSettings | Feature settings to apply try: - api_response = api_instance.featureset_f_eature_settings_put(featureSetIndex, featureIndex, body) + api_response = api_instance.featureset_f_eature_settings_put(featureIndex, body) pprint(api_response) except ApiException as e: print("Exception when calling FeatureSetApi->featuresetFEatureSettingsPut: %s\n" % e) @@ -29248,29 +29234,6 @@ except ApiException as e: Name Description - featureSetIndex* - - - -
-
-
- - Integer - - -
- Index of feature set in the feature set list -
-
-
- Required -
-
-
- - - featureIndex* @@ -29283,7 +29246,7 @@ except ApiException as e:
- Index of the feature in the features list for this feature set + Index of the feature in the features list
@@ -29386,7 +29349,7 @@ $(document).ready(function() {
-

Status: 400 - Invalid feature set or feature index

+

Status: 400 - Invalid feature index