From bd7ac31172b00d293b53b78e7515c2ee0fca14e9 Mon Sep 17 00:00:00 2001 From: srcejon Date: Fri, 11 Sep 2026 16:46:00 +0100 Subject: [PATCH] Regenerate swagger --- sdrbase/resources/webapi/doc/html2/index.html | 1732 ++++++++++++++++- .../resources/webapi/doc/swagger/swagger.yaml | 117 ++ swagger/sdrangel/code/html2/index.html | 1732 ++++++++++++++++- .../code/qt5/client/SWGDeviceSetApi.cpp | 197 ++ .../code/qt5/client/SWGDeviceSetApi.h | 19 + .../code/qt5/client/SWGGLSpectrumData.cpp | 345 ++++ .../code/qt5/client/SWGGLSpectrumData.h | 120 ++ .../code/qt5/client/SWGGLSpectrumReport.cpp | 484 +++++ .../code/qt5/client/SWGGLSpectrumReport.h | 157 ++ .../code/qt5/client/SWGModelFactory.h | 24 + .../code/qt5/client/SWGSpectrumActions.cpp | 200 ++ .../code/qt5/client/SWGSpectrumActions.h | 82 + .../code/qt5/client/SWGSpectrumPeak.cpp | 131 ++ .../code/qt5/client/SWGSpectrumPeak.h | 64 + 14 files changed, 5402 insertions(+), 2 deletions(-) create mode 100644 swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGSpectrumActions.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGSpectrumActions.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.h diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 1273db4a8..2783811f3 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -10460,6 +10460,155 @@ margin-bottom: 20px; } }, "description" : "GLSpectrumGUI settings" +}; + defs.GLSpectrumData = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64", + "description" : "Centre frequency of the whole spectrum in Hz." + }, + "bandwidth" : { + "type" : "integer", + "description" : "Width of the whole spectrum in Hz." + }, + "fftSize" : { + "type" : "integer", + "description" : "Number of bins the spectrum was computed with, before reduction." + }, + "linear" : { + "type" : "integer", + "description" : "1 when the powers are linear, 0 when they are in dB.", + "minimum" : 0, + "maximum" : 1 + }, + "updated" : { + "type" : "string", + "description" : "When the spectrum was last computed, ISO 8601. Absent if it never has been." + }, + "startFrequency" : { + "type" : "integer", + "format" : "int64", + "description" : "Centre frequency of the first returned bin in Hz." + }, + "stopFrequency" : { + "type" : "integer", + "format" : "int64", + "description" : "Centre frequency of the last returned bin in Hz." + }, + "binBandwidth" : { + "type" : "number", + "format" : "float", + "description" : "Width of each returned bin in Hz, after reduction." + }, + "bins" : { + "type" : "integer", + "description" : "Number of values in power." + }, + "reduce" : { + "type" : "string", + "description" : "How several FFT bins were combined into each returned one, max or mean. Max keeps a narrow carrier that averaging would bury in its neighbours, which is why it is the default.\n" + }, + "power" : { + "type" : "array", + "description" : "The reduced powers, first bin first.", + "items" : { + "type" : "number", + "format" : "float" + } + } + }, + "description" : "A copy of the current power spectrum, reduced to the number of bins asked for so that the answer stays a sensible size whatever the FFT size. The spectrum is only computed while something is consuming it, a spectrum window or a websocket client, so updated says how old these values are and is absent if none has been produced yet.\n" +}; + defs.GLSpectrumReport = { + "properties" : { + "measurement" : { + "type" : "integer", + "description" : "Which measurement produced these values.\n * 0 - None, nothing is being measured\n * 1 - Peaks\n * 2 - Channel power\n * 3 - Adjacent channel power\n * 4 - Occupied bandwidth\n * 5 - 3 dB bandwidth\n * 6 - SNR\n" + }, + "updated" : { + "type" : "string", + "description" : "When these values were last measured, ISO 8601. Absent until the first measurement." + }, + "peaks" : { + "type" : "array", + "description" : "The strongest peaks, most powerful first. Peaks measurement only.", + "items" : { + "$ref" : "#/definitions/SpectrumPeak" + } + }, + "channelPower" : { + "type" : "number", + "format" : "float", + "description" : "Total power in the measurement bandwidth in dB. Channel power measurement only." + }, + "adjChannelPowerLeft" : { + "type" : "number", + "format" : "float", + "description" : "Power in the lower adjacent channel in dB." + }, + "adjChannelPowerLeftRatio" : { + "type" : "number", + "format" : "float", + "description" : "Lower adjacent channel power ratio in dB, relative to the centre channel." + }, + "adjChannelPowerCentre" : { + "type" : "number", + "format" : "float", + "description" : "Power in the centre channel in dB." + }, + "adjChannelPowerRight" : { + "type" : "number", + "format" : "float", + "description" : "Power in the upper adjacent channel in dB." + }, + "adjChannelPowerRightRatio" : { + "type" : "number", + "format" : "float", + "description" : "Upper adjacent channel power ratio in dB, relative to the centre channel." + }, + "occupiedBandwidth" : { + "type" : "number", + "format" : "float", + "description" : "Occupied bandwidth in Hz. Occupied bandwidth measurement only." + }, + "bandwidth3dB" : { + "type" : "number", + "format" : "float", + "description" : "3 dB bandwidth in Hz. 3 dB bandwidth measurement only." + }, + "snr" : { + "type" : "number", + "format" : "float", + "description" : "Signal to noise ratio in dB. SNR measurement only." + }, + "snfr" : { + "type" : "number", + "format" : "float", + "description" : "Signal to noise and distortion free ratio in dB." + }, + "thd" : { + "type" : "number", + "format" : "float", + "description" : "Total harmonic distortion in dB." + }, + "thdPlusNoise" : { + "type" : "number", + "format" : "float", + "description" : "Total harmonic distortion plus noise in dB." + }, + "sinad" : { + "type" : "number", + "format" : "float", + "description" : "Signal to noise and distortion ratio in dB." + }, + "sfdr" : { + "type" : "number", + "format" : "float", + "description" : "Spurious free dynamic range in dB." + } + }, + "description" : "The latest values of whichever spectrum measurement is switched on. Which fields are present depends on the measurement: with none selected nothing is measured at all and only the measurement field is returned. The figures are those of the spectrum as displayed, so they match the window rather than the full span when it is zoomed, and they are only produced by a running GUI.\n" }; defs.GS232ControllerActions = { "properties" : { @@ -21946,6 +22095,40 @@ margin-bottom: 20px; } }, "description" : "SoapySDR" +}; + defs.SpectrumActions = { + "properties" : { + "autoscale" : { + "type" : "integer", + "description" : "Set the reference level and range from the spectrum currently displayed, as the autoscale button does. Needs a running GUI (1 to do it, 0 to do nothing).\n", + "minimum" : 0, + "maximum" : 1 + }, + "clearSpectrum" : { + "type" : "integer", + "description" : "Discard the accumulated histogram and max hold traces, as the clear button does. Needs a running GUI (1 to do it, 0 to do nothing).\n", + "minimum" : 0, + "maximum" : 1 + }, + "resetMeasurements" : { + "type" : "integer", + "description" : "Discard the accumulated measurement statistics, so the minimum, maximum and mean columns start again. Needs a running GUI (1 to do it, 0 to do nothing).\n", + "minimum" : 0, + "maximum" : 1 + }, + "freeze" : { + "type" : "integer", + "description" : "Stop or resume spectrum processing. Unlike the others this acts on the spectrum itself rather than its display, so it works without a GUI (1 to freeze, 0 to resume).\n", + "minimum" : 0, + "maximum" : 1 + }, + "gotoMarker" : { + "type" : "integer", + "description" : "Retune the device to the annotation marker at this index, counting from 0, as choosing it in the goto list does. Needs a running GUI.\n", + "minimum" : 0 + } + }, + "description" : "Actions on the main spectrum of a device set" }; defs.SpectrumAnnotationMarker = { "properties" : { @@ -22044,6 +22227,21 @@ margin-bottom: 20px; } }, "description" : "Display settings for one saved spectrum memory. The captured spectrum samples are not transferred through settings APIs." +}; + defs.SpectrumPeak = { + "properties" : { + "frequency" : { + "type" : "integer", + "format" : "int64", + "description" : "Frequency of the peak in Hz." + }, + "power" : { + "type" : "number", + "format" : "float", + "description" : "Power of the peak in dB." + } + }, + "description" : "One peak found in the spectrum" }; defs.SpectrumServer = { "properties" : { @@ -24996,6 +25194,15 @@ margin-bottom: 20px;
  • devicesetGet
  • +
  • + devicesetSpectrumActionsPost +
  • +
  • + devicesetSpectrumDataGet +
  • +
  • + devicesetSpectrumReportGet +
  • devicesetSpectrumServerDelete
  • @@ -37512,6 +37719,1529 @@ except ApiException as e:
    +
    +
    +
    +

    devicesetSpectrumActionsPost

    +

    +
    +
    +
    +

    +

    post an action or actions on the main spectrum

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/spectrum/actions
    +

    +

    Usage and SDK Samples

    +

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

    Parameters

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

    Responses

    +

    Status: 202 - Message to perform action was sent successfully

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

    Status: 400 - Unknown action, no action given, or an action that needs a spectrum display

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

    Status: 404 - Invalid index

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

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

    devicesetSpectrumDataGet

    +

    +
    +
    +
    +

    +

    Get the main spectrum power values, reduced to a number of bins

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/spectrum/data
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://localhost/sdrangel/deviceset/{deviceSetIndex}/spectrum/data?bins=&startFrequency=&stopFrequency=&reduce="
    +
    +
    +
    import SWGSDRangel.*;
    +import SWGSDRangel.auth.*;
    +import SWGSDRangel.model.*;
    +import SWGSDRangel.api.DeviceSetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DeviceSetApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DeviceSetApi apiInstance = new DeviceSetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        Integer bins = 56; // Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
    +        Long startFrequency = 789; // Long | Lowest frequency to return in Hz. Default is the start of the spectrum
    +        Long stopFrequency = 789; // Long | Highest frequency to return in Hz. Default is the end of the spectrum
    +        String reduce = reduce_example; // String | How several bins are combined into one, max or mean (default max)
    +        try {
    +            GLSpectrumData result = apiInstance.devicesetSpectrumDataGet(deviceSetIndex, bins, startFrequency, stopFrequency, reduce);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DeviceSetApi#devicesetSpectrumDataGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.DeviceSetApi;
    +
    +public class DeviceSetApiExample {
    +
    +    public static void main(String[] args) {
    +        DeviceSetApi apiInstance = new DeviceSetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        Integer bins = 56; // Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
    +        Long startFrequency = 789; // Long | Lowest frequency to return in Hz. Default is the start of the spectrum
    +        Long stopFrequency = 789; // Long | Highest frequency to return in Hz. Default is the end of the spectrum
    +        String reduce = reduce_example; // String | How several bins are combined into one, max or mean (default max)
    +        try {
    +            GLSpectrumData result = apiInstance.devicesetSpectrumDataGet(deviceSetIndex, bins, startFrequency, stopFrequency, reduce);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DeviceSetApi#devicesetSpectrumDataGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +Integer *bins = 56; // Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many (optional)
    +Long *startFrequency = 789; // Lowest frequency to return in Hz. Default is the start of the spectrum (optional)
    +Long *stopFrequency = 789; // Highest frequency to return in Hz. Default is the end of the spectrum (optional)
    +String *reduce = reduce_example; // How several bins are combined into one, max or mean (default max) (optional)
    +
    +DeviceSetApi *apiInstance = [[DeviceSetApi alloc] init];
    +
    +[apiInstance devicesetSpectrumDataGetWith:deviceSetIndex
    +    bins:bins
    +    startFrequency:startFrequency
    +    stopFrequency:stopFrequency
    +    reduce:reduce
    +              completionHandler: ^(GLSpectrumData output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DeviceSetApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +var opts = { 
    +  'bins': 56, // {Integer} Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
    +  'startFrequency': 789, // {Long} Lowest frequency to return in Hz. Default is the start of the spectrum
    +  'stopFrequency': 789, // {Long} Highest frequency to return in Hz. Default is the end of the spectrum
    +  'reduce': reduce_example // {String} How several bins are combined into one, max or mean (default max)
    +};
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetSpectrumDataGet(deviceSetIndex, opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class devicesetSpectrumDataGetExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DeviceSetApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +            var bins = 56;  // Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many (optional) 
    +            var startFrequency = 789;  // Long | Lowest frequency to return in Hz. Default is the start of the spectrum (optional) 
    +            var stopFrequency = 789;  // Long | Highest frequency to return in Hz. Default is the end of the spectrum (optional) 
    +            var reduce = reduce_example;  // String | How several bins are combined into one, max or mean (default max) (optional) 
    +
    +            try
    +            {
    +                GLSpectrumData result = apiInstance.devicesetSpectrumDataGet(deviceSetIndex, bins, startFrequency, stopFrequency, reduce);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DeviceSetApi.devicesetSpectrumDataGet: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DeviceSetApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +$bins = 56; // Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
    +$startFrequency = 789; // Long | Lowest frequency to return in Hz. Default is the start of the spectrum
    +$stopFrequency = 789; // Long | Highest frequency to return in Hz. Default is the end of the spectrum
    +$reduce = reduce_example; // String | How several bins are combined into one, max or mean (default max)
    +
    +try {
    +    $result = $api_instance->devicesetSpectrumDataGet($deviceSetIndex, $bins, $startFrequency, $stopFrequency, $reduce);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DeviceSetApi->devicesetSpectrumDataGet: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::DeviceSetApi;
    +
    +my $api_instance = SWGSDRangel::DeviceSetApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +my $bins = 56; # Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
    +my $startFrequency = 789; # Long | Lowest frequency to return in Hz. Default is the start of the spectrum
    +my $stopFrequency = 789; # Long | Highest frequency to return in Hz. Default is the end of the spectrum
    +my $reduce = reduce_example; # String | How several bins are combined into one, max or mean (default max)
    +
    +eval { 
    +    my $result = $api_instance->devicesetSpectrumDataGet(deviceSetIndex => $deviceSetIndex, bins => $bins, startFrequency => $startFrequency, stopFrequency => $stopFrequency, reduce => $reduce);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DeviceSetApi->devicesetSpectrumDataGet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_sdrangel
    +from swagger_sdrangel.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_sdrangel.DeviceSetApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +bins = 56 # Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many (optional)
    +startFrequency = 789 # Long | Lowest frequency to return in Hz. Default is the start of the spectrum (optional)
    +stopFrequency = 789 # Long | Highest frequency to return in Hz. Default is the end of the spectrum (optional)
    +reduce = reduce_example # String | How several bins are combined into one, max or mean (default max) (optional)
    +
    +try: 
    +    api_response = api_instance.deviceset_spectrum_data_get(deviceSetIndex, bins=bins, startFrequency=startFrequency, stopFrequency=stopFrequency, reduce=reduce)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DeviceSetApi->devicesetSpectrumDataGet: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    deviceSetIndex* + + +
    +
    +
    + + Integer + + +
    + Index of device set in the device set list +
    +
    +
    + Required +
    +
    +
    +
    + + + + +
    Query parameters
    + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    bins + + +
    +
    +
    + + Integer + + +
    + Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many +
    +
    +
    +
    +
    startFrequency + + +
    +
    +
    + + Long + + + (int64) + + +
    + Lowest frequency to return in Hz. Default is the start of the spectrum +
    +
    +
    +
    +
    stopFrequency + + +
    +
    +
    + + Long + + + (int64) + + +
    + Highest frequency to return in Hz. Default is the end of the spectrum +
    +
    +
    +
    +
    reduce + + +
    +
    +
    + + String + + +
    + How several bins are combined into one, max or mean (default max) +
    +
    +
    +
    +
    + +

    Responses

    +

    Status: 200 - On success return the reduced spectrum

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

    Status: 400 - Invalid bins, frequency range or reduction

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

    Status: 404 - Invalid index

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

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

    devicesetSpectrumReportGet

    +

    +
    +
    +
    +

    +

    Get the latest main spectrum measurement results

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/spectrum/report
    +

    +

    Usage and SDK Samples

    +

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

    Parameters

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

    Responses

    +

    Status: 200 - On success return the results of the selected measurement

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

    Status: 404 - Invalid index

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    @@ -66337,7 +68067,7 @@ except ApiException as e:
    - Generated 2026-09-11T11:04:13.600+02:00 + Generated 2026-09-11T17:45:32.114+02:00
    diff --git a/sdrbase/resources/webapi/doc/swagger/swagger.yaml b/sdrbase/resources/webapi/doc/swagger/swagger.yaml index e1c049d43..1eed86e0e 100644 --- a/sdrbase/resources/webapi/doc/swagger/swagger.yaml +++ b/sdrbase/resources/webapi/doc/swagger/swagger.yaml @@ -1252,6 +1252,123 @@ paths: "501": $ref: "#/responses/Response_501" + /sdrangel/deviceset/{deviceSetIndex}/spectrum/report: + x-swagger-router-controller: deviceset + get: + description: Get the latest main spectrum measurement results + operationId: devicesetSpectrumReportGet + tags: + - DeviceSet + parameters: + - in: path + name: deviceSetIndex + type: integer + required: true + description: Index of device set in the device set list + responses: + "200": + description: On success return the results of the selected measurement + schema: + $ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrumReport" + "404": + description: Invalid index + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + + /sdrangel/deviceset/{deviceSetIndex}/spectrum/actions: + x-swagger-router-controller: deviceset + post: + description: post an action or actions on the main spectrum + operationId: devicesetSpectrumActionsPost + tags: + - DeviceSet + parameters: + - in: path + name: deviceSetIndex + type: integer + required: true + description: Index of device set in the device set list + - name: body + in: body + description: Action(s) to apply to the main spectrum + required: true + schema: + $ref: "/doc/swagger/include/GLSpectrum.yaml#/SpectrumActions" + responses: + "202": + description: Message to perform action was sent successfully + schema: + $ref: "#/definitions/SuccessResponse" + "400": + description: Unknown action, no action given, or an action that needs a spectrum display + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Invalid index + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + + /sdrangel/deviceset/{deviceSetIndex}/spectrum/data: + x-swagger-router-controller: deviceset + get: + description: Get the main spectrum power values, reduced to a number of bins + operationId: devicesetSpectrumDataGet + tags: + - DeviceSet + parameters: + - in: path + name: deviceSetIndex + type: integer + required: true + description: Index of device set in the device set list + - name: bins + in: query + description: Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many + required: false + type: integer + - name: startFrequency + in: query + description: Lowest frequency to return in Hz. Default is the start of the spectrum + required: false + type: integer + format: int64 + - name: stopFrequency + in: query + description: Highest frequency to return in Hz. Default is the end of the spectrum + required: false + type: integer + format: int64 + - name: reduce + in: query + description: How several bins are combined into one, max or mean (default max) + required: false + type: string + responses: + "200": + description: On success return the reduced spectrum + schema: + $ref: "/doc/swagger/include/GLSpectrum.yaml#/GLSpectrumData" + "400": + description: Invalid bins, frequency range or reduction + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Invalid index + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + /sdrangel/deviceset/{deviceSetIndex}/spectrum/server: x-swagger-router-controller: deviceset get: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 1273db4a8..2783811f3 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -10460,6 +10460,155 @@ margin-bottom: 20px; } }, "description" : "GLSpectrumGUI settings" +}; + defs.GLSpectrumData = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64", + "description" : "Centre frequency of the whole spectrum in Hz." + }, + "bandwidth" : { + "type" : "integer", + "description" : "Width of the whole spectrum in Hz." + }, + "fftSize" : { + "type" : "integer", + "description" : "Number of bins the spectrum was computed with, before reduction." + }, + "linear" : { + "type" : "integer", + "description" : "1 when the powers are linear, 0 when they are in dB.", + "minimum" : 0, + "maximum" : 1 + }, + "updated" : { + "type" : "string", + "description" : "When the spectrum was last computed, ISO 8601. Absent if it never has been." + }, + "startFrequency" : { + "type" : "integer", + "format" : "int64", + "description" : "Centre frequency of the first returned bin in Hz." + }, + "stopFrequency" : { + "type" : "integer", + "format" : "int64", + "description" : "Centre frequency of the last returned bin in Hz." + }, + "binBandwidth" : { + "type" : "number", + "format" : "float", + "description" : "Width of each returned bin in Hz, after reduction." + }, + "bins" : { + "type" : "integer", + "description" : "Number of values in power." + }, + "reduce" : { + "type" : "string", + "description" : "How several FFT bins were combined into each returned one, max or mean. Max keeps a narrow carrier that averaging would bury in its neighbours, which is why it is the default.\n" + }, + "power" : { + "type" : "array", + "description" : "The reduced powers, first bin first.", + "items" : { + "type" : "number", + "format" : "float" + } + } + }, + "description" : "A copy of the current power spectrum, reduced to the number of bins asked for so that the answer stays a sensible size whatever the FFT size. The spectrum is only computed while something is consuming it, a spectrum window or a websocket client, so updated says how old these values are and is absent if none has been produced yet.\n" +}; + defs.GLSpectrumReport = { + "properties" : { + "measurement" : { + "type" : "integer", + "description" : "Which measurement produced these values.\n * 0 - None, nothing is being measured\n * 1 - Peaks\n * 2 - Channel power\n * 3 - Adjacent channel power\n * 4 - Occupied bandwidth\n * 5 - 3 dB bandwidth\n * 6 - SNR\n" + }, + "updated" : { + "type" : "string", + "description" : "When these values were last measured, ISO 8601. Absent until the first measurement." + }, + "peaks" : { + "type" : "array", + "description" : "The strongest peaks, most powerful first. Peaks measurement only.", + "items" : { + "$ref" : "#/definitions/SpectrumPeak" + } + }, + "channelPower" : { + "type" : "number", + "format" : "float", + "description" : "Total power in the measurement bandwidth in dB. Channel power measurement only." + }, + "adjChannelPowerLeft" : { + "type" : "number", + "format" : "float", + "description" : "Power in the lower adjacent channel in dB." + }, + "adjChannelPowerLeftRatio" : { + "type" : "number", + "format" : "float", + "description" : "Lower adjacent channel power ratio in dB, relative to the centre channel." + }, + "adjChannelPowerCentre" : { + "type" : "number", + "format" : "float", + "description" : "Power in the centre channel in dB." + }, + "adjChannelPowerRight" : { + "type" : "number", + "format" : "float", + "description" : "Power in the upper adjacent channel in dB." + }, + "adjChannelPowerRightRatio" : { + "type" : "number", + "format" : "float", + "description" : "Upper adjacent channel power ratio in dB, relative to the centre channel." + }, + "occupiedBandwidth" : { + "type" : "number", + "format" : "float", + "description" : "Occupied bandwidth in Hz. Occupied bandwidth measurement only." + }, + "bandwidth3dB" : { + "type" : "number", + "format" : "float", + "description" : "3 dB bandwidth in Hz. 3 dB bandwidth measurement only." + }, + "snr" : { + "type" : "number", + "format" : "float", + "description" : "Signal to noise ratio in dB. SNR measurement only." + }, + "snfr" : { + "type" : "number", + "format" : "float", + "description" : "Signal to noise and distortion free ratio in dB." + }, + "thd" : { + "type" : "number", + "format" : "float", + "description" : "Total harmonic distortion in dB." + }, + "thdPlusNoise" : { + "type" : "number", + "format" : "float", + "description" : "Total harmonic distortion plus noise in dB." + }, + "sinad" : { + "type" : "number", + "format" : "float", + "description" : "Signal to noise and distortion ratio in dB." + }, + "sfdr" : { + "type" : "number", + "format" : "float", + "description" : "Spurious free dynamic range in dB." + } + }, + "description" : "The latest values of whichever spectrum measurement is switched on. Which fields are present depends on the measurement: with none selected nothing is measured at all and only the measurement field is returned. The figures are those of the spectrum as displayed, so they match the window rather than the full span when it is zoomed, and they are only produced by a running GUI.\n" }; defs.GS232ControllerActions = { "properties" : { @@ -21946,6 +22095,40 @@ margin-bottom: 20px; } }, "description" : "SoapySDR" +}; + defs.SpectrumActions = { + "properties" : { + "autoscale" : { + "type" : "integer", + "description" : "Set the reference level and range from the spectrum currently displayed, as the autoscale button does. Needs a running GUI (1 to do it, 0 to do nothing).\n", + "minimum" : 0, + "maximum" : 1 + }, + "clearSpectrum" : { + "type" : "integer", + "description" : "Discard the accumulated histogram and max hold traces, as the clear button does. Needs a running GUI (1 to do it, 0 to do nothing).\n", + "minimum" : 0, + "maximum" : 1 + }, + "resetMeasurements" : { + "type" : "integer", + "description" : "Discard the accumulated measurement statistics, so the minimum, maximum and mean columns start again. Needs a running GUI (1 to do it, 0 to do nothing).\n", + "minimum" : 0, + "maximum" : 1 + }, + "freeze" : { + "type" : "integer", + "description" : "Stop or resume spectrum processing. Unlike the others this acts on the spectrum itself rather than its display, so it works without a GUI (1 to freeze, 0 to resume).\n", + "minimum" : 0, + "maximum" : 1 + }, + "gotoMarker" : { + "type" : "integer", + "description" : "Retune the device to the annotation marker at this index, counting from 0, as choosing it in the goto list does. Needs a running GUI.\n", + "minimum" : 0 + } + }, + "description" : "Actions on the main spectrum of a device set" }; defs.SpectrumAnnotationMarker = { "properties" : { @@ -22044,6 +22227,21 @@ margin-bottom: 20px; } }, "description" : "Display settings for one saved spectrum memory. The captured spectrum samples are not transferred through settings APIs." +}; + defs.SpectrumPeak = { + "properties" : { + "frequency" : { + "type" : "integer", + "format" : "int64", + "description" : "Frequency of the peak in Hz." + }, + "power" : { + "type" : "number", + "format" : "float", + "description" : "Power of the peak in dB." + } + }, + "description" : "One peak found in the spectrum" }; defs.SpectrumServer = { "properties" : { @@ -24996,6 +25194,15 @@ margin-bottom: 20px;
  • devicesetGet
  • +
  • + devicesetSpectrumActionsPost +
  • +
  • + devicesetSpectrumDataGet +
  • +
  • + devicesetSpectrumReportGet +
  • devicesetSpectrumServerDelete
  • @@ -37512,6 +37719,1529 @@ except ApiException as e:
    +
    +
    +
    +

    devicesetSpectrumActionsPost

    +

    +
    +
    +
    +

    +

    post an action or actions on the main spectrum

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/spectrum/actions
    +

    +

    Usage and SDK Samples

    +

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

    Parameters

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

    Responses

    +

    Status: 202 - Message to perform action was sent successfully

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

    Status: 400 - Unknown action, no action given, or an action that needs a spectrum display

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

    Status: 404 - Invalid index

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

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

    devicesetSpectrumDataGet

    +

    +
    +
    +
    +

    +

    Get the main spectrum power values, reduced to a number of bins

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/spectrum/data
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://localhost/sdrangel/deviceset/{deviceSetIndex}/spectrum/data?bins=&startFrequency=&stopFrequency=&reduce="
    +
    +
    +
    import SWGSDRangel.*;
    +import SWGSDRangel.auth.*;
    +import SWGSDRangel.model.*;
    +import SWGSDRangel.api.DeviceSetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DeviceSetApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DeviceSetApi apiInstance = new DeviceSetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        Integer bins = 56; // Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
    +        Long startFrequency = 789; // Long | Lowest frequency to return in Hz. Default is the start of the spectrum
    +        Long stopFrequency = 789; // Long | Highest frequency to return in Hz. Default is the end of the spectrum
    +        String reduce = reduce_example; // String | How several bins are combined into one, max or mean (default max)
    +        try {
    +            GLSpectrumData result = apiInstance.devicesetSpectrumDataGet(deviceSetIndex, bins, startFrequency, stopFrequency, reduce);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DeviceSetApi#devicesetSpectrumDataGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.DeviceSetApi;
    +
    +public class DeviceSetApiExample {
    +
    +    public static void main(String[] args) {
    +        DeviceSetApi apiInstance = new DeviceSetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        Integer bins = 56; // Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
    +        Long startFrequency = 789; // Long | Lowest frequency to return in Hz. Default is the start of the spectrum
    +        Long stopFrequency = 789; // Long | Highest frequency to return in Hz. Default is the end of the spectrum
    +        String reduce = reduce_example; // String | How several bins are combined into one, max or mean (default max)
    +        try {
    +            GLSpectrumData result = apiInstance.devicesetSpectrumDataGet(deviceSetIndex, bins, startFrequency, stopFrequency, reduce);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DeviceSetApi#devicesetSpectrumDataGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +Integer *bins = 56; // Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many (optional)
    +Long *startFrequency = 789; // Lowest frequency to return in Hz. Default is the start of the spectrum (optional)
    +Long *stopFrequency = 789; // Highest frequency to return in Hz. Default is the end of the spectrum (optional)
    +String *reduce = reduce_example; // How several bins are combined into one, max or mean (default max) (optional)
    +
    +DeviceSetApi *apiInstance = [[DeviceSetApi alloc] init];
    +
    +[apiInstance devicesetSpectrumDataGetWith:deviceSetIndex
    +    bins:bins
    +    startFrequency:startFrequency
    +    stopFrequency:stopFrequency
    +    reduce:reduce
    +              completionHandler: ^(GLSpectrumData output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DeviceSetApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +var opts = { 
    +  'bins': 56, // {Integer} Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
    +  'startFrequency': 789, // {Long} Lowest frequency to return in Hz. Default is the start of the spectrum
    +  'stopFrequency': 789, // {Long} Highest frequency to return in Hz. Default is the end of the spectrum
    +  'reduce': reduce_example // {String} How several bins are combined into one, max or mean (default max)
    +};
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetSpectrumDataGet(deviceSetIndex, opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class devicesetSpectrumDataGetExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DeviceSetApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +            var bins = 56;  // Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many (optional) 
    +            var startFrequency = 789;  // Long | Lowest frequency to return in Hz. Default is the start of the spectrum (optional) 
    +            var stopFrequency = 789;  // Long | Highest frequency to return in Hz. Default is the end of the spectrum (optional) 
    +            var reduce = reduce_example;  // String | How several bins are combined into one, max or mean (default max) (optional) 
    +
    +            try
    +            {
    +                GLSpectrumData result = apiInstance.devicesetSpectrumDataGet(deviceSetIndex, bins, startFrequency, stopFrequency, reduce);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DeviceSetApi.devicesetSpectrumDataGet: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DeviceSetApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +$bins = 56; // Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
    +$startFrequency = 789; // Long | Lowest frequency to return in Hz. Default is the start of the spectrum
    +$stopFrequency = 789; // Long | Highest frequency to return in Hz. Default is the end of the spectrum
    +$reduce = reduce_example; // String | How several bins are combined into one, max or mean (default max)
    +
    +try {
    +    $result = $api_instance->devicesetSpectrumDataGet($deviceSetIndex, $bins, $startFrequency, $stopFrequency, $reduce);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DeviceSetApi->devicesetSpectrumDataGet: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::DeviceSetApi;
    +
    +my $api_instance = SWGSDRangel::DeviceSetApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +my $bins = 56; # Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many
    +my $startFrequency = 789; # Long | Lowest frequency to return in Hz. Default is the start of the spectrum
    +my $stopFrequency = 789; # Long | Highest frequency to return in Hz. Default is the end of the spectrum
    +my $reduce = reduce_example; # String | How several bins are combined into one, max or mean (default max)
    +
    +eval { 
    +    my $result = $api_instance->devicesetSpectrumDataGet(deviceSetIndex => $deviceSetIndex, bins => $bins, startFrequency => $startFrequency, stopFrequency => $stopFrequency, reduce => $reduce);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DeviceSetApi->devicesetSpectrumDataGet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_sdrangel
    +from swagger_sdrangel.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_sdrangel.DeviceSetApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +bins = 56 # Integer | Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many (optional)
    +startFrequency = 789 # Long | Lowest frequency to return in Hz. Default is the start of the spectrum (optional)
    +stopFrequency = 789 # Long | Highest frequency to return in Hz. Default is the end of the spectrum (optional)
    +reduce = reduce_example # String | How several bins are combined into one, max or mean (default max) (optional)
    +
    +try: 
    +    api_response = api_instance.deviceset_spectrum_data_get(deviceSetIndex, bins=bins, startFrequency=startFrequency, stopFrequency=stopFrequency, reduce=reduce)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DeviceSetApi->devicesetSpectrumDataGet: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    deviceSetIndex* + + +
    +
    +
    + + Integer + + +
    + Index of device set in the device set list +
    +
    +
    + Required +
    +
    +
    +
    + + + + +
    Query parameters
    + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    bins + + +
    +
    +
    + + Integer + + +
    + Number of bins to return, 1 to 4096 (default 128). The spectrum is grouped down to this many +
    +
    +
    +
    +
    startFrequency + + +
    +
    +
    + + Long + + + (int64) + + +
    + Lowest frequency to return in Hz. Default is the start of the spectrum +
    +
    +
    +
    +
    stopFrequency + + +
    +
    +
    + + Long + + + (int64) + + +
    + Highest frequency to return in Hz. Default is the end of the spectrum +
    +
    +
    +
    +
    reduce + + +
    +
    +
    + + String + + +
    + How several bins are combined into one, max or mean (default max) +
    +
    +
    +
    +
    + +

    Responses

    +

    Status: 200 - On success return the reduced spectrum

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

    Status: 400 - Invalid bins, frequency range or reduction

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

    Status: 404 - Invalid index

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

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

    devicesetSpectrumReportGet

    +

    +
    +
    +
    +

    +

    Get the latest main spectrum measurement results

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/spectrum/report
    +

    +

    Usage and SDK Samples

    +

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

    Parameters

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

    Responses

    +

    Status: 200 - On success return the results of the selected measurement

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

    Status: 404 - Invalid index

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    @@ -66337,7 +68067,7 @@ except ApiException as e:
    - Generated 2026-09-11T11:04:13.600+02:00 + Generated 2026-09-11T17:45:32.114+02:00
    diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.cpp b/swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.cpp index 46230ed91..b426b6440 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.cpp @@ -1442,6 +1442,203 @@ SWGDeviceSetApi::devicesetGetCallback(SWGHttpRequestWorker * worker) { } } +void +SWGDeviceSetApi::devicesetSpectrumActionsPost(qint32 device_set_index, SWGSpectrumActions& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/spectrum/actions"); + + QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}"); + fullPath.replace(device_set_indexPathParam, stringValue(device_set_index)); + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGDeviceSetApi::devicesetSpectrumActionsPostCallback); + + worker->execute(&input); +} + +void +SWGDeviceSetApi::devicesetSpectrumActionsPostCallback(SWGHttpRequestWorker * worker) { + QString msg; + QString error_str = worker->error_str; + QNetworkReply::NetworkError error_type = worker->error_type; + + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + QString json(worker->response); + SWGSuccessResponse* output = static_cast(create(json, QString("SWGSuccessResponse"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit devicesetSpectrumActionsPostSignal(output); + } else { + emit devicesetSpectrumActionsPostSignalE(output, error_type, error_str); + emit devicesetSpectrumActionsPostSignalEFull(worker, error_type, error_str); + } +} + +void +SWGDeviceSetApi::devicesetSpectrumDataGet(qint32 device_set_index, qint32 bins, qint64 start_frequency, qint64 stop_frequency, QString* reduce) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/spectrum/data"); + + QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}"); + fullPath.replace(device_set_indexPathParam, stringValue(device_set_index)); + + if (fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append(QUrl::toPercentEncoding("bins")) + .append("=") + .append(QUrl::toPercentEncoding(stringValue(bins))); + + if (fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append(QUrl::toPercentEncoding("startFrequency")) + .append("=") + .append(QUrl::toPercentEncoding(stringValue(start_frequency))); + + if (fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append(QUrl::toPercentEncoding("stopFrequency")) + .append("=") + .append(QUrl::toPercentEncoding(stringValue(stop_frequency))); + + if (fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append(QUrl::toPercentEncoding("reduce")) + .append("=") + .append(QUrl::toPercentEncoding(stringValue(reduce))); + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); + + + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGDeviceSetApi::devicesetSpectrumDataGetCallback); + + worker->execute(&input); +} + +void +SWGDeviceSetApi::devicesetSpectrumDataGetCallback(SWGHttpRequestWorker * worker) { + QString msg; + QString error_str = worker->error_str; + QNetworkReply::NetworkError error_type = worker->error_type; + + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + QString json(worker->response); + SWGGLSpectrumData* output = static_cast(create(json, QString("SWGGLSpectrumData"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit devicesetSpectrumDataGetSignal(output); + } else { + emit devicesetSpectrumDataGetSignalE(output, error_type, error_str); + emit devicesetSpectrumDataGetSignalEFull(worker, error_type, error_str); + } +} + +void +SWGDeviceSetApi::devicesetSpectrumReportGet(qint32 device_set_index) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/spectrum/report"); + + QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}"); + fullPath.replace(device_set_indexPathParam, stringValue(device_set_index)); + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); + + + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGDeviceSetApi::devicesetSpectrumReportGetCallback); + + worker->execute(&input); +} + +void +SWGDeviceSetApi::devicesetSpectrumReportGetCallback(SWGHttpRequestWorker * worker) { + QString msg; + QString error_str = worker->error_str; + QNetworkReply::NetworkError error_type = worker->error_type; + + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + QString json(worker->response); + SWGGLSpectrumReport* output = static_cast(create(json, QString("SWGGLSpectrumReport"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit devicesetSpectrumReportGetSignal(output); + } else { + emit devicesetSpectrumReportGetSignalE(output, error_type, error_str); + emit devicesetSpectrumReportGetSignalEFull(worker, error_type, error_str); + } +} + void SWGDeviceSetApi::devicesetSpectrumServerDelete(qint32 device_set_index) { QString fullPath; diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.h b/swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.h index 81ac095eb..b1e5c5523 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.h +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceSetApi.h @@ -15,6 +15,7 @@ #include "SWGHttpRequest.h" +#include #include "SWGChannelActions.h" #include "SWGChannelReport.h" #include "SWGChannelSettings.h" @@ -27,6 +28,9 @@ #include "SWGDeviceState.h" #include "SWGErrorResponse.h" #include "SWGGLSpectrum.h" +#include "SWGGLSpectrumData.h" +#include "SWGGLSpectrumReport.h" +#include "SWGSpectrumActions.h" #include "SWGSpectrumServer.h" #include "SWGSuccessResponse.h" #include "SWGWorkspaceInfo.h" @@ -72,6 +76,9 @@ public: void devicesetDeviceWorkspaceGet(qint32 device_set_index); void devicesetDeviceWorkspacePut(qint32 device_set_index, SWGWorkspaceInfo& body); void devicesetGet(qint32 device_set_index); + void devicesetSpectrumActionsPost(qint32 device_set_index, SWGSpectrumActions& body); + void devicesetSpectrumDataGet(qint32 device_set_index, qint32 bins, qint64 start_frequency, qint64 stop_frequency, QString* reduce); + void devicesetSpectrumReportGet(qint32 device_set_index); void devicesetSpectrumServerDelete(qint32 device_set_index); void devicesetSpectrumServerGet(qint32 device_set_index); void devicesetSpectrumServerPost(qint32 device_set_index); @@ -109,6 +116,9 @@ private: void devicesetDeviceWorkspaceGetCallback (SWGHttpRequestWorker * worker); void devicesetDeviceWorkspacePutCallback (SWGHttpRequestWorker * worker); void devicesetGetCallback (SWGHttpRequestWorker * worker); + void devicesetSpectrumActionsPostCallback (SWGHttpRequestWorker * worker); + void devicesetSpectrumDataGetCallback (SWGHttpRequestWorker * worker); + void devicesetSpectrumReportGetCallback (SWGHttpRequestWorker * worker); void devicesetSpectrumServerDeleteCallback (SWGHttpRequestWorker * worker); void devicesetSpectrumServerGetCallback (SWGHttpRequestWorker * worker); void devicesetSpectrumServerPostCallback (SWGHttpRequestWorker * worker); @@ -146,6 +156,9 @@ signals: void devicesetDeviceWorkspaceGetSignal(SWGWorkspaceInfo* summary); void devicesetDeviceWorkspacePutSignal(SWGSuccessResponse* summary); void devicesetGetSignal(SWGDeviceSet* summary); + void devicesetSpectrumActionsPostSignal(SWGSuccessResponse* summary); + void devicesetSpectrumDataGetSignal(SWGGLSpectrumData* summary); + void devicesetSpectrumReportGetSignal(SWGGLSpectrumReport* summary); void devicesetSpectrumServerDeleteSignal(SWGSuccessResponse* summary); void devicesetSpectrumServerGetSignal(SWGSpectrumServer* summary); void devicesetSpectrumServerPostSignal(SWGSuccessResponse* summary); @@ -182,6 +195,9 @@ signals: void devicesetDeviceWorkspaceGetSignalE(SWGWorkspaceInfo* summary, QNetworkReply::NetworkError error_type, QString& error_str); void devicesetDeviceWorkspacePutSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); void devicesetGetSignalE(SWGDeviceSet* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void devicesetSpectrumActionsPostSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void devicesetSpectrumDataGetSignalE(SWGGLSpectrumData* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void devicesetSpectrumReportGetSignalE(SWGGLSpectrumReport* summary, QNetworkReply::NetworkError error_type, QString& error_str); void devicesetSpectrumServerDeleteSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); void devicesetSpectrumServerGetSignalE(SWGSpectrumServer* summary, QNetworkReply::NetworkError error_type, QString& error_str); void devicesetSpectrumServerPostSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); @@ -218,6 +234,9 @@ signals: void devicesetDeviceWorkspaceGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void devicesetDeviceWorkspacePutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void devicesetGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void devicesetSpectrumActionsPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void devicesetSpectrumDataGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void devicesetSpectrumReportGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void devicesetSpectrumServerDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void devicesetSpectrumServerGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void devicesetSpectrumServerPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); diff --git a/swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.cpp b/swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.cpp new file mode 100644 index 000000000..dba65f949 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.cpp @@ -0,0 +1,345 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGGLSpectrumData.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGGLSpectrumData::SWGGLSpectrumData(QString* json) { + init(); + this->fromJson(*json); +} + +SWGGLSpectrumData::SWGGLSpectrumData() { + center_frequency = 0L; + m_center_frequency_isSet = false; + bandwidth = 0; + m_bandwidth_isSet = false; + fft_size = 0; + m_fft_size_isSet = false; + linear = 0; + m_linear_isSet = false; + updated = nullptr; + m_updated_isSet = false; + start_frequency = 0L; + m_start_frequency_isSet = false; + stop_frequency = 0L; + m_stop_frequency_isSet = false; + bin_bandwidth = 0.0f; + m_bin_bandwidth_isSet = false; + bins = 0; + m_bins_isSet = false; + reduce = nullptr; + m_reduce_isSet = false; + power = new QList(); + m_power_isSet = false; +} + +SWGGLSpectrumData::~SWGGLSpectrumData() { + this->cleanup(); +} + +void +SWGGLSpectrumData::init() { + center_frequency = 0L; + m_center_frequency_isSet = false; + bandwidth = 0; + m_bandwidth_isSet = false; + fft_size = 0; + m_fft_size_isSet = false; + linear = 0; + m_linear_isSet = false; + updated = new QString(""); + m_updated_isSet = false; + start_frequency = 0L; + m_start_frequency_isSet = false; + stop_frequency = 0L; + m_stop_frequency_isSet = false; + bin_bandwidth = 0.0f; + m_bin_bandwidth_isSet = false; + bins = 0; + m_bins_isSet = false; + reduce = new QString(""); + m_reduce_isSet = false; + power = new QList(); + m_power_isSet = false; +} + +void +SWGGLSpectrumData::cleanup() { + + + + + if(updated != nullptr) { + delete updated; + } + + + + + if(reduce != nullptr) { + delete reduce; + } + +} + +SWGGLSpectrumData* +SWGGLSpectrumData::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGGLSpectrumData::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", ""); + + ::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", ""); + + ::SWGSDRangel::setValue(&fft_size, pJson["fftSize"], "qint32", ""); + + ::SWGSDRangel::setValue(&linear, pJson["linear"], "qint32", ""); + + ::SWGSDRangel::setValue(&updated, pJson["updated"], "QString", "QString"); + + ::SWGSDRangel::setValue(&start_frequency, pJson["startFrequency"], "qint64", ""); + + ::SWGSDRangel::setValue(&stop_frequency, pJson["stopFrequency"], "qint64", ""); + + ::SWGSDRangel::setValue(&bin_bandwidth, pJson["binBandwidth"], "float", ""); + + ::SWGSDRangel::setValue(&bins, pJson["bins"], "qint32", ""); + + ::SWGSDRangel::setValue(&reduce, pJson["reduce"], "QString", "QString"); + + + ::SWGSDRangel::setValue(&power, pJson["power"], "QList", "float"); +} + +QString +SWGGLSpectrumData::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGGLSpectrumData::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_center_frequency_isSet){ + obj->insert("centerFrequency", QJsonValue(center_frequency)); + } + if(m_bandwidth_isSet){ + obj->insert("bandwidth", QJsonValue(bandwidth)); + } + if(m_fft_size_isSet){ + obj->insert("fftSize", QJsonValue(fft_size)); + } + if(m_linear_isSet){ + obj->insert("linear", QJsonValue(linear)); + } + if(updated != nullptr && *updated != QString("")){ + toJsonValue(QString("updated"), updated, obj, QString("QString")); + } + if(m_start_frequency_isSet){ + obj->insert("startFrequency", QJsonValue(start_frequency)); + } + if(m_stop_frequency_isSet){ + obj->insert("stopFrequency", QJsonValue(stop_frequency)); + } + if(m_bin_bandwidth_isSet){ + obj->insert("binBandwidth", QJsonValue(bin_bandwidth)); + } + if(m_bins_isSet){ + obj->insert("bins", QJsonValue(bins)); + } + if(reduce != nullptr && *reduce != QString("")){ + toJsonValue(QString("reduce"), reduce, obj, QString("QString")); + } + if(power && power->size() > 0){ + toJsonArray((QList*)power, obj, "power", ""); + } + + return obj; +} + +qint64 +SWGGLSpectrumData::getCenterFrequency() { + return center_frequency; +} +void +SWGGLSpectrumData::setCenterFrequency(qint64 center_frequency) { + this->center_frequency = center_frequency; + this->m_center_frequency_isSet = true; +} + +qint32 +SWGGLSpectrumData::getBandwidth() { + return bandwidth; +} +void +SWGGLSpectrumData::setBandwidth(qint32 bandwidth) { + this->bandwidth = bandwidth; + this->m_bandwidth_isSet = true; +} + +qint32 +SWGGLSpectrumData::getFftSize() { + return fft_size; +} +void +SWGGLSpectrumData::setFftSize(qint32 fft_size) { + this->fft_size = fft_size; + this->m_fft_size_isSet = true; +} + +qint32 +SWGGLSpectrumData::getLinear() { + return linear; +} +void +SWGGLSpectrumData::setLinear(qint32 linear) { + this->linear = linear; + this->m_linear_isSet = true; +} + +QString* +SWGGLSpectrumData::getUpdated() { + return updated; +} +void +SWGGLSpectrumData::setUpdated(QString* updated) { + this->updated = updated; + this->m_updated_isSet = true; +} + +qint64 +SWGGLSpectrumData::getStartFrequency() { + return start_frequency; +} +void +SWGGLSpectrumData::setStartFrequency(qint64 start_frequency) { + this->start_frequency = start_frequency; + this->m_start_frequency_isSet = true; +} + +qint64 +SWGGLSpectrumData::getStopFrequency() { + return stop_frequency; +} +void +SWGGLSpectrumData::setStopFrequency(qint64 stop_frequency) { + this->stop_frequency = stop_frequency; + this->m_stop_frequency_isSet = true; +} + +float +SWGGLSpectrumData::getBinBandwidth() { + return bin_bandwidth; +} +void +SWGGLSpectrumData::setBinBandwidth(float bin_bandwidth) { + this->bin_bandwidth = bin_bandwidth; + this->m_bin_bandwidth_isSet = true; +} + +qint32 +SWGGLSpectrumData::getBins() { + return bins; +} +void +SWGGLSpectrumData::setBins(qint32 bins) { + this->bins = bins; + this->m_bins_isSet = true; +} + +QString* +SWGGLSpectrumData::getReduce() { + return reduce; +} +void +SWGGLSpectrumData::setReduce(QString* reduce) { + this->reduce = reduce; + this->m_reduce_isSet = true; +} + +QList* +SWGGLSpectrumData::getPower() { + return power; +} +void +SWGGLSpectrumData::setPower(QList* power) { + this->power = power; + this->m_power_isSet = true; +} + + +bool +SWGGLSpectrumData::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_center_frequency_isSet){ + isObjectUpdated = true; break; + } + if(m_bandwidth_isSet){ + isObjectUpdated = true; break; + } + if(m_fft_size_isSet){ + isObjectUpdated = true; break; + } + if(m_linear_isSet){ + isObjectUpdated = true; break; + } + if(updated && *updated != QString("")){ + isObjectUpdated = true; break; + } + if(m_start_frequency_isSet){ + isObjectUpdated = true; break; + } + if(m_stop_frequency_isSet){ + isObjectUpdated = true; break; + } + if(m_bin_bandwidth_isSet){ + isObjectUpdated = true; break; + } + if(m_bins_isSet){ + isObjectUpdated = true; break; + } + if(reduce && *reduce != QString("")){ + isObjectUpdated = true; break; + } + if(m_power_isSet){ + isObjectUpdated = true; break; + } + if(power && (power->size() > 0)){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.h b/swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.h new file mode 100644 index 000000000..80aad010f --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGGLSpectrumData.h @@ -0,0 +1,120 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGGLSpectrumData.h + * + * A copy of the current power spectrum, reduced to the number of bins asked for so that the answer stays a sensible size whatever the FFT size. The spectrum is only computed while something is consuming it, a spectrum window or a websocket client, so updated says how old these values are and is absent if none has been produced yet. + */ + +#ifndef SWGGLSpectrumData_H_ +#define SWGGLSpectrumData_H_ + +#include + + +#include +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGGLSpectrumData: public SWGObject { +public: + SWGGLSpectrumData(); + SWGGLSpectrumData(QString* json); + virtual ~SWGGLSpectrumData(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGGLSpectrumData* fromJson(QString &jsonString) override; + + qint64 getCenterFrequency(); + void setCenterFrequency(qint64 center_frequency); + + qint32 getBandwidth(); + void setBandwidth(qint32 bandwidth); + + qint32 getFftSize(); + void setFftSize(qint32 fft_size); + + qint32 getLinear(); + void setLinear(qint32 linear); + + QString* getUpdated(); + void setUpdated(QString* updated); + + qint64 getStartFrequency(); + void setStartFrequency(qint64 start_frequency); + + qint64 getStopFrequency(); + void setStopFrequency(qint64 stop_frequency); + + float getBinBandwidth(); + void setBinBandwidth(float bin_bandwidth); + + qint32 getBins(); + void setBins(qint32 bins); + + QString* getReduce(); + void setReduce(QString* reduce); + + QList* getPower(); + void setPower(QList* power); + + + virtual bool isSet() override; + +private: + qint64 center_frequency; + bool m_center_frequency_isSet; + + qint32 bandwidth; + bool m_bandwidth_isSet; + + qint32 fft_size; + bool m_fft_size_isSet; + + qint32 linear; + bool m_linear_isSet; + + QString* updated; + bool m_updated_isSet; + + qint64 start_frequency; + bool m_start_frequency_isSet; + + qint64 stop_frequency; + bool m_stop_frequency_isSet; + + float bin_bandwidth; + bool m_bin_bandwidth_isSet; + + qint32 bins; + bool m_bins_isSet; + + QString* reduce; + bool m_reduce_isSet; + + QList* power; + bool m_power_isSet; + +}; + +} + +#endif /* SWGGLSpectrumData_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.cpp b/swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.cpp new file mode 100644 index 000000000..8fcfe9c57 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.cpp @@ -0,0 +1,484 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGGLSpectrumReport.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGGLSpectrumReport::SWGGLSpectrumReport(QString* json) { + init(); + this->fromJson(*json); +} + +SWGGLSpectrumReport::SWGGLSpectrumReport() { + measurement = 0; + m_measurement_isSet = false; + updated = nullptr; + m_updated_isSet = false; + peaks = nullptr; + m_peaks_isSet = false; + channel_power = 0.0f; + m_channel_power_isSet = false; + adj_channel_power_left = 0.0f; + m_adj_channel_power_left_isSet = false; + adj_channel_power_left_ratio = 0.0f; + m_adj_channel_power_left_ratio_isSet = false; + adj_channel_power_centre = 0.0f; + m_adj_channel_power_centre_isSet = false; + adj_channel_power_right = 0.0f; + m_adj_channel_power_right_isSet = false; + adj_channel_power_right_ratio = 0.0f; + m_adj_channel_power_right_ratio_isSet = false; + occupied_bandwidth = 0.0f; + m_occupied_bandwidth_isSet = false; + bandwidth3d_b = 0.0f; + m_bandwidth3d_b_isSet = false; + snr = 0.0f; + m_snr_isSet = false; + snfr = 0.0f; + m_snfr_isSet = false; + thd = 0.0f; + m_thd_isSet = false; + thd_plus_noise = 0.0f; + m_thd_plus_noise_isSet = false; + sinad = 0.0f; + m_sinad_isSet = false; + sfdr = 0.0f; + m_sfdr_isSet = false; +} + +SWGGLSpectrumReport::~SWGGLSpectrumReport() { + this->cleanup(); +} + +void +SWGGLSpectrumReport::init() { + measurement = 0; + m_measurement_isSet = false; + updated = new QString(""); + m_updated_isSet = false; + peaks = new QList(); + m_peaks_isSet = false; + channel_power = 0.0f; + m_channel_power_isSet = false; + adj_channel_power_left = 0.0f; + m_adj_channel_power_left_isSet = false; + adj_channel_power_left_ratio = 0.0f; + m_adj_channel_power_left_ratio_isSet = false; + adj_channel_power_centre = 0.0f; + m_adj_channel_power_centre_isSet = false; + adj_channel_power_right = 0.0f; + m_adj_channel_power_right_isSet = false; + adj_channel_power_right_ratio = 0.0f; + m_adj_channel_power_right_ratio_isSet = false; + occupied_bandwidth = 0.0f; + m_occupied_bandwidth_isSet = false; + bandwidth3d_b = 0.0f; + m_bandwidth3d_b_isSet = false; + snr = 0.0f; + m_snr_isSet = false; + snfr = 0.0f; + m_snfr_isSet = false; + thd = 0.0f; + m_thd_isSet = false; + thd_plus_noise = 0.0f; + m_thd_plus_noise_isSet = false; + sinad = 0.0f; + m_sinad_isSet = false; + sfdr = 0.0f; + m_sfdr_isSet = false; +} + +void +SWGGLSpectrumReport::cleanup() { + + if(updated != nullptr) { + delete updated; + } + if(peaks != nullptr) { + auto arr = peaks; + for(auto o: *arr) { + delete o; + } + delete peaks; + } + + + + + + + + + + + + + + +} + +SWGGLSpectrumReport* +SWGGLSpectrumReport::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGGLSpectrumReport::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&measurement, pJson["measurement"], "qint32", ""); + + ::SWGSDRangel::setValue(&updated, pJson["updated"], "QString", "QString"); + + + ::SWGSDRangel::setValue(&peaks, pJson["peaks"], "QList", "SWGSpectrumPeak"); + ::SWGSDRangel::setValue(&channel_power, pJson["channelPower"], "float", ""); + + ::SWGSDRangel::setValue(&adj_channel_power_left, pJson["adjChannelPowerLeft"], "float", ""); + + ::SWGSDRangel::setValue(&adj_channel_power_left_ratio, pJson["adjChannelPowerLeftRatio"], "float", ""); + + ::SWGSDRangel::setValue(&adj_channel_power_centre, pJson["adjChannelPowerCentre"], "float", ""); + + ::SWGSDRangel::setValue(&adj_channel_power_right, pJson["adjChannelPowerRight"], "float", ""); + + ::SWGSDRangel::setValue(&adj_channel_power_right_ratio, pJson["adjChannelPowerRightRatio"], "float", ""); + + ::SWGSDRangel::setValue(&occupied_bandwidth, pJson["occupiedBandwidth"], "float", ""); + + ::SWGSDRangel::setValue(&bandwidth3d_b, pJson["bandwidth3dB"], "float", ""); + + ::SWGSDRangel::setValue(&snr, pJson["snr"], "float", ""); + + ::SWGSDRangel::setValue(&snfr, pJson["snfr"], "float", ""); + + ::SWGSDRangel::setValue(&thd, pJson["thd"], "float", ""); + + ::SWGSDRangel::setValue(&thd_plus_noise, pJson["thdPlusNoise"], "float", ""); + + ::SWGSDRangel::setValue(&sinad, pJson["sinad"], "float", ""); + + ::SWGSDRangel::setValue(&sfdr, pJson["sfdr"], "float", ""); + +} + +QString +SWGGLSpectrumReport::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGGLSpectrumReport::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_measurement_isSet){ + obj->insert("measurement", QJsonValue(measurement)); + } + if(updated != nullptr && *updated != QString("")){ + toJsonValue(QString("updated"), updated, obj, QString("QString")); + } + if(peaks && peaks->size() > 0){ + toJsonArray((QList*)peaks, obj, "peaks", "SWGSpectrumPeak"); + } + if(m_channel_power_isSet){ + obj->insert("channelPower", QJsonValue(channel_power)); + } + if(m_adj_channel_power_left_isSet){ + obj->insert("adjChannelPowerLeft", QJsonValue(adj_channel_power_left)); + } + if(m_adj_channel_power_left_ratio_isSet){ + obj->insert("adjChannelPowerLeftRatio", QJsonValue(adj_channel_power_left_ratio)); + } + if(m_adj_channel_power_centre_isSet){ + obj->insert("adjChannelPowerCentre", QJsonValue(adj_channel_power_centre)); + } + if(m_adj_channel_power_right_isSet){ + obj->insert("adjChannelPowerRight", QJsonValue(adj_channel_power_right)); + } + if(m_adj_channel_power_right_ratio_isSet){ + obj->insert("adjChannelPowerRightRatio", QJsonValue(adj_channel_power_right_ratio)); + } + if(m_occupied_bandwidth_isSet){ + obj->insert("occupiedBandwidth", QJsonValue(occupied_bandwidth)); + } + if(m_bandwidth3d_b_isSet){ + obj->insert("bandwidth3dB", QJsonValue(bandwidth3d_b)); + } + if(m_snr_isSet){ + obj->insert("snr", QJsonValue(snr)); + } + if(m_snfr_isSet){ + obj->insert("snfr", QJsonValue(snfr)); + } + if(m_thd_isSet){ + obj->insert("thd", QJsonValue(thd)); + } + if(m_thd_plus_noise_isSet){ + obj->insert("thdPlusNoise", QJsonValue(thd_plus_noise)); + } + if(m_sinad_isSet){ + obj->insert("sinad", QJsonValue(sinad)); + } + if(m_sfdr_isSet){ + obj->insert("sfdr", QJsonValue(sfdr)); + } + + return obj; +} + +qint32 +SWGGLSpectrumReport::getMeasurement() { + return measurement; +} +void +SWGGLSpectrumReport::setMeasurement(qint32 measurement) { + this->measurement = measurement; + this->m_measurement_isSet = true; +} + +QString* +SWGGLSpectrumReport::getUpdated() { + return updated; +} +void +SWGGLSpectrumReport::setUpdated(QString* updated) { + this->updated = updated; + this->m_updated_isSet = true; +} + +QList* +SWGGLSpectrumReport::getPeaks() { + return peaks; +} +void +SWGGLSpectrumReport::setPeaks(QList* peaks) { + this->peaks = peaks; + this->m_peaks_isSet = true; +} + +float +SWGGLSpectrumReport::getChannelPower() { + return channel_power; +} +void +SWGGLSpectrumReport::setChannelPower(float channel_power) { + this->channel_power = channel_power; + this->m_channel_power_isSet = true; +} + +float +SWGGLSpectrumReport::getAdjChannelPowerLeft() { + return adj_channel_power_left; +} +void +SWGGLSpectrumReport::setAdjChannelPowerLeft(float adj_channel_power_left) { + this->adj_channel_power_left = adj_channel_power_left; + this->m_adj_channel_power_left_isSet = true; +} + +float +SWGGLSpectrumReport::getAdjChannelPowerLeftRatio() { + return adj_channel_power_left_ratio; +} +void +SWGGLSpectrumReport::setAdjChannelPowerLeftRatio(float adj_channel_power_left_ratio) { + this->adj_channel_power_left_ratio = adj_channel_power_left_ratio; + this->m_adj_channel_power_left_ratio_isSet = true; +} + +float +SWGGLSpectrumReport::getAdjChannelPowerCentre() { + return adj_channel_power_centre; +} +void +SWGGLSpectrumReport::setAdjChannelPowerCentre(float adj_channel_power_centre) { + this->adj_channel_power_centre = adj_channel_power_centre; + this->m_adj_channel_power_centre_isSet = true; +} + +float +SWGGLSpectrumReport::getAdjChannelPowerRight() { + return adj_channel_power_right; +} +void +SWGGLSpectrumReport::setAdjChannelPowerRight(float adj_channel_power_right) { + this->adj_channel_power_right = adj_channel_power_right; + this->m_adj_channel_power_right_isSet = true; +} + +float +SWGGLSpectrumReport::getAdjChannelPowerRightRatio() { + return adj_channel_power_right_ratio; +} +void +SWGGLSpectrumReport::setAdjChannelPowerRightRatio(float adj_channel_power_right_ratio) { + this->adj_channel_power_right_ratio = adj_channel_power_right_ratio; + this->m_adj_channel_power_right_ratio_isSet = true; +} + +float +SWGGLSpectrumReport::getOccupiedBandwidth() { + return occupied_bandwidth; +} +void +SWGGLSpectrumReport::setOccupiedBandwidth(float occupied_bandwidth) { + this->occupied_bandwidth = occupied_bandwidth; + this->m_occupied_bandwidth_isSet = true; +} + +float +SWGGLSpectrumReport::getBandwidth3dB() { + return bandwidth3d_b; +} +void +SWGGLSpectrumReport::setBandwidth3dB(float bandwidth3d_b) { + this->bandwidth3d_b = bandwidth3d_b; + this->m_bandwidth3d_b_isSet = true; +} + +float +SWGGLSpectrumReport::getSnr() { + return snr; +} +void +SWGGLSpectrumReport::setSnr(float snr) { + this->snr = snr; + this->m_snr_isSet = true; +} + +float +SWGGLSpectrumReport::getSnfr() { + return snfr; +} +void +SWGGLSpectrumReport::setSnfr(float snfr) { + this->snfr = snfr; + this->m_snfr_isSet = true; +} + +float +SWGGLSpectrumReport::getThd() { + return thd; +} +void +SWGGLSpectrumReport::setThd(float thd) { + this->thd = thd; + this->m_thd_isSet = true; +} + +float +SWGGLSpectrumReport::getThdPlusNoise() { + return thd_plus_noise; +} +void +SWGGLSpectrumReport::setThdPlusNoise(float thd_plus_noise) { + this->thd_plus_noise = thd_plus_noise; + this->m_thd_plus_noise_isSet = true; +} + +float +SWGGLSpectrumReport::getSinad() { + return sinad; +} +void +SWGGLSpectrumReport::setSinad(float sinad) { + this->sinad = sinad; + this->m_sinad_isSet = true; +} + +float +SWGGLSpectrumReport::getSfdr() { + return sfdr; +} +void +SWGGLSpectrumReport::setSfdr(float sfdr) { + this->sfdr = sfdr; + this->m_sfdr_isSet = true; +} + + +bool +SWGGLSpectrumReport::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_measurement_isSet){ + isObjectUpdated = true; break; + } + if(updated && *updated != QString("")){ + isObjectUpdated = true; break; + } + if(peaks && (peaks->size() > 0)){ + isObjectUpdated = true; break; + } + if(m_channel_power_isSet){ + isObjectUpdated = true; break; + } + if(m_adj_channel_power_left_isSet){ + isObjectUpdated = true; break; + } + if(m_adj_channel_power_left_ratio_isSet){ + isObjectUpdated = true; break; + } + if(m_adj_channel_power_centre_isSet){ + isObjectUpdated = true; break; + } + if(m_adj_channel_power_right_isSet){ + isObjectUpdated = true; break; + } + if(m_adj_channel_power_right_ratio_isSet){ + isObjectUpdated = true; break; + } + if(m_occupied_bandwidth_isSet){ + isObjectUpdated = true; break; + } + if(m_bandwidth3d_b_isSet){ + isObjectUpdated = true; break; + } + if(m_snr_isSet){ + isObjectUpdated = true; break; + } + if(m_snfr_isSet){ + isObjectUpdated = true; break; + } + if(m_thd_isSet){ + isObjectUpdated = true; break; + } + if(m_thd_plus_noise_isSet){ + isObjectUpdated = true; break; + } + if(m_sinad_isSet){ + isObjectUpdated = true; break; + } + if(m_sfdr_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.h b/swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.h new file mode 100644 index 000000000..b2e1483e1 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGGLSpectrumReport.h @@ -0,0 +1,157 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGGLSpectrumReport.h + * + * The latest values of whichever spectrum measurement is switched on. Which fields are present depends on the measurement: with none selected nothing is measured at all and only the measurement field is returned. The figures are those of the spectrum as displayed, so they match the window rather than the full span when it is zoomed, and they are only produced by a running GUI. + */ + +#ifndef SWGGLSpectrumReport_H_ +#define SWGGLSpectrumReport_H_ + +#include + + +#include "SWGSpectrumPeak.h" +#include +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGGLSpectrumReport: public SWGObject { +public: + SWGGLSpectrumReport(); + SWGGLSpectrumReport(QString* json); + virtual ~SWGGLSpectrumReport(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGGLSpectrumReport* fromJson(QString &jsonString) override; + + qint32 getMeasurement(); + void setMeasurement(qint32 measurement); + + QString* getUpdated(); + void setUpdated(QString* updated); + + QList* getPeaks(); + void setPeaks(QList* peaks); + + float getChannelPower(); + void setChannelPower(float channel_power); + + float getAdjChannelPowerLeft(); + void setAdjChannelPowerLeft(float adj_channel_power_left); + + float getAdjChannelPowerLeftRatio(); + void setAdjChannelPowerLeftRatio(float adj_channel_power_left_ratio); + + float getAdjChannelPowerCentre(); + void setAdjChannelPowerCentre(float adj_channel_power_centre); + + float getAdjChannelPowerRight(); + void setAdjChannelPowerRight(float adj_channel_power_right); + + float getAdjChannelPowerRightRatio(); + void setAdjChannelPowerRightRatio(float adj_channel_power_right_ratio); + + float getOccupiedBandwidth(); + void setOccupiedBandwidth(float occupied_bandwidth); + + float getBandwidth3dB(); + void setBandwidth3dB(float bandwidth3d_b); + + float getSnr(); + void setSnr(float snr); + + float getSnfr(); + void setSnfr(float snfr); + + float getThd(); + void setThd(float thd); + + float getThdPlusNoise(); + void setThdPlusNoise(float thd_plus_noise); + + float getSinad(); + void setSinad(float sinad); + + float getSfdr(); + void setSfdr(float sfdr); + + + virtual bool isSet() override; + +private: + qint32 measurement; + bool m_measurement_isSet; + + QString* updated; + bool m_updated_isSet; + + QList* peaks; + bool m_peaks_isSet; + + float channel_power; + bool m_channel_power_isSet; + + float adj_channel_power_left; + bool m_adj_channel_power_left_isSet; + + float adj_channel_power_left_ratio; + bool m_adj_channel_power_left_ratio_isSet; + + float adj_channel_power_centre; + bool m_adj_channel_power_centre_isSet; + + float adj_channel_power_right; + bool m_adj_channel_power_right_isSet; + + float adj_channel_power_right_ratio; + bool m_adj_channel_power_right_ratio_isSet; + + float occupied_bandwidth; + bool m_occupied_bandwidth_isSet; + + float bandwidth3d_b; + bool m_bandwidth3d_b_isSet; + + float snr; + bool m_snr_isSet; + + float snfr; + bool m_snfr_isSet; + + float thd; + bool m_thd_isSet; + + float thd_plus_noise; + bool m_thd_plus_noise_isSet; + + float sinad; + bool m_sinad_isSet; + + float sfdr; + bool m_sfdr_isSet; + +}; + +} + +#endif /* SWGGLSpectrumReport_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 6e70fadae..f4d2109b6 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -179,6 +179,8 @@ #include "SWGFrequencyRange.h" #include "SWGGLScope.h" #include "SWGGLSpectrum.h" +#include "SWGGLSpectrumData.h" +#include "SWGGLSpectrumReport.h" #include "SWGGS232ControllerActions.h" #include "SWGGS232ControllerReport.h" #include "SWGGS232ControllerSettings.h" @@ -365,10 +367,12 @@ #include "SWGSoapySDRInputSettings.h" #include "SWGSoapySDROutputSettings.h" #include "SWGSoapySDRReport.h" +#include "SWGSpectrumActions.h" #include "SWGSpectrumAnnotationMarker.h" #include "SWGSpectrumCalibrationPoint.h" #include "SWGSpectrumHistogramMarker.h" #include "SWGSpectrumMemorySettings.h" +#include "SWGSpectrumPeak.h" #include "SWGSpectrumServer.h" #include "SWGSpectrumServer_clients.h" #include "SWGSpectrumWaterfallMarker.h" @@ -1244,6 +1248,16 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGGLSpectrumData").compare(type) == 0) { + SWGGLSpectrumData *obj = new SWGGLSpectrumData(); + obj->init(); + return obj; + } + if(QString("SWGGLSpectrumReport").compare(type) == 0) { + SWGGLSpectrumReport *obj = new SWGGLSpectrumReport(); + obj->init(); + return obj; + } if(QString("SWGGS232ControllerActions").compare(type) == 0) { SWGGS232ControllerActions *obj = new SWGGS232ControllerActions(); obj->init(); @@ -2174,6 +2188,11 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGSpectrumActions").compare(type) == 0) { + SWGSpectrumActions *obj = new SWGSpectrumActions(); + obj->init(); + return obj; + } if(QString("SWGSpectrumAnnotationMarker").compare(type) == 0) { SWGSpectrumAnnotationMarker *obj = new SWGSpectrumAnnotationMarker(); obj->init(); @@ -2194,6 +2213,11 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGSpectrumPeak").compare(type) == 0) { + SWGSpectrumPeak *obj = new SWGSpectrumPeak(); + obj->init(); + return obj; + } if(QString("SWGSpectrumServer").compare(type) == 0) { SWGSpectrumServer *obj = new SWGSpectrumServer(); obj->init(); diff --git a/swagger/sdrangel/code/qt5/client/SWGSpectrumActions.cpp b/swagger/sdrangel/code/qt5/client/SWGSpectrumActions.cpp new file mode 100644 index 000000000..baa4a8307 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGSpectrumActions.cpp @@ -0,0 +1,200 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGSpectrumActions.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGSpectrumActions::SWGSpectrumActions(QString* json) { + init(); + this->fromJson(*json); +} + +SWGSpectrumActions::SWGSpectrumActions() { + autoscale = 0; + m_autoscale_isSet = false; + clear_spectrum = 0; + m_clear_spectrum_isSet = false; + reset_measurements = 0; + m_reset_measurements_isSet = false; + freeze = 0; + m_freeze_isSet = false; + goto_marker = 0; + m_goto_marker_isSet = false; +} + +SWGSpectrumActions::~SWGSpectrumActions() { + this->cleanup(); +} + +void +SWGSpectrumActions::init() { + autoscale = 0; + m_autoscale_isSet = false; + clear_spectrum = 0; + m_clear_spectrum_isSet = false; + reset_measurements = 0; + m_reset_measurements_isSet = false; + freeze = 0; + m_freeze_isSet = false; + goto_marker = 0; + m_goto_marker_isSet = false; +} + +void +SWGSpectrumActions::cleanup() { + + + + + +} + +SWGSpectrumActions* +SWGSpectrumActions::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGSpectrumActions::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&autoscale, pJson["autoscale"], "qint32", ""); + + ::SWGSDRangel::setValue(&clear_spectrum, pJson["clearSpectrum"], "qint32", ""); + + ::SWGSDRangel::setValue(&reset_measurements, pJson["resetMeasurements"], "qint32", ""); + + ::SWGSDRangel::setValue(&freeze, pJson["freeze"], "qint32", ""); + + ::SWGSDRangel::setValue(&goto_marker, pJson["gotoMarker"], "qint32", ""); + +} + +QString +SWGSpectrumActions::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGSpectrumActions::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_autoscale_isSet){ + obj->insert("autoscale", QJsonValue(autoscale)); + } + if(m_clear_spectrum_isSet){ + obj->insert("clearSpectrum", QJsonValue(clear_spectrum)); + } + if(m_reset_measurements_isSet){ + obj->insert("resetMeasurements", QJsonValue(reset_measurements)); + } + if(m_freeze_isSet){ + obj->insert("freeze", QJsonValue(freeze)); + } + if(m_goto_marker_isSet){ + obj->insert("gotoMarker", QJsonValue(goto_marker)); + } + + return obj; +} + +qint32 +SWGSpectrumActions::getAutoscale() { + return autoscale; +} +void +SWGSpectrumActions::setAutoscale(qint32 autoscale) { + this->autoscale = autoscale; + this->m_autoscale_isSet = true; +} + +qint32 +SWGSpectrumActions::getClearSpectrum() { + return clear_spectrum; +} +void +SWGSpectrumActions::setClearSpectrum(qint32 clear_spectrum) { + this->clear_spectrum = clear_spectrum; + this->m_clear_spectrum_isSet = true; +} + +qint32 +SWGSpectrumActions::getResetMeasurements() { + return reset_measurements; +} +void +SWGSpectrumActions::setResetMeasurements(qint32 reset_measurements) { + this->reset_measurements = reset_measurements; + this->m_reset_measurements_isSet = true; +} + +qint32 +SWGSpectrumActions::getFreeze() { + return freeze; +} +void +SWGSpectrumActions::setFreeze(qint32 freeze) { + this->freeze = freeze; + this->m_freeze_isSet = true; +} + +qint32 +SWGSpectrumActions::getGotoMarker() { + return goto_marker; +} +void +SWGSpectrumActions::setGotoMarker(qint32 goto_marker) { + this->goto_marker = goto_marker; + this->m_goto_marker_isSet = true; +} + + +bool +SWGSpectrumActions::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_autoscale_isSet){ + isObjectUpdated = true; break; + } + if(m_clear_spectrum_isSet){ + isObjectUpdated = true; break; + } + if(m_reset_measurements_isSet){ + isObjectUpdated = true; break; + } + if(m_freeze_isSet){ + isObjectUpdated = true; break; + } + if(m_goto_marker_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGSpectrumActions.h b/swagger/sdrangel/code/qt5/client/SWGSpectrumActions.h new file mode 100644 index 000000000..316e0d92e --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGSpectrumActions.h @@ -0,0 +1,82 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGSpectrumActions.h + * + * Actions on the main spectrum of a device set + */ + +#ifndef SWGSpectrumActions_H_ +#define SWGSpectrumActions_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGSpectrumActions: public SWGObject { +public: + SWGSpectrumActions(); + SWGSpectrumActions(QString* json); + virtual ~SWGSpectrumActions(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGSpectrumActions* fromJson(QString &jsonString) override; + + qint32 getAutoscale(); + void setAutoscale(qint32 autoscale); + + qint32 getClearSpectrum(); + void setClearSpectrum(qint32 clear_spectrum); + + qint32 getResetMeasurements(); + void setResetMeasurements(qint32 reset_measurements); + + qint32 getFreeze(); + void setFreeze(qint32 freeze); + + qint32 getGotoMarker(); + void setGotoMarker(qint32 goto_marker); + + + virtual bool isSet() override; + +private: + qint32 autoscale; + bool m_autoscale_isSet; + + qint32 clear_spectrum; + bool m_clear_spectrum_isSet; + + qint32 reset_measurements; + bool m_reset_measurements_isSet; + + qint32 freeze; + bool m_freeze_isSet; + + qint32 goto_marker; + bool m_goto_marker_isSet; + +}; + +} + +#endif /* SWGSpectrumActions_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.cpp b/swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.cpp new file mode 100644 index 000000000..06885988c --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.cpp @@ -0,0 +1,131 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGSpectrumPeak.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGSpectrumPeak::SWGSpectrumPeak(QString* json) { + init(); + this->fromJson(*json); +} + +SWGSpectrumPeak::SWGSpectrumPeak() { + frequency = 0L; + m_frequency_isSet = false; + power = 0.0f; + m_power_isSet = false; +} + +SWGSpectrumPeak::~SWGSpectrumPeak() { + this->cleanup(); +} + +void +SWGSpectrumPeak::init() { + frequency = 0L; + m_frequency_isSet = false; + power = 0.0f; + m_power_isSet = false; +} + +void +SWGSpectrumPeak::cleanup() { + + +} + +SWGSpectrumPeak* +SWGSpectrumPeak::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGSpectrumPeak::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&frequency, pJson["frequency"], "qint64", ""); + + ::SWGSDRangel::setValue(&power, pJson["power"], "float", ""); + +} + +QString +SWGSpectrumPeak::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGSpectrumPeak::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_frequency_isSet){ + obj->insert("frequency", QJsonValue(frequency)); + } + if(m_power_isSet){ + obj->insert("power", QJsonValue(power)); + } + + return obj; +} + +qint64 +SWGSpectrumPeak::getFrequency() { + return frequency; +} +void +SWGSpectrumPeak::setFrequency(qint64 frequency) { + this->frequency = frequency; + this->m_frequency_isSet = true; +} + +float +SWGSpectrumPeak::getPower() { + return power; +} +void +SWGSpectrumPeak::setPower(float power) { + this->power = power; + this->m_power_isSet = true; +} + + +bool +SWGSpectrumPeak::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_frequency_isSet){ + isObjectUpdated = true; break; + } + if(m_power_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.h b/swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.h new file mode 100644 index 000000000..e4b12ecb2 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGSpectrumPeak.h @@ -0,0 +1,64 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGSpectrumPeak.h + * + * One peak found in the spectrum + */ + +#ifndef SWGSpectrumPeak_H_ +#define SWGSpectrumPeak_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGSpectrumPeak: public SWGObject { +public: + SWGSpectrumPeak(); + SWGSpectrumPeak(QString* json); + virtual ~SWGSpectrumPeak(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGSpectrumPeak* fromJson(QString &jsonString) override; + + qint64 getFrequency(); + void setFrequency(qint64 frequency); + + float getPower(); + void setPower(float power); + + + virtual bool isSet() override; + +private: + qint64 frequency; + bool m_frequency_isSet; + + float power; + bool m_power_isSet; + +}; + +} + +#endif /* SWGSpectrumPeak_H_ */