Skip to content

Commit

Permalink
Mods for 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rklasky committed Feb 13, 2023
1 parent 212214e commit 3f657c9
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 23 deletions.
8 changes: 8 additions & 0 deletions MSSPM_GuiEstimation/nmfEstimationTab07.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
{
Expand Down
9 changes: 9 additions & 0 deletions MSSPM_GuiEstimation/nmfEstimationTab07.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
32 changes: 17 additions & 15 deletions MSSPM_GuiSetup/nmfSetupTab03.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> ColumnsToLoad = {1,2,3,6,10}; // {1,2,3,6,12}; // modify this when implement GrowthRateShape
std::vector<int> ColumnsToLoad = {1,2,3,6,12};

speciesFilename = QFileDialog::getOpenFileName(Setup_Tabs,
QObject::tr("Select Species CSV file"), inputDataPath,
Expand Down Expand Up @@ -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();
Expand Down
5 changes: 2 additions & 3 deletions MSSPM_GuiSetup/nmfSetupTab04.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ nmfSetup_Tab4::loadModel()
std::map<std::string, std::vector<std::string> > dataMap;
std::string queryStr;
ModelData data;
qDebug() << "Loading model: " << QString::fromStdString(m_ModelName);

readSettings();

m_logger->logMsg(nmfConstants::Normal,"Loading: "+m_ModelName);
Expand Down Expand Up @@ -469,10 +469,9 @@ qDebug() << "Loading model: " << QString::fromStdString(m_ModelName);

saveSettings();

emit ModelLoaded();

setEstimatedParameterNames();

emit ModelLoaded();
emit UpdateDiagnosticParameterChoices();

}
Expand Down
4 changes: 2 additions & 2 deletions MSSPM_Main/forms/Setup/Setup_Tab04.ui
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,10 @@ This value is read-only and auto-generated.</string>
</font>
</property>
<property name="minimum">
<number>1900</number>
<number>0</number>
</property>
<property name="maximum">
<number>3000</number>
<number>9999</number>
</property>
</widget>
</item>
Expand Down
16 changes: 13 additions & 3 deletions MSSPM_Main/nmfMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down Expand Up @@ -11060,7 +11062,7 @@ nmfMainWindow::callback_RunEstimation(bool showDiagnosticsChart)
QString multiRunSpeciesFilename;
QString multiRunModelFilename;
QString msg;

qDebug() <<"isAMultiOrMohnsRhoRun: " << isAMultiRun;
saveSettings();
loadAllWidgets();
readSettings();
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
{
Expand Down
4 changes: 4 additions & 0 deletions MSSPM_Main/nmfMainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f657c9

Please sign in to comment.