From 1b56da90f1beb88e93d5c550efd1c3a00bbd2e65 Mon Sep 17 00:00:00 2001 From: Ron Date: Mon, 26 Sep 2022 22:17:55 -0400 Subject: [PATCH] Mods for 1.3.4 --- MSSPM_GuiEstimation/nmfEstimationTab06.cpp | 34 +++++++++++++++++++--- MSSPM_Main/nmfMainWindow.cpp | 2 +- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/MSSPM_GuiEstimation/nmfEstimationTab06.cpp b/MSSPM_GuiEstimation/nmfEstimationTab06.cpp index 33eb500..54d3779 100755 --- a/MSSPM_GuiEstimation/nmfEstimationTab06.cpp +++ b/MSSPM_GuiEstimation/nmfEstimationTab06.cpp @@ -1189,6 +1189,7 @@ nmfEstimation_Tab6::saveInitialValuesAndRangesTable() } } saveCmd = saveCmd.substr(0,saveCmd.size()-1); +//std::cout << "saveCmd: " << saveCmd << std::endl; errorMsg = m_DatabasePtr->nmfUpdateDatabase(saveCmd); if (nmfUtilsQt::isAnError(errorMsg)) { m_Logger->logMsg(nmfConstants::Error,"nmfEstimation_Tab6::saveInitialValuesAndRangesTable: Write table error: " + errorMsg); @@ -1374,15 +1375,40 @@ nmfEstimation_Tab6::callback_SavePB() bool loadOK = loadInitialValuesAndRangesForEditableCells(); if (loadOK) { saveInitialValuesAndRangesTable(); - QApplication::restoreOverrideCursor(); - QMessageBox::information(Estimation_Tabs,"Save", - "\nSuccessful save of table: "+QString::fromStdString(nmfConstantsMSSPM::TableCovariateAssignment), - QMessageBox::Ok); +// QApplication::restoreOverrideCursor(); +// QMessageBox::information(Estimation_Tabs,"Save", +// "\nSuccessful save of table: "+QString::fromStdString(nmfConstantsMSSPM::TableCovariateInitialValuesAndRanges), +// QMessageBox::Ok); } + QApplication::restoreOverrideCursor(); + QMessageBox::information(Estimation_Tabs,"Save", + "\nSuccessful save of table: "+QString::fromStdString(nmfConstantsMSSPM::TableCovariateAssignment), + QMessageBox::Ok); + + // Call reload callback + loadWidgets(); // Needed to ensure that after loading a new model, all of the covariate tabs load properly and the estimation runs properly + } else { + QApplication::restoreOverrideCursor(); + QMessageBox::information(Estimation_Tabs,"Save", + "\nCould not save table: "+QString::fromStdString(nmfConstantsMSSPM::TableCovariateAssignment), + QMessageBox::Ok); } } else if (Estimation_Tab6_InitialValuesTV->isVisible()) { ok = saveInitialValuesAndRangesTable(); if (ok) { + saveCovariateAssignmentTable(); + + ok = saveCovariateAssignmentTable(); + if (ok) { + initializeInitialValuesAndRangesTable(); + bool loadOK = loadInitialValuesAndRangesForEditableCells(); + QApplication::restoreOverrideCursor(); + QMessageBox::information(Estimation_Tabs,"Save", + "\nSuccessful save of table: "+QString::fromStdString(nmfConstantsMSSPM::TableCovariateAssignment), + QMessageBox::Ok); + } + + QApplication::restoreOverrideCursor(); QMessageBox::information(Estimation_Tabs,"Save", "\nSuccessful save of table: "+QString::fromStdString(nmfConstantsMSSPM::TableCovariateInitialValuesAndRanges), diff --git a/MSSPM_Main/nmfMainWindow.cpp b/MSSPM_Main/nmfMainWindow.cpp index 8f28bff..c24ad42 100755 --- a/MSSPM_Main/nmfMainWindow.cpp +++ b/MSSPM_Main/nmfMainWindow.cpp @@ -2072,7 +2072,7 @@ void nmfMainWindow::menu_about() { QString name = "Multi-Species Surplus Production Model"; - QString version = "MSSPM v1.3.3 "; + QString version = "MSSPM v1.3.4 "; QString specialAcknowledgement = ""; QString cppVersion = "C++??"; QString mysqlVersion = "?";