Commit e48b8892 authored by Yann Boucher's avatar Yann Boucher
Browse files

Le numéro de la génération ne se mettait pas à jour correctement lors d'un step back

parent 84bc92ab
...@@ -222,13 +222,13 @@ pattern recorded :</string> ...@@ -222,13 +222,13 @@ pattern recorded :</string>
<item> <item>
<widget class="QSpinBox" name="recordSpinBox"> <widget class="QSpinBox" name="recordSpinBox">
<property name="minimum"> <property name="minimum">
<number>0</number> <number>1</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>100</number> <number>500</number>
</property> </property>
<property name="value"> <property name="value">
<number>10</number> <number>50</number>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -608,7 +608,7 @@ pattern recorded :</string> ...@@ -608,7 +608,7 @@ pattern recorded :</string>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1068</width> <width>1068</width>
<height>21</height> <height>25</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFichier"> <widget class="QMenu" name="menuFichier">
......
...@@ -86,7 +86,7 @@ private slots: ...@@ -86,7 +86,7 @@ private slots:
//! \brief Réinitialise la simulation à la grille initiale //! \brief Réinitialise la simulation à la grille initiale
void on_resetButton_clicked(); void on_resetButton_clicked();
//! \brief Change la vitesse de simulation //! \brief Change la profondeur de l'historique de simulation
void on_recordSpinBox_valueChanged(int arg1); void on_recordSpinBox_valueChanged(int arg1);
......
...@@ -82,6 +82,7 @@ MainWindow::MainWindow(QWidget *parent) ...@@ -82,6 +82,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->struct_library->update_cell_pixel_size(ui->grid_view->cell_screen_size()); ui->struct_library->update_cell_pixel_size(ui->grid_view->cell_screen_size());
simulation.setHistorySize(ui->recordSpinBox->value());
simulation.set_boundary_policy(BoundaryPolicy::Periodic); simulation.set_boundary_policy(BoundaryPolicy::Periodic);
if (!try_load_saved_state()) if (!try_load_saved_state())
{ {
...@@ -958,7 +959,7 @@ void MainWindow::on_prevButton_clicked() ...@@ -958,7 +959,7 @@ void MainWindow::on_prevButton_clicked()
QMessageBox::warning(this, "Unable to step back", "Empty history : unable to step back"); QMessageBox::warning(this, "Unable to step back", "Empty history : unable to step back");
} }
ui->grid_view->copy_grid(simulation.getGrid()); ui->grid_view->copy_grid(simulation.getGrid());
ui->nbStepsLabel->setText(simulation.getPeriod()!=-1?QString::number(simulation.getPeriod())+" steps":"none"); ui->nbStepsLabel->setText(QString::number(simulation.getTime())+" steps");
} }
void MainWindow::on_playPauseButton_clicked() void MainWindow::on_playPauseButton_clicked()
......
Markdown is supported
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