1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Swagger changes

This commit is contained in:
f4exb 2022-05-19 03:15:55 +02:00
parent a10fe91c5d
commit cce023bf56
11 changed files with 206 additions and 60 deletions

View File

@ -221,15 +221,24 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force)
QList<QString> reverseAPIKeys;
if((m_settings.m_inputFrequencyOffset != settings.m_inputFrequencyOffset) || force) {
if ((m_settings.m_inputFrequencyOffset != settings.m_inputFrequencyOffset) || force) {
reverseAPIKeys.append("inputFrequencyOffset");
}
if((m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth != settings.m_filterBank[settings.m_filterIndex].m_rfBandwidth) || force) {
if ((m_settings.m_filterIndex != settings.m_filterIndex) || force) {
reverseAPIKeys.append("filterIndex");
}
if ((m_settings.m_filterBank[m_settings.m_filterIndex].m_spanLog2 != settings.m_filterBank[settings.m_filterIndex].m_spanLog2) || force) {
reverseAPIKeys.append("spanLog2");
}
if ((m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth != settings.m_filterBank[settings.m_filterIndex].m_rfBandwidth) || force) {
reverseAPIKeys.append("rfBandwidth");
}
if((m_settings.m_filterBank[m_settings.m_filterIndex].m_lowCutoff != settings.m_filterBank[settings.m_filterIndex].m_lowCutoff) || force) {
if ((m_settings.m_filterBank[m_settings.m_filterIndex].m_lowCutoff != settings.m_filterBank[settings.m_filterIndex].m_lowCutoff) || force) {
reverseAPIKeys.append("lowCutoff");
}
if ((m_settings.m_filterBank[m_settings.m_filterIndex].m_fftWindow != settings.m_filterBank[settings.m_filterIndex].m_fftWindow) || force) {
reverseAPIKeys.append("fftWindow");
}
if ((m_settings.m_volume != settings.m_volume) || force) {
reverseAPIKeys.append("volume");
}
@ -248,9 +257,6 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force)
if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force) {
reverseAPIKeys.append("audioDeviceName");
}
if ((m_settings.m_filterBank[m_settings.m_filterIndex].m_spanLog2 != settings.m_filterBank[settings.m_filterIndex].m_spanLog2) || force) {
reverseAPIKeys.append("spanLog2");
}
if ((m_settings.m_audioBinaural != settings.m_audioBinaural) || force) {
reverseAPIKeys.append("audioBinaural");
}
@ -412,18 +418,24 @@ void SSBDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("inputFrequencyOffset")) {
settings.m_inputFrequencyOffset = response.getSsbDemodSettings()->getInputFrequencyOffset();
}
if (channelSettingsKeys.contains("filterIndex")) {
settings.m_filterIndex = response.getSsbDemodSettings()->getFilterIndex();
}
if (channelSettingsKeys.contains("spanLog2")) {
settings.m_filterBank[settings.m_filterIndex].m_spanLog2 = response.getSsbDemodSettings()->getSpanLog2();
}
if (channelSettingsKeys.contains("rfBandwidth")) {
settings.m_filterBank[settings.m_filterIndex].m_rfBandwidth = response.getSsbDemodSettings()->getRfBandwidth();
}
if (channelSettingsKeys.contains("lowCutoff")) {
settings.m_filterBank[settings.m_filterIndex].m_lowCutoff = response.getSsbDemodSettings()->getLowCutoff();
}
if (channelSettingsKeys.contains("fftWimdow")) {
settings.m_filterBank[settings.m_filterIndex].m_fftWindow = (FFTWindow::Function) response.getSsbDemodSettings()->getFftWindow();
}
if (channelSettingsKeys.contains("volume")) {
settings.m_volume = response.getSsbDemodSettings()->getVolume();
}
if (channelSettingsKeys.contains("spanLog2")) {
settings.m_filterBank[settings.m_filterIndex].m_spanLog2 = response.getSsbDemodSettings()->getSpanLog2();
}
if (channelSettingsKeys.contains("audioBinaural")) {
settings.m_audioBinaural = response.getSsbDemodSettings()->getAudioBinaural() != 0;
}
@ -504,10 +516,12 @@ void SSBDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
{
response.getSsbDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
response.getSsbDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getSsbDemodSettings()->setFilterIndex(settings.m_filterIndex);
response.getSsbDemodSettings()->setSpanLog2(settings.m_filterBank[settings.m_filterIndex].m_spanLog2);
response.getSsbDemodSettings()->setRfBandwidth(settings.m_filterBank[settings.m_filterIndex].m_rfBandwidth);
response.getSsbDemodSettings()->setLowCutoff(settings.m_filterBank[settings.m_filterIndex].m_lowCutoff);
response.getSsbDemodSettings()->setFftWindow((int) settings.m_filterBank[settings.m_filterIndex].m_fftWindow);
response.getSsbDemodSettings()->setVolume(settings.m_volume);
response.getSsbDemodSettings()->setSpanLog2(settings.m_filterBank[settings.m_filterIndex].m_spanLog2);
response.getSsbDemodSettings()->setAudioBinaural(settings.m_audioBinaural ? 1 : 0);
response.getSsbDemodSettings()->setAudioFlipChannels(settings.m_audioFlipChannels ? 1 : 0);
response.getSsbDemodSettings()->setDsb(settings.m_dsb ? 1 : 0);
@ -670,18 +684,24 @@ void SSBDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("inputFrequencyOffset") || force) {
swgSSBDemodSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
}
if (channelSettingsKeys.contains("filteIndex") || force) {
swgSSBDemodSettings->setFilterIndex(settings.m_filterIndex);
}
if (channelSettingsKeys.contains("spanLog2") || force) {
swgSSBDemodSettings->setSpanLog2(settings.m_filterBank[settings.m_filterIndex].m_spanLog2);
}
if (channelSettingsKeys.contains("rfBandwidth") || force) {
swgSSBDemodSettings->setRfBandwidth(settings.m_filterBank[settings.m_filterIndex].m_rfBandwidth);
}
if (channelSettingsKeys.contains("lowCutoff") || force) {
swgSSBDemodSettings->setLowCutoff(settings.m_filterBank[settings.m_filterIndex].m_lowCutoff);
}
if (channelSettingsKeys.contains("fftWindow") || force) {
swgSSBDemodSettings->setLowCutoff(settings.m_filterBank[settings.m_filterIndex].m_fftWindow);
}
if (channelSettingsKeys.contains("volume") || force) {
swgSSBDemodSettings->setVolume(settings.m_volume);
}
if (channelSettingsKeys.contains("spanLog2") || force) {
swgSSBDemodSettings->setSpanLog2(settings.m_filterBank[settings.m_filterIndex].m_spanLog2);
}
if (channelSettingsKeys.contains("audioBinaural") || force) {
swgSSBDemodSettings->setAudioBinaural(settings.m_audioBinaural ? 1 : 0);
}

