#3784 Completion Export : Use isCompletionWellPathEqual()

This commit is contained in:
Magne Sjaastad
2018-12-03 10:40:15 +01:00
parent fe17e9e0c0
commit 3a31199365
2 changed files with 21 additions and 15 deletions

View File

@@ -328,13 +328,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
std::vector<RigCompletionData> completionsForWell;
for (const auto& completion : completions)
{
RimWellPath* parentWellPath = nullptr;
if (completion.sourcePdmObject())
{
completion.sourcePdmObject()->firstAncestorOrThisOfType(parentWellPath);
}
if (parentWellPath == wellPath)
if (RicWellPathExportCompletionDataFeatureImpl::isCompletionWellPathEqual(completion, wellPath))
{
completionsForWell.push_back(completion);
}
@@ -375,15 +369,9 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
std::vector<RigCompletionData> completionsForWell;
for (const auto& completion : completions)
{
RimWellPath* parentWellPath = nullptr;
if (completion.sourcePdmObject())
if (completionType == completion.completionType())
{
completion.sourcePdmObject()->firstAncestorOrThisOfType(parentWellPath);
}
if (parentWellPath == wellPath)
{
if (completionType == completion.completionType())
if (RicWellPathExportCompletionDataFeatureImpl::isCompletionWellPathEqual(completion, wellPath))
{
completionsForWell.push_back(completion);
}
@@ -2691,6 +2679,23 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCarfinForTemporaryLgrs(co
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicWellPathExportCompletionDataFeatureImpl::isCompletionWellPathEqual(const RigCompletionData& completion,
const RimWellPath* wellPath)
{
if (!wellPath) return false;
RimWellPath* parentWellPath = nullptr;
if (completion.sourcePdmObject())
{
completion.sourcePdmObject()->firstAncestorOrThisOfType(parentWellPath);
}
return (parentWellPath == wellPath);
}
//--------------------------------------------------------------------------------------------------
/// Internal function
//--------------------------------------------------------------------------------------------------

View File

@@ -290,4 +290,5 @@ private:
static void exportCarfinForTemporaryLgrs(const RimEclipseCase* sourceCase, const QString& folder);
static bool isCompletionWellPathEqual(const RigCompletionData& completion, const RimWellPath* wellPath);
};