Skip to content

Commit

Permalink
(#396) Added fields for minimum and maximum X-axis values
Browse files Browse the repository at this point in the history
  • Loading branch information
palhagen committed Sep 3, 2015
1 parent c7f9716 commit 8fa2701
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ RimWellLogPlotTrace::RimWellLogPlotTrace()
CAF_PDM_InitFieldNoDefault(&curves, "Curves", "", "", "", "");
curves.uiCapability()->setUiHidden(true);

CAF_PDM_InitField(&m_minimumValue, "MinimumValue", -10.0, "Minimum value", "", "", "");
CAF_PDM_InitField(&m_maximumValue, "MaximumValue", 100.0, "Maximum value", "", "", "");

m_viewer = new RiuWellLogTracePlot;
}

Expand All @@ -66,6 +69,11 @@ void RimWellLogPlotTrace::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
{
m_viewer->setVisible(show());
}
else if (changedField == &m_minimumValue || changedField == &m_maximumValue)
{
m_viewer->setAxisScale(QwtPlot::xTop, m_minimumValue, m_maximumValue);
m_viewer->replot();
}
}

//--------------------------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions ApplicationCode/ProjectDataModel/RimWellLogPlotTrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class RimWellLogPlotTrace : public caf::PdmObject
private:
caf::PdmField<bool> show;
caf::PdmChildArrayField<RimWellLogPlotCurve*> curves;
caf::PdmField<double> m_minimumValue;
caf::PdmField<double> m_maximumValue;

QPointer<RiuWellLogTracePlot> m_viewer;
};

0 comments on commit 8fa2701

Please sign in to comment.