#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);
track->uiOrderingForShowFormationNamesAndCase(uiOrdering);
track->uiOrderingForFormations(uiOrdering);
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup("Legend and Axis");
legendAndAxisGroup->setCollapsedByDefault(true);

View File

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

View File

@ -80,23 +80,26 @@ namespace caf
void AppEnum< RimWellLogTrack::FormationSource >::setUp()
{
addItem(RimWellLogTrack::CASE, "CASE", "Case");
addItem(RimWellLogTrack::WELL_PICK, "WELL_PICK", "Well Pick");
addItem(RimWellLogTrack::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Pick Filter");
addItem(RimWellLogTrack::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Path");
setDefault(RimWellLogTrack::CASE);
}
template<>
void AppEnum<RigWellPathFormation::FormationLevel>::setUp()
void AppEnum<RigWellPathFormations::FormationLevel>::setUp()
{
addItem(RigWellPathFormation::ALL, "ALL", "All");
addItem(RigWellPathFormation::GROUP, "GROUP", "Group");
addItem(RigWellPathFormation::LEVEL0, "LEVEL0", "Main");
addItem(RigWellPathFormation::LEVEL1, "LEVEL1", "Level 1");
addItem(RigWellPathFormation::LEVEL2, "LEVEL2", "Level 2");
addItem(RigWellPathFormation::LEVEL3, "LEVEL3", "Level 3");
addItem(RigWellPathFormation::LEVEL4, "LEVEL4", "Level 4");
addItem(RigWellPathFormation::LEVEL5, "LEVEL5", "Level 5");
addItem(RigWellPathFormation::LEVEL6, "LEVEL6", "Level 6");
addItem(RigWellPathFormations::ALL, "ALL", "All");
addItem(RigWellPathFormations::GROUP, "GROUP", "Formation Group");
addItem(RigWellPathFormations::LEVEL0, "LEVEL0", "Formation");
addItem(RigWellPathFormations::LEVEL1, "LEVEL1", "Formation 1");
addItem(RigWellPathFormations::LEVEL2, "LEVEL2", "Formation 2");
addItem(RigWellPathFormations::LEVEL3, "LEVEL3", "Formation 3");
addItem(RigWellPathFormations::LEVEL4, "LEVEL4", "Formation 4");
addItem(RigWellPathFormations::LEVEL5, "LEVEL5", "Formation 5");
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_showFormations, "ShowFormations", false, "Show Formations", "", "", "");
CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_formationSource, "FormationSource", "Formation Source", "", "", "");
@ -141,7 +144,7 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitFieldNoDefault(&m_formationCase, "FormationCase", "Formation Case", "", "", "");
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", "", "", "");
}
@ -329,7 +332,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
{
RimTools::wellPathOptionItems(&options);
}
else if(m_formationSource == WELL_PICK || m_formationSource == WELL_PICK_FILTER)
else if(m_formationSource == WELL_PICK_FILTER)
{
RimTools::wellPathWithFormationsOptionItems(&options);
}
@ -358,16 +361,18 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
const RigWellPathFormations* formations = m_formationWellPath->formationsGeometry();
if (formations)
{
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<RigWellPathFormation::FormationLevel>::uiText(RigWellPathFormation::ALL),
caf::AppEnum<RigWellPathFormation::FormationLevel>::fromText("All")));
using FormationLevelEnum = caf::AppEnum<RigWellPathFormations::FormationLevel>;
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);
if (index >= caf::AppEnum<RigWellPathFormation::FormationLevel>::size()) continue;
size_t index = FormationLevelEnum::index(level);
if (index >= FormationLevelEnum::size()) continue;
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<RigWellPathFormation::FormationLevel>::uiTextFromIndex(index),
caf::AppEnum<RigWellPathFormation::FormationLevel>::fromIndex(index)));
options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiTextFromIndex(index),
FormationLevelEnum::fromIndex(index)));
}
}
}
@ -784,10 +789,6 @@ void RimWellLogTrack::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
m_formationBranchIndex);
}
}
else if (m_formationSource() == WELL_PICK)
{
formationGroup->add(&m_formationWellPath);
}
else if (m_formationSource() == WELL_PICK_FILTER)
{
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");
formationGroup->setCollapsedByDefault(true);
@ -934,6 +935,15 @@ void RimWellLogTrack::uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering&
{
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);
}
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)
{
if (m_formationWellPath == nullptr) return;

View File

@ -21,6 +21,8 @@
#include "RimWellLogPlot.h"
#include "RigWellPathFormations.h"
#include "cafPdmObject.h"
#include "cafPdmField.h"
#include "cafPdmChildArrayField.h"
@ -67,7 +69,7 @@ public:
virtual ~RimWellLogTrack();
enum TrajectoryType { WELL_PATH, SIMULATION_WELL };
enum FormationSource { CASE, WELL_PICK };
enum FormationSource { CASE, WELL_PICK_FILTER };
void setDescription(const QString& description);
bool isVisible();
@ -114,7 +116,7 @@ public:
QString description();
std::vector<RimWellLogCurve* > curvesVector();
void uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering& uiOrdering);
void uiOrderingForFormations(caf::PdmUiOrdering& uiOrdering);
void uiOrderingForVisibleXRange(caf::PdmUiOrdering& uiOrdering);
private:
@ -163,15 +165,17 @@ private:
caf::PdmField<bool> m_isAutoScaleXEnabled;
caf::PdmField<bool> m_isLogarithmicScaleEnabled;
caf::PdmField<bool> m_showFormations;
caf::PdmField<caf::AppEnum<FormationSource> > m_formationSource;
caf::PdmPtrField<RimCase*> m_formationCase;
caf::PdmField<caf::AppEnum<TrajectoryType> > m_formationTrajectoryType;
caf::PdmPtrField<RimWellPath*> m_formationWellPath;
caf::PdmField<bool> m_showFormations;
caf::PdmField<caf::AppEnum<FormationSource> > m_formationSource;
caf::PdmPtrField<RimCase*> m_formationCase;
caf::PdmField<caf::AppEnum<TrajectoryType> > m_formationTrajectoryType;
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<int> m_formationBranchIndex;
caf::PdmField<bool> m_formationBranchDetection;
caf::PdmField<bool> m_formationBranchDetection;
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)
{
m_filePath = filePath;
m_keyInFile = key;
m_formations = formations;
for (RigWellPathFormation& formation : m_formations)
for (const RigWellPathFormation& formation : formations)
{
RigWellPathFormation::FormationLevel level = detectLevel(formation.formationName);
formation.level = level;
m_formationsLevelsPresent[level] = true;
FormationLevel level = detectLevel(formation.formationName);
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;
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);
names->push_back(formation.formationName + " Top");
tempMakeVectorUniqueOnMeasuredDepth[formation.mdTop] = true;
measuredDepths->push_back(formation.first.mdTop);
names->push_back(formation.first.formationName + " Top");
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);
names->push_back(formation.formationName + " Base");
tempMakeVectorUniqueOnMeasuredDepth[formation.mdBase] = true;
measuredDepths->push_back(formation.first.mdBase);
names->push_back(formation.first.formationName + " Base");
tempMakeVectorUniqueOnMeasuredDepth[formation.first.mdBase] = true;
}
}
}
@ -90,10 +90,10 @@ void RigWellPathFormations::measuredDepthAndFormationNamesWithoutDuplicatesOnDep
struct 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;
QString name;
RigWellPathFormations::FormationLevel level;
QString name;
};
enum PICK_POSITION
@ -104,9 +104,10 @@ enum PICK_POSITION
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void evaluateFormations(const std::vector<RigWellPathFormation>& formations, const RigWellPathFormation::FormationLevel& maxLevel,
bool includeFluids, const PICK_POSITION& position,
std::map<double, LevelAndName, MeasuredDepthComp>* uniqueListMaker)
void evaluateFormations(const std::vector<std::pair<RigWellPathFormation, RigWellPathFormations::FormationLevel>>& formations,
const RigWellPathFormations::FormationLevel& maxLevel,
bool includeFluids, const PICK_POSITION& position,
std::map<double, LevelAndName, MeasuredDepthComp>* uniqueListMaker)
{
QString postFix;
@ -119,32 +120,32 @@ void evaluateFormations(const std::vector<RigWellPathFormation>& formations, con
postFix = " Base";
}
for (const RigWellPathFormation& formation : formations)
for (const std::pair<RigWellPathFormation, RigWellPathFormations::FormationLevel>& formation : formations)
{
double md;
if (position == TOP)
{
md = formation.mdTop;
md = formation.first.mdTop;
}
else
{
md = formation.mdBase;
md = formation.first.mdBase;
}
if (formation.level == RigWellPathFormation::FLUIDS)
if (formation.second == RigWellPathFormations::FLUIDS)
{
if (includeFluids)
{
(*uniqueListMaker)[md] = LevelAndName(formation.level, formation.formationName + postFix);
(*uniqueListMaker)[md] = LevelAndName(formation.second, formation.first.formationName + postFix);
}
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<double>* measuredDepths, bool includeFluids) const
{
names->clear();
measuredDepths->clear();
if (maxLevel == RigWellPathFormation::ALL)
if (maxLevel == RigWellPathFormations::ALL)
{
measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(names, measuredDepths);
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++)
{
@ -219,13 +220,13 @@ size_t RigWellPathFormations::formationNamesCount() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigWellPathFormation::FormationLevel RigWellPathFormations::detectLevel(QString formationName)
RigWellPathFormations::FormationLevel RigWellPathFormations::detectLevel(QString formationName)
{
formationName = formationName.trimmed();
if (formationName == "OIL" || formationName == "GAS")
if (formationName == "OIL" || formationName == "GAS" || formationName == "WATER")
{
return RigWellPathFormation::FLUIDS;
return RigWellPathFormations::FLUIDS;
}
bool isGroupName = true;
@ -239,7 +240,7 @@ RigWellPathFormation::FormationLevel RigWellPathFormations::detectLevel(QString
}
if (isGroupName)
{
return RigWellPathFormation::GROUP;
return RigWellPathFormations::GROUP;
}
QStringList formationNameSplitted = formationName.split(" ");
@ -259,7 +260,7 @@ RigWellPathFormation::FormationLevel RigWellPathFormations::detectLevel(QString
}
if (levelDesctiptorCandidates.empty())
{
return RigWellPathFormation::LEVEL0;
return RigWellPathFormations::LEVEL0;
}
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];
@ -285,13 +286,17 @@ RigWellPathFormation::FormationLevel RigWellPathFormations::detectLevel(QString
switch (dotCount)
{
case 0: return RigWellPathFormation::LEVEL1;
case 1: return RigWellPathFormation::LEVEL2;
case 2: return RigWellPathFormation::LEVEL3;
case 3: return RigWellPathFormation::LEVEL4;
case 4: return RigWellPathFormation::LEVEL5;
case 5: return RigWellPathFormation::LEVEL6;
case 0: return RigWellPathFormations::LEVEL1;
case 1: return RigWellPathFormations::LEVEL2;
case 2: return RigWellPathFormations::LEVEL3;
case 3: return RigWellPathFormations::LEVEL4;
case 4: return RigWellPathFormations::LEVEL5;
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;
}
return RigWellPathFormation::UNKNOWN;
return RigWellPathFormations::UNKNOWN;
}

View File

@ -29,53 +29,42 @@
struct RigWellPathFormation
{
enum FormationLevel
{
GROUP,
LEVEL0,
LEVEL1,
LEVEL2,
LEVEL3,
LEVEL4,
LEVEL5,
LEVEL6,
ALL,
FLUIDS,
UNKNOWN
};
double mdTop;
double mdBase;
QString formationName;
FormationLevel level;
double mdTop;
double mdBase;
QString formationName;
};
class RigWellPathFormations : public cvf::Object
{
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,
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<RigWellPathFormation::FormationLevel> formationsLevelsPresent() const;
std::vector<FormationLevel> formationsLevelsPresent() const;
QString filePath() const;
QString keyInFile() const;
size_t formationNamesCount() const;
size_t formationNamesCount() const;
private:
RigWellPathFormation::FormationLevel detectLevel(QString formationName);
FormationLevel detectLevel(QString formationName);
private:
QString m_filePath;
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;
};