mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix summary issues
* Add missing time conversion for month * #9606: FIx wrong usage of function when accessing data from summary file The result values are aggregated into the destination vector in RimSummaryCaseCollection::computeMinMax(), so make sure the vector is recreated per case. * #9602 : Make sure the plot is updated correctly for "Time since simulation start" * Move roundToNumSignificantDigits() to RiaNumericalTools * Make sure the time axis is consistent when individual time range differs
This commit is contained in:
@@ -108,6 +108,7 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot )
|
||||
, plotZoomedByUser( this )
|
||||
, titleChanged( this )
|
||||
, m_isValid( true )
|
||||
, axisChangedReloadRequired( this )
|
||||
{
|
||||
CAF_PDM_InitScriptableObject( "Summary Plot", ":/SummaryPlotLight16x16.png", "", "A Summary Plot" );
|
||||
|
||||
@@ -144,6 +145,7 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot )
|
||||
{
|
||||
auto* timeAxisProperties = new RimSummaryTimeAxisProperties;
|
||||
timeAxisProperties->settingsChanged.connect( this, &RimSummaryPlot::axisSettingsChanged );
|
||||
timeAxisProperties->requestLoadDataAndUpdate.connect( this, &RimSummaryPlot::axisSettingsChangedReloadRequired );
|
||||
|
||||
m_axisProperties.push_back( timeAxisProperties );
|
||||
}
|
||||
@@ -1740,24 +1742,20 @@ void RimSummaryPlot::updateZoomFromParentPlot()
|
||||
|
||||
for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisProperties )
|
||||
{
|
||||
if ( !axisProperties ) continue;
|
||||
|
||||
auto [axisMin, axisMax] = plotWidget()->axisRange( axisProperties->plotAxisType() );
|
||||
if ( axisProperties->isAxisInverted() ) std::swap( axisMin, axisMax );
|
||||
|
||||
auto propertyAxis = dynamic_cast<RimPlotAxisProperties*>( axisProperties );
|
||||
|
||||
if ( propertyAxis )
|
||||
if ( auto propertyAxis = dynamic_cast<RimPlotAxisProperties*>( axisProperties ) )
|
||||
{
|
||||
propertyAxis->setAutoValueVisibleRangeMax( axisMax );
|
||||
propertyAxis->setAutoValueVisibleRangeMin( axisMin );
|
||||
axisProperties->setVisibleRangeMax( axisMax );
|
||||
axisProperties->setVisibleRangeMin( axisMin );
|
||||
}
|
||||
else
|
||||
{
|
||||
axisProperties->setVisibleRangeMax( axisMax );
|
||||
axisProperties->setVisibleRangeMin( axisMin );
|
||||
}
|
||||
|
||||
axisProperties->setVisibleRangeMax( axisMax );
|
||||
axisProperties->setVisibleRangeMin( axisMin );
|
||||
|
||||
axisProperties->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
@@ -1868,6 +1866,14 @@ void RimSummaryPlot::axisSettingsChanged( const caf::SignalEmitter* emitter )
|
||||
updateAxes();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::axisSettingsChangedReloadRequired( const caf::SignalEmitter* emitter )
|
||||
{
|
||||
axisChangedReloadRequired.send( this );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -2568,6 +2574,7 @@ void RimSummaryPlot::initAfterRead()
|
||||
if ( timeAxis )
|
||||
{
|
||||
timeAxis->settingsChanged.connect( this, &RimSummaryPlot::axisSettingsChanged );
|
||||
timeAxis->requestLoadDataAndUpdate.connect( this, &RimSummaryPlot::axisSettingsChangedReloadRequired );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user