File indexing completed on 2024-04-14 03:40:23

0001 /*
0002     SPDX-FileCopyrightText: 2005, 2006 Carsten Niehaus <cniehaus@kde.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef SPECTRUMVIEWIMPL_H
0007 #define SPECTRUMVIEWIMPL_H
0008 
0009 #include "spectrum.h"
0010 
0011 #include "ui_spectrumview.h"
0012 
0013 /**
0014  * @author Carsten Niehaus
0015  */
0016 class SpectrumViewImpl : public QWidget, Ui_SpectrumView
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     /**
0022      * @param parent the parent widget
0023      */
0024     explicit SpectrumViewImpl(QWidget *parent);
0025 
0026     /**
0027      * sets the spectrum to @p spec
0028      * @param spec the spectrum to display
0029      */
0030     void setSpectrum(Spectrum *spec)
0031     {
0032         m_spectrumWidget->setSpectrum(spec);
0033 
0034         fillPeakList();
0035 
0036         m_spectrumWidget->update();
0037     }
0038 
0039 Q_SIGNALS:
0040     void settingsChanged();
0041 
0042 private Q_SLOTS:
0043     /**
0044      * set the correct ranges and min/max values of the
0045      * GUI elements
0046      * @param left The left border of the spectrum
0047      * @param right The right border of the spectrum
0048      */
0049     void updateUI(int left, int right);
0050 
0051     void updatePeakInformation(Spectrum::peak *peak);
0052 
0053     void setUnit();
0054 
0055     void updateMin(int left);
0056     void updateMax(int right);
0057 
0058 private:
0059     /**
0060      * filling the list of peaks
0061      */
0062     void fillPeakList();
0063 };
0064 
0065 #endif // SPECTRUMVIEWIMPL_H