Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Romain De Laage De Bellefaye
LO21-projet
Commits
3c8b5c8c
Commit
3c8b5c8c
authored
Jun 09, 2021
by
Maxime Goret
Browse files
Interface Regle
parent
1b3533c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/autocell.h
View file @
3c8b5c8c
...
...
@@ -98,11 +98,11 @@ class AutoCell : public QWidget
public
slots
:
//void chargerModele();
//void listerModele(); //à faire en dernier
//
void chargerGrille();
void
chargerGrille
s
();
//void listerGrille(); //déjà réfléchir à la recopie
//Reseau initialiserGrille(); //méthode à implémenter qui récupère les données du formulaire - penser à réinitialiser les données annexes
//void afficherGrille(Reseau&); //affiche une grille
void
chargerGrilles
(
const
QString
&
text
);
//
void chargerGrilles(const QString &text);
void
afficherGrille
(
Reseau
*
Grille
);
...
...
includes/parametragemodele.h
View file @
3c8b5c8c
...
...
@@ -77,7 +77,7 @@ public slots:
void
affGrille
();
void
modifGrille
(
const
QModelIndex
&
index
);
void
paramRegle
(
const
QString
&
choix_regle
);
//
void choisirEtatCourant(
QFormLayout* form_choix
);
void
choisirEtatCourant
(
bool
checked
);
};
...
...
src/parametragemodele.cpp
View file @
3c8b5c8c
...
...
@@ -53,13 +53,14 @@ NouveauModele::NouveauModele(QWidget* parent) : QWidget() {
liste_regle_transition
->
addItem
(
"Langston's Loop"
);
liste_regle_transition
->
addItem
(
"Nouvelle fonction de transition"
);
connect
(
liste_regle_transition
,
SIGNAL
(
currentTextChanged
(
const
QString
&
)),
this
,
SLOT
(
paramRegle
(
const
QString
)));
liste_regle_transition
->
setCurrentIndex
(
-
1
);
//connect(liste_regle_transition, SIGNAL(currentIndexChanged(int)), liste_voisinage, SLOT(setCurrentIndex(int)));
connect
(
liste_regle_transition
,
SIGNAL
(
currentTextChanged
(
const
QString
&
)),
this
,
SLOT
(
changerVoisinage
(
const
QString
&
)));
connect
(
liste_regle_transition
,
SIGNAL
(
currentTextChanged
(
const
QString
&
)),
this
,
SLOT
(
paramRegle
(
const
QString
)));
bouton_valide
=
new
QPushButton
(
"Valider"
);
bouton_valide
->
setFixedWidth
(
50
);
...
...
@@ -67,19 +68,9 @@ NouveauModele::NouveauModele(QWidget* parent) : QWidget() {
//connect(bouton_valide, SIGNAL(clicked()), SLOT(affParametrage()));
//ajout regle :
seuilMax
=
new
QLabel
(
"Seuil Max : "
);
seuilMin
=
new
QLabel
(
"Seuil Min : "
);
destination
=
new
QLabel
(
"Destination : "
);
etatCourant
=
new
QLabel
(
"Etat Courant : "
);
valid_Etat
=
new
QCheckBox
;
etatDest
=
new
QSpinBox
;
etatDest
->
setRange
(
1
,
8
);
//connect(etatDest, SIGNAL(toggled(bool)), this, SLOT(choisirEtatCourant(QFormLayout*)));
...
...
@@ -90,10 +81,7 @@ NouveauModele::NouveauModele(QWidget* parent) : QWidget() {
form_choix
->
addRow
(
seuilMin
);
form_choix
->
addRow
(
seuilMax
);
form_choix
->
addRow
(
destination
);
form_choix
->
addRow
(
etatCourant
,
valid_Etat
);
...
...
@@ -141,6 +129,15 @@ void NouveauModele::paramVoisinage(const QString& choix_voisinage){
}
void
NouveauModele
::
paramRegle
(
const
QString
&
choix_regle
)
{
seuilMax
=
new
QLabel
(
"Seuil Max : "
);
seuilMin
=
new
QLabel
(
"Seuil Min : "
);
destination
=
new
QLabel
(
"Destination : "
);
etatCourant
=
new
QLabel
(
"Etat Courant : "
);
valid_Etat
=
new
QCheckBox
;
etatDest
=
new
QSpinBox
;
etatDest
->
setRange
(
1
,
8
);
if
(
choix_regle
==
"Nouvelle fonction de transition"
)
{
...
...
@@ -155,8 +152,17 @@ void NouveauModele::paramRegle(const QString& choix_regle) {
form_init
->
addWidget
(
numSeuilMin
[
i
]);
}
}
form_choix
->
addRow
(
seuilMin
);
form_choix
->
addRow
(
seuilMax
);
form_choix
->
addRow
(
destination
,
etatDest
);
form_choix
->
addRow
(
etatCourant
,
valid_Etat
);
connect
(
etatDest
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
choisirEtatCourant
(
bool
)));
}
void
choisirEtatCourant
(
bool
checked
){
numEtatCourant
=
new
QSpinBox
*
;
}
void
NouveauModele
::
affGrille
()
{
delete
grid
;
grid
=
new
QTableWidget
(
5
,
5
);
...
...
@@ -245,8 +251,3 @@ void NouveauModele::changerVoisinage(const QString& choix_regle){
connect
(
liste_voisinage
,
SIGNAL
(
currentTextChanged
(
const
QString
&
)),
this
,
SLOT
(
paramVoisinage
(
const
QString
&
)));
}
/*void choisirEtatCourant(QFormLayout* form_choix){
QSpinBox* numEtatCourant = new QSpinBox;
numEtatCourant->setRange(1,8);
form_choix->addRow("Choisissez l'indice de l'tat courant : ", numEtatCourant);
}*/
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment