#2303 Formations: Update well path only when formation source changes

This commit is contained in:
Rebecca Cox 2018-01-05 08:36:17 +01:00
parent fc2e638ba2
commit cf12e5ae36
2 changed files with 11 additions and 10 deletions

View File

@ -242,7 +242,7 @@ void RimWellRftPlot::updateFormationsOnPlot() const
RimCase* formationNamesCase = m_wellLogPlot->trackByIndex(0)->formationNamesCase(); RimCase* formationNamesCase = m_wellLogPlot->trackByIndex(0)->formationNamesCase();
if ( !formationNamesCase ) if (!formationNamesCase)
{ {
/// Set default case. Todo : Use the first of the selected cases in the plot /// Set default case. Todo : Use the first of the selected cases in the plot
std::vector<RimCase*> cases; std::vector<RimCase*> cases;

View File

@ -260,15 +260,17 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
} }
else if (changedField == &m_showFormations || changedField == &m_formationSource) else if (changedField == &m_showFormations || changedField == &m_formationSource)
{ {
bool validWellPathChosen = false; if (changedField == &m_formationSource && m_formationSource == WELL_PICK_FILTER)
std::vector<RimWellPath*> wellPaths;
RimTools::wellPathWithFormations(&wellPaths);
for (RimWellPath* wellPath : wellPaths)
{ {
if (wellPath == m_formationWellPathForSourceCase) std::vector<RimWellPath*> wellPaths;
RimTools::wellPathWithFormations(&wellPaths);
for (RimWellPath* wellPath : wellPaths)
{ {
m_formationWellPathForSourceWellPath = m_formationWellPathForSourceCase(); if (wellPath == m_formationWellPathForSourceCase)
break; {
m_formationWellPathForSourceWellPath = m_formationWellPathForSourceCase();
break;
}
} }
} }
@ -284,8 +286,8 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
else else
{ {
RimWellPltPlot* pltPlot(nullptr); RimWellPltPlot* pltPlot(nullptr);
firstAncestorOrThisOfType(pltPlot); firstAncestorOrThisOfType(pltPlot);
if (pltPlot) if (pltPlot)
{ {
pltPlot->updateConnectedEditors(); pltPlot->updateConnectedEditors();
@ -362,7 +364,6 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
if (fieldNeedingOptions == &m_formationWellPathForSourceCase) if (fieldNeedingOptions == &m_formationWellPathForSourceCase)
{ {
RimTools::wellPathOptionItems(&options); RimTools::wellPathOptionItems(&options);
options.push_front(caf::PdmOptionItemInfo("None", nullptr)); options.push_front(caf::PdmOptionItemInfo("None", nullptr));
} }
else if (fieldNeedingOptions == &m_formationWellPathForSourceWellPath) else if (fieldNeedingOptions == &m_formationWellPathForSourceWellPath)