Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYSpectreWidget.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
27 #ifndef __TY_SPECTRE_WIDGET__
28 #define __TY_SPECTRE_WIDGET__
29 
30 #include "TYWidget.h"
31 // Added by qt3to4:
32 #include <QGridLayout>
33 #include <QLabel>
34 #include <QString>
36 
37 class QLineEdit;
38 class QGridLayout;
39 class QLabel;
40 class QTreeWidget;
41 class QGroupBox;
42 class TYElementWidget;
43 class QComboBox;
44 class QTabWidget;
45 class QTableWidget;
46 class QPushButton;
47 class QPrinter;
48 class QRadioButton;
49 class QButtonGroup;
50 class TYHistoWidget;
51 class TYCourbeWidget;
52 
57 class TYSpectreWidget : public TYWidget
58 {
59  Q_OBJECT
60 
62 
63  // Methodes
64 public:
68  TYSpectreWidget(TYSpectre* pElement, QWidget* _pParent = NULL);
72  virtual ~TYSpectreWidget();
73 
77  void setPrecision(const int& prec)
78  {
79  _precision = prec;
80  }
82  {
83  return _precision;
84  }
85  const int getPrecision() const
86  {
87  return _precision;
88  }
89 
90 public:
94  void resetTab();
95 
100  void spectreToTableau(TYSpectre* pSpectre);
101 
106  void tableauToSpectre(TYSpectre* pSpectre);
107 
116  void spectre(TYSpectre* pSpectre);
117 
124 
128  using TYSpectrePondProvider = QString (*)();
131 
132 public slots:
133  virtual void updateContent();
134  virtual void apply();
135 
139  void exportCsv();
140 
144  void importCsv();
145 
149  void tabValueChanged(int row, int col);
150 
154  void changeOctave();
155 
159  void changePonderation();
160 
164  void changeType();
165 
169  void setContentEnabled(bool state);
170 
171  // Membres
172 protected:
173  QGroupBox* _groupBox;
174  QTreeWidget* _listViewTabSp;
175  QLineEdit* _lineEditRq;
176  QLabel* _labeRq;
177  QComboBox* _comboBoxType;
178  QLabel* _labelType;
179  QTabWidget* _tabWidget;
180  QTableWidget* _tableau;
181  QPushButton* _pushButtonExport;
182  QPushButton* _pushButtonImport;
183  QRadioButton* _radioButtonTiers;
184  QRadioButton* _radioButtonOctave;
185  QRadioButton* _radioButtonPondZ;
186  QRadioButton* _radioButtonPondA;
187  QButtonGroup* _formButtonGroup;
188  QButtonGroup* _pondButtonGroup;
191 
192 protected:
193  QGridLayout* _spectreLayout;
194  QGridLayout* _groupBoxLayout;
195 
197  int _nbFreq;
198  QPrinter* _printer;
199 
200 public:
202 
203 protected:
205 
208 
209 private:
211  QString _etatSpectre;
212  QString _pondSpectre;
213 
218 
223 
229 
234 
239 };
240 
241 #endif // __TY_SPECTRE_WIDGET__
outil IHM pour un objet metier de type TYElement (fichier header)
#define TY_DECL_METIER_WIDGET(classname)
Definition: TYWidget.h:31
classe de l'objet IHM pour une courbe
classe de l'objet IHM pour un element
classe de l'outil IHM pour un histogramme
Definition: TYHistoWidget.h:39
classe de l'objet IHM pour un spectre
void applyInitialPondFromProvider()
Applique la pondération initiale du spectre fournie par le provider.
virtual void apply()
QLineEdit * _lineEditRq
QString(*)() TYSpectrePondProvider
QGridLayout * _groupBoxLayout
virtual ~TYSpectreWidget()
const int getPrecision() const
QPrinter * _printer
void spectre(TYSpectre *pSpectre)
Construit un spectre a partir du contenu du widget.
int _precision
Precision d'affichage des spectres.
void resetTab()
Initialisation du tableau.
void tabValueChanged(int row, int col)
TYCourbeWidget * _courbeWidget
QRadioButton * _radioButtonOctave
QGroupBox * _groupBox
void tableauToSpectre(TYSpectre *pSpectre)
Mise a jour d'un spectre depuis le tableau.
static bool _warningConvertingTOtoOctShown
QRadioButton * _radioButtonPondA
TYElementWidget * _elmW
static TYSpectreFormProvider s_formProvider
QRadioButton * _radioButtonPondZ
void setContentEnabled(bool state)
QGridLayout * _spectreLayout
static void setSpectrePondProvider(TYSpectrePondProvider p)
TYHistoWidget * _histoWidget
QTreeWidget * _listViewTabSp
void spectreToTableau(TYSpectre *pSpectre)
Mise a jour du tableau depuis un spectre.
void setPrecision(const int &prec)
QPushButton * _pushButtonImport
void applyInitialFormFromProvider()
Applique la forme initiale du spectre fournie par le provider.
static void setSpectreFormProvider(TYSpectreFormProvider p)
virtual void updateContent()
QPushButton * _pushButtonExport
TYSpectreForm(*)() TYSpectreFormProvider
static TYSpectrePondProvider spectrePondProvider()
TYSpectreWidget(TYSpectre *pElement, QWidget *_pParent=NULL)
QButtonGroup * _formButtonGroup
static TYSpectrePondProvider s_pondProvider
QComboBox * _comboBoxType
static TYSpectreFormProvider spectreFormProvider()
QButtonGroup * _pondButtonGroup
TYSpectre * _pTmpSpectre
QRadioButton * _radioButtonTiers
QTabWidget * _tabWidget
QTableWidget * _tableau
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
TYSpectreForm
Spectrum representation.
Definition: spectre.h:36