diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportCompletionDataSettingsUi.cpp b/ApplicationCode/Commands/CompletionCommands/RicExportCompletionDataSettingsUi.cpp index 039d20f4a3..8c9673bfe7 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportCompletionDataSettingsUi.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicExportCompletionDataSettingsUi.cpp @@ -28,6 +28,14 @@ namespace caf addItem(RicExportCompletionDataSettingsUi::SPLIT_ON_WELL_AND_COMPLETION_TYPE, "SPLIT_ON_WELL_AND_COMPLETION_TYPE", "Split on Well and Completion Type"); setDefault(RicExportCompletionDataSettingsUi::UNIFIED_FILE); } + + template<> + void RicExportCompletionDataSettingsUi::WellSelectionType::setUp() + { + addItem(RicExportCompletionDataSettingsUi::ALL_WELLS, "ALL_WELLS", "All Wells"); + addItem(RicExportCompletionDataSettingsUi::CHECKED_WELLS, "CHECKED_WELLS", "Checked Wells"); + setDefault(RicExportCompletionDataSettingsUi::ALL_WELLS); + } } @@ -41,6 +49,7 @@ RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi() CAF_PDM_InitObject("RimExportCompletionDataSettings", "", "", ""); CAF_PDM_InitFieldNoDefault(&fileSplit, "FileSplit", "File Split", "", "", ""); + CAF_PDM_InitFieldNoDefault(&wellSelection, "WellSelection", "Well Selection", "", "", ""); CAF_PDM_InitField(&timeStep, "TimeStepIndex", 0, "Time Step", "", "", ""); diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportCompletionDataSettingsUi.h b/ApplicationCode/Commands/CompletionCommands/RicExportCompletionDataSettingsUi.h index 8a5c52fc7c..08b6f3d940 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportCompletionDataSettingsUi.h +++ b/ApplicationCode/Commands/CompletionCommands/RicExportCompletionDataSettingsUi.h @@ -36,14 +36,20 @@ public: SPLIT_ON_WELL, SPLIT_ON_WELL_AND_COMPLETION_TYPE, }; - typedef caf::AppEnum ExportSplitType; + enum WellSelection { + ALL_WELLS, + CHECKED_WELLS, + }; + typedef caf::AppEnum WellSelectionType; + RicExportCompletionDataSettingsUi(); caf::PdmField fileSplit; + caf::PdmField wellSelection; caf::PdmField computeTransmissibility; caf::PdmField includePerforations; diff --git a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp index 309c4c732c..eff2ae1a1b 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp @@ -147,9 +147,25 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector return; } + std::vector usedWellPaths; + if (exportSettings.wellSelection == RicExportCompletionDataSettingsUi::ALL_WELLS) + { + usedWellPaths = wellPaths; + } + else if (exportSettings.wellSelection == RicExportCompletionDataSettingsUi::CHECKED_WELLS) + { + for (auto wellPath : wellPaths) + { + if (wellPath->showWellPath) + { + usedWellPaths.push_back(wellPath); + } + } + } + { bool unitSystemMismatch = false; - for (const RimWellPath* wellPath : wellPaths) + for (const RimWellPath* wellPath : usedWellPaths) { if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD && exportSettings.caseToApply->eclipseCaseData()->unitsType() != RigEclipseCaseData::UNITS_FIELD) { @@ -172,7 +188,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector std::map > completionData; - for (auto wellPath : wellPaths) + for (auto wellPath : usedWellPaths) { // Generate completion data @@ -210,7 +226,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector } else if (exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL) { - for (auto wellPath : wellPaths) + for (auto wellPath : usedWellPaths) { std::vector wellCompletions; for (auto completion : completions) @@ -227,7 +243,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector } else if (exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL_AND_COMPLETION_TYPE) { - for (auto wellPath : wellPaths) + for (auto wellPath : usedWellPaths) { { std::vector fishbonesCompletions = getCompletionsForWellAndCompletionType(completions, wellPath->completions()->wellNameForExport(), RigCompletionData::FISHBONES);