diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h index d055429261..ce1e6ffed9 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.h @@ -81,6 +81,7 @@ public: void setCurrentWellName(const QString& currWellName); QString currentWellName() const; + int branchIndex() const; static bool hasPressureData(const RimWellLogFile* wellLogFile); static bool isPressureChannel(RimWellLogFileChannel* channel); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp index d92e403f11..2f213e6438 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp @@ -244,6 +244,20 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField, } else if (changedField == &m_showFormations) { + if (!m_formationCase) + { + RimProject* proj = RiaApplication::instance()->project(); + if (proj) + { + std::vector cases; + proj->allCases(cases); + if (!cases.empty()) + { + m_formationCase = cases[0]; + } + } + } + loadDataAndUpdate(); } else if (changedField == &m_formationCase) @@ -455,6 +469,16 @@ void RimWellLogTrack::loadDataAndUpdate() m_simulationWellChosen = true; } + RimWellRftPlot* rftPlot(nullptr); + firstAncestorOrThisOfType(rftPlot); + + if (rftPlot) + { + m_trajectoryType = RimWellLogTrack::SIMULATION_WELL; + m_simWellName = rftPlot->currentWellName(); + m_branchIndex = rftPlot->branchIndex(); + } + if (m_showFormations) { m_trajectoryType.uiCapability()->setUiReadOnly(false);