Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LO21_Pin_Noir_Boucher_Bouri_Detree
CellulutLO21
Commits
786fdc58
Commit
786fdc58
authored
Jun 11, 2021
by
Yann Boucher
Browse files
Merge branch 'master' of
https://gitlab.utc.fr/lo21_pin_noir_boucher_bouri_detree/cellulutlo21
parents
5140c806
c2d21c8e
Pipeline
#79689
passed with stages
in 17 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
forms/interface.ui
View file @
786fdc58
...
...
@@ -93,6 +93,13 @@
<layout
class=
"QVBoxLayout"
name=
"simSpeedLayout_3"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"simSpeedLabLayout_2"
>
<item>
<widget
class=
"QLabel"
name=
"simStatusLabel"
>
<property
name=
"text"
>
<string>
Status :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"simSpeedLabel"
>
<property
name=
"text"
>
...
...
@@ -601,7 +608,7 @@ pattern recorded :</string>
<x>
0
</x>
<y>
0
</y>
<width>
1068
</width>
<height>
2
5
</height>
<height>
2
1
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menuFichier"
>
...
...
include/grid.h
View file @
786fdc58
...
...
@@ -103,7 +103,10 @@ public:
}
}
}
//! \brief Recopie de la grille
Grid
&
operator
=
(
const
Grid
&
g
);
//! \brief Vérifie si deux grilles sont identiques
bool
operator
==
(
const
Grid
&
);
//! \brief Retourne une structure représentant le contenu non-nul de la Grid (les cellules d'état != 0), pour un enregistrement dans un fichier par exemple.
...
...
include/simulation.hpp
View file @
786fdc58
...
...
@@ -13,6 +13,7 @@ Cette classe représente un automate cellulaire dans le temps.
#include "grid.h"
#include "automaton.hpp"
//! \brief Cette classe représente un automate cellulaire dans le temps.
class
Simulation
{
private:
bool
canRun
;
...
...
@@ -81,6 +82,10 @@ public:
//! \return vrai si la simulation peut tourner
bool
runnable
()
{
return
canRun
;}
//! \brief Indique si la simulation est gelée
//! \return vrai si le nouvel état est le même que le dernier
bool
frozen
()
{
return
hist
.
topGrid
()
==
automaton
.
getGrid
();}
//! \brief Donne la période de la simulation
//!
//! Si elle n'est pas encore obtenue : vaut 0
...
...
src/interface.cpp
View file @
786fdc58
...
...
@@ -944,6 +944,9 @@ void MainWindow::on_nextButton_clicked()
ui
->
grid_view
->
copy_grid
(
simulation
.
getGrid
());
ui
->
stepsPeriodLabel
->
setText
(
QString
::
number
(
simulation
.
getPeriod
())
+
" steps"
);
ui
->
nbStepsLabel
->
setText
(
QString
::
number
(
simulation
.
getTime
())
+
" steps"
);
if
(
simulation
.
frozen
())
{
ui
->
simStatusLabel
->
setText
(
"Status : frozen"
);
}
}
void
MainWindow
::
on_prevButton_clicked
()
...
...
@@ -960,10 +963,12 @@ void MainWindow::on_playPauseButton_clicked()
if
(
timer
->
isActive
())
{
//Pause
ui
->
playPauseButton
->
setText
(
"Play"
);
ui
->
simStatusLabel
->
setText
(
"Status : inactive"
);
timer
->
stop
();
}
else
{
//Play
ui
->
playPauseButton
->
setText
(
"Pause"
);
ui
->
simStatusLabel
->
setText
(
"Status : active"
);
int
frequence
=
ui
->
simSpeedSpinbox
->
value
();
if
(
frequence
==
0
)
{
QMessageBox
::
critical
(
this
,
"Unable to start"
,
"Speed needs to be nonzero."
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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