mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-11 18:57:11 +01:00
fix some fft sizes not being saved as described in #1396
This commit is contained in:
parent
27072e9fe7
commit
27edc260c9
@ -19,6 +19,7 @@ namespace displaymenu {
|
|||||||
std::string colorMapAuthor = "";
|
std::string colorMapAuthor = "";
|
||||||
int selectedWindow = 0;
|
int selectedWindow = 0;
|
||||||
int fftRate = 20;
|
int fftRate = 20;
|
||||||
|
int fftSizeId = 0;
|
||||||
int uiScaleId = 0;
|
int uiScaleId = 0;
|
||||||
bool restartRequired = false;
|
bool restartRequired = false;
|
||||||
bool fftHold = false;
|
bool fftHold = false;
|
||||||
@ -28,34 +29,9 @@ namespace displaymenu {
|
|||||||
bool snrSmoothing = false;
|
bool snrSmoothing = false;
|
||||||
int snrSmoothingSpeed = 20;
|
int snrSmoothingSpeed = 20;
|
||||||
|
|
||||||
|
OptionList<int, int> fftSizes;
|
||||||
OptionList<float, float> uiScales;
|
OptionList<float, float> uiScales;
|
||||||
|
|
||||||
const int FFTSizes[] = {
|
|
||||||
524288,
|
|
||||||
262144,
|
|
||||||
131072,
|
|
||||||
65536,
|
|
||||||
32768,
|
|
||||||
16384,
|
|
||||||
8192,
|
|
||||||
4096,
|
|
||||||
2048,
|
|
||||||
1024
|
|
||||||
};
|
|
||||||
|
|
||||||
const char* FFTSizesStr = "524288\0"
|
|
||||||
"262144\0"
|
|
||||||
"131072\0"
|
|
||||||
"65536\0"
|
|
||||||
"32768\0"
|
|
||||||
"16384\0"
|
|
||||||
"8192\0"
|
|
||||||
"4096\0"
|
|
||||||
"2048\0"
|
|
||||||
"1024\0";
|
|
||||||
|
|
||||||
int fftSizeId = 0;
|
|
||||||
|
|
||||||
const IQFrontEnd::FFTWindow fftWindowList[] = {
|
const IQFrontEnd::FFTWindow fftWindowList[] = {
|
||||||
IQFrontEnd::FFTWindow::RECTANGULAR,
|
IQFrontEnd::FFTWindow::RECTANGULAR,
|
||||||
IQFrontEnd::FFTWindow::BLACKMAN,
|
IQFrontEnd::FFTWindow::BLACKMAN,
|
||||||
@ -69,6 +45,18 @@ namespace displaymenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init() {
|
void init() {
|
||||||
|
// Define FFT sizes
|
||||||
|
fftSizes.define(524288, "524288", 524288);
|
||||||
|
fftSizes.define(262144, "262144", 262144);
|
||||||
|
fftSizes.define(131072, "131072", 131072);
|
||||||
|
fftSizes.define(65536, "65536", 65536);
|
||||||
|
fftSizes.define(32768, "32768", 32768);
|
||||||
|
fftSizes.define(16384, "16384", 16384);
|
||||||
|
fftSizes.define(8192, "8192", 8192);
|
||||||
|
fftSizes.define(4096, "4096", 4096);
|
||||||
|
fftSizes.define(2048, "2048", 2048);
|
||||||
|
fftSizes.define(1024, "1024", 1024);
|
||||||
|
|
||||||
showWaterfall = core::configManager.conf["showWaterfall"];
|
showWaterfall = core::configManager.conf["showWaterfall"];
|
||||||
showWaterfall ? gui::waterfall.showWaterfall() : gui::waterfall.hideWaterfall();
|
showWaterfall ? gui::waterfall.showWaterfall() : gui::waterfall.hideWaterfall();
|
||||||
std::string colormapName = core::configManager.conf["colorMap"];
|
std::string colormapName = core::configManager.conf["colorMap"];
|
||||||
@ -90,15 +78,12 @@ namespace displaymenu {
|
|||||||
fullWaterfallUpdate = core::configManager.conf["fullWaterfallUpdate"];
|
fullWaterfallUpdate = core::configManager.conf["fullWaterfallUpdate"];
|
||||||
gui::waterfall.setFullWaterfallUpdate(fullWaterfallUpdate);
|
gui::waterfall.setFullWaterfallUpdate(fullWaterfallUpdate);
|
||||||
|
|
||||||
fftSizeId = 3;
|
fftSizeId = fftSizes.valueId(65536);
|
||||||
int fftSize = core::configManager.conf["fftSize"];
|
int size = core::configManager.conf["fftSize"];
|
||||||
for (int i = 0; i < 7; i++) {
|
if (fftSizes.keyExists(size)) {
|
||||||
if (fftSize == FFTSizes[i]) {
|
fftSizeId = fftSizes.keyId(size);
|
||||||
fftSizeId = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sigpath::iqFrontEnd.setFFTSize(FFTSizes[fftSizeId]);
|
sigpath::iqFrontEnd.setFFTSize(fftSizes.value(fftSizeId));
|
||||||
|
|
||||||
fftRate = core::configManager.conf["fftRate"];
|
fftRate = core::configManager.conf["fftRate"];
|
||||||
sigpath::iqFrontEnd.setFFTRate(fftRate);
|
sigpath::iqFrontEnd.setFFTRate(fftRate);
|
||||||
@ -229,10 +214,10 @@ namespace displaymenu {
|
|||||||
|
|
||||||
ImGui::LeftLabel("FFT Size");
|
ImGui::LeftLabel("FFT Size");
|
||||||
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||||
if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, FFTSizesStr)) {
|
if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, fftSizes.txt)) {
|
||||||
sigpath::iqFrontEnd.setFFTSize(FFTSizes[fftSizeId]);
|
sigpath::iqFrontEnd.setFFTSize(fftSizes.value(fftSizeId));
|
||||||
core::configManager.acquire();
|
core::configManager.acquire();
|
||||||
core::configManager.conf["fftSize"] = FFTSizes[fftSizeId];
|
core::configManager.conf["fftSize"] = fftSizes.key(fftSizeId);
|
||||||
core::configManager.release(true);
|
core::configManager.release(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user