mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 22:50:25 -05:00
#14780 Create a best effort ensemble instead of nothing for None grouping
RiaEnsembleNameTools::groupFilesByEnsembleName had no branch for EnsembleGroupingMode::NONE, so it silently returned an empty map and no ensemble was created for this grouping mode. Add handling that groups all input files into a single ensemble. Also surface warning dialogs instead of silently doing nothing when no ensemble/grid ensemble could be created from the selected files, in RicImportGridAndSummaryEnsembleFeature and RicCreateGridCaseEnsemblesFromFilesFeature.
This commit is contained in:
1 parent
8f9b828ac4
commit
e269893c04
3 files changed
+43
-3
No files matched your search
+15
-1
@@ -47,6 +47,9 @@
|
||||
#include <QAction>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicCreateGridCaseEnsemblesFromFilesFeature, "RicCreateGridCaseEnsemblesFromFilesFeature" );
|
||||
|
||||
@@ -73,7 +76,18 @@ void RicCreateGridCaseEnsemblesFromFilesFeature::onActionTriggered( bool isCheck
|
||||
}
|
||||
}
|
||||
|
||||
if ( gridEnsembles.empty() ) return;
|
||||
if ( fileNames.isEmpty() ) return;
|
||||
|
||||
bool anyCasesCreated = std::any_of( gridEnsembles.begin(),
|
||||
gridEnsembles.end(),
|
||||
[]( RimEclipseCaseEnsemble* ensemble ) { return ensemble && !ensemble->cases().empty(); } );
|
||||
if ( !anyCasesCreated )
|
||||
{
|
||||
QMessageBox::warning( RiaGuiApplication::widgetToUseAsParent(),
|
||||
"Grid Ensemble Import Failed",
|
||||
"No grid ensemble could be created from the selected files." );
|
||||
return;
|
||||
}
|
||||
|
||||
auto firstEnsemble = gridEnsembles.front();
|
||||
if ( firstEnsemble->cases().empty() ) return;
|
||||
|
||||
Reference in new issue
Block a user