Skip to content

Commit

Permalink
(#438) Added unit to depth axis title. Did some refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
palhagen committed Sep 11, 2015
1 parent 7901c3c commit dce0361
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,25 @@ RimWellLogPlot::DepthTypeEnum RimWellLogPlot::depthType() const
{
return m_depthType.value();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellLogPlot::depthPlotTitle() const
{
QString depthTitle = "Depth";

switch (m_depthType.value())
{
case MEASURED_DEPTH:
depthTitle = "MD";
break;

case TRUE_VERTICAL_DEPTH:
depthTitle = "TVD";
break;
}

depthTitle += " [m]";
return depthTitle;
}
1 change: 1 addition & 0 deletions ApplicationCode/ProjectDataModel/RimWellLogPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class RimWellLogPlot : public caf::PdmObject
void setVisibleDepthRangeFromContents();

DepthTypeEnum depthType() const;
QString depthPlotTitle() const;

virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; }

Expand Down
3 changes: 1 addition & 2 deletions ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ void RimWellLogPlotTrace::loadDataAndUpdate()
firstAnchestorOrThisOfType(wellLogPlot);
if (wellLogPlot)
{
QString depthTitle = wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH ? "MD" : "TVD";
m_viewer->setDepthTitle(depthTitle);
m_viewer->setDepthTitle(wellLogPlot->depthPlotTitle());
}

for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx)
Expand Down

0 comments on commit dce0361

Please sign in to comment.