parametragemodele.h 2.94 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

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

    QLineEdit* nom_automate;
48
49
50
    QLineEdit* auteur;
    QLineEdit* annee;
    QLineEdit* description;
51
52
53
54
55
    QSpinBox* nb_etats;
    QComboBox* liste_voisinage;
    QComboBox* liste_regle_transition;
    QPushButton* bouton_valide;

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

Maxime Goret's avatar
Maxime Goret committed
58
    QLineEdit* nomModele;
Maxime Goret's avatar
Maxime Goret committed
59
60
    //definition frame règle de transitions
    QWidget* fenetre_regle;
Maxime Goret's avatar
Maxime Goret committed
61
62
63
64
    QLabel* seuilMax;
    QLabel* seuilMin;
    QLabel* destination;
    QLabel* etatCourant;
Maxime Goret's avatar
Maxime Goret committed
65
    QLabel* etatCourant2 = nullptr;
Maxime Goret's avatar
Merge    
Maxime Goret committed
66
    QLabel* etat_d = 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
Maxime Goret committed
70
    QSpinBox* etatDest;
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

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

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

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

Maxime Goret's avatar
Maxime Goret committed
104
105
    AutoCell* nvAutocell = nullptr;

106
107
108
public:
    NouveauModele(QWidget* parent = nullptr);
public slots:
109
    void paramVoisinage(const QString& choix_voisinage);
110
    void changerVoisinage(const QString& choix_regle);
111
    void affGrille();
112
    void modifGrille(const QModelIndex& index);
Maxime Goret's avatar
Maxime Goret committed
113
    void paramRegle(const QString& choix_regle);
Maxime Goret's avatar
Maxime Goret committed
114

Maxime Goret's avatar
Maxime Goret committed
115
    void choisirEtatCourant(const QString& validEtat);
Romain De Laage De Bellefaye's avatar
Romain De Laage De Bellefaye committed
116
    void parametrerEtats();
Maxime Goret's avatar
Maxime Goret committed
117

Maxime Goret's avatar
Maxime Goret committed
118
119
    void addRegle();

Maxime Goret's avatar
Maxime Goret committed
120
   //  void validerParametrage();
Maxime Goret's avatar
Maxime Goret committed
121

122
123
124
125
126
127


};


#endif // PARAMETRAGEMODELE_H