#2227 Well formations: update ui. remove level from RigWellPathFormation

This commit is contained in:
Rebecca Cox 2017-12-11 12:59:03 +01:00
parent 406c371682
commit c3cd0a650e
6 changed files with 120 additions and 128 deletions

View File

@ -990,7 +990,7 @@ void RimWellPltPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
{ {
RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0); RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0);
track->uiOrderingForShowFormationNamesAndCase(uiOrdering); track->uiOrderingForFormations(uiOrdering);
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup("Legend and Axis"); caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup("Legend and Axis");
legendAndAxisGroup->setCollapsedByDefault(true); legendAndAxisGroup->setCollapsedByDefault(true);

View File

@ -773,13 +773,11 @@ void RimWellRftPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
caf::PdmUiGroup* timeStepsGroup = uiOrdering.addNewGroupWithKeyword("Time Steps", "TimeSteps"); caf::PdmUiGroup* timeStepsGroup = uiOrdering.addNewGroupWithKeyword("Time Steps", "TimeSteps");
timeStepsGroup->add(&m_selectedTimeSteps); timeStepsGroup->add(&m_selectedTimeSteps);
//uiOrdering.add(&m_showPlotTitle);
if (m_wellLogPlot && m_wellLogPlot->trackCount() > 0) if (m_wellLogPlot && m_wellLogPlot->trackCount() > 0)
{ {
RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0); RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0);
track->uiOrderingForShowFormationNamesAndCase(uiOrdering); track->uiOrderingForFormations(uiOrdering);
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup("Legend and Axis"); caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup("Legend and Axis");
legendAndAxisGroup->setCollapsedByDefault(true); legendAndAxisGroup->setCollapsedByDefault(true);

View File

@ -80,23 +80,26 @@ namespace caf
void AppEnum< RimWellLogTrack::FormationSource >::setUp() void AppEnum< RimWellLogTrack::FormationSource >::setUp()
{ {
addItem(RimWellLogTrack::CASE, "CASE", "Case"); addItem(RimWellLogTrack::CASE, "CASE", "Case");
addItem(RimWellLogTrack::WELL_PICK, "WELL_PICK", "Well Pick"); addItem(RimWellLogTrack::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Path");
addItem(RimWellLogTrack::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Pick Filter");
setDefault(RimWellLogTrack::CASE); setDefault(RimWellLogTrack::CASE);
} }
template<> template<>
void AppEnum<RigWellPathFormation::FormationLevel>::setUp() void AppEnum<RigWellPathFormations::FormationLevel>::setUp()
{ {
addItem(RigWellPathFormation::ALL, "ALL", "All"); addItem(RigWellPathFormations::ALL, "ALL", "All");
addItem(RigWellPathFormation::GROUP, "GROUP", "Group"); addItem(RigWellPathFormations::GROUP, "GROUP", "Formation Group");
addItem(RigWellPathFormation::LEVEL0, "LEVEL0", "Main"); addItem(RigWellPathFormations::LEVEL0, "LEVEL0", "Formation");
addItem(RigWellPathFormation::LEVEL1, "LEVEL1", "Level 1"); addItem(RigWellPathFormations::LEVEL1, "LEVEL1", "Formation 1");
addItem(RigWellPathFormation::LEVEL2, "LEVEL2", "Level 2"); addItem(RigWellPathFormations::LEVEL2, "LEVEL2", "Formation 2");
addItem(RigWellPathFormation::LEVEL3, "LEVEL3", "Level 3"); addItem(RigWellPathFormations::LEVEL3, "LEVEL3", "Formation 3");
addItem(RigWellPathFormation::LEVEL4, "LEVEL4", "Level 4"); addItem(RigWellPathFormations::LEVEL4, "LEVEL4", "Formation 4");
addItem(RigWellPathFormation::LEVEL5, "LEVEL5", "Level 5"); addItem(RigWellPathFormations::LEVEL5, "LEVEL5", "Formation 5");
addItem(RigWellPathFormation::LEVEL6, "LEVEL6", "Level 6"); addItem(RigWellPathFormations::LEVEL6, "LEVEL6", "Formation 6");
addItem(RigWellPathFormations::LEVEL7, "LEVEL7", "Formation 7");
addItem(RigWellPathFormations::LEVEL8, "LEVEL8", "Formation 8");
addItem(RigWellPathFormations::LEVEL9, "LEVEL9", "Formation 9");
addItem(RigWellPathFormations::LEVEL10, "LEVEL10", "Formation 10");
} }
} }
@ -124,7 +127,7 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitField(&m_isLogarithmicScaleEnabled, "LogarithmicScaleX", false, "Logarithmic Scale", "", "", ""); CAF_PDM_InitField(&m_isLogarithmicScaleEnabled, "LogarithmicScaleX", false, "Logarithmic Scale", "", "", "");
CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show Formations", "", "", ""); CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_formationSource, "FormationSource", "Formation Source", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_formationSource, "FormationSource", "Formation Source", "", "", "");
@ -141,7 +144,7 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitFieldNoDefault(&m_formationCase, "FormationCase", "Formation Case", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_formationCase, "FormationCase", "Formation Case", "", "", "");
m_formationCase.uiCapability()->setUiTreeChildrenHidden(true); m_formationCase.uiCapability()->setUiTreeChildrenHidden(true);
CAF_PDM_InitFieldNoDefault(&m_formationLevel, "FormationLevel", "Formation Level", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_formationLevel, "FormationLevel", "Well Pick Filter", "", "", "");
CAF_PDM_InitField(&m_showformationFluids, "ShowFormationFluids", false, "Show Fluids", "", "", ""); CAF_PDM_InitField(&m_showformationFluids, "ShowFormationFluids", false, "Show Fluids", "", "", "");
} }
@ -329,7 +332,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
{ {
RimTools::wellPathOptionItems(&options); RimTools::wellPathOptionItems(&options);
} }
else if(m_formationSource == WELL_PICK || m_formationSource == WELL_PICK_FILTER) else if(m_formationSource == WELL_PICK_FILTER)
{ {
RimTools::wellPathWithFormationsOptionItems(&options); RimTools::wellPathWithFormationsOptionItems(&options);
} }
@ -358,16 +361,18 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
const RigWellPathFormations* formations = m_formationWellPath->formationsGeometry(); const RigWellPathFormations* formations = m_formationWellPath->formationsGeometry();
if (formations) if (formations)
{ {
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<RigWellPathFormation::FormationLevel>::uiText(RigWellPathFormation::ALL), using FormationLevelEnum = caf::AppEnum<RigWellPathFormations::FormationLevel>;
caf::AppEnum<RigWellPathFormation::FormationLevel>::fromText("All")));
for (const RigWellPathFormation::FormationLevel& level : formations->formationsLevelsPresent()) options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiText(RigWellPathFormations::ALL),
FormationLevelEnum::fromText("All")));
for (const RigWellPathFormations::FormationLevel& level : formations->formationsLevelsPresent())
{ {
size_t index = caf::AppEnum<RigWellPathFormation::FormationLevel>::index(level); size_t index = FormationLevelEnum::index(level);
if (index >= caf::AppEnum<RigWellPathFormation::FormationLevel>::size()) continue; if (index >= FormationLevelEnum::size()) continue;
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<RigWellPathFormation::FormationLevel>::uiTextFromIndex(index), options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiTextFromIndex(index),
caf::AppEnum<RigWellPathFormation::FormationLevel>::fromIndex(index))); FormationLevelEnum::fromIndex(index)));
} }
} }
} }
@ -784,10 +789,6 @@ void RimWellLogTrack::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
m_formationBranchIndex); m_formationBranchIndex);
} }
} }
else if (m_formationSource() == WELL_PICK)
{
formationGroup->add(&m_formationWellPath);
}
else if (m_formationSource() == WELL_PICK_FILTER) else if (m_formationSource() == WELL_PICK_FILTER)
{ {
formationGroup->add(&m_formationWellPath); formationGroup->add(&m_formationWellPath);
@ -924,7 +925,7 @@ std::vector<RimWellLogCurve* > RimWellLogTrack::curvesVector()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering& uiOrdering) void RimWellLogTrack::uiOrderingForFormations(caf::PdmUiOrdering& uiOrdering)
{ {
caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup("Zonation/Formation Names"); caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup("Zonation/Formation Names");
formationGroup->setCollapsedByDefault(true); formationGroup->setCollapsedByDefault(true);
@ -934,6 +935,15 @@ void RimWellLogTrack::uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering&
{ {
formationGroup->add(&m_formationCase); formationGroup->add(&m_formationCase);
} }
if (m_formationSource == WELL_PICK_FILTER)
{
formationGroup->add(&m_formationWellPath);
if (m_formationWellPath())
{
formationGroup->add(&m_formationLevel);
formationGroup->add(&m_showformationFluids);
}
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -1217,20 +1227,6 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
m_annotationTool->attachFormationNames(this->viewer(), formationNamesToPlot, yValues); m_annotationTool->attachFormationNames(this->viewer(), formationNamesToPlot, yValues);
} }
else if (m_formationSource() == WELL_PICK)
{
if (m_formationWellPath == nullptr) return;
if (plot->depthType() != RimWellLogPlot::MEASURED_DEPTH) return;
std::vector<double> yValues;
const RigWellPathFormations* formations = m_formationWellPath->formationsGeometry();
if (!formations) return;
formations->measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(&formationNamesToPlot, &yValues);
m_annotationTool->attachWellPicks(this->viewer(), formationNamesToPlot, yValues);
}
else if (m_formationSource() == WELL_PICK_FILTER) else if (m_formationSource() == WELL_PICK_FILTER)
{ {
if (m_formationWellPath == nullptr) return; if (m_formationWellPath == nullptr) return;

View File

@ -21,6 +21,8 @@
#include "RimWellLogPlot.h" #include "RimWellLogPlot.h"
#include "RigWellPathFormations.h"
#include "cafPdmObject.h" #include "cafPdmObject.h"
#include "cafPdmField.h" #include "cafPdmField.h"
#include "cafPdmChildArrayField.h" #include "cafPdmChildArrayField.h"
@ -67,7 +69,7 @@ public:
virtual ~RimWellLogTrack(); virtual ~RimWellLogTrack();
enum TrajectoryType { WELL_PATH, SIMULATION_WELL }; enum TrajectoryType { WELL_PATH, SIMULATION_WELL };
enum FormationSource { CASE, WELL_PICK }; enum FormationSource { CASE, WELL_PICK_FILTER };
void setDescription(const QString& description); void setDescription(const QString& description);
bool isVisible(); bool isVisible();
@ -114,7 +116,7 @@ public:
QString description(); QString description();
std::vector<RimWellLogCurve* > curvesVector(); std::vector<RimWellLogCurve* > curvesVector();
void uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering& uiOrdering); void uiOrderingForFormations(caf::PdmUiOrdering& uiOrdering);
void uiOrderingForVisibleXRange(caf::PdmUiOrdering& uiOrdering); void uiOrderingForVisibleXRange(caf::PdmUiOrdering& uiOrdering);
private: private:
@ -163,15 +165,17 @@ private:
caf::PdmField<bool> m_isAutoScaleXEnabled; caf::PdmField<bool> m_isAutoScaleXEnabled;
caf::PdmField<bool> m_isLogarithmicScaleEnabled; caf::PdmField<bool> m_isLogarithmicScaleEnabled;
caf::PdmField<bool> m_showFormations; caf::PdmField<bool> m_showFormations;
caf::PdmField<caf::AppEnum<FormationSource> > m_formationSource; caf::PdmField<caf::AppEnum<FormationSource> > m_formationSource;
caf::PdmPtrField<RimCase*> m_formationCase; caf::PdmPtrField<RimCase*> m_formationCase;
caf::PdmField<caf::AppEnum<TrajectoryType> > m_formationTrajectoryType; caf::PdmField<caf::AppEnum<TrajectoryType> > m_formationTrajectoryType;
caf::PdmPtrField<RimWellPath*> m_formationWellPath; caf::PdmPtrField<RimWellPath*> m_formationWellPath;
caf::PdmField<QString> m_formationSimWellName;
caf::PdmField<int> m_formationBranchIndex;
caf::PdmField<caf::AppEnum<RigWellPathFormations::FormationLevel>> m_formationLevel;
caf::PdmField<bool> m_showformationFluids;
caf::PdmField<QString> m_formationSimWellName; caf::PdmField<bool> m_formationBranchDetection;
caf::PdmField<int> m_formationBranchIndex;
caf::PdmField<bool> m_formationBranchDetection;
QPointer<RiuWellLogTrack> m_wellLogTrackPlotWidget; QPointer<RiuWellLogTrack> m_wellLogTrackPlotWidget;

View File

@ -25,18 +25,18 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RigWellPathFormations::RigWellPathFormations(std::vector<RigWellPathFormation> formations, const QString& filePath, RigWellPathFormations::RigWellPathFormations(const std::vector<RigWellPathFormation>& formations, const QString& filePath,
const QString& key) const QString& key)
{ {
m_filePath = filePath; m_filePath = filePath;
m_keyInFile = key; m_keyInFile = key;
m_formations = formations;
for (RigWellPathFormation& formation : m_formations) for (const RigWellPathFormation& formation : formations)
{ {
RigWellPathFormation::FormationLevel level = detectLevel(formation.formationName); FormationLevel level = detectLevel(formation.formationName);
formation.level = level; m_formationsLevelsPresent[level] = true;
m_formationsLevelsPresent[level] = true;
m_formations.push_back(std::pair<RigWellPathFormation, FormationLevel>(formation, level));
} }
} }
@ -63,23 +63,23 @@ void RigWellPathFormations::measuredDepthAndFormationNamesWithoutDuplicatesOnDep
std::map<double, bool, MeasuredDepthComp> tempMakeVectorUniqueOnMeasuredDepth; std::map<double, bool, MeasuredDepthComp> tempMakeVectorUniqueOnMeasuredDepth;
for (RigWellPathFormation formation : m_formations) for (const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations)
{ {
if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.mdTop)) if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.first.mdTop))
{ {
measuredDepths->push_back(formation.mdTop); measuredDepths->push_back(formation.first.mdTop);
names->push_back(formation.formationName + " Top"); names->push_back(formation.first.formationName + " Top");
tempMakeVectorUniqueOnMeasuredDepth[formation.mdTop] = true; tempMakeVectorUniqueOnMeasuredDepth[formation.first.mdTop] = true;
} }
} }
for (RigWellPathFormation formation : m_formations) for (const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations)
{ {
if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.mdBase)) if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.first.mdBase))
{ {
measuredDepths->push_back(formation.mdBase); measuredDepths->push_back(formation.first.mdBase);
names->push_back(formation.formationName + " Base"); names->push_back(formation.first.formationName + " Base");
tempMakeVectorUniqueOnMeasuredDepth[formation.mdBase] = true; tempMakeVectorUniqueOnMeasuredDepth[formation.first.mdBase] = true;
} }
} }
} }
@ -90,10 +90,10 @@ void RigWellPathFormations::measuredDepthAndFormationNamesWithoutDuplicatesOnDep
struct LevelAndName struct LevelAndName
{ {
LevelAndName() {} LevelAndName() {}
LevelAndName(RigWellPathFormation::FormationLevel level, QString name) : level(level), name(name) {} LevelAndName(RigWellPathFormations::FormationLevel level, QString name) : level(level), name(name) {}
RigWellPathFormation::FormationLevel level; RigWellPathFormations::FormationLevel level;
QString name; QString name;
}; };
enum PICK_POSITION enum PICK_POSITION
@ -104,9 +104,10 @@ enum PICK_POSITION
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void evaluateFormations(const std::vector<RigWellPathFormation>& formations, const RigWellPathFormation::FormationLevel& maxLevel, void evaluateFormations(const std::vector<std::pair<RigWellPathFormation, RigWellPathFormations::FormationLevel>>& formations,
bool includeFluids, const PICK_POSITION& position, const RigWellPathFormations::FormationLevel& maxLevel,
std::map<double, LevelAndName, MeasuredDepthComp>* uniqueListMaker) bool includeFluids, const PICK_POSITION& position,
std::map<double, LevelAndName, MeasuredDepthComp>* uniqueListMaker)
{ {
QString postFix; QString postFix;
@ -119,32 +120,32 @@ void evaluateFormations(const std::vector<RigWellPathFormation>& formations, con
postFix = " Base"; postFix = " Base";
} }
for (const RigWellPathFormation& formation : formations) for (const std::pair<RigWellPathFormation, RigWellPathFormations::FormationLevel>& formation : formations)
{ {
double md; double md;
if (position == TOP) if (position == TOP)
{ {
md = formation.mdTop; md = formation.first.mdTop;
} }
else else
{ {
md = formation.mdBase; md = formation.first.mdBase;
} }
if (formation.level == RigWellPathFormation::FLUIDS) if (formation.second == RigWellPathFormations::FLUIDS)
{ {
if (includeFluids) if (includeFluids)
{ {
(*uniqueListMaker)[md] = LevelAndName(formation.level, formation.formationName + postFix); (*uniqueListMaker)[md] = LevelAndName(formation.second, formation.first.formationName + postFix);
} }
continue; continue;
} }
if (formation.level > maxLevel) continue; if (formation.second > maxLevel) continue;
if (!uniqueListMaker->count(md) || uniqueListMaker->at(md).level < formation.level) if (!uniqueListMaker->count(md) || uniqueListMaker->at(md).level < formation.second)
{ {
(*uniqueListMaker)[md] = LevelAndName(formation.level, formation.formationName + postFix); (*uniqueListMaker)[md] = LevelAndName(formation.second, formation.first.formationName + postFix);
} }
} }
} }
@ -152,14 +153,14 @@ void evaluateFormations(const std::vector<RigWellPathFormation>& formations, con
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RigWellPathFormations::measuredDepthAndFormationNamesUpToLevel(RigWellPathFormation::FormationLevel maxLevel, void RigWellPathFormations::measuredDepthAndFormationNamesUpToLevel(FormationLevel maxLevel,
std::vector<QString>* names, std::vector<QString>* names,
std::vector<double>* measuredDepths, bool includeFluids) const std::vector<double>* measuredDepths, bool includeFluids) const
{ {
names->clear(); names->clear();
measuredDepths->clear(); measuredDepths->clear();
if (maxLevel == RigWellPathFormation::ALL) if (maxLevel == RigWellPathFormations::ALL)
{ {
measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(names, measuredDepths); measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(names, measuredDepths);
return; return;
@ -181,9 +182,9 @@ void RigWellPathFormations::measuredDepthAndFormationNamesUpToLevel(RigWellPathF
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<RigWellPathFormation::FormationLevel> RigWellPathFormations::formationsLevelsPresent() const std::vector<RigWellPathFormations::FormationLevel> RigWellPathFormations::formationsLevelsPresent() const
{ {
std::vector<RigWellPathFormation::FormationLevel> formationLevels; std::vector<RigWellPathFormations::FormationLevel> formationLevels;
for (auto it = m_formationsLevelsPresent.begin(); it != m_formationsLevelsPresent.end(); it++) for (auto it = m_formationsLevelsPresent.begin(); it != m_formationsLevelsPresent.end(); it++)
{ {
@ -219,13 +220,13 @@ size_t RigWellPathFormations::formationNamesCount() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RigWellPathFormation::FormationLevel RigWellPathFormations::detectLevel(QString formationName) RigWellPathFormations::FormationLevel RigWellPathFormations::detectLevel(QString formationName)
{ {
formationName = formationName.trimmed(); formationName = formationName.trimmed();
if (formationName == "OIL" || formationName == "GAS") if (formationName == "OIL" || formationName == "GAS" || formationName == "WATER")
{ {
return RigWellPathFormation::FLUIDS; return RigWellPathFormations::FLUIDS;
} }
bool isGroupName = true; bool isGroupName = true;
@ -239,7 +240,7 @@ RigWellPathFormation::FormationLevel RigWellPathFormations::detectLevel(QString
} }
if (isGroupName) if (isGroupName)
{ {
return RigWellPathFormation::GROUP; return RigWellPathFormations::GROUP;
} }
QStringList formationNameSplitted = formationName.split(" "); QStringList formationNameSplitted = formationName.split(" ");
@ -259,7 +260,7 @@ RigWellPathFormation::FormationLevel RigWellPathFormations::detectLevel(QString
} }
if (levelDesctiptorCandidates.empty()) if (levelDesctiptorCandidates.empty())
{ {
return RigWellPathFormation::LEVEL0; return RigWellPathFormations::LEVEL0;
} }
if (levelDesctiptorCandidates.size() > 1) if (levelDesctiptorCandidates.size() > 1)
@ -275,7 +276,7 @@ RigWellPathFormation::FormationLevel RigWellPathFormations::detectLevel(QString
} }
} }
} }
if (levelDesctiptorCandidates.size() != 1) return RigWellPathFormation::UNKNOWN; if (levelDesctiptorCandidates.size() != 1) return RigWellPathFormations::UNKNOWN;
QString levelDescriptor = levelDesctiptorCandidates[0]; QString levelDescriptor = levelDesctiptorCandidates[0];
@ -285,13 +286,17 @@ RigWellPathFormation::FormationLevel RigWellPathFormations::detectLevel(QString
switch (dotCount) switch (dotCount)
{ {
case 0: return RigWellPathFormation::LEVEL1; case 0: return RigWellPathFormations::LEVEL1;
case 1: return RigWellPathFormation::LEVEL2; case 1: return RigWellPathFormations::LEVEL2;
case 2: return RigWellPathFormation::LEVEL3; case 2: return RigWellPathFormations::LEVEL3;
case 3: return RigWellPathFormation::LEVEL4; case 3: return RigWellPathFormations::LEVEL4;
case 4: return RigWellPathFormation::LEVEL5; case 4: return RigWellPathFormations::LEVEL5;
case 5: return RigWellPathFormation::LEVEL6; case 5: return RigWellPathFormations::LEVEL6;
case 6: return RigWellPathFormations::LEVEL7;
case 7: return RigWellPathFormations::LEVEL8;
case 8: return RigWellPathFormations::LEVEL9;
case 9: return RigWellPathFormations::LEVEL10;
default: break; default: break;
} }
return RigWellPathFormation::UNKNOWN; return RigWellPathFormations::UNKNOWN;
} }

View File

@ -29,53 +29,42 @@
struct RigWellPathFormation struct RigWellPathFormation
{ {
enum FormationLevel double mdTop;
{ double mdBase;
GROUP, QString formationName;
LEVEL0,
LEVEL1,
LEVEL2,
LEVEL3,
LEVEL4,
LEVEL5,
LEVEL6,
ALL,
FLUIDS,
UNKNOWN
};
double mdTop;
double mdBase;
QString formationName;
FormationLevel level;
}; };
class RigWellPathFormations : public cvf::Object class RigWellPathFormations : public cvf::Object
{ {
public: public:
RigWellPathFormations(std::vector<RigWellPathFormation> formations, const QString& filePath, const QString& key); RigWellPathFormations(const std::vector<RigWellPathFormation>& formations, const QString& filePath, const QString& key);
void measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(std::vector<QString>* names, void measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(std::vector<QString>* names,
std::vector<double>* measuredDepths) const; std::vector<double>* measuredDepths) const;
void measuredDepthAndFormationNamesUpToLevel(RigWellPathFormation::FormationLevel level, std::vector<QString>* names, enum FormationLevel
{
GROUP, LEVEL0, LEVEL1, LEVEL2, LEVEL3, LEVEL4, LEVEL5, LEVEL6, LEVEL7, LEVEL8, LEVEL9, LEVEL10, ALL, FLUIDS, UNKNOWN
};
void measuredDepthAndFormationNamesUpToLevel(FormationLevel level, std::vector<QString>* names,
std::vector<double>* measuredDepths, bool includeFluids) const; std::vector<double>* measuredDepths, bool includeFluids) const;
std::vector<RigWellPathFormation::FormationLevel> formationsLevelsPresent() const; std::vector<FormationLevel> formationsLevelsPresent() const;
QString filePath() const; QString filePath() const;
QString keyInFile() const; QString keyInFile() const;
size_t formationNamesCount() const; size_t formationNamesCount() const;
private: private:
RigWellPathFormation::FormationLevel detectLevel(QString formationName); FormationLevel detectLevel(QString formationName);
private: private:
QString m_filePath; QString m_filePath;
QString m_keyInFile; QString m_keyInFile;
std::map<RigWellPathFormation::FormationLevel, bool> m_formationsLevelsPresent; std::map<FormationLevel, bool> m_formationsLevelsPresent;
std::vector<RigWellPathFormation> m_formations; std::vector<std::pair<RigWellPathFormation, FormationLevel>> m_formations;
}; };