Skip to content

Commit

Permalink
Make sure seismic file reader is created in RiaApplication::loadProje…
Browse files Browse the repository at this point in the history
…ct()
  • Loading branch information
magnesj committed Oct 17, 2023
1 parent a4428c1 commit 18e9ef0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
11 changes: 10 additions & 1 deletion ApplicationLibCode/Application/RiaApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
#include "RimPlotWindow.h"
#include "RimProject.h"
#include "RimScriptCollection.h"
#include "RimSeismicData.h"
#include "RimSeismicDataCollection.h"
#include "RimSeismicView.h"
#include "RimSeismicViewCollection.h"
#include "RimSimWellInViewCollection.h"
Expand Down Expand Up @@ -526,7 +528,6 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
}
}

// Add well paths for each oil field
for ( size_t oilFieldIdx = 0; oilFieldIdx < m_project->oilFields().size(); oilFieldIdx++ )
{
RimOilField* oilField = m_project->oilFields[oilFieldIdx];
Expand All @@ -536,8 +537,16 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
oilField->wellPathCollection = std::make_unique<RimWellPathCollection>();
}

// Initialize well paths
oilField->wellPathCollection->loadDataAndUpdate();
oilField->ensembleWellLogsCollection->loadDataAndUpdate();

// Initialize seismic data
auto& seisDataColl = oilField->seismicDataCollection();
for ( auto seismicData : seisDataColl->seismicData() )
{
seismicData->ensureFileReaderIsInitialized();
}
}

{
Expand Down
18 changes: 10 additions & 8 deletions ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,6 @@ void RimSeismicData::logError( QString msg )
m_nErrorsLogged++;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSeismicData::initAfterRead()
{
updateMetaData();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -498,6 +490,16 @@ std::pair<double, double> RimSeismicData::dataRangeMinMax() const
return m_activeDataRange;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSeismicData::ensureFileReaderIsInitialized()
{
if ( !openFileIfNotOpen() ) return;

updateMetaData();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicData.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ class RimSeismicData : public RimSeismicDataInterface

std::pair<double, double> dataRangeMinMax() const override;

void ensureFileReaderIsInitialized();

protected:
void updateMetaData();
void initAfterRead() override;

caf::PdmFieldHandle* userDescriptionField() override;

Expand Down

0 comments on commit 18e9ef0

Please sign in to comment.