mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add well log loaders.
This commit is contained in:
@@ -48,8 +48,9 @@ list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
||||
list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES})
|
||||
|
||||
list(APPEND QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RimOsduWellPathDataLoader.h)
|
||||
|
||||
list(APPEND QT_MOC_HEADERS
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimOsduWellPathDataLoader.h
|
||||
)
|
||||
|
||||
source_group(
|
||||
"ProjectDataModel\\WellPath"
|
||||
|
||||
@@ -84,26 +84,27 @@ bool RimOsduWellPathDataLoader::isRunnable() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimOsduWellPathDataLoader::parquetDownloadComplete( const QByteArray& contents, const QString& url, const QString& id )
|
||||
{
|
||||
RiaLogging::info( QString( "Parquet download complete. Id: %1 Size: %2" ).arg( id ).arg( contents.size() ) );
|
||||
|
||||
QMutexLocker lock( &m_mutex );
|
||||
int taskId = m_taskIds[id];
|
||||
|
||||
if ( !contents.isEmpty() )
|
||||
if ( m_wellPaths.find( id ) != m_wellPaths.end() )
|
||||
{
|
||||
m_parquetData[id] = contents;
|
||||
RiaLogging::info( QString( "Parquet download complete. Id: %1 Size: %2" ).arg( id ).arg( contents.size() ) );
|
||||
int taskId = m_taskIds[id];
|
||||
|
||||
auto oWPath = m_wellPaths[id];
|
||||
auto [wellPathGeometry, errorMessage] = RifOsduWellPathReader::readWellPathData( contents, oWPath->datumElevationFromOsdu() );
|
||||
if ( wellPathGeometry.notNull() )
|
||||
if ( !contents.isEmpty() )
|
||||
{
|
||||
oWPath->setWellPathGeometry( wellPathGeometry.p() );
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::warning( errorMessage );
|
||||
auto oWPath = m_wellPaths[id];
|
||||
auto [wellPathGeometry, errorMessage] = RifOsduWellPathReader::readWellPathData( contents, oWPath->datumElevationFromOsdu() );
|
||||
if ( wellPathGeometry.notNull() )
|
||||
{
|
||||
oWPath->setWellPathGeometry( wellPathGeometry.p() );
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::warning( errorMessage );
|
||||
}
|
||||
}
|
||||
|
||||
taskDone.send( m_dataType, taskId );
|
||||
}
|
||||
|
||||
taskDone.send( m_dataType, taskId );
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ private slots:
|
||||
void parquetDownloadComplete( const QByteArray& contents, const QString& url, const QString& id );
|
||||
|
||||
private:
|
||||
std::map<QString, QByteArray> m_parquetData;
|
||||
std::map<QString, RimOsduWellPath*> m_wellPaths;
|
||||
std::map<QString, int> m_taskIds;
|
||||
QString m_dataType;
|
||||
|
||||
@@ -151,47 +151,37 @@ void RimWellPathCollection::fieldChangedByUi( const caf::PdmFieldHandle* changed
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCollection::loadDataAndUpdate()
|
||||
{
|
||||
caf::ProgressInfo progress( m_wellPaths.size(), "Reading well paths from file" );
|
||||
caf::ProgressInfo progress( 3, "Reading well paths from file" );
|
||||
|
||||
readWellPathFormationFiles();
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
caf::DataLoadController* dataLoadController = caf::DataLoadController::instance();
|
||||
|
||||
const QString wellPathGeometryKeyword = "WELL_PATH_GEOMETRY";
|
||||
const QString wellLogKeyword = "WELL_LOG";
|
||||
|
||||
progress.setProgressDescription( QString( "Reading well path geometry." ) );
|
||||
for ( RimWellPath* wellPath : allWellPaths() )
|
||||
{
|
||||
progress.setProgressDescription( QString( "Reading well %1" ).arg( wellPath->name() ) );
|
||||
dataLoadController->loadData( *wellPath, wellPathGeometryKeyword, progress );
|
||||
}
|
||||
|
||||
dataLoadController->blockUntilDone( wellPathGeometryKeyword );
|
||||
progress.incrementProgress();
|
||||
|
||||
progress.setProgressDescription( QString( "Reading well logs." ) );
|
||||
for ( RimWellPath* wellPath : allWellPaths() )
|
||||
{
|
||||
for ( RimWellLog* wellLog : wellPath->wellLogs() )
|
||||
{
|
||||
if ( RimWellLogFile* wellLogFile = dynamic_cast<RimWellLogFile*>( wellLog ) )
|
||||
{
|
||||
QString errorMessage;
|
||||
if ( !wellLogFile->readFile( &errorMessage ) )
|
||||
{
|
||||
RiaLogging::warning( errorMessage );
|
||||
}
|
||||
}
|
||||
else if ( RimOsduWellLog* osduWellLog = dynamic_cast<RimOsduWellLog*>( wellLog ) )
|
||||
{
|
||||
RiaOsduConnector* osduConnector = app->makeOsduConnector();
|
||||
auto [wellLogData, errorMessage] = loadWellLogFromOsdu( osduConnector, osduWellLog->wellLogId() );
|
||||
if ( wellLogData.notNull() )
|
||||
{
|
||||
osduWellLog->setWellLogData( wellLogData.p() );
|
||||
}
|
||||
}
|
||||
dataLoadController->loadData( *wellLog, wellLogKeyword, progress );
|
||||
}
|
||||
}
|
||||
dataLoadController->blockUntilDone( wellLogKeyword );
|
||||
progress.incrementProgress();
|
||||
|
||||
progress.setProgressDescription( QString( "Reading additional data." ) );
|
||||
for ( RimWellPath* wellPath : allWellPaths() )
|
||||
{
|
||||
RimStimPlanModelCollection* stimPlanModelCollection = wellPath->stimPlanModelCollection();
|
||||
if ( stimPlanModelCollection )
|
||||
{
|
||||
@@ -200,8 +190,8 @@ void RimWellPathCollection::loadDataAndUpdate()
|
||||
stimPlanModel->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
progress.incrementProgress();
|
||||
}
|
||||
progress.incrementProgress();
|
||||
|
||||
rebuildWellPathNodes();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user