#7716 Add pdm object for Ensemble Well Logs

This commit is contained in:
Kristian Bendiksen 2021-05-26 12:10:45 +02:00
parent 3af8d32928
commit fb301ef3ab
12 changed files with 395 additions and 0 deletions

View File

@ -63,6 +63,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.h
${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryGroupFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleWellLogsFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h
@ -147,6 +148,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.cpp
${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryGroupFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleWellLogsFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp

View File

@ -0,0 +1,129 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicImportEnsembleWellLogsFeature.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "WellLogCommands/RicWellLogsImportFileFeature.h"
#include "RimEnsembleWellLogs.h"
#include "RimEnsembleWellLogsCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimWellLogFile.h"
#include "RicRecursiveFileSearchDialog.h"
#include <QAction>
#include <QFileInfo>
CAF_CMD_SOURCE_INIT( RicImportEnsembleWellLogsFeature, "RicImportEnsembleWellLogsFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicImportEnsembleWellLogsFeature::RicImportEnsembleWellLogsFeature()
: m_pathFilter( "*" )
, m_fileNameFilter( "*" )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicImportEnsembleWellLogsFeature::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportEnsembleWellLogsFeature::onActionTriggered( bool isChecked )
{
RiaApplication* app = RiaApplication::instance();
QString pathCacheName = "ENSEMBLE_WELL_LOGS_FILES";
QStringList fileNames = runRecursiveFileSearchDialog( "Import Ensemble Well Logs", pathCacheName );
if ( fileNames.isEmpty() ) return;
QString ensembleName = "Ensemble Well Logs";
if ( ensembleName.isEmpty() ) return;
std::vector<RimWellLogFile*> cases;
for ( QString fileNames : fileNames )
{
QString errorMessage;
RimWellLogFile* logFileInfo = RimWellLogFile::readWellLogFile( fileNames, &errorMessage );
cases.push_back( logFileInfo );
if ( !errorMessage.isEmpty() )
{
RiaLogging::warning( errorMessage );
}
}
if ( cases.empty() ) return;
RimEnsembleWellLogs* ensemble = new RimEnsembleWellLogs;
ensemble->setName( ensembleName );
for ( auto wellLogFile : cases )
ensemble->addWellLogFile( wellLogFile );
RimProject::current()->activeOilField()->ensembleWellLogsCollection->addEnsembleWellLogs( ensemble );
RimProject::current()->activeOilField()->ensembleWellLogsCollection->updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportEnsembleWellLogsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/LasFile16x16.png" ) );
actionToSetup->setText( "Import Ensemble Well Logs" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QStringList RicImportEnsembleWellLogsFeature::runRecursiveFileSearchDialog( const QString& dialogTitle,
const QString& pathCacheName )
{
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory( pathCacheName );
RicRecursiveFileSearchDialogResult result = RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
dialogTitle,
defaultDir,
m_pathFilter,
m_fileNameFilter,
QStringList()
<< ".LAS"
<< ".las" );
// Remember filters
m_pathFilter = result.pathFilter;
m_fileNameFilter = result.fileNameFilter;
if ( !result.ok ) return QStringList();
// Remember the path to next time
app->setLastUsedDialogDirectory( pathCacheName, QFileInfo( result.rootDir ).absoluteFilePath() );
return result.files;
}

View File

@ -0,0 +1,45 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
#include <QString>
//==================================================================================================
///
//==================================================================================================
class RicImportEnsembleWellLogsFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
RicImportEnsembleWellLogsFeature();
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
QStringList runRecursiveFileSearchDialog( const QString& dialogTitle, const QString& pathCacheName );
private:
QString m_pathFilter;
QString m_fileNameFilter;
};

View File

@ -153,6 +153,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionWeight.h
${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.h
${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.h
${CMAKE_CURRENT_LIST_DIR}/RimPolylinesDataInterface.h
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.h
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h
${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.h
${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h
@ -309,6 +311,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunction.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionWeight.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.cpp
${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp
${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.cpp
${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.cpp

View File

@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimEnsembleWellLogs.h"
#include "RimWellLogFile.h"
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmObjectScriptingCapability.h"
CAF_PDM_SOURCE_INIT( RimEnsembleWellLogs, "EnsembleWellLogs" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEnsembleWellLogs::RimEnsembleWellLogs()
{
CAF_PDM_InitScriptableObject( "Ensemble Well Logs", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_wellLogFiles, "WellLogFiles", "", "", "", "" );
m_wellLogFiles.uiCapability()->setUiHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleWellLogs::removeWellLogFile( RimWellLogFile* summaryCase )
{
m_wellLogFiles.removeChildObject( summaryCase );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleWellLogs::addWellLogFile( RimWellLogFile* summaryCase )
{
m_wellLogFiles.push_back( summaryCase );
}

View File

@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimNamedObject.h"
#include "cafPdmChildArrayField.h"
class RimWellLogFile;
//==================================================================================================
///
//==================================================================================================
class RimEnsembleWellLogs : public RimNamedObject
{
CAF_PDM_HEADER_INIT;
public:
RimEnsembleWellLogs();
void removeWellLogFile( RimWellLogFile* wellLogFile );
void addWellLogFile( RimWellLogFile* wellLogFile );
protected:
void updateReferringCurveSets();
private:
caf::PdmChildArrayField<RimWellLogFile*> m_wellLogFiles;
};

View File

@ -0,0 +1,65 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimEnsembleWellLogsCollection.h"
#include "RimEnsembleWellLogs.h"
#include "cafProgressInfo.h"
CAF_PDM_SOURCE_INIT( RimEnsembleWellLogsCollection, "EnsembleWellLogsCollection" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEnsembleWellLogsCollection::RimEnsembleWellLogsCollection()
{
CAF_PDM_InitObject( "Ensemble Well Logs", ":/LasFile16x16.png", "", "" );
CAF_PDM_InitFieldNoDefault( &m_ensembleWellLogs, "EnsembleWellLogsCollection", "", "", "", "" );
m_ensembleWellLogs.uiCapability()->setUiHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEnsembleWellLogsCollection::~RimEnsembleWellLogsCollection()
{
m_ensembleWellLogs.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleWellLogsCollection::addEnsembleWellLogs( RimEnsembleWellLogs* ensembleWellLogs )
{
m_ensembleWellLogs.push_back( ensembleWellLogs );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimEnsembleWellLogs*> RimEnsembleWellLogsCollection::ensembleWellLogs() const
{
std::vector<RimEnsembleWellLogs*> ensembleWellLogs;
for ( const auto& e : m_ensembleWellLogs )
{
ensembleWellLogs.push_back( e );
}
return ensembleWellLogs;
}

View File

@ -0,0 +1,42 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmChildArrayField.h"
#include "cafPdmObject.h"
class RimEnsembleWellLogs;
//==================================================================================================
///
//==================================================================================================
class RimEnsembleWellLogsCollection : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimEnsembleWellLogsCollection();
~RimEnsembleWellLogsCollection() override;
std::vector<RimEnsembleWellLogs*> ensembleWellLogs() const;
void addEnsembleWellLogs( RimEnsembleWellLogs* ensembleWellLogs );
private:
caf::PdmChildArrayField<RimEnsembleWellLogs*> m_ensembleWellLogs;
};

View File

@ -23,6 +23,7 @@
#include "RimAnnotationCollection.h"
#include "RimCompletionTemplateCollection.h"
#include "RimEclipseCaseCollection.h"
#include "RimEnsembleWellLogsCollection.h"
#include "RimFormationNamesCollection.h"
#include "RimFractureTemplateCollection.h"
#include "RimGeoMechModels.h"
@ -51,6 +52,7 @@ RimOilField::RimOilField( void )
CAF_PDM_InitFieldNoDefault( &observedDataCollection, "ObservedDataCollection", "Observed Data", ":/Cases16x16.png", "", "" );
CAF_PDM_InitFieldNoDefault( &annotationCollection, "AnnotationCollection", "Annotations", "", "", "" );
CAF_PDM_InitFieldNoDefault( &ensembleWellLogsCollection, "EnsembleWellLogsCollection", "Ensemble Well Logs", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_fractureTemplateCollection_OBSOLETE,
"FractureDefinitionCollection",
@ -74,6 +76,7 @@ RimOilField::RimOilField( void )
observedDataCollection = new RimObservedDataCollection();
formationNamesCollection = new RimFormationNamesCollection();
annotationCollection = new RimAnnotationCollection();
ensembleWellLogsCollection = new RimEnsembleWellLogsCollection();
m_fractureTemplateCollection_OBSOLETE = new RimFractureTemplateCollection;
m_fractureTemplateCollection_OBSOLETE.xmlCapability()->setIOWritable( false );

View File

@ -38,6 +38,7 @@ class RimWellPathCollection;
class RimAnnotationCollection;
class RimMeasurement;
class RimSurfaceCollection;
class RimEnsembleWellLogsCollection;
//==================================================================================================
///
@ -67,6 +68,7 @@ public:
caf::PdmChildField<RimAnnotationCollection*> annotationCollection;
caf::PdmChildField<RimMeasurement*> measurement;
caf::PdmChildField<RimSurfaceCollection*> surfaceCollection;
caf::PdmChildField<RimEnsembleWellLogsCollection*> ensembleWellLogsCollection;
protected:
void initAfterRead() override;

View File

@ -47,6 +47,7 @@
#include "RimDialogData.h"
#include "RimEclipseCase.h"
#include "RimEclipseCaseCollection.h"
#include "RimEnsembleWellLogsCollection.h"
#include "RimFlowPlotCollection.h"
#include "RimFormationNamesCollection.h"
#include "RimFractureTemplate.h"
@ -1410,6 +1411,10 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
{
itemCollection->add( oilField->observedDataCollection() );
}
if ( oilField->ensembleWellLogsCollection() )
{
itemCollection->add( oilField->ensembleWellLogsCollection() );
}
}
}

View File

@ -278,6 +278,7 @@ void RiuPlotMainWindow::createMenus()
importWellMenu->addAction( cmdFeatureMgr->action( "RicWellPathsImportSsihubFeature" ) );
importWellMenu->addAction( cmdFeatureMgr->action( "RicWellLogsImportFileFeature" ) );
importWellMenu->addAction( cmdFeatureMgr->action( "RicWellPathFormationsImportFileFeature" ) );
importWellMenu->addAction( cmdFeatureMgr->action( "RicImportEnsembleWellLogsFeature" ) );
importMenu->addSeparator();
importMenu->addAction( cmdFeatureMgr->action( "RicImportObservedDataInMenuFeature" ) );