1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
| #include <QtGui>
#include <QVBoxLayout>
#include <QFormLayout>
#include <QTime>
#include "caldebit.h"
/*======================================================================================================================
DECLARATION DE LA FENETRE PRINCIPAL DU LOGICIEL
======================================================================================================================*/
Window::Window()
{
Init();
CoteDebit();
Boutons();
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(spinBoxesGroup);
layout->addWidget(editsGroup);
layout->addWidget(doubleSpinBoxesGroup);
setLayout(layout);
setWindowTitle(tr("Calculateur du Barrahe de Villerest"));
}
/*======================================================================================================================
FONCTION PERMETTANT DE RECUPERER LES VALEURS DES COTES ET DU DEBIT ET DE LES STOCKER
======================================================================================================================*/
double Window::CoteDebit()
{
spinBoxesGroup = new QGroupBox(tr("Cotes et Débit : "));
QLabel *retenue = new QLabel(tr("Entrer la cote de la retenue précedente : "));
QDoubleSpinBox *SpinBox = new QDoubleSpinBox;
SpinBox->setRange(270, 325);
SpinBox->setSingleStep(0.01);
SpinBox->setValue(0);
valcote = SpinBox->value();
QLabel *retenueactuelle = new QLabel(tr("Entrer la cote de la retenue actuelle : "));
QDoubleSpinBox *retactu = new QDoubleSpinBox;
retactu->setRange(270, 325);
retactu->setSingleStep(0.01);
retactu->setValue(0);
valcote1 = retactu->value();
QLabel *debitsortant = new QLabel(tr("Entrer la valeur du débit sortant actuel : "));
QDoubleSpinBox *debsor = new QDoubleSpinBox;
debsor->setRange(0, 4000);
debsor->setSingleStep(0.01);
debsor->setValue(0);
valdebit = debsor->value();
QGridLayout *spinBoxLayout = new QGridLayout;
spinBoxLayout->addWidget(retenue,0,0);
spinBoxLayout->addWidget(SpinBox,1,0);
spinBoxLayout->addWidget(retenueactuelle,3,0);
spinBoxLayout->addWidget(retactu,4,0);
spinBoxLayout->addWidget(debitsortant,6,0);
spinBoxLayout->addWidget(debsor,7,0);
spinBoxesGroup->setLayout(spinBoxLayout);
Ivalcote=valcote;
Ivalcote1=valcote1;
Ivaldebit=valdebit;
return Ivalcote;
return Ivalcote1;
return Ivaldebit;
}
/*======================================================================================================================
LES RESULTATS
======================================================================================================================*/
void Window::Resultats()
{
QString res ;
res.setNum (Ivalcote);
QString res1;
res1.setNum (Ivalcote1);
QString Qs ;
Qs.setNum(Ivaldebit);
qDebug() << "la première cote de la retenue est au niveau"<<Ivalcote<<"NGF.";
qDebug() << "la deuxième cote de la retenue est au niveau"<<Ivalcote1<<"NGF.";
qDebug() << "le débit sortant est de"<<Ivaldebit<<"M3/s.";
QMessageBox::information(this, "Resultats", "\n A la cote " + res.setNum (Ivalcote) + " NGF le volume de la retenue est de " " \n\n"
"A la cote " + res.setNum (Ivalcote1) + " NGF le volume de la retenue est de " " \n\n"
"le debit sortant est de : " + Qs.setNum(Ivaldebit)+ " M3/s \n\n"
} |
Partager