Local Sink: updated API and documentation

pull/1539/head
f4exb 2022-12-17 06:26:58 +01:00
rodzic edf464d987
commit 8c84d4a456
20 zmienionych plików z 776 dodań i 14 usunięć

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 13 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 101 KiB

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 101 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 18 KiB

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 8.0 KiB

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -483,6 +483,35 @@ void LocalSink::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("play")) {
settings.m_play = response.getLocalSinkSettings()->getPlay() != 0;
}
if (channelSettingsKeys.contains("dsp")) {
settings.m_dsp = response.getLocalSinkSettings()->getDsp() != 0;
}
if (channelSettingsKeys.contains("gaindB")) {
settings.m_gaindB = response.getLocalSinkSettings()->getGaindB();
}
if (channelSettingsKeys.contains("fftOn")) {
settings.m_fftOn = response.getLocalSinkSettings()->getFftOn() != 0;
}
if (channelSettingsKeys.contains("log2FFT")) {
settings.m_log2FFT = response.getLocalSinkSettings()->getLog2Fft();
}
if (channelSettingsKeys.contains("fftWindow")) {
settings.m_fftWindow = (FFTWindow::Function) response.getLocalSinkSettings()->getFftWindow();
}
if (channelSettingsKeys.contains("reverseFilter")) {
settings.m_reverseFilter = response.getLocalSinkSettings()->getReverseFilter() != 0;
}
if (channelSettingsKeys.contains("fftBands"))
{
QList<SWGSDRangel::SWGFFTBand *> *fftBands = response.getLocalSinkSettings()->getFftBands();
settings.m_fftBands.clear();
for (const auto& fftBand : *fftBands) {
settings.m_fftBands.push_back(std::pair<float, float>{fftBand->getFstart(), fftBand->getBandwidth()});
}
}
if (channelSettingsKeys.contains("streamIndex")) {
settings.m_streamIndex = response.getLocalSinkSettings()->getStreamIndex();
}
@ -523,6 +552,26 @@ void LocalSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getLocalSinkSettings()->setLog2Decim(settings.m_log2Decim);
response.getLocalSinkSettings()->setFilterChainHash(settings.m_filterChainHash);
response.getLocalSinkSettings()->setPlay(settings.m_play ? 1 : 0);
response.getLocalSinkSettings()->setDsp(settings.m_dsp ? 1 : 0);
response.getLocalSinkSettings()->setGaindB(settings.m_gaindB);
response.getLocalSinkSettings()->setFftOn(settings.m_fftOn ? 1 : 0);
response.getLocalSinkSettings()->setLog2Fft(settings.m_log2FFT);
response.getLocalSinkSettings()->setFftWindow((int) settings.m_fftWindow);
response.getLocalSinkSettings()->setReverseFilter(settings.m_reverseFilter ? 1 : 0);
if (!response.getLocalSinkSettings()->getFftBands()) {
response.getLocalSinkSettings()->setFftBands(new QList<SWGSDRangel::SWGFFTBand *>());
}
response.getLocalSinkSettings()->getFftBands()->clear();
for (const auto& fftBand : settings.m_fftBands)
{
response.getLocalSinkSettings()->getFftBands()->push_back(new SWGSDRangel::SWGFFTBand);
response.getLocalSinkSettings()->getFftBands()->back()->setFstart(fftBand.first);
response.getLocalSinkSettings()->getFftBands()->back()->setBandwidth(fftBand.second);
}
response.getLocalSinkSettings()->setStreamIndex(settings.m_streamIndex);
response.getLocalSinkSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
@ -649,6 +698,37 @@ void LocalSink::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("play") || force) {
swgLocalSinkSettings->setPlay(settings.m_play ? 1 : 0);
}
if (channelSettingsKeys.contains("dsp") || force) {
swgLocalSinkSettings->setDsp(settings.m_dsp ? 1 : 0);
}
if (channelSettingsKeys.contains("gaindB") || force) {
swgLocalSinkSettings->setGaindB(settings.m_gaindB);
}
if (channelSettingsKeys.contains("log2FFT") || force) {
swgLocalSinkSettings->setLog2Fft(settings.m_log2FFT);
}
if (channelSettingsKeys.contains("fftWindow") || force) {
swgLocalSinkSettings->setFftWindow((int) settings.m_fftWindow);
}
if (channelSettingsKeys.contains("fftOn") || force) {
swgLocalSinkSettings->setFftOn(settings.m_fftOn ? 1 : 0);
}
if (channelSettingsKeys.contains("reverseFilter") || force) {
swgLocalSinkSettings->setReverseFilter(settings.m_reverseFilter ? 1 : 0);
}
if (channelSettingsKeys.contains("fftBands") || force)
{
swgLocalSinkSettings->setFftBands(new QList<SWGSDRangel::SWGFFTBand *>());
for (const auto& fftBand : settings.m_fftBands)
{
swgLocalSinkSettings->getFftBands()->push_back(new SWGSDRangel::SWGFFTBand);
swgLocalSinkSettings->getFftBands()->back()->setFstart(fftBand.first);
swgLocalSinkSettings->getFftBands()->back()->setBandwidth(fftBand.second);
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgLocalSinkSettings->setStreamIndex(settings.m_streamIndex);
}

Wyświetl plik

@ -501,6 +501,10 @@ void LocalSinkGUI::on_fftBandAdd_clicked()
void LocalSinkGUI::on_fftBandDel_clicked()
{
if (m_settings.m_fftBands.size() == 0) {
return;
}
m_settings.m_fftBands.erase(m_settings.m_fftBands.begin() + m_currentBandIndex);
m_currentBandIndex--;
displayFFTBand();

Wyświetl plik

@ -12,6 +12,10 @@ These Local Sinks can then be coupled with two Local Input device source plugins
Note that because it uses only the channelizer half band filter chain to achieve decimation and center frequency shift you have a limited choice on the center frequencies that may be used (similarly to the Remote Sink). The available center frequencies depend on the baseband sample rate, the channel decimation and the filter chain that is used so you have to play with these parameters to obtain a suitable center frequency and pass band.
In addition it has some DSP stages that apply some transformations before sending the samples to the Local Input device that can be toggled vua (A.7.3):
- A gain stage which gain in dB is controlled by (A.7.4)
- A FFT multiband filter controlled by (A.7.6) to (A.13)
<b>&#9888; Important warning</b> When closing the application or before closing the local input device the local sink is connected it is recommended to stop processing on the local sink (7). Depending on the sequence by which the devices have been created closing the local input while the local sink runs may crash the program.
<h2>Interface</h2>
@ -20,15 +24,20 @@ The top and bottom bars of the channel window are described [here](../../../sdrg
![Local sink channel plugin GUI](../../../doc/img/LocalSink.png)
<h3>1: Decimation factor</h3>
- A: settings section
- B: channel spectrum display (not detailed here)
![Local sink channel plugin GUI Settings](../../../doc/img/LocalSink_A.png)
<h3>A.1: Decimation factor</h3>
The device baseband can be decimated in the channel and its center can be selected with (5). The resulting sample rate of the I/Q stream sent over the network is the baseband sample rate divided by this value. The value is displayed in (2).
<h3>2: I/Q stream sample rate</h3>
<h3>A.2: I/Q stream sample rate</h3>
This is the sample rate in kS/s of the I/Q stream sent to the Local Input source instance.
<h3>3: Half-band filters chain sequence</h3>
<h3>A.3: Half-band filters chain sequence</h3>
This string represents the sequence of half-band filters used in the decimation from device baseband to resulting I/Q stream. Each character represents a filter type:
@ -36,11 +45,15 @@ This string represents the sequence of half-band filters used in the decimation
- **H**: higher half-band
- **C**: centered
<h3>4: Center frequency shift</h3>
<h3>A.4: Center frequency shift</h3>
This is the shift of the channel center frequency from the device center frequency. Its value is driven by the device sample rate , the decimation (1) and the filter chain sequence (5).
<h3>5: Half-band filter chain sequence</h3>
<h3>A.5: Absolute or relative frequency scale display</h3>
Toggles channel spectrum (B) absolute or relative (to the center) frequency scale display
<h3>A.6: Half-band filter chain sequence</h3>
The slider moves the channel center frequency roughly from the lower to the higher frequency in the device baseband. The number on the right represents the filter sequence as the decimal value of a base 3 number. Each base 3 digit represents the filter type and its sequence from MSB to LSB in the filter chain:
@ -48,10 +61,62 @@ The slider moves the channel center frequency roughly from the lower to the high
- **1**: centered
- **2**: higher half-band
<h3>6: Local Input source index</h2>
<h3>A.7: Global settings</h3>
![Local sink channel plugin GUI Settings](../../../doc/img/LocalSink_A7.png)
<h4>A.7.1: Local Input source index</h4>
This selects the index of the Local Input source where to send the I/Q samples. The list can be refreshed with the next button (7)
<h3>7: Start/stop processing</h2>
<h4>A.7.2: Start/stop processing</h4>
Use this button to start or stop processing.
<h4>A.7.3: DSP functions</h4>
Togles DSP functions (gain and FFT filter)
<h4>A.7.4: Gain</h4>
This is the gain in dB applied to the channel
<h4>A.7.5: FFT filter</h4>
Toggles FFT multiband filter
<h4>A.7.6: FFT filter size</h4>
This is the FFT size of the multiband FFT filter
<h4>A.7.7: FFT filter window</h4>
This is the window type applied to the FFT filter
<h4>A.7.8: Reverse filter bands</h4>
When engaged the FFT filter bands are defined as reject bands instead of pass bands
<h3>A.8: FFT band index</h3>
FFT band selection. Index is displayed in (A.10)
<h3>A.9: FFT band add/delete</h3>
Add (`+`) new band or remove (`-`) selected band
<h3>A.10: Current FFT band index</h3>
Displays the index of the selected FFT band. Displays "0" if no FFT bands are available.
<h3>A.11: FFT band lower frequency relative position</h3>
This is the relative position to the center of the passband of the lower bound of the FFT band. The actual frequency shift from center is displayed on the right.
<h3>A.12: FFT band relative bandwidth or higher boumd</h3>
This is the relative badnwidth of the FFT band. The value displayed on the right is either the bandwidth or the higher frequency band depending on the (A.13) button setting.
<h3>A.13: Toggle bandwidth or higher frequency bound</h3>
Toggles display on (A.12)

Wyświetl plik

@ -5541,6 +5541,20 @@ margin-bottom: 20px;
}
},
"description" : "FCDPro"
};
defs.FFTBand = {
"properties" : {
"fstart" : {
"type" : "number",
"format" : "float",
"description" : "start frequency ratio [-0.5, 0.5]"
},
"bandwidth" : {
"type" : "number",
"format" : "float"
}
},
"description" : "FFT filter band definition"
};
defs.Feature = {
"required" : [ "id", "index", "title", "uid" ],
@ -8229,7 +8243,36 @@ margin-bottom: 20px;
},
"play" : {
"type" : "integer",
"description" : "boolean (1 to play, 0 to stop)"
"description" : "Run samples transfer\n * 0 - stop\n * 1 - run\n"
},
"dsp" : {
"type" : "integer",
"description" : "Activate DSP\n * 0 - Skip DSP functions\n * 1 - Run DSP functions\n"
},
"gaindB" : {
"type" : "integer",
"description" : "Gain in dB."
},
"fftOn" : {
"type" : "integer",
"description" : "Activate FFT multiband filter\n * 0 - do not run flter\n * 1 - run filter\n"
},
"log2FFT" : {
"type" : "integer",
"description" : "log2 of FFT size."
},
"fftWindow" : {
"type" : "integer",
"description" : "FFT window type\n * 0 - Bartlett\n * 1 - Blackman-Harris\n * 2 - Flat top\n * 3 - Hamming\n * 4 - Hanning\n * 5 - Rectangle\n * 6 - Kaiser\n * 7 - Blackman\n * 8 - Blackman-Harris (7th order)\n"
},
"fftBands" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/FFTBand"
}
},
"reverseFilter" : {
"type" : "integer"
},
"streamIndex" : {
"type" : "integer",
@ -56737,7 +56780,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2022-11-30T21:42:22.227+01:00
Generated 2022-12-16T06:50:35.932+01:00
</div>
</div>
</div>

Wyświetl plik

@ -13,8 +13,51 @@ LocalSinkSettings:
filterChainHash:
type: integer
play:
description: boolean (1 to play, 0 to stop)
type: integer
description: >
Run samples transfer
* 0 - stop
* 1 - run
dsp:
type: integer
description: >
Activate DSP
* 0 - Skip DSP functions
* 1 - Run DSP functions
gaindB:
description: Gain in dB.
type: integer
fftOn:
type: integer
description: >
Activate FFT multiband filter
* 0 - do not run flter
* 1 - run filter
log2FFT:
description: log2 of FFT size.
type: integer
fftWindow:
type: integer
description: >
FFT window type
* 0 - Bartlett
* 1 - Blackman-Harris
* 2 - Flat top
* 3 - Hamming
* 4 - Hanning
* 5 - Rectangle
* 6 - Kaiser
* 7 - Blackman
* 8 - Blackman-Harris (7th order)
fftBands:
type: array
items:
$ref: "/doc/swagger/include/LocalSink.yaml#/FFTBand"
reverseFilter:
type: integer
descrption: >
* 0 - band definitions are bandpass
* 1 - band definitions are band reject
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer
@ -33,3 +76,16 @@ LocalSinkSettings:
$ref: "/doc/swagger/include/ChannelMarker.yaml#/ChannelMarker"
rollupState:
$ref: "/doc/swagger/include/RollupState.yaml#/RollupState"
FFTBand:
description: FFT filter band definition
properties:
fstart:
type: number
format: float
description: start frequency ratio [-0.5, 0.5]
bandwidth:
type: number
format: float
desctiption: bandwidth ratio [0.0, 1.0]

Wyświetl plik

@ -4403,7 +4403,9 @@ bool WebAPIRequestMapper::getChannelSettings(
{
QJsonObject settingsJsonObject = channelSettingsJson[channelSettingsKey].toObject();
extractKeys(settingsJsonObject, channelSettingsKeys);
qDebug() << "WebAPIRequestMapper::getChannelSettings: channelSettingsKeys: " << channelSettingsKeys;
qDebug() << "WebAPIRequestMapper::getChannelSettings:"
<< " channelSettingsKey: " << channelSettingsKey
<< " channelSettingsKeys: " << channelSettingsKeys;
if (channelSettingsKey == "ADSBDemodSettings")
{
@ -4559,6 +4561,7 @@ bool WebAPIRequestMapper::getChannelSettings(
else if (channelSettingsKey == "LocalSinkSettings")
{
channelSettings->setLocalSinkSettings(new SWGSDRangel::SWGLocalSinkSettings());
channelSettings->getLocalSinkSettings()->init(); // contains a QList
channelSettings->getLocalSinkSettings()->fromJsonObject(settingsJsonObject);
}
else if (channelSettingsKey == "LocalSourceSettings")

Wyświetl plik

@ -13,8 +13,51 @@ LocalSinkSettings:
filterChainHash:
type: integer
play:
description: boolean (1 to play, 0 to stop)
type: integer
description: >
Run samples transfer
* 0 - stop
* 1 - run
dsp:
type: integer
description: >
Activate DSP
* 0 - Skip DSP functions
* 1 - Run DSP functions
gaindB:
description: Gain in dB.
type: integer
fftOn:
type: integer
description: >
Activate FFT multiband filter
* 0 - do not run flter
* 1 - run filter
log2FFT:
description: log2 of FFT size.
type: integer
fftWindow:
type: integer
description: >
FFT window type
* 0 - Bartlett
* 1 - Blackman-Harris
* 2 - Flat top
* 3 - Hamming
* 4 - Hanning
* 5 - Rectangle
* 6 - Kaiser
* 7 - Blackman
* 8 - Blackman-Harris (7th order)
fftBands:
type: array
items:
$ref: "http://swgserver:8081/api/swagger/include/LocalSink.yaml#/FFTBand"
reverseFilter:
type: integer
descrption: >
* 0 - band definitions are bandpass
* 1 - band definitions are band reject
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer
@ -33,3 +76,16 @@ LocalSinkSettings:
$ref: "http://swgserver:8081/api/swagger/include/ChannelMarker.yaml#/ChannelMarker"
rollupState:
$ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState"
FFTBand:
description: FFT filter band definition
properties:
fstart:
type: number
format: float
description: start frequency ratio [-0.5, 0.5]
bandwidth:
type: number
format: float
desctiption: bandwidth ratio [0.0, 1.0]

Wyświetl plik

@ -5541,6 +5541,20 @@ margin-bottom: 20px;
}
},
"description" : "FCDPro"
};
defs.FFTBand = {
"properties" : {
"fstart" : {
"type" : "number",
"format" : "float",
"description" : "start frequency ratio [-0.5, 0.5]"
},
"bandwidth" : {
"type" : "number",
"format" : "float"
}
},
"description" : "FFT filter band definition"
};
defs.Feature = {
"required" : [ "id", "index", "title", "uid" ],
@ -8229,7 +8243,36 @@ margin-bottom: 20px;
},
"play" : {
"type" : "integer",
"description" : "boolean (1 to play, 0 to stop)"
"description" : "Run samples transfer\n * 0 - stop\n * 1 - run\n"
},
"dsp" : {
"type" : "integer",
"description" : "Activate DSP\n * 0 - Skip DSP functions\n * 1 - Run DSP functions\n"
},
"gaindB" : {
"type" : "integer",
"description" : "Gain in dB."
},
"fftOn" : {
"type" : "integer",
"description" : "Activate FFT multiband filter\n * 0 - do not run flter\n * 1 - run filter\n"
},
"log2FFT" : {
"type" : "integer",
"description" : "log2 of FFT size."
},
"fftWindow" : {
"type" : "integer",
"description" : "FFT window type\n * 0 - Bartlett\n * 1 - Blackman-Harris\n * 2 - Flat top\n * 3 - Hamming\n * 4 - Hanning\n * 5 - Rectangle\n * 6 - Kaiser\n * 7 - Blackman\n * 8 - Blackman-Harris (7th order)\n"
},
"fftBands" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/FFTBand"
}
},
"reverseFilter" : {
"type" : "integer"
},
"streamIndex" : {
"type" : "integer",
@ -56737,7 +56780,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2022-11-30T21:42:22.227+01:00
Generated 2022-12-16T06:50:35.932+01:00
</div>
</div>
</div>

Wyświetl plik

@ -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 "SWGFFTBand.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGFFTBand::SWGFFTBand(QString* json) {
init();
this->fromJson(*json);
}
SWGFFTBand::SWGFFTBand() {
fstart = 0.0f;
m_fstart_isSet = false;
bandwidth = 0.0f;
m_bandwidth_isSet = false;
}
SWGFFTBand::~SWGFFTBand() {
this->cleanup();
}
void
SWGFFTBand::init() {
fstart = 0.0f;
m_fstart_isSet = false;
bandwidth = 0.0f;
m_bandwidth_isSet = false;
}
void
SWGFFTBand::cleanup() {
}
SWGFFTBand*
SWGFFTBand::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGFFTBand::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&fstart, pJson["fstart"], "float", "");
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "float", "");
}
QString
SWGFFTBand::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGFFTBand::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_fstart_isSet){
obj->insert("fstart", QJsonValue(fstart));
}
if(m_bandwidth_isSet){
obj->insert("bandwidth", QJsonValue(bandwidth));
}
return obj;
}
float
SWGFFTBand::getFstart() {
return fstart;
}
void
SWGFFTBand::setFstart(float fstart) {
this->fstart = fstart;
this->m_fstart_isSet = true;
}
float
SWGFFTBand::getBandwidth() {
return bandwidth;
}
void
SWGFFTBand::setBandwidth(float bandwidth) {
this->bandwidth = bandwidth;
this->m_bandwidth_isSet = true;
}
bool
SWGFFTBand::isSet(){
bool isObjectUpdated = false;
do{
if(m_fstart_isSet){
isObjectUpdated = true; break;
}
if(m_bandwidth_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

Wyświetl plik

@ -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.
*/
/*
* SWGFFTBand.h
*
* FFT filter band definition
*/
#ifndef SWGFFTBand_H_
#define SWGFFTBand_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGFFTBand: public SWGObject {
public:
SWGFFTBand();
SWGFFTBand(QString* json);
virtual ~SWGFFTBand();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGFFTBand* fromJson(QString &jsonString) override;
float getFstart();
void setFstart(float fstart);
float getBandwidth();
void setBandwidth(float bandwidth);
virtual bool isSet() override;
private:
float fstart;
bool m_fstart_isSet;
float bandwidth;
bool m_bandwidth_isSet;
};
}
#endif /* SWGFFTBand_H_ */

Wyświetl plik

@ -40,6 +40,20 @@ SWGLocalSinkSettings::SWGLocalSinkSettings() {
m_filter_chain_hash_isSet = false;
play = 0;
m_play_isSet = false;
dsp = 0;
m_dsp_isSet = false;
gaind_b = 0;
m_gaind_b_isSet = false;
fft_on = 0;
m_fft_on_isSet = false;
log2_fft = 0;
m_log2_fft_isSet = false;
fft_window = 0;
m_fft_window_isSet = false;
fft_bands = nullptr;
m_fft_bands_isSet = false;
reverse_filter = 0;
m_reverse_filter_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
@ -76,6 +90,20 @@ SWGLocalSinkSettings::init() {
m_filter_chain_hash_isSet = false;
play = 0;
m_play_isSet = false;
dsp = 0;
m_dsp_isSet = false;
gaind_b = 0;
m_gaind_b_isSet = false;
fft_on = 0;
m_fft_on_isSet = false;
log2_fft = 0;
m_log2_fft_isSet = false;
fft_window = 0;
m_fft_window_isSet = false;
fft_bands = new QList<SWGFFTBand*>();
m_fft_bands_isSet = false;
reverse_filter = 0;
m_reverse_filter_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
@ -106,6 +134,19 @@ SWGLocalSinkSettings::cleanup() {
if(fft_bands != nullptr) {
auto arr = fft_bands;
for(auto o: *arr) {
delete o;
}
delete fft_bands;
}
if(reverse_api_address != nullptr) {
delete reverse_api_address;
}
@ -143,6 +184,20 @@ SWGLocalSinkSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&play, pJson["play"], "qint32", "");
::SWGSDRangel::setValue(&dsp, pJson["dsp"], "qint32", "");
::SWGSDRangel::setValue(&gaind_b, pJson["gaindB"], "qint32", "");
::SWGSDRangel::setValue(&fft_on, pJson["fftOn"], "qint32", "");
::SWGSDRangel::setValue(&log2_fft, pJson["log2FFT"], "qint32", "");
::SWGSDRangel::setValue(&fft_window, pJson["fftWindow"], "qint32", "");
::SWGSDRangel::setValue(&fft_bands, pJson["fftBands"], "QList", "SWGFFTBand");
::SWGSDRangel::setValue(&reverse_filter, pJson["reverseFilter"], "qint32", "");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
@ -193,6 +248,27 @@ SWGLocalSinkSettings::asJsonObject() {
if(m_play_isSet){
obj->insert("play", QJsonValue(play));
}
if(m_dsp_isSet){
obj->insert("dsp", QJsonValue(dsp));
}
if(m_gaind_b_isSet){
obj->insert("gaindB", QJsonValue(gaind_b));
}
if(m_fft_on_isSet){
obj->insert("fftOn", QJsonValue(fft_on));
}
if(m_log2_fft_isSet){
obj->insert("log2FFT", QJsonValue(log2_fft));
}
if(m_fft_window_isSet){
obj->insert("fftWindow", QJsonValue(fft_window));
}
if(fft_bands && fft_bands->size() > 0){
toJsonArray((QList<void*>*)fft_bands, obj, "fftBands", "SWGFFTBand");
}
if(m_reverse_filter_isSet){
obj->insert("reverseFilter", QJsonValue(reverse_filter));
}
if(m_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index));
}
@ -281,6 +357,76 @@ SWGLocalSinkSettings::setPlay(qint32 play) {
this->m_play_isSet = true;
}
qint32
SWGLocalSinkSettings::getDsp() {
return dsp;
}
void
SWGLocalSinkSettings::setDsp(qint32 dsp) {
this->dsp = dsp;
this->m_dsp_isSet = true;
}
qint32
SWGLocalSinkSettings::getGaindB() {
return gaind_b;
}
void
SWGLocalSinkSettings::setGaindB(qint32 gaind_b) {
this->gaind_b = gaind_b;
this->m_gaind_b_isSet = true;
}
qint32
SWGLocalSinkSettings::getFftOn() {
return fft_on;
}
void
SWGLocalSinkSettings::setFftOn(qint32 fft_on) {
this->fft_on = fft_on;
this->m_fft_on_isSet = true;
}
qint32
SWGLocalSinkSettings::getLog2Fft() {
return log2_fft;
}
void
SWGLocalSinkSettings::setLog2Fft(qint32 log2_fft) {
this->log2_fft = log2_fft;
this->m_log2_fft_isSet = true;
}
qint32
SWGLocalSinkSettings::getFftWindow() {
return fft_window;
}
void
SWGLocalSinkSettings::setFftWindow(qint32 fft_window) {
this->fft_window = fft_window;
this->m_fft_window_isSet = true;
}
QList<SWGFFTBand*>*
SWGLocalSinkSettings::getFftBands() {
return fft_bands;
}
void
SWGLocalSinkSettings::setFftBands(QList<SWGFFTBand*>* fft_bands) {
this->fft_bands = fft_bands;
this->m_fft_bands_isSet = true;
}
qint32
SWGLocalSinkSettings::getReverseFilter() {
return reverse_filter;
}
void
SWGLocalSinkSettings::setReverseFilter(qint32 reverse_filter) {
this->reverse_filter = reverse_filter;
this->m_reverse_filter_isSet = true;
}
qint32
SWGLocalSinkSettings::getStreamIndex() {
return stream_index;
@ -384,6 +530,27 @@ SWGLocalSinkSettings::isSet(){
if(m_play_isSet){
isObjectUpdated = true; break;
}
if(m_dsp_isSet){
isObjectUpdated = true; break;
}
if(m_gaind_b_isSet){
isObjectUpdated = true; break;
}
if(m_fft_on_isSet){
isObjectUpdated = true; break;
}
if(m_log2_fft_isSet){
isObjectUpdated = true; break;
}
if(m_fft_window_isSet){
isObjectUpdated = true; break;
}
if(fft_bands && (fft_bands->size() > 0)){
isObjectUpdated = true; break;
}
if(m_reverse_filter_isSet){
isObjectUpdated = true; break;
}
if(m_stream_index_isSet){
isObjectUpdated = true; break;
}

Wyświetl plik

@ -23,7 +23,9 @@
#include "SWGChannelMarker.h"
#include "SWGFFTBand.h"
#include "SWGRollupState.h"
#include <QList>
#include <QString>
#include "SWGObject.h"
@ -62,6 +64,27 @@ public:
qint32 getPlay();
void setPlay(qint32 play);
qint32 getDsp();
void setDsp(qint32 dsp);
qint32 getGaindB();
void setGaindB(qint32 gaind_b);
qint32 getFftOn();
void setFftOn(qint32 fft_on);
qint32 getLog2Fft();
void setLog2Fft(qint32 log2_fft);
qint32 getFftWindow();
void setFftWindow(qint32 fft_window);
QList<SWGFFTBand*>* getFftBands();
void setFftBands(QList<SWGFFTBand*>* fft_bands);
qint32 getReverseFilter();
void setReverseFilter(qint32 reverse_filter);
qint32 getStreamIndex();
void setStreamIndex(qint32 stream_index);
@ -108,6 +131,27 @@ private:
qint32 play;
bool m_play_isSet;
qint32 dsp;
bool m_dsp_isSet;
qint32 gaind_b;
bool m_gaind_b_isSet;
qint32 fft_on;
bool m_fft_on_isSet;
qint32 log2_fft;
bool m_log2_fft_isSet;
qint32 fft_window;
bool m_fft_window_isSet;
QList<SWGFFTBand*>* fft_bands;
bool m_fft_bands_isSet;
qint32 reverse_filter;
bool m_reverse_filter_isSet;
qint32 stream_index;
bool m_stream_index_isSet;

Wyświetl plik

@ -113,6 +113,7 @@
#include "SWGErrorResponse.h"
#include "SWGFCDProPlusSettings.h"
#include "SWGFCDProSettings.h"
#include "SWGFFTBand.h"
#include "SWGFeature.h"
#include "SWGFeatureActions.h"
#include "SWGFeatureConfig.h"
@ -837,6 +838,11 @@ namespace SWGSDRangel {
obj->init();
return obj;
}
if(QString("SWGFFTBand").compare(type) == 0) {
SWGFFTBand *obj = new SWGFFTBand();
obj->init();
return obj;
}
if(QString("SWGFeature").compare(type) == 0) {
SWGFeature *obj = new SWGFeature();
obj->init();