mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7965 Ensemble Fracture Statistics: Group by iteration.
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "RicImportEnsembleFractureStatisticsFeature.h"
|
#include "RicImportEnsembleFractureStatisticsFeature.h"
|
||||||
|
|
||||||
|
#include "RiaEnsembleNameTools.h"
|
||||||
#include "RiaGuiApplication.h"
|
#include "RiaGuiApplication.h"
|
||||||
|
|
||||||
#include "RicRecursiveFileSearchDialog.h"
|
#include "RicRecursiveFileSearchDialog.h"
|
||||||
@@ -58,6 +59,24 @@ void RicImportEnsembleFractureStatisticsFeature::onActionTriggered( bool isCheck
|
|||||||
QString pathCacheName = "INPUT_FILES";
|
QString pathCacheName = "INPUT_FILES";
|
||||||
QStringList fileNames = runRecursiveFileSearchDialog( "Import StimPlan Fractures", pathCacheName );
|
QStringList fileNames = runRecursiveFileSearchDialog( "Import StimPlan Fractures", pathCacheName );
|
||||||
|
|
||||||
|
std::vector<QStringList> groupedByEnsemble = RiaEnsembleNameTools::groupFilesByEnsemble( fileNames );
|
||||||
|
for ( const QStringList& groupedFileNames : groupedByEnsemble )
|
||||||
|
{
|
||||||
|
importSingleEnsembleFractureStatistics( groupedFileNames );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicImportEnsembleFractureStatisticsFeature::importSingleEnsembleFractureStatistics( const QStringList& fileNames )
|
||||||
|
{
|
||||||
|
auto fractureGroupStatistics = new RimEnsembleFractureStatistics;
|
||||||
|
QString ensembleNameSuggestion = RiaEnsembleNameTools::findSuitableEnsembleName( fileNames );
|
||||||
|
fractureGroupStatistics->setName( ensembleNameSuggestion );
|
||||||
|
|
||||||
|
caf::ProgressInfo progInfo( fileNames.size() + 1, "Creating Ensemble Fracture Statistics" );
|
||||||
|
|
||||||
RimProject* project = RimProject::current();
|
RimProject* project = RimProject::current();
|
||||||
CVF_ASSERT( project );
|
CVF_ASSERT( project );
|
||||||
|
|
||||||
@@ -71,11 +90,6 @@ void RicImportEnsembleFractureStatisticsFeature::onActionTriggered( bool isCheck
|
|||||||
completionTemplateCollection->fractureGroupStatisticsCollection();
|
completionTemplateCollection->fractureGroupStatisticsCollection();
|
||||||
if ( !fractureGroupStatisticsCollection ) return;
|
if ( !fractureGroupStatisticsCollection ) return;
|
||||||
|
|
||||||
auto fractureGroupStatistics = new RimEnsembleFractureStatistics;
|
|
||||||
fractureGroupStatistics->setName( "Ensemble Fracture Statistics" );
|
|
||||||
|
|
||||||
caf::ProgressInfo progInfo( fileNames.size() + 1, "Creating Ensemble Fracture Statistics" );
|
|
||||||
|
|
||||||
for ( auto f : fileNames )
|
for ( auto f : fileNames )
|
||||||
{
|
{
|
||||||
auto task = progInfo.task( "Loading files", 1 );
|
auto task = progInfo.task( "Loading files", 1 );
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ public:
|
|||||||
static QStringList runRecursiveFileSearchDialog( const QString& dialogTitle, const QString& pathCacheName );
|
static QStringList runRecursiveFileSearchDialog( const QString& dialogTitle, const QString& pathCacheName );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
static void importSingleEnsembleFractureStatistics( const QStringList& fileNames );
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
bool isCommandEnabled() override;
|
bool isCommandEnabled() override;
|
||||||
void onActionTriggered( bool isChecked ) override;
|
void onActionTriggered( bool isChecked ) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user