Commit 9274ae69 authored by Anthony Noir's avatar Anthony Noir
Browse files

taille Historique paramétrable

parent ef6cd4d8
......@@ -186,35 +186,17 @@
<string>Number of previous
pattern recorded :</string>
</property>
<property name="buddy">
<cstring>recordLineEdit</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="recordLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
<widget class="QSpinBox" name="recordSpinBox">
<property name="minimum">
<number>0</number>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>10</string>
<property name="maximum">
<number>100</number>
</property>
<property name="maxLength">
<property name="value">
<number>10</number>
</property>
</widget>
......
......@@ -81,6 +81,8 @@ private slots:
void on_resetButton_clicked();
void on_recordSpinBox_valueChanged(int arg1);
private:
//! \brief Initialiser la liste des transitions et voisinages disponibles
void init_transition_neighborhood_list();
......
......@@ -52,6 +52,13 @@ public:
//! \brief Modificateur de la taille de l'historique
//!
//! Vide également l'historique
void setHistorySize(unsigned int size) {hist = History(size);}
//! \brief Définit la grille
//!
//! Si la simulation est lancée, cela ne modifie pas la grille de départ. Cela définit la grille de départ dans le cas contraire.
......
......@@ -654,3 +654,7 @@ void MainWindow::on_resetButton_clicked() {
simulation.reset();
ui->grid_view->copy_grid(simulation.getGrid());
}
void MainWindow::on_recordSpinBox_valueChanged(int newSize) {
simulation.setHistorySize(newSize);
}
......@@ -31,7 +31,7 @@ void Simulation::setGrid(const Grid & grid) {
if(!time) {
startGrid = grid;
time = 0;
hist = History(10);
hist = History(hist.get_nbMax());
} else if((grid.get_col() != automaton.getGrid().get_col())&&(grid.get_rows() != automaton.getGrid().get_rows())) {
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment