#2038 RFT Plot: Set default values for formation names

This commit is contained in:
Rebecca Cox 2017-11-03 14:53:00 +01:00
parent fc4ceeda95
commit c8b05fe9ce
2 changed files with 25 additions and 0 deletions

View File

@ -81,6 +81,7 @@ public:
void setCurrentWellName(const QString& currWellName); void setCurrentWellName(const QString& currWellName);
QString currentWellName() const; QString currentWellName() const;
int branchIndex() const;
static bool hasPressureData(const RimWellLogFile* wellLogFile); static bool hasPressureData(const RimWellLogFile* wellLogFile);
static bool isPressureChannel(RimWellLogFileChannel* channel); static bool isPressureChannel(RimWellLogFileChannel* channel);

View File

@ -244,6 +244,20 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
} }
else if (changedField == &m_showFormations) else if (changedField == &m_showFormations)
{ {
if (!m_formationCase)
{
RimProject* proj = RiaApplication::instance()->project();
if (proj)
{
std::vector<RimCase*> cases;
proj->allCases(cases);
if (!cases.empty())
{
m_formationCase = cases[0];
}
}
}
loadDataAndUpdate(); loadDataAndUpdate();
} }
else if (changedField == &m_formationCase) else if (changedField == &m_formationCase)
@ -455,6 +469,16 @@ void RimWellLogTrack::loadDataAndUpdate()
m_simulationWellChosen = true; 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) if (m_showFormations)
{ {
m_trajectoryType.uiCapability()->setUiReadOnly(false); m_trajectoryType.uiCapability()->setUiReadOnly(false);