parametragemodele.h 3.05 KB
Newer Older
1
2
3
#ifndef PARAMETRAGEMODELE_H
#define PARAMETRAGEMODELE_H

Romain De Laage De Bellefaye's avatar
Romain De Laage De Bellefaye committed
4
#include <reseau_cellule_etats.h>
Romain De Laage De Bellefaye's avatar
Romain De Laage De Bellefaye committed
5
#include <paramalpha.h>
Maxime Goret's avatar
Maxime Goret committed
6
#include <autocell.h>
7
8
9
10
11
12

#include <QObject>
#include <QApplication>
#include <QPushButton>
#include <QWidget>
#include <QLineEdit>
13
#include <QSpinBox>
14
15
16
17
18
19
20
21
22
23
24
25
#include <QLabel>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QComboBox>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QHeaderView>
#include <QLayoutItem>
#include <QFont>
#include <QPushButton>
#include <QCheckBox>
#include <QFormLayout>
26
#include <QBrush>
27
#include <QMouseEvent>
28
29
30
31
32
33
34

using namespace std;

class NouveauModele : public QWidget {
    Q_OBJECT
    QGridLayout* general;

35
36
    //définition de la frame paramétrage du modèle
    QWidget* fenetre_init;
37
    QLabel* label_init;
38
    QGridLayout* form_init;
39
40

    QFormLayout* form_choix;
41

Maxime Goret's avatar
Maxime Goret committed
42
    QLineEdit* nom_modele;
43
    QLineEdit* nom_automate;
Leon Do Castelo's avatar
Leon Do Castelo committed
44
45
46
47
    QLineEdit* auteur;
    QLineEdit* annee;
    QLineEdit* description;

48
49
    QSpinBox* nb_etats;
    QComboBox* liste_voisinage;
Maxime Goret's avatar
Merge  
Maxime Goret committed
50
    QComboBox* liste_regle_transition = nullptr;
51
52
    QPushButton* bouton_valide;

Maxime Goret's avatar
merge  
Maxime Goret committed
53
54
55
    QPushButton* valider_Etat = nullptr;
    QPushButton* valider_EtatDefault = nullptr;

Maxime Goret's avatar
Maxime Goret committed
56
    QHBoxLayout* layoutvalid = nullptr;
Maxime Goret's avatar
Maxime Goret committed
57

Maxime Goret's avatar
Maxime Goret committed
58
59
    //definition frame règle de transitions
    QWidget* fenetre_regle;
Maxime Goret's avatar
merge  
Maxime Goret committed
60
61
62
63
    QLabel* seuilMax= nullptr;
    QLabel* seuilMin= nullptr;
    QLabel* destination= nullptr;
    QLabel* etatCourant= nullptr;
Maxime Goret's avatar
Maxime Goret committed
64
    QLabel* etatCourant2 = nullptr;
Maxime Goret's avatar
Merge  
Maxime Goret committed
65
    QLabel* etat_d = nullptr;
Maxime Goret's avatar
merge  
Maxime Goret committed
66
    QLabel* etat= nullptr;
Maxime Goret's avatar
Maxime Goret committed
67

Maxime Goret's avatar
Maxime Goret committed
68
    QComboBox* valid_Etat;
Maxime Goret's avatar
Maxime Goret committed
69
    QSpinBox* numEtatCourant = nullptr;
Maxime Goret's avatar
merge  
Maxime Goret committed
70
    QSpinBox* etatDest= nullptr;
Maxime Goret's avatar
Merge  
Maxime Goret committed
71
    QSpinBox* etat_default = nullptr;
Maxime Goret's avatar
Maxime Goret committed
72

Maxime Goret's avatar
Maxime Goret committed
73
74
    QPushButton* fin = nullptr;
    QPushButton* next = nullptr;
Maxime Goret's avatar
Maxime Goret committed
75
76
    QIntValidator* seuilValidator;
    QLineEdit* numSeuilMin[8];
Maxime Goret's avatar
Maxime Goret committed
77
    QLineEdit* numSeuilMax[8];
Maxime Goret's avatar
Maxime Goret committed
78

Maxime Goret's avatar
Maxime Goret committed
79
80
81
82
83
    QVBoxLayout* layoutv = nullptr;
    QHBoxLayout* layouth1 = nullptr;
    QHBoxLayout* layouth2 = nullptr;
    QHBoxLayout* layouth3 = nullptr;
    QHBoxLayout* layouth4 = nullptr;
Maxime Goret's avatar
Merge  
Maxime Goret committed
84
    QHBoxLayout* layouth = nullptr;
Maxime Goret's avatar
Maxime Goret committed
85

Maxime Goret's avatar
Maxime Goret committed
86
87
88
    QVBoxLayout* layoutv2 = nullptr;
    QHBoxLayout* layouth5 = nullptr;
    QHBoxLayout* layouth6 = nullptr;
Maxime Goret's avatar
Maxime Goret committed
89

Maxime Goret's avatar
Merge  
Maxime Goret committed
90
91
    QHBoxLayout* layoutEtat;

92
93
94
95
    //définition de la frame paramétrage du choix
    QWidget* fenetre_param;
    QGridLayout* form_param;
    QLabel* label_param;
96

97
    //Voisiange non arbitraire
Maxime Goret's avatar
Maxime Goret committed
98
    QFormLayout* form_rayon = nullptr;
99
    QSpinBox* rayon;
100

101
    //définition de la frame contenant la grille de sélection du voisinage
Maxime Goret's avatar
Maxime Goret committed
102
    QTableWidget* grid = nullptr;
Romain De Laage De Bellefaye's avatar
Romain De Laage De Bellefaye committed
103
104
    std::unique_ptr<ParamAlpha> paramAlpha;
    QPushButton* boutonEtat;
105

Maxime Goret's avatar
Maxime Goret committed
106
107
    AutoCell* nvAutocell = nullptr;

108
109
110
public:
    NouveauModele(QWidget* parent = nullptr);
public slots:
111
    void paramVoisinage(const QString& choix_voisinage);
Maxime Goret's avatar
Maxime Goret committed
112
    void changerVoisinage();
113
    void affGrille();
114
    void modifGrille(const QModelIndex& index);
Maxime Goret's avatar
Maxime Goret committed
115
    void paramRegle();
Romain De Laage De Bellefaye's avatar
Romain De Laage De Bellefaye committed
116
    void validerParametrage();
Maxime Goret's avatar
Maxime Goret committed
117

Maxime Goret's avatar
Maxime Goret committed
118
    void choisirEtatCourant(const QString& validEtat);
Romain De Laage De Bellefaye's avatar
Romain De Laage De Bellefaye committed
119
    void parametrerEtats();
Maxime Goret's avatar
Maxime Goret committed
120

Maxime Goret's avatar
Maxime Goret committed
121
122
    void addRegle();

Maxime Goret's avatar
merge  
Maxime Goret committed
123
124
    void changerEtatDefault();

Maxime Goret's avatar
Maxime Goret committed
125
126
    void validation();

127
128
129
130
};


#endif // PARAMETRAGEMODELE_H