View File

@ -3680,7 +3680,7 @@ margin-bottom: 20px;
},
"fftWindow" : {
"type" : "integer",
"description" : "FFT Window index (FFTWindow::Function):\n * 0 - Bartlett\n * 1 - BlackmanHarris\n * 2 - Flattop\n * 3 - Hamming\n * 4 - Hanning\n * 5 - Rectangle\n * 6 - Kaiser\n"
"description" : "FFT Window index (FFTWindow::Function):\n * 0 - Bartlett\n * 1 - Blackman-Harris 4 term\n * 2 - Flattop\n * 3 - Hamming\n * 4 - Hanning\n * 5 - Rectangle\n * 6 - Kaiser\n * 7 - Blackman 3 term\n * 8 - Blackman-Harris 7 term\n"
},
"codingScheme" : {
"type" : "integer",
@ -6242,7 +6242,7 @@ margin-bottom: 20px;
},
"fftWindow" : {
"type" : "integer",
"description" : "See FFTWindow"
"description" : "FFT Window index (FFTWindow::Function):\n * 0 - Bartlett\n * 1 - Blackman-Harris 4 term\n * 2 - Flattop\n * 3 - Hamming\n * 4 - Hanning\n * 5 - Rectangle\n * 6 - Kaiser\n * 7 - Blackman 3 term\n * 8 - Blackman-Harris 7 term\n"
},
"refLevel" : {
"type" : "number",
@ -11188,6 +11188,12 @@ margin-bottom: 20px;
"type" : "integer",
"format" : "int64"
},
"filterIndex" : {
"type" : "integer"
},
"spanLog2" : {
"type" : "integer"
},
"rfBandwidth" : {
"type" : "number",
"format" : "float"
@ -11196,13 +11202,14 @@ margin-bottom: 20px;
"type" : "number",
"format" : "float"
},
"fftWindow" : {
"type" : "integer",
"description" : "FFT Window index (FFTWindow::Function):\n * 0 - Bartlett\n * 1 - Blackman-Harris 4 term\n * 2 - Flattop\n * 3 - Hamming\n * 4 - Hanning\n * 5 - Rectangle\n * 6 - Kaiser\n * 7 - Blackman 3 term\n * 8 - Blackman-Harris 7 term\n"
},
"volume" : {
"type" : "number",
"format" : "float"
},
"spanLog2" : {
"type" : "integer"
},
"audioBinaural" : {
"type" : "integer",
"description" : "Audio binaural mode (1 if active else 0)"
@ -59691,7 +59698,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2022-05-16T19:55:17.622+02:00
Generated 2022-05-19T00:27:23.053+02:00
</div>
</div>
</div>

View File

@ -45,12 +45,14 @@ ChirpChatDemodSettings:
description: >
FFT Window index (FFTWindow::Function):
* 0 - Bartlett
* 1 - BlackmanHarris
* 1 - Blackman-Harris 4 term
* 2 - Flattop
* 3 - Hamming
* 4 - Hanning
* 5 - Rectangle
* 6 - Kaiser
* 7 - Blackman 3 term
* 8 - Blackman-Harris 7 term
codingScheme:
type: integer
description: >

View File

@ -85,8 +85,18 @@ GLSpectrum:
fftOverlap:
type: integer
fftWindow:
description: See FFTWindow
type: integer
description: >
FFT Window index (FFTWindow::Function):
* 0 - Bartlett
* 1 - Blackman-Harris 4 term
* 2 - Flattop
* 3 - Hamming
* 4 - Hanning
* 5 - Rectangle
* 6 - Kaiser
* 7 - Blackman 3 term
* 8 - Blackman-Harris 7 term
refLevel:
type: number
format: float

View File

@ -4,17 +4,32 @@ SSBDemodSettings:
inputFrequencyOffset:
type: integer
format: int64
filterIndex:
type: integer
spanLog2:
type: integer
rfBandwidth:
type: number
format: float
lowCutoff:
type: number
format: float
fftWindow:
type: integer
description: >
FFT Window index (FFTWindow::Function):
* 0 - Bartlett
* 1 - Blackman-Harris 4 term
* 2 - Flattop
* 3 - Hamming
* 4 - Hanning
* 5 - Rectangle
* 6 - Kaiser
* 7 - Blackman 3 term
* 8 - Blackman-Harris 7 term
volume:
type: number
format: float
spanLog2:
type: integer
audioBinaural:
description: Audio binaural mode (1 if active else 0)
type: integer

View File

@ -45,12 +45,14 @@ ChirpChatDemodSettings:
description: >
FFT Window index (FFTWindow::Function):
* 0 - Bartlett
* 1 - BlackmanHarris
* 1 - Blackman-Harris 4 term
* 2 - Flattop
* 3 - Hamming
* 4 - Hanning
* 5 - Rectangle
* 6 - Kaiser
* 7 - Blackman 3 term
* 8 - Blackman-Harris 7 term
codingScheme:
type: integer
description: >

View File

@ -85,8 +85,18 @@ GLSpectrum:
fftOverlap:
type: integer
fftWindow:
description: See FFTWindow
type: integer
description: >
FFT Window index (FFTWindow::Function):
* 0 - Bartlett
* 1 - Blackman-Harris 4 term
* 2 - Flattop
* 3 - Hamming
* 4 - Hanning
* 5 - Rectangle
* 6 - Kaiser
* 7 - Blackman 3 term
* 8 - Blackman-Harris 7 term
refLevel:
type: number
format: float

View File

@ -4,17 +4,32 @@ SSBDemodSettings:
inputFrequencyOffset:
type: integer
format: int64
filterIndex:
type: integer
spanLog2:
type: integer
rfBandwidth:
type: number
format: float
lowCutoff:
type: number
format: float
fftWindow:
type: integer
description: >
FFT Window index (FFTWindow::Function):
* 0 - Bartlett
* 1 - Blackman-Harris 4 term
* 2 - Flattop
* 3 - Hamming
* 4 - Hanning
* 5 - Rectangle
* 6 - Kaiser
* 7 - Blackman 3 term
* 8 - Blackman-Harris 7 term
volume:
type: number
format: float
spanLog2:
type: integer
audioBinaural:
description: Audio binaural mode (1 if active else 0)
type: integer

View File

@ -3680,7 +3680,7 @@ margin-bottom: 20px;
},
"fftWindow" : {
"type" : "integer",
"description" : "FFT Window index (FFTWindow::Function):\n * 0 - Bartlett\n * 1 - BlackmanHarris\n * 2 - Flattop\n * 3 - Hamming\n * 4 - Hanning\n * 5 - Rectangle\n * 6 - Kaiser\n"
"description" : "FFT Window index (FFTWindow::Function):\n * 0 - Bartlett\n * 1 - Blackman-Harris 4 term\n * 2 - Flattop\n * 3 - Hamming\n * 4 - Hanning\n * 5 - Rectangle\n * 6 - Kaiser\n * 7 - Blackman 3 term\n * 8 - Blackman-Harris 7 term\n"
},
"codingScheme" : {
"type" : "integer",
@ -6242,7 +6242,7 @@ margin-bottom: 20px;
},
"fftWindow" : {
"type" : "integer",
"description" : "See FFTWindow"
"description" : "FFT Window index (FFTWindow::Function):\n * 0 - Bartlett\n * 1 - Blackman-Harris 4 term\n * 2 - Flattop\n * 3 - Hamming\n * 4 - Hanning\n * 5 - Rectangle\n * 6 - Kaiser\n * 7 - Blackman 3 term\n * 8 - Blackman-Harris 7 term\n"
},
"refLevel" : {
"type" : "number",
@ -11188,6 +11188,12 @@ margin-bottom: 20px;
"type" : "integer",
"format" : "int64"
},
"filterIndex" : {
"type" : "integer"
},
"spanLog2" : {
"type" : "integer"
},
"rfBandwidth" : {
"type" : "number",
"format" : "float"
@ -11196,13 +11202,14 @@ margin-bottom: 20px;
"type" : "number",
"format" : "float"
},
"fftWindow" : {
"type" : "integer",
"description" : "FFT Window index (FFTWindow::Function):\n * 0 - Bartlett\n * 1 - Blackman-Harris 4 term\n * 2 - Flattop\n * 3 - Hamming\n * 4 - Hanning\n * 5 - Rectangle\n * 6 - Kaiser\n * 7 - Blackman 3 term\n * 8 - Blackman-Harris 7 term\n"
},
"volume" : {
"type" : "number",
"format" : "float"
},
"spanLog2" : {
"type" : "integer"
},
"audioBinaural" : {
"type" : "integer",
"description" : "Audio binaural mode (1 if active else 0)"
@ -59691,7 +59698,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2022-05-16T19:55:17.622+02:00
Generated 2022-05-19T00:27:23.053+02:00
</div>
</div>
</div>

View File

@ -30,14 +30,18 @@ SWGSSBDemodSettings::SWGSSBDemodSettings(QString* json) {
SWGSSBDemodSettings::SWGSSBDemodSettings() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
filter_index = 0;
m_filter_index_isSet = false;
span_log2 = 0;
m_span_log2_isSet = false;
rf_bandwidth = 0.0f;
m_rf_bandwidth_isSet = false;
low_cutoff = 0.0f;
m_low_cutoff_isSet = false;
fft_window = 0;
m_fft_window_isSet = false;
volume = 0.0f;
m_volume_isSet = false;
span_log2 = 0;
m_span_log2_isSet = false;
audio_binaural = 0;
m_audio_binaural_isSet = false;
audio_flip_channels = 0;
@ -90,14 +94,18 @@ void
SWGSSBDemodSettings::init() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
filter_index = 0;
m_filter_index_isSet = false;
span_log2 = 0;
m_span_log2_isSet = false;
rf_bandwidth = 0.0f;
m_rf_bandwidth_isSet = false;
low_cutoff = 0.0f;
m_low_cutoff_isSet = false;
fft_window = 0;
m_fft_window_isSet = false;
volume = 0.0f;
m_volume_isSet = false;
span_log2 = 0;
m_span_log2_isSet = false;
audio_binaural = 0;
m_audio_binaural_isSet = false;
audio_flip_channels = 0;
@ -159,6 +167,8 @@ SWGSSBDemodSettings::cleanup() {
if(title != nullptr) {
delete title;
}
@ -197,13 +207,17 @@ void
SWGSSBDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
::SWGSDRangel::setValue(&filter_index, pJson["filterIndex"], "qint32", "");
::SWGSDRangel::setValue(&span_log2, pJson["spanLog2"], "qint32", "");
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
::SWGSDRangel::setValue(&low_cutoff, pJson["lowCutoff"], "float", "");
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
::SWGSDRangel::setValue(&fft_window, pJson["fftWindow"], "qint32", "");
::SWGSDRangel::setValue(&span_log2, pJson["spanLog2"], "qint32", "");
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
::SWGSDRangel::setValue(&audio_binaural, pJson["audioBinaural"], "qint32", "");
@ -266,18 +280,24 @@ SWGSSBDemodSettings::asJsonObject() {
if(m_input_frequency_offset_isSet){
obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
}
if(m_filter_index_isSet){
obj->insert("filterIndex", QJsonValue(filter_index));
}
if(m_span_log2_isSet){
obj->insert("spanLog2", QJsonValue(span_log2));
}
if(m_rf_bandwidth_isSet){
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
}
if(m_low_cutoff_isSet){
obj->insert("lowCutoff", QJsonValue(low_cutoff));
}
if(m_fft_window_isSet){
obj->insert("fftWindow", QJsonValue(fft_window));
}
if(m_volume_isSet){
obj->insert("volume", QJsonValue(volume));
}
if(m_span_log2_isSet){
obj->insert("spanLog2", QJsonValue(span_log2));
}
if(m_audio_binaural_isSet){
obj->insert("audioBinaural", QJsonValue(audio_binaural));
}
@ -355,6 +375,26 @@ SWGSSBDemodSettings::setInputFrequencyOffset(qint64 input_frequency_offset) {
this->m_input_frequency_offset_isSet = true;
}
qint32
SWGSSBDemodSettings::getFilterIndex() {
return filter_index;
}
void
SWGSSBDemodSettings::setFilterIndex(qint32 filter_index) {
this->filter_index = filter_index;
this->m_filter_index_isSet = true;
}
qint32
SWGSSBDemodSettings::getSpanLog2() {
return span_log2;
}
void
SWGSSBDemodSettings::setSpanLog2(qint32 span_log2) {
this->span_log2 = span_log2;
this->m_span_log2_isSet = true;
}
float
SWGSSBDemodSettings::getRfBandwidth() {
return rf_bandwidth;
@ -375,6 +415,16 @@ SWGSSBDemodSettings::setLowCutoff(float low_cutoff) {
this->m_low_cutoff_isSet = true;
}
qint32
SWGSSBDemodSettings::getFftWindow() {
return fft_window;
}
void
SWGSSBDemodSettings::setFftWindow(qint32 fft_window) {
this->fft_window = fft_window;
this->m_fft_window_isSet = true;
}
float
SWGSSBDemodSettings::getVolume() {
return volume;
@ -385,16 +435,6 @@ SWGSSBDemodSettings::setVolume(float volume) {
this->m_volume_isSet = true;
}
qint32
SWGSSBDemodSettings::getSpanLog2() {
return span_log2;
}
void
SWGSSBDemodSettings::setSpanLog2(qint32 span_log2) {
this->span_log2 = span_log2;
this->m_span_log2_isSet = true;
}
qint32
SWGSSBDemodSettings::getAudioBinaural() {
return audio_binaural;
@ -613,16 +653,22 @@ SWGSSBDemodSettings::isSet(){
if(m_input_frequency_offset_isSet){
isObjectUpdated = true; break;
}
if(m_filter_index_isSet){
isObjectUpdated = true; break;
}
if(m_span_log2_isSet){
isObjectUpdated = true; break;
}
if(m_rf_bandwidth_isSet){
isObjectUpdated = true; break;
}
if(m_low_cutoff_isSet){
isObjectUpdated = true; break;
}
if(m_volume_isSet){
if(m_fft_window_isSet){
isObjectUpdated = true; break;
}
if(m_span_log2_isSet){
if(m_volume_isSet){
isObjectUpdated = true; break;
}
if(m_audio_binaural_isSet){

View File

@ -48,18 +48,24 @@ public:
qint64 getInputFrequencyOffset();
void setInputFrequencyOffset(qint64 input_frequency_offset);
qint32 getFilterIndex();
void setFilterIndex(qint32 filter_index);
qint32 getSpanLog2();
void setSpanLog2(qint32 span_log2);
float getRfBandwidth();
void setRfBandwidth(float rf_bandwidth);
float getLowCutoff();
void setLowCutoff(float low_cutoff);
qint32 getFftWindow();
void setFftWindow(qint32 fft_window);
float getVolume();
void setVolume(float volume);
qint32 getSpanLog2();
void setSpanLog2(qint32 span_log2);
qint32 getAudioBinaural();
void setAudioBinaural(qint32 audio_binaural);
@ -130,18 +136,24 @@ private:
qint64 input_frequency_offset;
bool m_input_frequency_offset_isSet;
qint32 filter_index;
bool m_filter_index_isSet;
qint32 span_log2;
bool m_span_log2_isSet;
float rf_bandwidth;
bool m_rf_bandwidth_isSet;
float low_cutoff;
bool m_low_cutoff_isSet;
qint32 fft_window;
bool m_fft_window_isSet;
float volume;
bool m_volume_isSet;
qint32 span_log2;
bool m_span_log2_isSet;
qint32 audio_binaural;
bool m_audio_binaural_isSet;