#2227 Well formations: Remove fluid annotation duplicates

This commit is contained in:
Rebecca Cox 2017-12-11 15:12:06 +01:00
parent 03b03cd438
commit fb876f8fdc
3 changed files with 51 additions and 12 deletions

View File

@ -87,6 +87,7 @@ namespace caf
template<> template<>
void AppEnum<RigWellPathFormations::FormationLevel>::setUp() void AppEnum<RigWellPathFormations::FormationLevel>::setUp()
{ {
addItem(RigWellPathFormations::NONE, "NONE", "None");
addItem(RigWellPathFormations::ALL, "ALL", "All"); addItem(RigWellPathFormations::ALL, "ALL", "All");
addItem(RigWellPathFormations::GROUP, "GROUP", "Formation Group"); addItem(RigWellPathFormations::GROUP, "GROUP", "Formation Group");
addItem(RigWellPathFormations::LEVEL0, "LEVEL0", "Formation"); addItem(RigWellPathFormations::LEVEL0, "LEVEL0", "Formation");
@ -100,6 +101,7 @@ namespace caf
addItem(RigWellPathFormations::LEVEL8, "LEVEL8", "Formation 8"); addItem(RigWellPathFormations::LEVEL8, "LEVEL8", "Formation 8");
addItem(RigWellPathFormations::LEVEL9, "LEVEL9", "Formation 9"); addItem(RigWellPathFormations::LEVEL9, "LEVEL9", "Formation 9");
addItem(RigWellPathFormations::LEVEL10, "LEVEL10", "Formation 10"); 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_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", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_formationTrajectoryType, "FormationTrajectoryType", "Trajectory", "", "", "");
@ -363,8 +365,11 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
{ {
using FormationLevelEnum = caf::AppEnum<RigWellPathFormations::FormationLevel>; using FormationLevelEnum = caf::AppEnum<RigWellPathFormations::FormationLevel>;
options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiText(RigWellPathFormations::NONE),
RigWellPathFormations::NONE));
options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiText(RigWellPathFormations::ALL), options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiText(RigWellPathFormations::ALL),
FormationLevelEnum::fromText("All"))); RigWellPathFormations::ALL));
for (const RigWellPathFormations::FormationLevel& level : formations->formationsLevelsPresent()) for (const RigWellPathFormations::FormationLevel& level : formations->formationsLevelsPresent())
{ {

View File

@ -132,7 +132,7 @@ void evaluateFormations(const std::vector<std::pair<RigWellPathFormation, RigWel
md = formation.first.mdBase; md = formation.first.mdBase;
} }
if (formation.second == RigWellPathFormations::FLUIDS) if (formation.second == RigWellPathFormations::FLUID)
{ {
if (includeFluids) if (includeFluids)
{ {
@ -150,6 +150,28 @@ void evaluateFormations(const std::vector<std::pair<RigWellPathFormation, RigWel
} }
} }
void evaluateFluids(const std::vector<std::pair<RigWellPathFormation, RigWellPathFormations::FormationLevel>>& formations,
std::map<double, LevelAndName, MeasuredDepthComp>* uniqueListMaker)
{
for (const std::pair<RigWellPathFormation, RigWellPathFormations::FormationLevel>& formation : formations)
{
if (formation.second == RigWellPathFormations::FLUID)
{
(*uniqueListMaker)[formation.first.mdBase] =
LevelAndName(formation.second, formation.first.formationName + " Base");
}
}
for (const std::pair<RigWellPathFormation, RigWellPathFormations::FormationLevel>& 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(); names->clear();
measuredDepths->clear(); measuredDepths->clear();
if (maxLevel == RigWellPathFormations::ALL) std::map<double, LevelAndName, MeasuredDepthComp> tempMakeVectorUniqueOnMeasuredDepth;
if (maxLevel == RigWellPathFormations::NONE)
{
if (includeFluids)
{
evaluateFluids(m_formations, &tempMakeVectorUniqueOnMeasuredDepth);
}
else
{
return;
}
}
else if (maxLevel == RigWellPathFormations::ALL)
{ {
measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(names, measuredDepths); measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(names, measuredDepths);
return; return;
} }
else
std::map<double, LevelAndName, MeasuredDepthComp> tempMakeVectorUniqueOnMeasuredDepth; {
evaluateFormations(m_formations, maxLevel, includeFluids, PICK_POSITION::TOP, &tempMakeVectorUniqueOnMeasuredDepth);
evaluateFormations(m_formations, maxLevel, includeFluids, PICK_POSITION::TOP, &tempMakeVectorUniqueOnMeasuredDepth); evaluateFormations(m_formations, maxLevel, includeFluids, PICK_POSITION::BASE, &tempMakeVectorUniqueOnMeasuredDepth);
}
evaluateFormations(m_formations, maxLevel, includeFluids, PICK_POSITION::BASE, &tempMakeVectorUniqueOnMeasuredDepth);
for (auto it = tempMakeVectorUniqueOnMeasuredDepth.begin(); it != tempMakeVectorUniqueOnMeasuredDepth.end(); it++) 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") if (formationName == "OIL" || formationName == "GAS" || formationName == "WATER")
{ {
return RigWellPathFormations::FLUIDS; return RigWellPathFormations::FLUID;
} }
bool isGroupName = true; bool isGroupName = true;

View File

@ -44,7 +44,7 @@ public:
enum FormationLevel 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<QString>* names, void measuredDepthAndFormationNamesUpToLevel(FormationLevel level, std::vector<QString>* names,