mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3097 Optionally add plot title to the plot itself
This commit is contained in:
@@ -79,6 +79,7 @@ RimWellLogPlot::RimWellLogPlot()
|
||||
CAF_PDM_InitField(&m_maxVisibleDepth, "MaximumDepth", 1000.0, "Max", "", "", "");
|
||||
CAF_PDM_InitField(&m_isAutoScaleDepthEnabled, "AutoScaleDepthEnabled", true, "Auto Scale", "", "", "");
|
||||
m_isAutoScaleDepthEnabled.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitField(&m_showTitleInPlot, "ShowTitleInPlot", true, "Show Title in Plot", "", "", "");
|
||||
CAF_PDM_InitField(&m_showTrackLegends, "ShowTrackLegends", true, "Show Legends", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_tracks, "Tracks", "", "", "", "");
|
||||
@@ -113,6 +114,12 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
|
||||
m_isAutoScaleDepthEnabled = false;
|
||||
}
|
||||
else if (changedField == &m_showTitleInPlot ||
|
||||
changedField == &m_showTrackLegends)
|
||||
{
|
||||
updateTracks();
|
||||
if (m_viewer) m_viewer->updateChildrenLayout();
|
||||
}
|
||||
else if (changedField == &m_isAutoScaleDepthEnabled)
|
||||
{
|
||||
updateDepthZoom();
|
||||
@@ -121,8 +128,7 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
{
|
||||
updateMdiWindowTitle();
|
||||
}
|
||||
|
||||
if ( changedField == &m_depthType )
|
||||
else if ( changedField == &m_depthType )
|
||||
{
|
||||
RimWellAllocationPlot* wellAllocPlot;
|
||||
firstAncestorOrThisOfType(wellAllocPlot);
|
||||
@@ -134,18 +140,12 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
updateDepthZoom();
|
||||
}
|
||||
}
|
||||
if ( changedField == &m_depthUnit)
|
||||
else if ( changedField == &m_depthUnit)
|
||||
{
|
||||
updateTracks();
|
||||
updateDepthZoom();
|
||||
}
|
||||
|
||||
if ( changedField == &m_showTrackLegends)
|
||||
{
|
||||
updateTracks();
|
||||
if (m_viewer) m_viewer->updateChildrenLayout();
|
||||
}
|
||||
|
||||
RimWellRftPlot* rftPlot(nullptr);
|
||||
this->firstAncestorOrThisOfType(rftPlot);
|
||||
|
||||
@@ -583,6 +583,7 @@ void RimWellLogPlot::uiOrderingForPlot(caf::PdmUiOrdering& uiOrdering)
|
||||
uiOrdering.add(&m_depthUnit);
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_showTitleInPlot);
|
||||
uiOrdering.add(&m_showTrackLegends);
|
||||
}
|
||||
|
||||
@@ -615,8 +616,8 @@ void RimWellLogPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
void RimWellLogPlot::onLoadDataAndUpdate()
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
|
||||
updateTracks();
|
||||
updatePlotTitle();
|
||||
updateTracks();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -834,6 +835,14 @@ QString RimWellLogPlot::depthPlotTitle() const
|
||||
return depthTitle;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellLogPlot::isPlotTitleVisible() const
|
||||
{
|
||||
return m_showTitleInPlot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -903,3 +912,14 @@ void RimWellLogPlot::updateDisabledDepthTypes()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlot::updatePlotTitle()
|
||||
{
|
||||
if (m_viewer)
|
||||
{
|
||||
m_viewer->setPlotTitle(this->windowTitle());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user