Make sure we read the LAS file contents, too, when loading a project (#6507)

* Make sure we read the LAS file contents, too, when loading a project
* Refactor WellPathCollection data loading on project open to simplify things a bit.
This commit is contained in:
jonjenssen
2020-09-21 10:59:08 +02:00
committed by GitHub
parent 85f2b3faf0
commit 8bb460c2db
2 changed files with 27 additions and 28 deletions

View File

@@ -511,26 +511,10 @@ bool RiaApplication::loadProject( const QString& projectFileName,
if ( oilField == nullptr ) continue; if ( oilField == nullptr ) continue;
if ( oilField->wellPathCollection == nullptr ) if ( oilField->wellPathCollection == nullptr )
{ {
// printf("Create well path collection for oil field %i in loadProject.\n", oilFieldIdx);
oilField->wellPathCollection = new RimWellPathCollection(); oilField->wellPathCollection = new RimWellPathCollection();
} }
if ( oilField->wellPathCollection ) oilField->wellPathCollection->loadDataAndUpdate();
{
oilField->wellPathCollection->loadDataAndUpdate();
oilField->wellPathCollection->readWellPathFormationFiles();
for ( RimWellPath* wellPath : oilField->wellPathCollection->wellPaths() )
{
RimFractureModelCollection* fractureModelCollection = wellPath->fractureModelCollection();
if ( fractureModelCollection )
{
for ( RimFractureModel* fractureModel : fractureModelCollection->allFractureModels() )
{
fractureModel->loadDataAndUpdate();
}
}
}
}
} }
{ {

View File

@@ -34,13 +34,14 @@
#include "RimEclipseCase.h" #include "RimEclipseCase.h"
#include "RimEclipseCaseCollection.h" #include "RimEclipseCaseCollection.h"
#include "RimEclipseView.h" #include "RimEclipseView.h"
#include "RimFractureModel.h"
#include "RimFractureModelCollection.h"
#include "RimOilField.h" #include "RimOilField.h"
#include "RimPerforationCollection.h" #include "RimPerforationCollection.h"
#include "RimProject.h" #include "RimProject.h"
#include "RimWellLogFile.h" #include "RimWellLogFile.h"
#include "RimWellMeasurementCollection.h" #include "RimWellMeasurementCollection.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "Riu3DMainWindowTools.h" #include "Riu3DMainWindowTools.h"
#include "RifWellPathFormationsImporter.h" #include "RifWellPathFormationsImporter.h"
@@ -143,10 +144,14 @@ void RimWellPathCollection::loadDataAndUpdate()
{ {
caf::ProgressInfo progress( wellPaths.size(), "Reading well paths from file" ); caf::ProgressInfo progress( wellPaths.size(), "Reading well paths from file" );
for ( size_t wpIdx = 0; wpIdx < wellPaths.size(); wpIdx++ ) readWellPathFormationFiles();
for ( RimWellPath* wellPath : wellPaths() )
{ {
RimFileWellPath* fWPath = dynamic_cast<RimFileWellPath*>( wellPaths[wpIdx] ); progress.setProgressDescription( QString( "Reading file %1" ).arg( wellPath->name() ) );
RimModeledWellPath* mWPath = dynamic_cast<RimModeledWellPath*>( wellPaths[wpIdx] );
RimFileWellPath* fWPath = dynamic_cast<RimFileWellPath*>( wellPath );
RimModeledWellPath* mWPath = dynamic_cast<RimModeledWellPath*>( wellPath );
if ( fWPath ) if ( fWPath )
{ {
if ( !fWPath->filePath().isEmpty() ) if ( !fWPath->filePath().isEmpty() )
@@ -157,8 +162,15 @@ void RimWellPathCollection::loadDataAndUpdate()
RiaLogging::warning( errorMessage ); RiaLogging::warning( errorMessage );
} }
} }
}
else if ( mWPath )
{
mWPath->createWellPathGeometry();
}
for ( RimWellLogFile* const wellLogFile : fWPath->wellLogFiles() ) if ( wellPath )
{
for ( RimWellLogFile* const wellLogFile : wellPath->wellLogFiles() )
{ {
if ( wellLogFile ) if ( wellLogFile )
{ {
@@ -169,13 +181,16 @@ void RimWellPathCollection::loadDataAndUpdate()
} }
} }
} }
}
else if ( mWPath )
{
mWPath->createWellPathGeometry();
}
progress.setProgressDescription( QString( "Reading file %1" ).arg( wellPaths[wpIdx]->name() ) ); RimFractureModelCollection* fractureModelCollection = wellPath->fractureModelCollection();
if ( fractureModelCollection )
{
for ( RimFractureModel* fractureModel : fractureModelCollection->allFractureModels() )
{
fractureModel->loadDataAndUpdate();
}
}
}
progress.incrementProgress(); progress.incrementProgress();
} }