From dcdd8cce2a80c5604c265bd9ac32ee8f7c071844 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 7 Sep 2018 13:01:57 +0200 Subject: [PATCH] #3268 MSW Fracture Export : Do not export empty file when no fishbones are present --- ApplicationCode/CommandFileInterface/RicfExportMsw.cpp | 8 ++------ .../RicExportFishbonesWellSegmentsFeature.cpp | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ApplicationCode/CommandFileInterface/RicfExportMsw.cpp b/ApplicationCode/CommandFileInterface/RicfExportMsw.cpp index 9e06386842..af5cb0f444 100644 --- a/ApplicationCode/CommandFileInterface/RicfExportMsw.cpp +++ b/ApplicationCode/CommandFileInterface/RicfExportMsw.cpp @@ -85,12 +85,8 @@ void RicfExportMsw::execute() return; } - std::vector fishbonesSubs; - - for (RimFishbonesMultipleSubs* fishbones : wellPath->fishbonesCollection()->activeFishbonesSubs()) + if (!wellPath->fishbonesCollection()->activeFishbonesSubs().empty()) { - fishbonesSubs.push_back(fishbones); + RicExportFishbonesWellSegmentsFeature::exportWellSegments(wellPath, wellPath->fishbonesCollection()->activeFishbonesSubs(), exportSettings); } - - RicExportFishbonesWellSegmentsFeature::exportWellSegments(wellPath, fishbonesSubs, exportSettings); } diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicExportFishbonesWellSegmentsFeature.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicExportFishbonesWellSegmentsFeature.cpp index e4a5123c5d..e6f748b866 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicExportFishbonesWellSegmentsFeature.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicExportFishbonesWellSegmentsFeature.cpp @@ -122,6 +122,8 @@ bool RicExportFishbonesWellSegmentsFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath* wellPath, const std::vector& fishbonesSubs, const RicCaseAndFileExportSettingsUi& settings) { + if (fishbonesSubs.empty()) return; + if (settings.caseToApply() == nullptr) { RiaLogging::error("Export Well Segments: Cannot export completions data without specified eclipse case");