mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-31 17:42:55 +08:00
Format code
This commit is contained in:
parent
022cf42425
commit
44b0172321
@ -598,7 +598,7 @@ QString Editor::datasetFFTSamples(const int group, const int dataset)
|
|||||||
{
|
{
|
||||||
auto set = getDataset(group, dataset);
|
auto set = getDataset(group, dataset);
|
||||||
if (set)
|
if (set)
|
||||||
return QString::number(set->m_fftSamples);
|
return QString::number(qMax(1, set->m_fftSamples));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1282,18 +1282,22 @@ void Editor::setDatasetWidgetAlarm(const int group, const int dataset,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the @a frequency value used for FFT plotting.
|
* Updates the @a samples used for FFT plotting.
|
||||||
*
|
*
|
||||||
* @param group index of the group in which the dataset belongs
|
* @param group index of the group in which the dataset belongs
|
||||||
* @param dataset index of the dataset
|
* @param dataset index of the dataset
|
||||||
*/
|
*/
|
||||||
void Editor::setDatasetFFTSamples(const int group, const int dataset,
|
void Editor::setDatasetFFTSamples(const int group, const int dataset,
|
||||||
const QString &frequency)
|
const QString &samples)
|
||||||
{
|
{
|
||||||
auto set = getDataset(group, dataset);
|
auto set = getDataset(group, dataset);
|
||||||
if (set)
|
if (set)
|
||||||
{
|
{
|
||||||
set->m_fftSamples = frequency.toInt();
|
auto sample = samples.toInt();
|
||||||
|
if (sample < 1)
|
||||||
|
sample = 1;
|
||||||
|
|
||||||
|
set->m_fftSamples = sample;
|
||||||
emit datasetChanged(group, dataset);
|
emit datasetChanged(group, dataset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,8 +157,7 @@ public slots:
|
|||||||
void setDatasetWidgetMax(const int group, const int dataset, const QString &maximum);
|
void setDatasetWidgetMax(const int group, const int dataset, const QString &maximum);
|
||||||
void setDatasetWidgetData(const int group, const int dataset, const QString &widget);
|
void setDatasetWidgetData(const int group, const int dataset, const QString &widget);
|
||||||
void setDatasetWidgetAlarm(const int group, const int dataset, const QString &alarm);
|
void setDatasetWidgetAlarm(const int group, const int dataset, const QString &alarm);
|
||||||
void setDatasetFFTSamples(const int group, const int dataset,
|
void setDatasetFFTSamples(const int group, const int dataset, const QString &samples);
|
||||||
const QString &frequency);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void setModified(const bool modified);
|
void setModified(const bool modified);
|
||||||
|
@ -99,7 +99,7 @@ FFTPlot::FFTPlot(const int index)
|
|||||||
int size = dataset->fftSamples();
|
int size = dataset->fftSamples();
|
||||||
|
|
||||||
// Ensure that FFT size is valid
|
// Ensure that FFT size is valid
|
||||||
while (m_transformer.setSize(size) == QFourierTransformer::InvalidSize)
|
while (m_transformer.setSize(size) != QFourierTransformer::FixedSize)
|
||||||
--size;
|
--size;
|
||||||
|
|
||||||
// Set FFT size
|
// Set FFT size
|
||||||
|
Loading…
x
Reference in New Issue
Block a user