From bbadf3918ef456de696dbe8344529ed293e50a83 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 3 Dec 2018 10:31:56 +0100 Subject: [PATCH] #3784 Completion Export : Split on well name instead of well name for export --- ...ellPathExportCompletionDataFeatureImpl.cpp | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index bbc6679d36..ccf6e98feb 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -330,7 +330,13 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve std::vector completionsForWell; for (const auto& completion : completions) { - if (completion.wellName() == wellPath->completions()->wellNameForExport()) + RimWellPath* parentWellPath = nullptr; + if (completion.sourcePdmObject()) + { + completion.sourcePdmObject()->firstAncestorOrThisOfType(parentWellPath); + } + + if (parentWellPath == wellPath) { completionsForWell.push_back(completion); } @@ -371,10 +377,18 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve std::vector completionsForWell; for (const auto& completion : completions) { - if (completion.wellName() == wellPath->completions()->wellNameForExport() && - completionType == completion.completionType()) + RimWellPath* parentWellPath = nullptr; + if (completion.sourcePdmObject()) { - completionsForWell.push_back(completion); + completion.sourcePdmObject()->firstAncestorOrThisOfType(parentWellPath); + } + + if (parentWellPath == wellPath) + { + if (completionType == completion.completionType()) + { + completionsForWell.push_back(completion); + } } } @@ -1029,6 +1043,11 @@ RigCompletionData { CVF_ASSERT(!completions.empty()); + if (completions.size() == 1) + { + return completions[0]; + } + const RigCompletionData& firstCompletion = completions[0]; const QString& wellName = firstCompletion.wellName(); @@ -1037,6 +1056,7 @@ RigCompletionData RigCompletionData resultCompletion(wellName, cellIndexIJK, firstCompletion.firstOrderingValue()); resultCompletion.setSecondOrderingValue(firstCompletion.secondOrderingValue()); + resultCompletion.setSourcePdmObject(firstCompletion.sourcePdmObject()); bool anyNonDarcyFlowPresent = false; for (const auto& c : completions)