diff --git a/doc/img/LocalSink.png b/doc/img/LocalSink.png index dec1912ac..a1ba80f6b 100644 Binary files a/doc/img/LocalSink.png and b/doc/img/LocalSink.png differ diff --git a/doc/img/LocalSink.xcf b/doc/img/LocalSink.xcf index a8e17bdfe..7e466b19e 100644 Binary files a/doc/img/LocalSink.xcf and b/doc/img/LocalSink.xcf differ diff --git a/doc/img/LocalSink.xcf.png b/doc/img/LocalSink.xcf.png new file mode 100644 index 000000000..149358752 Binary files /dev/null and b/doc/img/LocalSink.xcf.png differ diff --git a/doc/img/LocalSink_A.png b/doc/img/LocalSink_A.png new file mode 100644 index 000000000..9c2fd3a3b Binary files /dev/null and b/doc/img/LocalSink_A.png differ diff --git a/doc/img/LocalSink_A.xcf b/doc/img/LocalSink_A.xcf new file mode 100644 index 000000000..0e4f105e0 Binary files /dev/null and b/doc/img/LocalSink_A.xcf differ diff --git a/doc/img/LocalSink_A7.png b/doc/img/LocalSink_A7.png new file mode 100644 index 000000000..ab4551e91 Binary files /dev/null and b/doc/img/LocalSink_A7.png differ diff --git a/doc/img/LocalSink_A7.xcf b/doc/img/LocalSink_A7.xcf new file mode 100644 index 000000000..214d3d0d3 Binary files /dev/null and b/doc/img/LocalSink_A7.xcf differ diff --git a/plugins/channelrx/localsink/localsink.cpp b/plugins/channelrx/localsink/localsink.cpp index 4953c9ace..2a15402d8 100644 --- a/plugins/channelrx/localsink/localsink.cpp +++ b/plugins/channelrx/localsink/localsink.cpp @@ -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 *fftBands = response.getLocalSinkSettings()->getFftBands(); + settings.m_fftBands.clear(); + + for (const auto& fftBand : *fftBands) { + settings.m_fftBands.push_back(std::pair{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()); + } + + 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()); + + 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); } diff --git a/plugins/channelrx/localsink/localsinkgui.cpp b/plugins/channelrx/localsink/localsinkgui.cpp index ae3f2a9af..ff4fa5bec 100644 --- a/plugins/channelrx/localsink/localsinkgui.cpp +++ b/plugins/channelrx/localsink/localsinkgui.cpp @@ -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(); diff --git a/plugins/channelrx/localsink/readme.md b/plugins/channelrx/localsink/readme.md index b01e60972..945fb47ac 100644 --- a/plugins/channelrx/localsink/readme.md +++ b/plugins/channelrx/localsink/readme.md @@ -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) + ⚠ Important warning 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.

Interface

@@ -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) -

1: Decimation factor

+ - A: settings section + - B: channel spectrum display (not detailed here) + +![Local sink channel plugin GUI Settings](../../../doc/img/LocalSink_A.png) + +

A.1: Decimation factor

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). -

2: I/Q stream sample rate

+

A.2: I/Q stream sample rate

This is the sample rate in kS/s of the I/Q stream sent to the Local Input source instance. -

3: Half-band filters chain sequence

+

A.3: Half-band filters chain sequence

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 -

4: Center frequency shift

+

A.4: Center frequency shift

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). -

5: Half-band filter chain sequence

+

A.5: Absolute or relative frequency scale display

+ +Toggles channel spectrum (B) absolute or relative (to the center) frequency scale display + +

A.6: Half-band filter chain sequence

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 -

6: Local Input source index

+

A.7: Global settings

+ +![Local sink channel plugin GUI Settings](../../../doc/img/LocalSink_A7.png) + +

A.7.1: Local Input source index

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) -

7: Start/stop processing

+

A.7.2: Start/stop processing

