Skip to content

Commit

Permalink
Fixed issue where you can't export override file is no maps_fit_param…
Browse files Browse the repository at this point in the history
…eters_override.txt file exists
  • Loading branch information
Arthur Glowacki committed Nov 14, 2024
1 parent b69e056 commit 7649c1d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mvc/MapsElementsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,15 @@ void MapsElementsWidget::on_export_fit_params(data_struct::Fit_Parameters<double
}
}
}
else
{
QMessageBox::critical(nullptr, "Export Fit Parameters", "Param override variable is nullptr, can't save data.");
}
}
else
{
QMessageBox::critical(nullptr, "Export Fit Parameters", "Model is nullptr, can't save data.");
}
}

//---------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions src/mvc/MapsWorkspaceFilesWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ void MapsWorkspaceFilesWidget::onOpenModel(const QStringList& names_list, MODEL_
if (param_override == nullptr)
{
param_override = _model->getParamOverride(-1);
}
if (param_override == nullptr)
{
// generate param file
param_override = new data_struct::Params_Override<double>();
}
h5Model->set_fit_parameters_override(param_override);
emit loaded_model(name, mt);
Expand Down

0 comments on commit 7649c1d

Please sign in to comment.