mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-15 05:22:53 +08:00
Enforce minimum FFT sample size
This commit is contained in:
parent
e92aa3cce7
commit
7333519f60
@ -193,7 +193,7 @@ Widgets.Window {
|
|||||||
text: Cpp_JSON_Editor.datasetFFTSamples(group, dataset)
|
text: Cpp_JSON_Editor.datasetFFTSamples(group, dataset)
|
||||||
onTextChanged: Cpp_JSON_Editor.setDatasetFFTSamples(group, dataset, parseInt(text))
|
onTextChanged: Cpp_JSON_Editor.setDatasetFFTSamples(group, dataset, parseInt(text))
|
||||||
validator: IntValidator {
|
validator: IntValidator {
|
||||||
bottom: 128
|
bottom: 8
|
||||||
top: 40 * 1000
|
top: 40 * 1000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ Dataset::Dataset(QObject *parent)
|
|||||||
, m_max("0")
|
, m_max("0")
|
||||||
, m_min("0")
|
, m_min("0")
|
||||||
, m_alarm("0")
|
, m_alarm("0")
|
||||||
|
, m_fftSamples(8)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ FFTPlot::FFTPlot(const int index)
|
|||||||
if (dataset)
|
if (dataset)
|
||||||
{
|
{
|
||||||
// Calculate FFT size
|
// Calculate FFT size
|
||||||
int size = dataset->fftSamples();
|
int size = qMax(8, dataset->fftSamples());
|
||||||
|
|
||||||
// Ensure that FFT size is valid
|
// Ensure that FFT size is valid
|
||||||
while (m_transformer.setSize(size) != QFourierTransformer::FixedSize)
|
while (m_transformer.setSize(size) != QFourierTransformer::FixedSize)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user