Verified Commit d75a442e authored by Romain De Laage De Bellefaye's avatar Romain De Laage De Bellefaye 🌳
Browse files

Merge branch 'master' of gitlab.utc.fr:rdelaage/lo21-projet

parents 9d7b0c67 105e4f5e
Pipeline #79736 passed with stage
in 15 seconds
......@@ -73,6 +73,11 @@ class AutoCell : public QWidget
QPushButton* button_next;
QPushButton* button_reinitialiser;
QLabel* lab_nb_step;
QLineEdit* edit_nb_step;
QLabel* lab_periode;
QLineEdit* edit_periode;
QLabel* lab_sauv_grille;
QLineEdit* edit_nom_grille;
QPushButton* button_save_grid;
......@@ -81,10 +86,6 @@ class AutoCell : public QWidget
QWidget* win_grid;
QTableWidget* grid;
//notice
QWidget* win_notice;
QLabel* lab_notice;
explicit AutoCell(QWidget* parent=nullptr);
friend class NouveauModele;
public:
......@@ -131,7 +132,7 @@ class AutoCell : public QWidget
/// Initialiser un automate par son nom
void initAutomate(const QString& name);
/// Changer le délai de l'automate
void changeDelai(int i);
void changeDelai();
/// Aller en arrière dans la simulation
void previous();
/// Aller en avant dans la simulation
......
......@@ -36,8 +36,8 @@ std::unique_ptr<AutoCell> AutoCell::instance = nullptr;
AutoCell::AutoCell(QWidget* parent):QWidget(parent)
{
this->setWindowTitle("Automate cellulaire");
this->setMinimumSize(1150, 650);
this->setWindowTitle("Automate cellulaire");
this->setMinimumSize(1000, 650);
//division en frame de la fenêtre de l'application
......@@ -134,10 +134,10 @@ AutoCell::AutoCell(QWidget* parent):QWidget(parent)
grid_run_control = new QGridLayout(win_run_ctrl);
grid_run_control->setColumnMinimumWidth(1,100);
grid_run_control->setColumnMinimumWidth(2,100);
grid_run_control->setColumnMinimumWidth(1,80);
grid_run_control->setColumnMinimumWidth(2,80);
grid_run_control->setRowMinimumHeight(3,80);
grid_run_control->setRowMinimumHeight(4,400);
grid_run_control->setRowMinimumHeight(7,300);
grid_run_control->addWidget(lab_run_crtl, 0,0,1,3,Qt::AlignTop);
......@@ -150,7 +150,7 @@ AutoCell::AutoCell(QWidget* parent):QWidget(parent)
spin_time_step->setFixedWidth(70);
spin_time_step->setValue(1000);
spin_time_step->setRange(500,2500);
connect(spin_time_step, SIGNAL(valueChanged(int)), this, SLOT(changeDelai(int)));
connect(spin_time_step, SIGNAL(valueChanged()), this, SLOT(changeDelai()));
button_prev = new QPushButton("<<");
button_prev->setStyleSheet("background-color: rgb(255,255,255)");
button_prev->setFixedSize(40,40);
......@@ -167,13 +167,31 @@ AutoCell::AutoCell(QWidget* parent):QWidget(parent)
button_reinitialiser->setStyleSheet("background-color: rgb(255,255,255)");
button_reinitialiser->setFixedWidth(200);
grid_run_control->addWidget(matriceTorique, 1, 0, 1, 2);
lab_nb_step = new QLabel("Nombre d'étapes : ");
edit_nb_step = new QLineEdit;
edit_nb_step->setReadOnly(true);
edit_nb_step->setFixedWidth(30);
edit_nb_step->setText("0");
edit_nb_step->setStyleSheet("background-color: rgb(255,255,255)");
lab_periode = new QLabel("Période observée : ");
edit_periode = new QLineEdit;
edit_periode->setReadOnly(true);
edit_periode->setFixedWidth(30);
edit_periode->setText("0");
edit_periode->setStyleSheet("background-color: rgb(255,255,255)");
grid_run_control->addWidget(matriceTorique, 1, 0, Qt::AlignCenter);
grid_run_control->addWidget(lab_time_step, 2, 0);
grid_run_control->addWidget(spin_time_step, 2, 1);
grid_run_control->addWidget(button_prev, 3, 0);
grid_run_control->addWidget(button_run, 3, 1);
grid_run_control->addWidget(button_next, 3, 2);
grid_run_control->addWidget(button_reinitialiser, 4, 0, Qt::AlignCenter);
grid_run_control->addWidget(button_reinitialiser, 4, 0, Qt::AlignTop);
grid_run_control->addWidget(lab_nb_step, 5,0);
grid_run_control->addWidget(edit_nb_step, 5,1);
grid_run_control->addWidget(lab_periode,6,0);
grid_run_control->addWidget(edit_periode,6,1);
lab_sauv_grille = new QLabel("Sauvegarder la grille courante");
edit_nom_grille = new QLineEdit;
......@@ -186,9 +204,9 @@ AutoCell::AutoCell(QWidget* parent):QWidget(parent)
button_save_grid->setFixedWidth(90);
connect(button_save_grid,SIGNAL(clicked()),this,SLOT(sauvegarderGrille()));
grid_run_control->addWidget(lab_sauv_grille,4,0,1,3, Qt::AlignBottom);
grid_run_control->addWidget(edit_nom_grille,5,0, Qt::AlignBottom);
grid_run_control->addWidget(button_save_grid,5,2,Qt::AlignBottom);
grid_run_control->addWidget(lab_sauv_grille,7,0,1,3, Qt::AlignBottom);
grid_run_control->addWidget(edit_nom_grille,8,0, Qt::AlignBottom);
grid_run_control->addWidget(button_save_grid,8,2,Qt::AlignBottom);
general->addWidget(win_run_ctrl,1,0,2,1);
......@@ -197,16 +215,6 @@ AutoCell::AutoCell(QWidget* parent):QWidget(parent)
win_grid = new QWidget;
grid = new QTableWidget(0,0,win_grid);
//notice
win_notice = new QWidget;
win_notice->setStyleSheet("background-color: rgb(204, 209, 209)");
win_notice->setMaximumWidth(300);
win_notice->setMinimumWidth(200);
lab_notice = new QLabel("Notice :", win_notice);
general->addWidget(win_notice,0,2,3,1);
};
void AutoCell::afficherGrille(Reseau* grille)
......@@ -407,8 +415,8 @@ void AutoCell::initAutomate(const QString& name) {
matriceTorique->setCheckState(Qt::Checked);
}
void AutoCell::changeDelai(int i) {
Automate::getInstance().setDelai(static_cast<unsigned int>(i));
void AutoCell::changeDelai() {
Automate::getInstance().setDelai(static_cast<unsigned int>(spin_time_step->value()));
}
void AutoCell::next() {
......
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