mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve Grid Statistics Plot UI (#9831)
- Set default frequency enum to relative frequency [%] - Set current view selected in filter by 3D view visibility by default - Add labels for statistics data - Add UI to change number of bins in histogram - Add control of font size of axis values and axis titles
This commit is contained in:
@@ -67,9 +67,18 @@ void caf::AppEnum<RimHistogramCalculator::StatisticsCellRangeType>::setUp()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimHistogramCalculator::RimHistogramCalculator()
|
||||
: m_isVisCellStatUpToDate( false )
|
||||
, m_numBins( RigStatisticsDataCache::defaultNumBins() )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimHistogramCalculator::setNumBins( size_t numBins )
|
||||
{
|
||||
m_numBins = numBins;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -173,14 +182,14 @@ RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView*
|
||||
|
||||
if ( eclResultDefinition->isFlowDiagOrInjectionFlooding() )
|
||||
{
|
||||
// All timesteps is ignored
|
||||
if ( timeRange == StatisticsTimeRangeType::CURRENT_TIMESTEP || timeRange == StatisticsTimeRangeType::ALL_TIMESTEPS )
|
||||
if ( timeRange == StatisticsTimeRangeType::CURRENT_TIMESTEP )
|
||||
{
|
||||
if ( cellRange == StatisticsCellRangeType::ALL_CELLS )
|
||||
{
|
||||
RigFlowDiagResults* fldResults = eclResultDefinition->flowDiagSolution()->flowDiagResults();
|
||||
RigFlowDiagResultAddress resAddr = eclResultDefinition->flowDiagResAddress();
|
||||
|
||||
fldResults->setStatisticsDataCacheNumBins( resAddr, m_numBins );
|
||||
fldResults->minMaxScalarValues( resAddr, timeStep, &histData.min, &histData.max );
|
||||
fldResults->p10p90ScalarValues( resAddr, timeStep, &histData.p10, &histData.p90 );
|
||||
fldResults->meanScalarValue( resAddr, timeStep, &histData.mean );
|
||||
@@ -195,6 +204,7 @@ RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView*
|
||||
|
||||
updateVisCellStatsIfNeeded( eclipseView, eclResultDefinition );
|
||||
|
||||
m_visibleCellStatistics->setNumBins( m_numBins );
|
||||
m_visibleCellStatistics->meanCellScalarValues( timeStep, histData.mean );
|
||||
m_visibleCellStatistics->minMaxCellScalarValues( timeStep, histData.min, histData.max );
|
||||
m_visibleCellStatistics->p10p90CellScalarValues( timeStep, histData.p10, histData.p90 );
|
||||
@@ -204,6 +214,38 @@ RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView*
|
||||
histData.histogram = m_visibleCellStatistics->cellScalarValuesHistogram( timeStep );
|
||||
}
|
||||
}
|
||||
else if ( timeRange == StatisticsTimeRangeType::ALL_TIMESTEPS )
|
||||
{
|
||||
if ( cellRange == StatisticsCellRangeType::ALL_CELLS )
|
||||
{
|
||||
RigFlowDiagResults* fldResults = eclResultDefinition->flowDiagSolution()->flowDiagResults();
|
||||
RigFlowDiagResultAddress resAddr = eclResultDefinition->flowDiagResAddress();
|
||||
|
||||
fldResults->setStatisticsDataCacheNumBins( resAddr, m_numBins );
|
||||
fldResults->minMaxScalarValues( resAddr, &histData.min, &histData.max );
|
||||
fldResults->p10p90ScalarValues( resAddr, &histData.p10, &histData.p90 );
|
||||
fldResults->meanScalarValue( resAddr, &histData.mean );
|
||||
fldResults->sumScalarValue( resAddr, &histData.sum );
|
||||
fldResults->mobileVolumeWeightedMean( resAddr, &histData.weightedMean );
|
||||
|
||||
histData.histogram = fldResults->scalarValuesHistogram( resAddr );
|
||||
}
|
||||
else if ( cellRange == StatisticsCellRangeType::VISIBLE_CELLS )
|
||||
{
|
||||
CVF_ASSERT( eclipseView );
|
||||
|
||||
updateVisCellStatsIfNeeded( eclipseView, eclResultDefinition );
|
||||
|
||||
m_visibleCellStatistics->setNumBins( m_numBins );
|
||||
m_visibleCellStatistics->meanCellScalarValues( histData.mean );
|
||||
m_visibleCellStatistics->minMaxCellScalarValues( histData.min, histData.max );
|
||||
m_visibleCellStatistics->p10p90CellScalarValues( histData.p10, histData.p90 );
|
||||
m_visibleCellStatistics->sumCellScalarValues( histData.sum );
|
||||
m_visibleCellStatistics->mobileVolumeWeightedMean( histData.weightedMean );
|
||||
|
||||
histData.histogram = m_visibleCellStatistics->cellScalarValuesHistogram();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( cellRange == StatisticsCellRangeType::ALL_CELLS )
|
||||
{
|
||||
@@ -211,6 +253,7 @@ RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView*
|
||||
RigCaseCellResultsData* cellResults = eclResultDefinition->currentGridCellResults();
|
||||
if ( timeRange == StatisticsTimeRangeType::ALL_TIMESTEPS )
|
||||
{
|
||||
cellResults->setStatisticsDataCacheNumBins( eclResAddr, m_numBins );
|
||||
cellResults->minMaxCellScalarValues( eclResAddr, histData.min, histData.max );
|
||||
cellResults->p10p90CellScalarValues( eclResAddr, histData.p10, histData.p90 );
|
||||
cellResults->meanCellScalarValues( eclResAddr, histData.mean );
|
||||
@@ -220,6 +263,7 @@ RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView*
|
||||
}
|
||||
else if ( timeRange == StatisticsTimeRangeType::CURRENT_TIMESTEP )
|
||||
{
|
||||
cellResults->setStatisticsDataCacheNumBins( eclResAddr, m_numBins );
|
||||
cellResults->minMaxCellScalarValues( eclResAddr, timeStep, histData.min, histData.max );
|
||||
cellResults->p10p90CellScalarValues( eclResAddr, timeStep, histData.p10, histData.p90 );
|
||||
cellResults->meanCellScalarValues( eclResAddr, timeStep, histData.mean );
|
||||
@@ -235,6 +279,7 @@ RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView*
|
||||
if ( timeRange == StatisticsTimeRangeType::ALL_TIMESTEPS )
|
||||
{
|
||||
// TODO: Only valid if we have no dynamic property filter
|
||||
m_visibleCellStatistics->setNumBins( m_numBins );
|
||||
m_visibleCellStatistics->meanCellScalarValues( histData.mean );
|
||||
m_visibleCellStatistics->minMaxCellScalarValues( histData.min, histData.max );
|
||||
m_visibleCellStatistics->p10p90CellScalarValues( histData.p10, histData.p90 );
|
||||
@@ -245,6 +290,7 @@ RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView*
|
||||
}
|
||||
else if ( timeRange == StatisticsTimeRangeType::CURRENT_TIMESTEP )
|
||||
{
|
||||
m_visibleCellStatistics->setNumBins( m_numBins );
|
||||
m_visibleCellStatistics->meanCellScalarValues( timeStep, histData.mean );
|
||||
m_visibleCellStatistics->minMaxCellScalarValues( timeStep, histData.min, histData.max );
|
||||
m_visibleCellStatistics->p10p90CellScalarValues( timeStep, histData.p10, histData.p90 );
|
||||
|
||||
Reference in New Issue
Block a user