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 
125 public slots:
126  virtual void updateContent();
127  virtual void apply();
128 
132  void exportCsv();
133 
137  void importCsv();
138 
142  void tabValueChanged(int row, int col);
143 
147  void changeOctave();
148 
152  void changePonderation();
153 
157  void changeType();
158 
162  void setContentEnabled(bool state);
163 
164  // Membres
165 protected:
166  QGroupBox* _groupBox;
167  QTreeWidget* _listViewTabSp;
168  QLineEdit* _lineEditRq;
169  QLabel* _labeRq;
170  QComboBox* _comboBoxType;
171  QLabel* _labelType;
172  QTabWidget* _tabWidget;
173  QTableWidget* _tableau;
174  QPushButton* _pushButtonExport;
175  QPushButton* _pushButtonImport;
176  QRadioButton* _radioButtonTiers;
177  QRadioButton* _radioButtonOctave;
178  QRadioButton* _radioButtonPondZ;
179  QRadioButton* _radioButtonPondA;
180  QButtonGroup* _formButtonGroup;
181  QButtonGroup* _pondButtonGroup;
184 
185 protected:
186  QGridLayout* _spectreLayout;
187  QGridLayout* _groupBoxLayout;
188 
190  int _nbFreq;
191  QPrinter* _printer;
192 
193 public:
195 
196 protected:
198 
201 
202 private:
204  QString _etatSpectre;
205  QString _pondSpectre;
206 
211 
216 };
217 
218 #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
virtual void apply()
QLineEdit * _lineEditRq
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.
QRadioButton * _radioButtonPondA
TYElementWidget * _elmW
static TYSpectreFormProvider s_formProvider
QRadioButton * _radioButtonPondZ
void setContentEnabled(bool state)
QGridLayout * _spectreLayout
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 de spectre fournie par le provider.
static void setSpectreFormProvider(TYSpectreFormProvider p)
virtual void updateContent()
QPushButton * _pushButtonExport
TYSpectreForm(*)() TYSpectreFormProvider
TYSpectreWidget(TYSpectre *pElement, QWidget *_pParent=NULL)
QButtonGroup * _formButtonGroup
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