Changeset View
Changeset View
Standalone View
Standalone View
src/spectrumwidget.cpp
Show First 20 Lines • Show All 315 Lines • ▼ Show 20 Line(s) | 310 | { | |||
---|---|---|---|---|---|
316 | } | 316 | } | ||
317 | 317 | | |||
318 | findPeakFromMouseposition(Wavelength((double)e->pos().x() / width())); | 318 | findPeakFromMouseposition(Wavelength((double)e->pos().x() / width())); | ||
319 | } | 319 | } | ||
320 | 320 | | |||
321 | void SpectrumWidget::findPeakFromMouseposition(double wavelength) | 321 | void SpectrumWidget::findPeakFromMouseposition(double wavelength) | ||
322 | { | 322 | { | ||
323 | qDebug() << "SpectrumWidget::findPeakFromMouseposition()"; | 323 | qDebug() << "SpectrumWidget::findPeakFromMouseposition()"; | ||
324 | Spectrum::peak *peak = NULL; | 324 | Spectrum::peak *peak = nullptr; | ||
325 | 325 | | |||
326 | //find the difference in percent (1.0 is 100%, 0.1 is 10%) | 326 | //find the difference in percent (1.0 is 100%, 0.1 is 10%) | ||
327 | double dif = 0.0; | 327 | double dif = 0.0; | ||
328 | 328 | | |||
329 | bool foundWavelength = false; | 329 | bool foundWavelength = false; | ||
330 | 330 | | |||
331 | //find the highest intensity | 331 | //find the highest intensity | ||
332 | foreach (Spectrum::peak *currentPeak, m_spectrum->peaklist()) { | 332 | foreach (Spectrum::peak *currentPeak, m_spectrum->peaklist()) { | ||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |