mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-30 09:00:20 -05:00
#14539 Summary Plot: Preserve user defined axis ranges when the data source changes
An axis range defined by the user is now kept when a summary case or ensemble is added, reloaded or replaced. The range is marked as user defined when the user edits the min/max values, unchecks "Set Range Automatically" or zooms interactively in the plot. The user defined range is released by "Zoom All", by double click in a plot, by checking "Set Range Automatically" or by changing the Y axis range aggregation of a summary multi plot.
This commit is contained in:
1 parent
f38332b2e6
commit
110bdbe0c7
11 files changed
+121
-7
No files matched your search
@@ -586,14 +586,14 @@ double RimPlotAxisProperties::visibleRangeMax() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisProperties::enableAutoValueMinMax( bool enable )
|
||||
{
|
||||
// Never replace a range defined by the user by an automatically computed range
|
||||
const bool useAutoValue = enable && !isRangeUserDefined();
|
||||
|
||||
m_visibleRangeMin.uiCapability()->enableAutoValueSupport( enable );
|
||||
m_visibleRangeMax.uiCapability()->enableAutoValueSupport( enable );
|
||||
|
||||
if ( enable )
|
||||
{
|
||||
m_visibleRangeMin.uiCapability()->enableAutoValue( enable );
|
||||
m_visibleRangeMax.uiCapability()->enableAutoValue( enable );
|
||||
}
|
||||
m_visibleRangeMin.uiCapability()->enableAutoValue( useAutoValue );
|
||||
m_visibleRangeMax.uiCapability()->enableAutoValue( useAutoValue );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -711,12 +711,22 @@ void RimPlotAxisProperties::fieldChangedByUi( const caf::PdmFieldHandle* changed
|
||||
if ( m_visibleRangeMin > m_visibleRangeMax ) m_visibleRangeMax = oldValue.toDouble();
|
||||
|
||||
m_isAutoZoom = false;
|
||||
|
||||
// The range is defined by the user unless the value comes from the auto value of the field
|
||||
setRangeUserDefined( !m_visibleRangeMax.uiCapability()->isAutoValueEnabled() );
|
||||
}
|
||||
else if ( changedField == &m_visibleRangeMin )
|
||||
{
|
||||
if ( m_visibleRangeMin > m_visibleRangeMax ) m_visibleRangeMin = oldValue.toDouble();
|
||||
|
||||
m_isAutoZoom = false;
|
||||
|
||||
// The range is defined by the user unless the value comes from the auto value of the field
|
||||
setRangeUserDefined( !m_visibleRangeMin.uiCapability()->isAutoValueEnabled() );
|
||||
}
|
||||
else if ( changedField == &m_isAutoZoom )
|
||||
{
|
||||
setRangeUserDefined( !m_isAutoZoom() );
|
||||
}
|
||||
|
||||
if ( changedField == &m_isLogarithmicScaleEnabled )
|
||||
|
||||
Reference in new issue
Block a user