Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYMachineWidget.cpp
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 
21 // Added by qt3to4:
22 #include <QGridLayout>
23 #include <QLabel>
24 #include <QTextEdit>
25 #include <QtWidgets>
26 
30 
31 #include "TYMachineWidget.h"
32 
33 #define TR(id) OLocalizator::getString("TYMachineWidget", (id))
34 
35 TYMachineWidget::TYMachineWidget(TYMachine* pElement, QWidget* _pParent /*=NULL*/)
36  : TYWidget(pElement, _pParent)
37 {
38  QString num;
39 
40  resize(300, 680);
41  setWindowTitle(TR("id_caption"));
42 
43  _elmW = new TYAcousticVolumeNodeWidget(pElement, this);
44 
45  _lineEditCategorie = new QLineEdit();
46  _lineEditCategorie->setText(num.setNum(getElement()->getCategorie()));
47 
48  _labelCategorie = new QLabel();
49  _labelCategorie->setText(TR("id_categorie_label"));
50 
51  _labelConstructeur = new QLabel();
52  _labelConstructeur->setText(TR("id_constructeur_label"));
53 
54  _lineEditConstructeur = new QLineEdit();
55  _lineEditConstructeur->setText(getElement()->getConstructeur());
56 
57  _labelModele = new QLabel();
58  _labelModele->setText(TR("id_modele_label"));
59 
60  _lineEditModele = new QLineEdit();
61  _lineEditModele->setText(getElement()->getModele());
62 
63  _lineEditComment = new QTextEdit(getElement()->getCommentaire());
64 
65  _labelComment = new QLabel();
66  _labelComment->setText(TR("id_commentaire_label"));
67 
68  _groupBoxLayout = new QGridLayout();
69  _groupBoxLayout->addWidget(_lineEditCategorie, 0, 1);
70  _groupBoxLayout->addWidget(_labelCategorie, 0, 0);
71  _groupBoxLayout->addWidget(_labelConstructeur, 1, 0);
72  _groupBoxLayout->addWidget(_lineEditConstructeur, 1, 1);
73  _groupBoxLayout->addWidget(_labelModele, 2, 0);
74  _groupBoxLayout->addWidget(_lineEditModele, 2, 1);
75  _groupBoxLayout->addWidget(_lineEditComment, 4, 0, 1, 2);
76  _groupBoxLayout->addWidget(_labelComment, 3, 0);
77 
78  _groupBox = new QGroupBox();
79  _groupBox->setTitle(TR(""));
80  _groupBox->setLayout(_groupBoxLayout);
81 
82  _machineLayout = new QGridLayout();
83  _machineLayout->addWidget(_elmW, 0, 0);
84  _machineLayout->addWidget(_groupBox, 1, 0);
85 
86  setLayout(_machineLayout);
87 }
88 
90 
92 {
93  QString num;
94 
96 
97  _lineEditComment->setPlainText(getElement()->getCommentaire());
98  _lineEditModele->setText(getElement()->getModele());
99  _lineEditConstructeur->setText(getElement()->getConstructeur());
100  _lineEditCategorie->setText(num.setNum(getElement()->getCategorie()));
101 }
102 
104 {
105  _elmW->apply();
106 
107  getElement()->setCommentaire(_lineEditComment->toPlainText());
108  getElement()->setModele(_lineEditModele->text());
109  getElement()->setConstructeur(_lineEditConstructeur->text());
110  getElement()->setCategorie(_lineEditCategorie->text().toInt());
111 
112  emit modified();
113 }
outil IHM pour un ensemble de volumes acoustiques (fichier header)
#define TR(id)
outil IHM pour une machine (fichier header)
Classe de l'objet IHM pour un ensemble de volumes acoustiques.
QGridLayout * _machineLayout
QLineEdit * _lineEditModele
QLabel * _labelComment
QGridLayout * _groupBoxLayout
QLabel * _labelCategorie
TYMachineWidget(TYMachine *pElement, QWidget *_pParent=NULL)
QLineEdit * _lineEditConstructeur
QLineEdit * _lineEditCategorie
QLabel * _labelModele
virtual void apply()
virtual void updateContent()
QGroupBox * _groupBox
QLabel * _labelConstructeur
virtual ~TYMachineWidget()
QTextEdit * _lineEditComment
TYAcousticVolumeNodeWidget * _elmW
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
void modified()