mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5917 Export Completion: Avoid overwrite of export completion well name
This commit is contained in:
parent
ff90ae5704
commit
4a8aa6ced1
@ -139,7 +139,7 @@ void RimFileWellPath::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Read JSON or ascii file containing well path data
|
/// 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() ) )
|
if ( caf::Utils::fileExists( this->filePath() ) )
|
||||||
{
|
{
|
||||||
@ -150,7 +150,15 @@ bool RimFileWellPath::readWellPathFile( QString* errorMessage, RifWellPathImport
|
|||||||
wellPathImporter->readWellMetaData( this->filePath(), m_wellPathIndexInFile() );
|
wellPathImporter->readWellMetaData( this->filePath(), m_wellPathIndexInFile() );
|
||||||
// General well info
|
// General well info
|
||||||
|
|
||||||
setName( wellData.m_name );
|
if ( setWellNameForExport )
|
||||||
|
{
|
||||||
|
setName( wellData.m_name );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setNameNoUpdateOfExportName( wellData.m_name );
|
||||||
|
}
|
||||||
|
|
||||||
id = wellMetaData.m_id;
|
id = wellMetaData.m_id;
|
||||||
sourceSystem = wellMetaData.m_sourceSystem;
|
sourceSystem = wellMetaData.m_sourceSystem;
|
||||||
utmZone = wellMetaData.m_utmZone;
|
utmZone = wellMetaData.m_utmZone;
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
|
|
||||||
QString filePath() const;
|
QString filePath() const;
|
||||||
void setFilepath( const QString& path );
|
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.
|
int wellPathIndexInFile() const; // -1 means none.
|
||||||
void setWellPathIndexInFile( int index );
|
void setWellPathIndexInFile( int index );
|
||||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath ) override;
|
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath ) override;
|
||||||
|
@ -460,8 +460,17 @@ QString RimWellPath::name() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellPath::setName( const QString& name )
|
void RimWellPath::setName( const QString& name )
|
||||||
{
|
{
|
||||||
m_name = name;
|
setNameNoUpdateOfExportName( name );
|
||||||
|
|
||||||
m_completions->setWellNameForExport( name );
|
m_completions->setWellNameForExport( name );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellPath::setNameNoUpdateOfExportName( const QString& name )
|
||||||
|
{
|
||||||
|
m_name = name;
|
||||||
tryAssociateWithSimulationWell();
|
tryAssociateWithSimulationWell();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@ public:
|
|||||||
|
|
||||||
QString name() const;
|
QString name() const;
|
||||||
void setName( const QString& name );
|
void setName( const QString& name );
|
||||||
|
void setNameNoUpdateOfExportName( const QString& name );
|
||||||
|
|
||||||
const QString associatedSimulationWellName() const;
|
const QString associatedSimulationWellName() const;
|
||||||
int associatedSimulationWellBranch() const;
|
int associatedSimulationWellBranch() const;
|
||||||
|
@ -152,7 +152,7 @@ void RimWellPathCollection::loadDataAndUpdate()
|
|||||||
if ( !fWPath->filePath().isEmpty() )
|
if ( !fWPath->filePath().isEmpty() )
|
||||||
{
|
{
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if ( !fWPath->readWellPathFile( &errorMessage, m_wellPathImporter ) )
|
if ( !fWPath->readWellPathFile( &errorMessage, m_wellPathImporter, false ) )
|
||||||
{
|
{
|
||||||
RiaLogging::warning( errorMessage );
|
RiaLogging::warning( errorMessage );
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ void RimWellPathCollection::readAndAddWellPaths( std::vector<RimFileWellPath*>&
|
|||||||
for ( size_t wpIdx = 0; wpIdx < wellPathArray.size(); wpIdx++ )
|
for ( size_t wpIdx = 0; wpIdx < wellPathArray.size(); wpIdx++ )
|
||||||
{
|
{
|
||||||
RimFileWellPath* wellPath = wellPathArray[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() ) );
|
progress.setProgressDescription( QString( "Reading file %1" ).arg( wellPath->name() ) );
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ void RimWellPathCollection::readAndAddWellPaths( std::vector<RimFileWellPath*>&
|
|||||||
{
|
{
|
||||||
existingWellPath->setFilepath( wellPath->filePath() );
|
existingWellPath->setFilepath( wellPath->filePath() );
|
||||||
existingWellPath->setWellPathIndexInFile( wellPath->wellPathIndexInFile() );
|
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
|
// Let name from well path file override name from well log file
|
||||||
existingWellPath->setName( wellPath->name() );
|
existingWellPath->setName( wellPath->name() );
|
||||||
|
Loading…
Reference in New Issue
Block a user