mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
ScatterCtrl: FFT view is auto centered to max.
git-svn-id: svn://ultimatepp.org/upp/trunk@10581 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
a3b1cc76c1
commit
daae738186
1 changed files with 6 additions and 0 deletions
|
|
@ -815,6 +815,7 @@ void ProcessingTab::OnFFT()
|
|||
Exclamation(t_("Incorrect sampling time"));
|
||||
return;
|
||||
}
|
||||
int64 idMaxFFT;
|
||||
{
|
||||
WaitCursor waitcursor;
|
||||
|
||||
|
|
@ -852,6 +853,8 @@ void ProcessingTab::OnFFT()
|
|||
|
||||
VectorY<double> series(resampledSeries, 0, samplingTime);
|
||||
fft = series.FFTY(samplingTime, tabFreq.opXAxis == 1, tabFreq.type, tabFreq.setWindow);
|
||||
VectorPointf fftData(fft);
|
||||
fftData.MaxY(idMaxFFT);
|
||||
}
|
||||
if (fft.IsEmpty()) {
|
||||
tabFreq.comments.SetText(errText);
|
||||
|
|
@ -871,6 +874,9 @@ void ProcessingTab::OnFFT()
|
|||
tabFreq.scatter.SetLabelX(tabFreq.opXAxis == 1 ? t_("Frequency [Hz]") : t_("Period [sec]"));
|
||||
tabFreq.scatter.SetLabelY(legend);
|
||||
tabFreq.scatter.ZoomToFit(true, true);
|
||||
if (fft[int(idMaxFFT)].x < (fft[fft.GetCount() - 1].x)/2)
|
||||
tabFreq.scatter.SetRange(fft[int(idMaxFFT)].x*2, Null);
|
||||
|
||||
tabFreq.comments.SetText(errText);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue