#2039 PLT Plot: Move formation logic from track to plot

This commit is contained in:
Rebecca Cox 2017-11-06 14:40:26 +01:00
parent 7be8227efa
commit 99f6d21e68
2 changed files with 47 additions and 0 deletions

View File

@ -346,6 +346,51 @@ std::vector<RimEclipseCase*> RimWellPltPlot::eclipseCases() const
return cases;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPltPlot::updateFormationNamesData() const
{
if (m_selectedTimeSteps().empty())
{
for (size_t i = 0; i < m_wellLogPlot->trackCount(); i++)
{
m_wellLogPlot->trackByIndex(i)->updateFormationNamesData(nullptr, RimWellLogTrack::WELL_PATH, nullptr, QString(), 0);
}
return;
}
RimProject* proj = RiaApplication::instance()->project();
RimOilField* oilField = proj->activeOilField();
RimWellPathCollection* wellPathCollection = oilField->wellPathCollection();
RimWellPath* wellPath = wellPathCollection->wellPathByName(m_wellName);
RimWellLogTrack::TrajectoryType trajectoryType;
if (wellPath)
{
trajectoryType = RimWellLogTrack::WELL_PATH;
}
else
{
trajectoryType = RimWellLogTrack::SIMULATION_WELL;
}
RimCase* rimCase = nullptr;
std::vector<RimCase*> cases;
proj->allCases(cases);
if (!cases.empty())
{
rimCase = cases[0];
}
if (m_wellLogPlot->trackCount() > 0)
{
m_wellLogPlot->trackByIndex(0)->updateFormationNamesData(rimCase, trajectoryType, wellPath, m_wellName, m_branchIndex);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -174,6 +174,8 @@ private:
void setPlotXAxisTitles(RimWellLogTrack* plotTrack);
std::vector<RimEclipseCase*> eclipseCases() const;
void updateFormationNamesData() const;
private:
caf::PdmField<bool> m_showPlotTitle;
caf::PdmField<QString> m_userName;