Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYSpectreWidget.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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>
35 class QLineEdit;
36 class QGridLayout;
37 class QLabel;
38 class QTreeWidget;
39 class QGroupBox;
40 class TYElementWidget;
41 class QComboBox;
42 class QTabWidget;
43 class QTableWidget;
44 class QPushButton;
45 class QPrinter;
46 class QRadioButton;
47 class QButtonGroup;
48 class TYSpectre;
49 class TYHistoWidget;
50 class TYCourbeWidget;
51 
56 class TYSpectreWidget : public TYWidget
57 {
58  Q_OBJECT
59 
61 
62  // Methodes
63 public:
67  TYSpectreWidget(TYSpectre* pElement, QWidget* _pParent = NULL);
71  virtual ~TYSpectreWidget();
72 
76  void setPrecision(const int& prec)
77  {
78  _precision = prec;
79  }
81  {
82  return _precision;
83  }
84  const int getPrecision() const
85  {
86  return _precision;
87  }
88 
89 public:
93  void resetTab();
94 
99  void spectreToTableau(TYSpectre* pSpectre);
100 
105  void tableauToSpectre(TYSpectre* pSpectre);
106 
115  void spectre(TYSpectre* pSpectre);
116 
117 public slots:
118  virtual void updateContent();
119  virtual void apply();
120 
124  void tabChanged(int);
125 
129  void print();
130 
134  void exportCsv();
135 
139  void importCsv();
140 
144  void tabValueChanged(int row, int col);
145 
149  void changeOctave();
150 
154  void changeType();
155 
159  void setContentEnabled(bool state);
160 
161  // Membres
162 protected:
163  QGroupBox* _groupBox;
164  QTreeWidget* _listViewTabSp;
165  QLineEdit* _lineEditRq;
166  QLabel* _labeRq;
167  QComboBox* _comboBoxType;
168  QLabel* _labelType;
169  QTabWidget* _tabWidget;
170  QTableWidget* _tableau;
171  QPushButton* _pushButtonPrint;
172  QPushButton* _pushButtonExport;
173  QPushButton* _pushButtonImport;
174  QRadioButton* _radioButtonTiers;
175  QRadioButton* _radioButtonOctave;
176  QPushButton* _pushButtonFit;
177  QButtonGroup* _buttonGroup;
180 
181 protected:
182  QGridLayout* _spectreLayout;
183  QGridLayout* _groupBoxLayout;
184 
186  int _nbFreq;
187  QPrinter* _printer;
188 
189 public:
191 
192 protected:
194 
197 
198 private:
200  QString _etatSpectre;
201 };
202 
203 #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:40
classe de l'objet IHM pour un spectre
virtual void apply()
QLineEdit * _lineEditRq
QGridLayout * _groupBoxLayout
virtual ~TYSpectreWidget()
const int getPrecision() const
QPushButton * _pushButtonFit
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.
TYElementWidget * _elmW
void setContentEnabled(bool state)
QGridLayout * _spectreLayout
TYHistoWidget * _histoWidget
QTreeWidget * _listViewTabSp
QButtonGroup * _buttonGroup
void spectreToTableau(TYSpectre *pSpectre)
Mise a jour du tableau depuis un spectre.
QPushButton * _pushButtonPrint
void setPrecision(const int &prec)
QPushButton * _pushButtonImport
virtual void updateContent()
QPushButton * _pushButtonExport
TYSpectreWidget(TYSpectre *pElement, QWidget *_pParent=NULL)
QComboBox * _comboBoxType
TYSpectre * _pTmpSpectre
QRadioButton * _radioButtonTiers
QTabWidget * _tabWidget
QTableWidget * _tableau
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43