(#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);
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);
}
}
@@ -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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------