mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use a time based summary plot as source for time axis linking
If a summary plot is created with a cross plot curve, the time axis object might not be configured. Always use a time based summary plot as source for linking of time axis.
This commit is contained in:
@@ -456,7 +456,7 @@ void RimSummaryMultiPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
|||||||
}
|
}
|
||||||
else if ( changedField == &m_linkTimeAxis )
|
else if ( changedField == &m_linkTimeAxis )
|
||||||
{
|
{
|
||||||
updateTimeAxisRangesFromFirstPlot();
|
updateTimeAxisRangesFromFirstTimePlot();
|
||||||
}
|
}
|
||||||
else if ( changedField == &m_linkSubPlotAxes || changedField == &m_axisRangeAggregation || changedField == &m_linkTimeAxis )
|
else if ( changedField == &m_linkSubPlotAxes || changedField == &m_axisRangeAggregation || changedField == &m_linkTimeAxis )
|
||||||
{
|
{
|
||||||
@@ -760,7 +760,7 @@ void RimSummaryMultiPlot::zoomAll()
|
|||||||
|
|
||||||
updateZoom();
|
updateZoom();
|
||||||
|
|
||||||
updateTimeAxisRangesFromFirstPlot();
|
updateTimeAxisRangesFromFirstTimePlot();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -770,18 +770,31 @@ void RimSummaryMultiPlot::zoomAll()
|
|||||||
|
|
||||||
syncAxisRanges();
|
syncAxisRanges();
|
||||||
|
|
||||||
updateTimeAxisRangesFromFirstPlot();
|
updateTimeAxisRangesFromFirstTimePlot();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryMultiPlot::updateTimeAxisRangesFromFirstPlot()
|
void RimSummaryMultiPlot::updateTimeAxisRangesFromFirstTimePlot()
|
||||||
{
|
{
|
||||||
if ( m_linkTimeAxis && !summaryPlots().empty() )
|
if ( m_linkTimeAxis )
|
||||||
|
{
|
||||||
|
auto allPlots = summaryPlots();
|
||||||
|
for ( auto plot : allPlots )
|
||||||
|
{
|
||||||
|
auto curves = plot->summaryAndEnsembleCurves();
|
||||||
|
for ( auto curve : curves )
|
||||||
|
{
|
||||||
|
if ( curve->axisTypeX() == RiaDefines::HorizontalAxisType::TIME )
|
||||||
{
|
{
|
||||||
setAutoScaleXEnabled( false );
|
setAutoScaleXEnabled( false );
|
||||||
syncTimeAxisRanges( summaryPlots().front() );
|
syncTimeAxisRanges( plot );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ private:
|
|||||||
void onSubPlotAxisReloadRequired( const caf::SignalEmitter* emitter, RimSummaryPlot* summaryPlot );
|
void onSubPlotAxisReloadRequired( const caf::SignalEmitter* emitter, RimSummaryPlot* summaryPlot );
|
||||||
void onSubPlotAutoTitleChanged( const caf::SignalEmitter* emitter, bool isEnabled );
|
void onSubPlotAutoTitleChanged( const caf::SignalEmitter* emitter, bool isEnabled );
|
||||||
|
|
||||||
void updateTimeAxisRangesFromFirstPlot();
|
void updateTimeAxisRangesFromFirstTimePlot();
|
||||||
|
|
||||||
void updateReadOnlyState();
|
void updateReadOnlyState();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user