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:
Magne Sjaastad
2023-01-02 10:22:44 +01:00
committed by GitHub
parent 984557a46a
commit 09e05e9996
18 changed files with 293 additions and 179 deletions

View File

@@ -71,6 +71,7 @@ CAF_PDM_SOURCE_INIT( RimSummaryTimeAxisProperties, "SummaryTimeAxisProperties" )
///
//--------------------------------------------------------------------------------------------------
RimSummaryTimeAxisProperties::RimSummaryTimeAxisProperties()
: requestLoadDataAndUpdate( this )
{
CAF_PDM_InitObject( "Time Axis", ":/BottomAxis16x16.png" );
@@ -472,7 +473,7 @@ void RimSummaryTimeAxisProperties::setTimeMode( TimeModeType val )
}
//--------------------------------------------------------------------------------------------------
///
/// https://www.unitconverters.net/time-converter.html
//--------------------------------------------------------------------------------------------------
double RimSummaryTimeAxisProperties::fromTimeTToDisplayUnitScale()
{
@@ -490,9 +491,13 @@ double RimSummaryTimeAxisProperties::fromTimeTToDisplayUnitScale()
case DAYS:
scale = 1.0 / ( 60.0 * 60.0 * 24.0 );
break;
case MONTHS:
scale = 3.805175038E-7;
break;
case YEARS:
scale = 1.0 / 31556952.0;
break;
default:
CVF_ASSERT( false );
break;
@@ -502,7 +507,7 @@ double RimSummaryTimeAxisProperties::fromTimeTToDisplayUnitScale()
}
//--------------------------------------------------------------------------------------------------
///
/// https://www.unitconverters.net/time-converter.html
//--------------------------------------------------------------------------------------------------
double RimSummaryTimeAxisProperties::fromDaysToDisplayUnitScale()
{
@@ -520,6 +525,9 @@ double RimSummaryTimeAxisProperties::fromDaysToDisplayUnitScale()
break;
case DAYS:
break;
case MONTHS:
scale = 1.0 / 30.416666667;
break;
case YEARS:
scale = 1.0 / 365.2425;
break;
@@ -712,21 +720,12 @@ void RimSummaryTimeAxisProperties::fieldChangedByUi( const caf::PdmFieldHandle*
updateDateVisibleRange();
m_isAutoZoom = false;
}
else if ( changedField == &m_timeMode )
else if ( changedField == &m_timeMode || changedField == &m_timeUnit || changedField == &m_dateFormat ||
changedField == &m_timeFormat )
{
rimSummaryPlot->loadDataAndUpdate();
}
else if ( changedField == &m_timeUnit )
{
updateTimeVisibleRange(); // Use the stored max min dates to update the visible time range to new unit
rimSummaryPlot->loadDataAndUpdate();
updateDateVisibleRange();
}
else if ( changedField == &m_dateFormat || changedField == &m_timeFormat )
{
updateTimeVisibleRange(); // Use the stored max min dates to update the visible time range to new unit
rimSummaryPlot->loadDataAndUpdate();
updateDateVisibleRange();
// Changing these settings requires a full update of the plot
requestLoadDataAndUpdate.send();
return;
}
rimSummaryPlot->updateAxes();