diff --git a/ApplicationCode/ProjectDataModel/RimFileWellPath.cpp b/ApplicationCode/ProjectDataModel/RimFileWellPath.cpp index 031cdbc5a7..c45d435c87 100644 --- a/ApplicationCode/ProjectDataModel/RimFileWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/RimFileWellPath.cpp @@ -139,7 +139,7 @@ void RimFileWellPath::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering //-------------------------------------------------------------------------------------------------- /// Read JSON or ascii file containing well path data //-------------------------------------------------------------------------------------------------- -bool RimFileWellPath::readWellPathFile( QString* errorMessage, RifWellPathImporter* wellPathImporter ) +bool RimFileWellPath::readWellPathFile( QString* errorMessage, RifWellPathImporter* wellPathImporter, bool setWellNameForExport ) { if ( caf::Utils::fileExists( this->filePath() ) ) { @@ -150,7 +150,15 @@ bool RimFileWellPath::readWellPathFile( QString* errorMessage, RifWellPathImport wellPathImporter->readWellMetaData( this->filePath(), m_wellPathIndexInFile() ); // General well info - setName( wellData.m_name ); + if ( setWellNameForExport ) + { + setName( wellData.m_name ); + } + else + { + setNameNoUpdateOfExportName( wellData.m_name ); + } + id = wellMetaData.m_id; sourceSystem = wellMetaData.m_sourceSystem; utmZone = wellMetaData.m_utmZone; diff --git a/ApplicationCode/ProjectDataModel/RimFileWellPath.h b/ApplicationCode/ProjectDataModel/RimFileWellPath.h index fc359db5ea..81b6b5c291 100644 --- a/ApplicationCode/ProjectDataModel/RimFileWellPath.h +++ b/ApplicationCode/ProjectDataModel/RimFileWellPath.h @@ -28,7 +28,7 @@ public: QString filePath() const; void setFilepath( const QString& path ); - bool readWellPathFile( QString* errorMessage, RifWellPathImporter* wellPathImporter ); + bool readWellPathFile( QString* errorMessage, RifWellPathImporter* wellPathImporter, bool setWellNameForExport ); int wellPathIndexInFile() const; // -1 means none. void setWellPathIndexInFile( int index ); void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath ) override; diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.cpp b/ApplicationCode/ProjectDataModel/RimWellPath.cpp index f5f06ca621..dc0c581575 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPath.cpp @@ -460,8 +460,17 @@ QString RimWellPath::name() const //-------------------------------------------------------------------------------------------------- void RimWellPath::setName( const QString& name ) { - m_name = name; + setNameNoUpdateOfExportName( name ); + m_completions->setWellNameForExport( name ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPath::setNameNoUpdateOfExportName( const QString& name ) +{ + m_name = name; tryAssociateWithSimulationWell(); } diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.h b/ApplicationCode/ProjectDataModel/RimWellPath.h index c65c50ad87..84b3e434c4 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.h +++ b/ApplicationCode/ProjectDataModel/RimWellPath.h @@ -75,6 +75,7 @@ public: QString name() const; void setName( const QString& name ); + void setNameNoUpdateOfExportName( const QString& name ); const QString associatedSimulationWellName() const; int associatedSimulationWellBranch() const; diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp index ffe9676290..6f1dfbbf80 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp @@ -152,7 +152,7 @@ void RimWellPathCollection::loadDataAndUpdate() if ( !fWPath->filePath().isEmpty() ) { QString errorMessage; - if ( !fWPath->readWellPathFile( &errorMessage, m_wellPathImporter ) ) + if ( !fWPath->readWellPathFile( &errorMessage, m_wellPathImporter, false ) ) { RiaLogging::warning( errorMessage ); } @@ -260,7 +260,7 @@ void RimWellPathCollection::readAndAddWellPaths( std::vector& for ( size_t wpIdx = 0; wpIdx < wellPathArray.size(); wpIdx++ ) { RimFileWellPath* wellPath = wellPathArray[wpIdx]; - wellPath->readWellPathFile( nullptr, m_wellPathImporter ); + wellPath->readWellPathFile( nullptr, m_wellPathImporter, true ); progress.setProgressDescription( QString( "Reading file %1" ).arg( wellPath->name() ) ); @@ -270,7 +270,7 @@ void RimWellPathCollection::readAndAddWellPaths( std::vector& { existingWellPath->setFilepath( wellPath->filePath() ); existingWellPath->setWellPathIndexInFile( wellPath->wellPathIndexInFile() ); - existingWellPath->readWellPathFile( nullptr, m_wellPathImporter ); + existingWellPath->readWellPathFile( nullptr, m_wellPathImporter, true ); // Let name from well path file override name from well log file existingWellPath->setName( wellPath->name() );