Use this button to start or stop processing. + +

A.7.3: DSP functions

+ +Togles DSP functions (gain and FFT filter) + +

A.7.4: Gain

+ +This is the gain in dB applied to the channel + +

A.7.5: FFT filter

+ +Toggles FFT multiband filter + +

A.7.6: FFT filter size

+ +This is the FFT size of the multiband FFT filter + +

A.7.7: FFT filter window

+ +This is the window type applied to the FFT filter + +

A.7.8: Reverse filter bands

+ +When engaged the FFT filter bands are defined as reject bands instead of pass bands + +

A.8: FFT band index

+ +FFT band selection. Index is displayed in (A.10) + +

A.9: FFT band add/delete

+ +Add (`+`) new band or remove (`-`) selected band + +

A.10: Current FFT band index

+ +Displays the index of the selected FFT band. Displays "0" if no FFT bands are available. + +

A.11: FFT band lower frequency relative position

+ +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. + +

A.12: FFT band relative bandwidth or higher boumd

+ +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. + +

A.13: Toggle bandwidth or higher frequency bound

+ +Toggles display on (A.12) diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index f39ceafb6..916ef602c 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -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:
- Generated 2022-11-30T21:42:22.227+01:00 + Generated 2022-12-16T06:50:35.932+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/LocalSink.yaml b/sdrbase/resources/webapi/doc/swagger/include/LocalSink.yaml index 0cacb668d..5dedf3436 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/LocalSink.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/LocalSink.yaml @@ -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] diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 2e8dc4f14..e386ba707 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -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") diff --git a/swagger/sdrangel/api/swagger/include/LocalSink.yaml b/swagger/sdrangel/api/swagger/include/LocalSink.yaml index 52261d633..12656f551 100644 --- a/swagger/sdrangel/api/swagger/include/LocalSink.yaml +++ b/swagger/sdrangel/api/swagger/include/LocalSink.yaml @@ -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] diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index f39ceafb6..916ef602c 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -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:
- Generated 2022-11-30T21:42:22.227+01:00 + Generated 2022-12-16T06:50:35.932+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGFFTBand.cpp b/swagger/sdrangel/code/qt5/client/SWGFFTBand.cpp new file mode 100644 index 000000000..060657431 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFFTBand.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 "SWGFFTBand.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +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; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGFFTBand.h b/swagger/sdrangel/code/qt5/client/SWGFFTBand.h new file mode 100644 index 000000000..a8fbe8cf8 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFFTBand.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. + */ + +/* + * SWGFFTBand.h + * + * FFT filter band definition + */ + +#ifndef SWGFFTBand_H_ +#define SWGFFTBand_H_ + +#include + + + +#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_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGLocalSinkSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGLocalSinkSettings.cpp index aef6fa44c..8f696b74e 100644 --- a/swagger/sdrangel/code/qt5/client/SWGLocalSinkSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGLocalSinkSettings.cpp @@ -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(); + 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*)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* +SWGLocalSinkSettings::getFftBands() { + return fft_bands; +} +void +SWGLocalSinkSettings::setFftBands(QList* 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; } diff --git a/swagger/sdrangel/code/qt5/client/SWGLocalSinkSettings.h b/swagger/sdrangel/code/qt5/client/SWGLocalSinkSettings.h index cd62ba7a7..48f4c1edd 100644 --- a/swagger/sdrangel/code/qt5/client/SWGLocalSinkSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGLocalSinkSettings.h @@ -23,7 +23,9 @@ #include "SWGChannelMarker.h" +#include "SWGFFTBand.h" #include "SWGRollupState.h" +#include #include #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* getFftBands(); + void setFftBands(QList* 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* fft_bands; + bool m_fft_bands_isSet; + + qint32 reverse_filter; + bool m_reverse_filter_isSet; + qint32 stream_index; bool m_stream_index_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 22f0dc4cf..f0fa88294 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -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();