(#435) Adding well log to existing well if well names are the same

This commit is contained in:
Pål Hagen
2015-09-14 17:05:28 +02:00
parent 095d974e38
commit 7f2aa1c389
2 changed files with 24 additions and 4 deletions

View File

@@ -210,11 +210,14 @@ void RimWellPathCollection::addWellLogs(const QStringList& filePaths)
RimWellLasFileInfo* logFileInfo = RimWellPath::readWellLogFile(filePath); RimWellLasFileInfo* logFileInfo = RimWellPath::readWellLogFile(filePath);
if (logFileInfo) if (logFileInfo)
{ {
// TODO: Check for existing well paths and add log to correct well path if existing RimWellPath* wellPath = wellPathByName(logFileInfo->wellName());
if (!wellPath)
{
RimWellPath* wellPath = new RimWellPath();
wellPath->setCollection(this);
wellPaths.push_back(wellPath);
}
RimWellPath* wellPath = new RimWellPath();
wellPath->setCollection(this);
wellPaths.push_back(wellPath);
wellPath->setLogFileInfo(logFileInfo); wellPath->setLogFileInfo(logFileInfo);
} }
} }
@@ -266,6 +269,22 @@ void RimWellPathCollection::updateFilePathsFromProjectPath()
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPath* RimWellPathCollection::wellPathByName(const QString& wellPathName) const
{
for (size_t wellPathIdx = 0; wellPathIdx < wellPaths.size(); wellPathIdx++)
{
if (wellPaths[wellPathIdx]->name() == wellPathName)
{
return wellPaths[wellPathIdx];
}
}
return NULL;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -82,6 +82,7 @@ public:
void addWellPaths(QStringList filePaths); void addWellPaths(QStringList filePaths);
RimWellPathAsciiFileReader* asciiFileReader() {return m_asciiFileReader;} RimWellPathAsciiFileReader* asciiFileReader() {return m_asciiFileReader;}
RimWellPath* wellPathByName(const QString& wellPathName) const;
void addWellLogs(const QStringList& filePaths); void addWellLogs(const QStringList& filePaths);
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ); virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );