#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

@@ -132,7 +132,7 @@ void evaluateFormations(const std::vector<std::pair<RigWellPathFormation, RigWel
md = formation.first.mdBase;
}
if (formation.second == RigWellPathFormations::FLUIDS)
if (formation.second == RigWellPathFormations::FLUID)
{
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();
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);
return;
}
std::map<double, LevelAndName, MeasuredDepthComp> 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;