Commits

Arturo Hernandez  committed 20bfb66

Refactor old on_btnShowTabData_clicked function

Now, it is simply called simulationShowTabbedData, and does the same,
tabs the data, so it is put into a model usable by the tableView.

Remove the enable/disable switch between simulation, as there is no
pair of buttons now.

Also, reorder the private functions and variable members in the header
file.

  • Participants
  • Parent commits 3c92e4e
  • Tags v0.9

Comments (0)

Files changed (2)

File mvGUIClient/mainwindow.cpp

     // This should be done with a bool function
     // TODO: Refactor this in smaller pieces that return boolean codes.
 
-
-    // this->ui->btnShowTabData->setEnabled(true);
-    this->ui->btnGenerateTabData->setEnabled(false);
     QMessageBox::information(this, tr("Simulacion"),
                              tr("Ahora puede visualizar la tabla de datos"));
-    on_btnShowTabData_clicked();
-
+    simulationShowTabbedData();
 }
 
-void MainWindow::on_btnShowTabData_clicked()
+void MainWindow::simulationShowTabbedData()
 {
     // First, we check if there is already data on memory
     // If exist, then we liberate that data, so we dont have leaks when reasigning
     // And now, delete the "table", because we have already graphicated it.
     delete table;
     table = NULL;
-
-    // And stop the user from creating more tables if not tabulated before
-    // this->ui->btnShowTabData->setEnabled(false);
-    this->ui->btnGenerateTabData->setEnabled(true);
 }
 
 bool MainWindow::writeNumbersToFile()

File mvGUIClient/mainwindow.h

     std::vector<int> *poissonVariables;
     QVector<double> plotKeyData;
     QVector<double> plotValueData;
+    std::vector<MvSimulationTable> *table;
+    QStandardItemModel *simTableModel;
+
     bool writeNumbersToFile();
     bool writeCustomNumbersToFile();
     bool validateNumbersInput();
     void showXSquare(double value);
     void tabulateData();
     void setPoissonPlot();
-    std::vector<MvSimulationTable> *table;
-    QStandardItemModel *simTableModel;
+    void simulationShowTabbedData();
 
 private slots:
     void on_btnNumbersDefault_clicked();
     void on_btnTestFileSelect_clicked();
     void on_btnPoissonVarGen_clicked();
     void on_btnGenerateTabData_clicked();
-    void on_btnShowTabData_clicked();
 };
 
 #endif // MAINWINDOW_H