#2303 Formation: Make formations for RFT and PLT work

This commit is contained in:
Rebecca Cox
2018-01-04 16:42:57 +01:00
parent 0f30433286
commit fc2e638ba2
4 changed files with 68 additions and 53 deletions

View File

@@ -1005,7 +1005,7 @@ void RimWellPltPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
{ {
RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0); RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0);
track->uiOrderingForFormations(uiOrdering); track->uiOrderingForRftPltFormations(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

@@ -253,7 +253,8 @@ void RimWellRftPlot::updateFormationsOnPlot() const
formationNamesCase = cases[0]; formationNamesCase = cases[0];
} }
} }
else if (wellPath)
if (wellPath)
{ {
m_wellLogPlot->trackByIndex(0)->setAndUpdateWellPathFormationNamesData(formationNamesCase, wellPath); m_wellLogPlot->trackByIndex(0)->setAndUpdateWellPathFormationNamesData(formationNamesCase, wellPath);
} }
@@ -781,7 +782,7 @@ void RimWellRftPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
{ {
RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0); RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0);
track->uiOrderingForFormations(uiOrdering); track->uiOrderingForRftPltFormations(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

@@ -135,8 +135,11 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitFieldNoDefault(&m_formationTrajectoryType, "FormationTrajectoryType", "Trajectory", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_formationTrajectoryType, "FormationTrajectoryType", "Trajectory", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_formationWellPath, "FormationWellPath", "Well Path", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_formationWellPathForSourceCase, "FormationWellPath", "Well Path", "", "", "");
m_formationWellPath.uiCapability()->setUiTreeChildrenHidden(true); m_formationWellPathForSourceCase.uiCapability()->setUiTreeChildrenHidden(true);
CAF_PDM_InitFieldNoDefault(&m_formationWellPathForSourceWellPath, "FormationWellPathForSourceWellPath", "Well Path", "", "", "");
m_formationWellPathForSourceWellPath.uiCapability()->setUiTreeChildrenHidden(true);
CAF_PDM_InitField(&m_formationSimWellName, "FormationSimulationWellName", QString("None"), "Simulation Well", "", "", ""); CAF_PDM_InitField(&m_formationSimWellName, "FormationSimulationWellName", QString("None"), "Simulation Well", "", "", "");
CAF_PDM_InitField(&m_formationBranchIndex, "FormationBranchIndex", 0, " ", "", "", ""); CAF_PDM_InitField(&m_formationBranchIndex, "FormationBranchIndex", 0, " ", "", "", "");
@@ -257,8 +260,19 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
} }
else if (changedField == &m_showFormations || changedField == &m_formationSource) else if (changedField == &m_showFormations || changedField == &m_formationSource)
{ {
loadDataAndUpdate(); bool validWellPathChosen = false;
std::vector<RimWellPath*> wellPaths;
RimTools::wellPathWithFormations(&wellPaths);
for (RimWellPath* wellPath : wellPaths)
{
if (wellPath == m_formationWellPathForSourceCase)
{
m_formationWellPathForSourceWellPath = m_formationWellPathForSourceCase();
break;
}
}
loadDataAndUpdate();
RimWellRftPlot* rftPlot(nullptr); RimWellRftPlot* rftPlot(nullptr);
firstAncestorOrThisOfType(rftPlot); firstAncestorOrThisOfType(rftPlot);
@@ -277,36 +291,20 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
pltPlot->updateConnectedEditors(); pltPlot->updateConnectedEditors();
} }
} }
bool validWellPathChosen = false;
std::vector<RimWellPath*> wellPaths;
RimTools::wellPathWithFormations(&wellPaths);
for (RimWellPath* wellPath : wellPaths)
{
if (wellPath == m_formationWellPath)
{
validWellPathChosen = true;
break;
}
}
if (!validWellPathChosen)
{
m_formationWellPath = nullptr;
}
} }
else if (changedField == &m_formationCase) else if (changedField == &m_formationCase)
{ {
QList<caf::PdmOptionItemInfo> options; QList<caf::PdmOptionItemInfo> options;
RimWellLogTrack::simWellOptionItems(&options, m_formationCase); RimWellLogTrack::simWellOptionItems(&options, m_formationCase);
if (options.isEmpty()) if (options.isEmpty() || m_formationCase == nullptr)
{ {
m_formationSimWellName = QString("None"); m_formationSimWellName = QString("None");
} }
loadDataAndUpdate(); loadDataAndUpdate();
} }
else if (changedField == &m_formationWellPath) else if (changedField == &m_formationWellPathForSourceCase)
{ {
loadDataAndUpdate(); loadDataAndUpdate();
} }
@@ -316,6 +314,19 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
} }
else if (changedField == &m_formationTrajectoryType) else if (changedField == &m_formationTrajectoryType)
{ {
if (m_formationTrajectoryType == WELL_PATH)
{
RimProject* proj = RiaApplication::instance()->project();
m_formationWellPathForSourceCase = proj->wellPathFromSimWellName(m_formationSimWellName);
}
else
{
if (m_formationWellPathForSourceCase)
{
m_formationSimWellName = m_formationWellPathForSourceCase->m_simWellName;
}
}
loadDataAndUpdate(); loadDataAndUpdate();
} }
else if (changedField == &m_formationBranchIndex || else if (changedField == &m_formationBranchIndex ||
@@ -325,6 +336,10 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
loadDataAndUpdate(); loadDataAndUpdate();
} }
else if (changedField == &m_formationWellPathForSourceWellPath)
{
loadDataAndUpdate();
}
else if (changedField == &m_formationLevel) else if (changedField == &m_formationLevel)
{ {
loadDataAndUpdate(); loadDataAndUpdate();
@@ -344,19 +359,17 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
if (options.size() > 0) return options; if (options.size() > 0) return options;
if (fieldNeedingOptions == &m_formationWellPath) if (fieldNeedingOptions == &m_formationWellPathForSourceCase)
{ {
if (m_formationSource == CASE) RimTools::wellPathOptionItems(&options);
{
RimTools::wellPathOptionItems(&options);
}
else if(m_formationSource == WELL_PICK_FILTER)
{
RimTools::wellPathWithFormationsOptionItems(&options);
}
options.push_front(caf::PdmOptionItemInfo("None", nullptr)); options.push_front(caf::PdmOptionItemInfo("None", nullptr));
} }
else if (fieldNeedingOptions == &m_formationWellPathForSourceWellPath)
{
RimTools::wellPathWithFormationsOptionItems(&options);
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
}
else if (fieldNeedingOptions == &m_formationCase) else if (fieldNeedingOptions == &m_formationCase)
{ {
RimTools::caseOptionItems(&options); RimTools::caseOptionItems(&options);
@@ -374,9 +387,9 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
} }
else if (fieldNeedingOptions == &m_formationLevel) else if (fieldNeedingOptions == &m_formationLevel)
{ {
if (m_formationWellPath) if (m_formationWellPathForSourceWellPath)
{ {
const RigWellPathFormations* formations = m_formationWellPath->formationsGeometry(); const RigWellPathFormations* formations = m_formationWellPathForSourceWellPath->formationsGeometry();
if (formations) if (formations)
{ {
using FormationLevelEnum = caf::AppEnum<RigWellPathFormations::FormationLevel>; using FormationLevelEnum = caf::AppEnum<RigWellPathFormations::FormationLevel>;
@@ -551,7 +564,7 @@ void RimWellLogTrack::setAndUpdateWellPathFormationNamesData(RimCase* rimCase, R
{ {
m_formationCase = rimCase; m_formationCase = rimCase;
m_formationTrajectoryType = RimWellLogTrack::WELL_PATH; m_formationTrajectoryType = RimWellLogTrack::WELL_PATH;
m_formationWellPath = wellPath; m_formationWellPathForSourceCase = wellPath;
m_formationSimWellName = ""; m_formationSimWellName = "";
m_formationBranchIndex = -1; m_formationBranchIndex = -1;
@@ -581,7 +594,7 @@ void RimWellLogTrack::setAndUpdateSimWellFormationNamesData(RimCase* rimCase, co
{ {
m_formationCase = rimCase; m_formationCase = rimCase;
m_formationTrajectoryType = RimWellLogTrack::SIMULATION_WELL; m_formationTrajectoryType = RimWellLogTrack::SIMULATION_WELL;
m_formationWellPath = nullptr; m_formationWellPathForSourceCase = nullptr;
m_formationSimWellName = simWellName; m_formationSimWellName = simWellName;
updateConnectedEditors(); updateConnectedEditors();
@@ -605,7 +618,7 @@ void RimWellLogTrack::setXAxisTitle(const QString& text)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setFormationWellPath(RimWellPath* wellPath) void RimWellLogTrack::setFormationWellPath(RimWellPath* wellPath)
{ {
m_formationWellPath = wellPath; m_formationWellPathForSourceCase = wellPath;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -798,7 +811,7 @@ void RimWellLogTrack::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
formationGroup->add(&m_formationTrajectoryType); formationGroup->add(&m_formationTrajectoryType);
if (m_formationTrajectoryType() == WELL_PATH) if (m_formationTrajectoryType() == WELL_PATH)
{ {
formationGroup->add(&m_formationWellPath); formationGroup->add(&m_formationWellPathForSourceCase);
} }
else else
{ {
@@ -812,8 +825,8 @@ void RimWellLogTrack::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
} }
else if (m_formationSource() == WELL_PICK_FILTER) else if (m_formationSource() == WELL_PICK_FILTER)
{ {
formationGroup->add(&m_formationWellPath); formationGroup->add(&m_formationWellPathForSourceWellPath);
if (m_formationWellPath()) if (m_formationWellPathForSourceWellPath())
{ {
formationGroup->add(&m_formationLevel); formationGroup->add(&m_formationLevel);
formationGroup->add(&m_showformationFluids); formationGroup->add(&m_showformationFluids);
@@ -946,7 +959,7 @@ std::vector<RimWellLogCurve* > RimWellLogTrack::curvesVector()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::uiOrderingForFormations(caf::PdmUiOrdering& uiOrdering) void RimWellLogTrack::uiOrderingForRftPltFormations(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);
@@ -958,8 +971,7 @@ void RimWellLogTrack::uiOrderingForFormations(caf::PdmUiOrdering& uiOrdering)
} }
if (m_formationSource == WELL_PICK_FILTER) if (m_formationSource == WELL_PICK_FILTER)
{ {
formationGroup->add(&m_formationWellPath); if (m_formationWellPathForSourceWellPath() && m_formationWellPathForSourceWellPath()->hasFormations())
if (m_formationWellPath())
{ {
formationGroup->add(&m_formationLevel); formationGroup->add(&m_formationLevel);
formationGroup->add(&m_showformationFluids); formationGroup->add(&m_showformationFluids);
@@ -1161,7 +1173,8 @@ void RimWellLogTrack::setFormationFieldsUiReadOnly(bool readOnly /*= true*/)
m_formationTrajectoryType.uiCapability()->setUiReadOnly(readOnly); m_formationTrajectoryType.uiCapability()->setUiReadOnly(readOnly);
m_formationSimWellName.uiCapability()->setUiReadOnly(readOnly); m_formationSimWellName.uiCapability()->setUiReadOnly(readOnly);
m_formationCase.uiCapability()->setUiReadOnly(readOnly); m_formationCase.uiCapability()->setUiReadOnly(readOnly);
m_formationWellPath.uiCapability()->setUiReadOnly(readOnly); m_formationWellPathForSourceCase.uiCapability()->setUiReadOnly(readOnly);
m_formationWellPathForSourceWellPath.uiCapability()->setUiReadOnly(readOnly);
m_formationBranchIndex.uiCapability()->setUiReadOnly(readOnly); m_formationBranchIndex.uiCapability()->setUiReadOnly(readOnly);
m_formationLevel.uiCapability()->setUiReadOnly(readOnly); m_formationLevel.uiCapability()->setUiReadOnly(readOnly);
m_showformationFluids.uiCapability()->setUiReadOnly(readOnly); m_showformationFluids.uiCapability()->setUiReadOnly(readOnly);
@@ -1189,7 +1202,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
if (m_formationSource == CASE) if (m_formationSource == CASE)
{ {
if ((m_formationSimWellName == QString("None") && m_formationWellPath == nullptr) || m_formationCase == nullptr) return; if ((m_formationSimWellName == QString("None") && m_formationWellPathForSourceCase == nullptr) || m_formationCase == nullptr) return;
RimMainPlotCollection* mainPlotCollection; RimMainPlotCollection* mainPlotCollection;
this->firstAncestorOrThisOfTypeAsserted(mainPlotCollection); this->firstAncestorOrThisOfTypeAsserted(mainPlotCollection);
@@ -1213,7 +1226,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
{ {
eclWellLogExtractor = RimWellLogTrack::createWellPathExtractor(wellLogCollection, eclWellLogExtractor = RimWellLogTrack::createWellPathExtractor(wellLogCollection,
m_formationCase, m_formationCase,
m_formationWellPath); m_formationWellPathForSourceCase);
} }
if (eclWellLogExtractor) if (eclWellLogExtractor)
@@ -1230,7 +1243,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
} }
else else
{ {
geoMechWellLogExtractor = RimWellLogTrack::createGeoMechExtractor(wellLogCollection, m_formationCase, m_formationWellPath); geoMechWellLogExtractor = RimWellLogTrack::createGeoMechExtractor(wellLogCollection, m_formationCase, m_formationWellPathForSourceCase);
if (!geoMechWellLogExtractor) return; if (!geoMechWellLogExtractor) return;
std::string activeFormationNamesResultName = RiaDefines::activeFormationNamesResultName().toStdString(); std::string activeFormationNamesResultName = RiaDefines::activeFormationNamesResultName().toStdString();
@@ -1250,12 +1263,12 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
} }
else if (m_formationSource() == WELL_PICK_FILTER) else if (m_formationSource() == WELL_PICK_FILTER)
{ {
if (m_formationWellPath == nullptr) return; if (m_formationWellPathForSourceWellPath == nullptr) return;
if (plot->depthType() != RimWellLogPlot::MEASURED_DEPTH) return; if (!(plot->depthType() == RimWellLogPlot::MEASURED_DEPTH || plot->depthType() == RimWellLogPlot::PSEUDO_LENGTH)) return;
std::vector<double> yValues; std::vector<double> yValues;
const RigWellPathFormations* formations = m_formationWellPath->formationsGeometry(); const RigWellPathFormations* formations = m_formationWellPathForSourceWellPath->formationsGeometry();
if (!formations) return; if (!formations) return;
formations->measuredDepthAndFormationNamesUpToLevel(m_formationLevel(), &formationNamesToPlot, &yValues, m_showformationFluids()); formations->measuredDepthAndFormationNamesUpToLevel(m_formationLevel(), &formationNamesToPlot, &yValues, m_showformationFluids());

View File

@@ -116,7 +116,7 @@ public:
QString description(); QString description();
std::vector<RimWellLogCurve* > curvesVector(); std::vector<RimWellLogCurve* > curvesVector();
void uiOrderingForFormations(caf::PdmUiOrdering& uiOrdering); void uiOrderingForRftPltFormations(caf::PdmUiOrdering& uiOrdering);
void uiOrderingForVisibleXRange(caf::PdmUiOrdering& uiOrdering); void uiOrderingForVisibleXRange(caf::PdmUiOrdering& uiOrdering);
private: private:
@@ -169,7 +169,8 @@ private:
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_formationWellPathForSourceCase;
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceWellPath;
caf::PdmField<QString> m_formationSimWellName; caf::PdmField<QString> m_formationSimWellName;
caf::PdmField<int> m_formationBranchIndex; caf::PdmField<int> m_formationBranchIndex;
caf::PdmField<caf::AppEnum<RigWellPathFormations::FormationLevel>> m_formationLevel; caf::PdmField<caf::AppEnum<RigWellPathFormations::FormationLevel>> m_formationLevel;