mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-15 12:18:48 -04:00
Spactrum: allow arbitrary FPS (API) or in a range of FPS (GUI) with possible no limit. Implements #772
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
#include "util/db.h"
|
||||
#include "ui_glspectrumgui.h"
|
||||
|
||||
const int GLSpectrumGUI::m_fpsMs[] = {500, 200, 100, 50, 20, 10, 5, 0};
|
||||
|
||||
GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::GLSpectrumGUI),
|
||||
@@ -144,6 +146,24 @@ void GLSpectrumGUI::displaySettings()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_settings.m_fpsPeriodMs == 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++)
|
||||
{
|
||||
if (m_settings.m_fpsPeriodMs >= m_fpsMs[i]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ui->fps->setCurrentIndex(i);
|
||||
}
|
||||
|
||||
ui->fftOverlap->setValue(m_settings.m_fftOverlap);
|
||||
setMaximumOverlap();
|
||||
ui->averaging->setCurrentIndex(m_settings.m_averagingIndex);
|
||||
@@ -208,6 +228,7 @@ void GLSpectrumGUI::applyGLSpectrumSettings()
|
||||
qDebug("GLSpectrumGUI::applySettings: refLevel: %e powerRange: %e", refLevel, powerRange);
|
||||
m_glSpectrum->setReferenceLevel(refLevel);
|
||||
m_glSpectrum->setPowerRange(powerRange);
|
||||
m_glSpectrum->setFPSPeriodMs(m_settings.m_fpsPeriodMs);
|
||||
m_glSpectrum->setLinear(m_settings.m_linear);
|
||||
}
|
||||
|
||||
@@ -323,6 +344,13 @@ void GLSpectrumGUI::on_levelRange_valueChanged(int value)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void GLSpectrumGUI::on_fps_currentIndexChanged(int index)
|
||||
{
|
||||
m_settings.m_fpsPeriodMs = m_fpsMs[index];
|
||||
qDebug("GLSpectrumGUI::on_fps_currentIndexChanged: %d ms", m_settings.m_fpsPeriodMs);
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void GLSpectrumGUI::on_decay_valueChanged(int index)
|
||||
{
|
||||
m_settings.m_decay = index;
|
||||
|
||||
Reference in New Issue
Block a user