From 3f657c93fd3aa5fd07ca0568840aa1ea875d3728 Mon Sep 17 00:00:00 2001 From: Ron Date: Mon, 13 Feb 2023 16:39:43 -0500 Subject: [PATCH] Mods for 1.6.0 --- MSSPM_GuiEstimation/nmfEstimationTab07.cpp | 8 ++++++ MSSPM_GuiEstimation/nmfEstimationTab07.h | 9 ++++++ MSSPM_GuiSetup/nmfSetupTab03.cpp | 32 ++++++++++++---------- MSSPM_GuiSetup/nmfSetupTab04.cpp | 5 ++-- MSSPM_Main/forms/Setup/Setup_Tab04.ui | 4 +-- MSSPM_Main/nmfMainWindow.cpp | 16 +++++++++-- MSSPM_Main/nmfMainWindow.h | 4 +++ 7 files changed, 55 insertions(+), 23 deletions(-) diff --git a/MSSPM_GuiEstimation/nmfEstimationTab07.cpp b/MSSPM_GuiEstimation/nmfEstimationTab07.cpp index b8cd39f..1562d19 100755 --- a/MSSPM_GuiEstimation/nmfEstimationTab07.cpp +++ b/MSSPM_GuiEstimation/nmfEstimationTab07.cpp @@ -1305,6 +1305,8 @@ nmfEstimation_Tab7::callback_SavePB() { bool areEnsembleControlsChecked = Estimation_Tab7_EnsembleControlsGB->isChecked(); + emit DisableMohnsRhoRun(); + // Assure the estimation checkboxes aren't all disabled due to the multi-runs // being selected. If so, enable them, get their states, and then disable them. if (areEnsembleControlsChecked) { @@ -2625,6 +2627,12 @@ nmfEstimation_Tab7::callback_AddToReviewPB() callback_ReloadWidgets(); } +bool +nmfEstimation_Tab7::isEnsembleUsingAll() +{ + return (Estimation_Tab7_EnsembleUsingByCMB->currentText() == "using All"); +} + bool nmfEstimation_Tab7::isEnsembleUsingPct() { diff --git a/MSSPM_GuiEstimation/nmfEstimationTab07.h b/MSSPM_GuiEstimation/nmfEstimationTab07.h index f86ce7e..7ac7001 100755 --- a/MSSPM_GuiEstimation/nmfEstimationTab07.h +++ b/MSSPM_GuiEstimation/nmfEstimationTab07.h @@ -507,6 +507,11 @@ class nmfEstimation_Tab7: public QObject * @return true if Multi-Run, false otherwise */ bool isAMultiRun(); + /** + * @brief Returns whether or not the user has chose the "using All" setting + * @return true if "using All" selected, false otherwise + */ + bool isEnsembleUsingAll(); /** * @brief Returns whether or not the Using Pct button has been pressed * @return true if pressed, false otherwise @@ -899,6 +904,10 @@ class nmfEstimation_Tab7: public QObject */ void CheckAllEstimationTablesAndRun(); // void DimScalarBiomassControls(bool dim); + /** + * @brief Signal to notify main routine to turn off mohns rho flag in diagnostic tab2 page + */ + void DisableMohnsRhoRun(); /** * @brief Signal to notify main routine to set the enable state of all of its Run buttons * @param state : enable state of application's Run buttons diff --git a/MSSPM_GuiSetup/nmfSetupTab03.cpp b/MSSPM_GuiSetup/nmfSetupTab03.cpp index 02078f5..3353bce 100644 --- a/MSSPM_GuiSetup/nmfSetupTab03.cpp +++ b/MSSPM_GuiSetup/nmfSetupTab03.cpp @@ -217,7 +217,7 @@ nmfSetup_Tab3::importSpecies(QStringList& guildList, int numRows = 0; QString errorMsg; QString inputDataPath = QDir(QString::fromStdString(m_ProjectDir)).filePath(QString::fromStdString(nmfConstantsMSSPM::InputDataDir)); - std::vector ColumnsToLoad = {1,2,3,6,10}; // {1,2,3,6,12}; // modify this when implement GrowthRateShape + std::vector ColumnsToLoad = {1,2,3,6,12}; speciesFilename = QFileDialog::getOpenFileName(Setup_Tabs, QObject::tr("Select Species CSV file"), inputDataPath, @@ -1173,20 +1173,22 @@ nmfSetup_Tab3::callback_ImportPB() QString speciesFilename = ""; QStringList guildsList = {}; - QMessageBox::information(Setup_Tabs,"Import","\nSelect Guild CSV file to import first.\n",QMessageBox::Ok); - importOK = importGuilds(guildsList,guildsFilename); - if (importOK) { - emit LoadGuildSupplemental(nmfConstantsMSSPM::Dont_Query_User_For_Filename, - guildsFilename); - } - - QMessageBox::information(Setup_Tabs,"Import","\nSelect Species CSV file to import next.\n",QMessageBox::Ok); - importOK = importSpecies(guildsList,speciesFilename); - if (importOK) { - emit LoadSpeciesSupplemental(nmfConstantsMSSPM::DontUpdateSetup, - nmfConstantsMSSPM::Dont_Query_User_For_Filename, - speciesFilename); - } +// if (onGuildPage()) { + QMessageBox::information(Setup_Tabs,"Import","\nSelect Guild CSV file to import first.\n",QMessageBox::Ok); + importOK = importGuilds(guildsList,guildsFilename); + if (importOK) { + emit LoadGuildSupplemental(nmfConstantsMSSPM::Dont_Query_User_For_Filename, + guildsFilename); + } +// } else { + QMessageBox::information(Setup_Tabs,"Import","\nSelect Species CSV file to import next.\n",QMessageBox::Ok); + importOK = importSpecies(guildsList,speciesFilename); + if (importOK) { + emit LoadSpeciesSupplemental(nmfConstantsMSSPM::DontUpdateSetup, + nmfConstantsMSSPM::Dont_Query_User_For_Filename, + speciesFilename); + } +// } // if (onGuildPage()) { // importOK = importGuilds(); diff --git a/MSSPM_GuiSetup/nmfSetupTab04.cpp b/MSSPM_GuiSetup/nmfSetupTab04.cpp index cba3a4e..a47640b 100755 --- a/MSSPM_GuiSetup/nmfSetupTab04.cpp +++ b/MSSPM_GuiSetup/nmfSetupTab04.cpp @@ -365,7 +365,7 @@ nmfSetup_Tab4::loadModel() std::map > dataMap; std::string queryStr; ModelData data; -qDebug() << "Loading model: " << QString::fromStdString(m_ModelName); + readSettings(); m_logger->logMsg(nmfConstants::Normal,"Loading: "+m_ModelName); @@ -469,10 +469,9 @@ qDebug() << "Loading model: " << QString::fromStdString(m_ModelName); saveSettings(); - emit ModelLoaded(); - setEstimatedParameterNames(); + emit ModelLoaded(); emit UpdateDiagnosticParameterChoices(); } diff --git a/MSSPM_Main/forms/Setup/Setup_Tab04.ui b/MSSPM_Main/forms/Setup/Setup_Tab04.ui index e6bf53f..96d6694 100644 --- a/MSSPM_Main/forms/Setup/Setup_Tab04.ui +++ b/MSSPM_Main/forms/Setup/Setup_Tab04.ui @@ -634,10 +634,10 @@ This value is read-only and auto-generated. - 1900 + 0 - 3000 + 9999 diff --git a/MSSPM_Main/nmfMainWindow.cpp b/MSSPM_Main/nmfMainWindow.cpp index e73a22a..bc5278c 100755 --- a/MSSPM_Main/nmfMainWindow.cpp +++ b/MSSPM_Main/nmfMainWindow.cpp @@ -3655,6 +3655,8 @@ nmfMainWindow::initConnections() this, SLOT(callback_SetEstimatedParameterNames())); connect(Estimation_Tab7_ptr, SIGNAL(LoadEstimatedParameters()), this, SLOT(callback_LoadEstimatedParameters())); + connect(Estimation_Tab7_ptr, SIGNAL(DisableMohnsRhoRun()), + this, SLOT(callback_DisableMohnsRhoRun())); connect(Estimation_Tab8_ptr, SIGNAL(LoadFromModelReview(nmfStructsQt::ModelReviewStruct)), this, SLOT(callback_LoadFromModelReview(nmfStructsQt::ModelReviewStruct))); connect(Estimation_Tab6_ptr, SIGNAL(ReloadDiagnosticWidgets()), @@ -11060,7 +11062,7 @@ nmfMainWindow::callback_RunEstimation(bool showDiagnosticsChart) QString multiRunSpeciesFilename; QString multiRunModelFilename; QString msg; - +qDebug() <<"isAMultiOrMohnsRhoRun: " << isAMultiRun; saveSettings(); loadAllWidgets(); readSettings(); @@ -12807,9 +12809,10 @@ std::cout << "Warning: TBD nmfMainWindow::calculateAverageBiomass: refine logic usingTopValue = Estimation_Tab7_ptr->getEnsembleUsingAmountValue(); } - bool isPercent = Estimation_Tab7_ptr->isEnsembleUsingPct(); + bool isUsingAll = Estimation_Tab7_ptr->isEnsembleUsingAll(); + bool isPercent = Estimation_Tab7_ptr->isEnsembleUsingPct(); - m_AveragedData->calculateAverage(usingTopValue,isPercent,aveAlgorithm); + m_AveragedData->calculateAverage(usingTopValue,isUsingAll,isPercent,aveAlgorithm); m_AveragedData->getAveData(Fitness, AveInitBiomass, AveGrowthRates, @@ -15920,6 +15923,13 @@ nmfMainWindow::callback_DiagnosticsTabChanged(int tab) NavigatorTree->blockSignals(false); } +void +nmfMainWindow::callback_DisableMohnsRhoRun() +{ + Diagnostic_Tab2_ptr->setMohnsRhoForSingleRun(false); + Diagnostic_Tab2_ptr->setMohnsRhoForMultiRun(false); +} + void nmfMainWindow::callback_ForecastTabChanged(int tab) { diff --git a/MSSPM_Main/nmfMainWindow.h b/MSSPM_Main/nmfMainWindow.h index e5d4bdf..e6e8739 100755 --- a/MSSPM_Main/nmfMainWindow.h +++ b/MSSPM_Main/nmfMainWindow.h @@ -1230,6 +1230,10 @@ public slots: * @param tab : Diagnostics tab selected */ void callback_DiagnosticsTabChanged(int tab); + /** + * @brief Callback invoked to disable any mohns rho settings once a user saves a single or multi run + */ + void callback_DisableMohnsRhoRun(); /** * @brief Callback invoked to set the state of the toolbar's filter buttons * @param state : state to set the toolbar filter buttons to