Spectrum: removed FPS 'no limit' setting. Fixes #793

This commit is contained in:
f4exb 2021-03-07 11:54:16 +01:00
parent 806e6cac69
commit 01170eb724
5 changed files with 15 additions and 28 deletions

View File

@ -110,7 +110,8 @@ bool GLSpectrumSettings::deserialize(const QByteArray& data)
m_fftWindow = (FFTWindow::Function) tmp; m_fftWindow = (FFTWindow::Function) tmp;
d.readReal(4, &m_refLevel, 0); d.readReal(4, &m_refLevel, 0);
d.readReal(5, &m_powerRange, 100); d.readReal(5, &m_powerRange, 100);
d.readS32(26, &m_fpsPeriodMs, 50); d.readS32(26, &tmp, 50);
m_fpsPeriodMs = tmp < 5 ? 5 : tmp > 500 ? 500 : tmp;
d.readBool(6, &m_displayWaterfall, true); d.readBool(6, &m_displayWaterfall, true);
d.readBool(7, &m_invertedWaterfall, true); d.readBool(7, &m_invertedWaterfall, true);
d.readBool(8, &m_displayMaxHold, false); d.readBool(8, &m_displayMaxHold, false);

View File

@ -370,8 +370,10 @@ void WebAPIAdapterBase::webapiUpdatePreset(
if (spectrumIt->contains("refLevel")) { if (spectrumIt->contains("refLevel")) {
spectrumSettings.m_refLevel = apiPreset->getSpectrumConfig()->getRefLevel(); spectrumSettings.m_refLevel = apiPreset->getSpectrumConfig()->getRefLevel();
} }
if (spectrumIt->contains("fpsPeriodMs")) { if (spectrumIt->contains("fpsPeriodMs"))
spectrumSettings.m_fpsPeriodMs = apiPreset->getSpectrumConfig()->getFpsPeriodMs(); {
qint32 fpsPeriodMs = apiPreset->getSpectrumConfig()->getFpsPeriodMs();
spectrumSettings.m_fpsPeriodMs = fpsPeriodMs < 5 ? 5 : fpsPeriodMs > 500 ? 500 : fpsPeriodMs;
} }
if (spectrumIt->contains("waterfallShare")) { if (spectrumIt->contains("waterfallShare")) {
spectrumSettings.m_waterfallShare = apiPreset->getSpectrumConfig()->getWaterfallShare(); spectrumSettings.m_waterfallShare = apiPreset->getSpectrumConfig()->getWaterfallShare();

View File

@ -440,10 +440,6 @@ void GLSpectrum::newSpectrum(const Real *spectrum, int nbBins, int fftSize)
updateWaterfall(spectrum); updateWaterfall(spectrum);
updateHistogram(spectrum); updateHistogram(spectrum);
if (m_fpsPeriodMs == 0) {
update();
}
} }
void GLSpectrum::updateWaterfall(const Real *spectrum) void GLSpectrum::updateWaterfall(const Real *spectrum)

View File

@ -32,7 +32,7 @@
#include "util/db.h" #include "util/db.h"
#include "ui_glspectrumgui.h" #include "ui_glspectrumgui.h"
const int GLSpectrumGUI::m_fpsMs[] = {500, 200, 100, 50, 20, 10, 5, 0}; const int GLSpectrumGUI::m_fpsMs[] = {500, 200, 100, 50, 20, 10, 5};
GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) : GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) :
QWidget(parent), QWidget(parent),
@ -147,24 +147,17 @@ void GLSpectrumGUI::displaySettings()
} }
} }
if (m_settings.m_fpsPeriodMs == 0) unsigned int i = 0;
{
ui->fps->setCurrentIndex(sizeof(m_fpsMs)/sizeof(m_fpsMs[0]) - 1);
}
else
{
unsigned int i = 0;
for (; i < sizeof(m_fpsMs)/sizeof(m_fpsMs[0]); i++) for (; i < sizeof(m_fpsMs)/sizeof(m_fpsMs[0]); i++)
{ {
if (m_settings.m_fpsPeriodMs >= m_fpsMs[i]) { if (m_settings.m_fpsPeriodMs >= m_fpsMs[i]) {
break; break;
}
} }
ui->fps->setCurrentIndex(i);
} }
ui->fps->setCurrentIndex(i);
ui->fftOverlap->setValue(m_settings.m_fftOverlap); ui->fftOverlap->setValue(m_settings.m_fftOverlap);
setMaximumOverlap(); setMaximumOverlap();
ui->averaging->setCurrentIndex(m_settings.m_averagingIndex); ui->averaging->setCurrentIndex(m_settings.m_averagingIndex);

View File

@ -461,7 +461,7 @@
<string>Spectrum maximum FPS (NL for No Limit)</string> <string>Spectrum maximum FPS (NL for No Limit)</string>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>0</number>
</property> </property>
<item> <item>
<property name="text"> <property name="text">
@ -498,11 +498,6 @@
<string>200</string> <string>200</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>NL</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item> <item>