diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp index bd62c20c03..ea2b619dc0 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp @@ -87,6 +87,7 @@ namespace caf template<> void AppEnum::setUp() { + addItem(RigWellPathFormations::NONE, "NONE", "None"); addItem(RigWellPathFormations::ALL, "ALL", "All"); addItem(RigWellPathFormations::GROUP, "GROUP", "Formation Group"); addItem(RigWellPathFormations::LEVEL0, "LEVEL0", "Formation"); @@ -100,6 +101,7 @@ namespace caf addItem(RigWellPathFormations::LEVEL8, "LEVEL8", "Formation 8"); addItem(RigWellPathFormations::LEVEL9, "LEVEL9", "Formation 9"); addItem(RigWellPathFormations::LEVEL10, "LEVEL10", "Formation 10"); + setDefault(RigWellPathFormations::ALL); } } @@ -129,7 +131,7 @@ RimWellLogTrack::RimWellLogTrack() CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show", "", "", ""); - CAF_PDM_InitFieldNoDefault(&m_formationSource, "FormationSource", "Formation Source", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_formationSource, "FormationSource", "Source", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_formationTrajectoryType, "FormationTrajectoryType", "Trajectory", "", "", ""); @@ -362,9 +364,12 @@ QList RimWellLogTrack::calculateValueOptions(const caf:: if (formations) { using FormationLevelEnum = caf::AppEnum; + + options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiText(RigWellPathFormations::NONE), + RigWellPathFormations::NONE)); options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiText(RigWellPathFormations::ALL), - FormationLevelEnum::fromText("All"))); + RigWellPathFormations::ALL)); for (const RigWellPathFormations::FormationLevel& level : formations->formationsLevelsPresent()) { diff --git a/ApplicationCode/ReservoirDataModel/RigWellPathFormations.cpp b/ApplicationCode/ReservoirDataModel/RigWellPathFormations.cpp index 3fc96aeb78..2732d79390 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPathFormations.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellPathFormations.cpp @@ -132,7 +132,7 @@ void evaluateFormations(const std::vector>& formations, + std::map* uniqueListMaker) +{ + for (const std::pair& formation : formations) + { + if (formation.second == RigWellPathFormations::FLUID) + { + (*uniqueListMaker)[formation.first.mdBase] = + LevelAndName(formation.second, formation.first.formationName + " Base"); + } + } + + for (const std::pair& formation : formations) + { + if (formation.second == RigWellPathFormations::FLUID) + { + (*uniqueListMaker)[formation.first.mdTop] = + LevelAndName(formation.second, formation.first.formationName + " Top"); + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -160,17 +182,29 @@ void RigWellPathFormations::measuredDepthAndFormationNamesUpToLevel(FormationLev names->clear(); measuredDepths->clear(); - if (maxLevel == RigWellPathFormations::ALL) + std::map tempMakeVectorUniqueOnMeasuredDepth; + + if (maxLevel == RigWellPathFormations::NONE) + { + if (includeFluids) + { + evaluateFluids(m_formations, &tempMakeVectorUniqueOnMeasuredDepth); + } + else + { + return; + } + } + else if (maxLevel == RigWellPathFormations::ALL) { measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(names, measuredDepths); return; } - - std::map tempMakeVectorUniqueOnMeasuredDepth; - - evaluateFormations(m_formations, maxLevel, includeFluids, PICK_POSITION::TOP, &tempMakeVectorUniqueOnMeasuredDepth); - - evaluateFormations(m_formations, maxLevel, includeFluids, PICK_POSITION::BASE, &tempMakeVectorUniqueOnMeasuredDepth); + else + { + evaluateFormations(m_formations, maxLevel, includeFluids, PICK_POSITION::TOP, &tempMakeVectorUniqueOnMeasuredDepth); + evaluateFormations(m_formations, maxLevel, includeFluids, PICK_POSITION::BASE, &tempMakeVectorUniqueOnMeasuredDepth); + } for (auto it = tempMakeVectorUniqueOnMeasuredDepth.begin(); it != tempMakeVectorUniqueOnMeasuredDepth.end(); it++) { @@ -226,7 +260,7 @@ RigWellPathFormations::FormationLevel RigWellPathFormations::detectLevel(QString if (formationName == "OIL" || formationName == "GAS" || formationName == "WATER") { - return RigWellPathFormations::FLUIDS; + return RigWellPathFormations::FLUID; } bool isGroupName = true; diff --git a/ApplicationCode/ReservoirDataModel/RigWellPathFormations.h b/ApplicationCode/ReservoirDataModel/RigWellPathFormations.h index 5d550e1d8f..2b9fb2776f 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPathFormations.h +++ b/ApplicationCode/ReservoirDataModel/RigWellPathFormations.h @@ -44,7 +44,7 @@ public: enum FormationLevel { - GROUP, LEVEL0, LEVEL1, LEVEL2, LEVEL3, LEVEL4, LEVEL5, LEVEL6, LEVEL7, LEVEL8, LEVEL9, LEVEL10, ALL, FLUIDS, UNKNOWN + GROUP, LEVEL0, LEVEL1, LEVEL2, LEVEL3, LEVEL4, LEVEL5, LEVEL6, LEVEL7, LEVEL8, LEVEL9, LEVEL10, ALL, FLUID, UNKNOWN, NONE }; void measuredDepthAndFormationNamesUpToLevel(FormationLevel level, std::vector* names,