mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#9671 summary calculations for summary items
* Summary Calculation: use shorter name in title * Sort summary addresses to group calculated results last. * Summary Calculation: add option to distribute calculation to other items. * Add support for summary calculation for RimGridSummaryCase. * Use short name for calculations in plot titles. * Update ensembles in Data Sources when calculation is added. * Summary Calculation: allow drag-and-drop of ensembles * Summary Plot: fix axis range aggregation for calculated ensemble addresses. --------- Co-authored-by: Kristian Bendiksen <kristian.bendiksen@gmail.com>
This commit is contained in:
@@ -47,7 +47,6 @@ void caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>::setUp()
|
||||
addItem( RifAdr::SUMMARY_WELL_SEGMENT, "SUMMARY_SEGMENT", RiaDefines::summarySegment() );
|
||||
addItem( RifAdr::SUMMARY_BLOCK, "SUMMARY_BLOCK", RiaDefines::summaryBlock() );
|
||||
addItem( RifAdr::SUMMARY_BLOCK_LGR, "SUMMARY_BLOCK_LGR", RiaDefines::summaryLgrBlock() );
|
||||
addItem( RifAdr::SUMMARY_CALCULATED, "SUMMARY_CALCULATED", RiaDefines::summaryCalculated() );
|
||||
addItem( RifAdr::SUMMARY_IMPORTED, "SUMMARY_IMPORTED", "Imported" );
|
||||
addItem( RifAdr::SUMMARY_ENSEMBLE_STATISTICS, "SUMMARY_ENSEMBLE_STATISTICS", "Ensemble Statistics" );
|
||||
setDefault( RifAdr::SUMMARY_FIELD );
|
||||
@@ -137,6 +136,7 @@ void RimSummaryAddress::setAddress( const RifEclipseSummaryAddress& addr )
|
||||
m_calculationId = addr.id();
|
||||
|
||||
setUiName( m_vectorName );
|
||||
setUiIconFromResourceString( iconResourceText() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -160,27 +160,6 @@ RifEclipseSummaryAddress RimSummaryAddress::address() const
|
||||
m_calculationId );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddress::ensureCalculationIdIsAssigned()
|
||||
{
|
||||
if ( m_category == RifEclipseSummaryAddress::SUMMARY_CALCULATED && m_calculationId == -1 )
|
||||
{
|
||||
RimSummaryCalculationCollection* calcColl = RimProject::current()->calculationCollection();
|
||||
|
||||
for ( const RimUserDefinedCalculation* c : calcColl->calculations() )
|
||||
{
|
||||
QString description = c->description();
|
||||
|
||||
if ( description == m_vectorName )
|
||||
{
|
||||
m_calculationId = c->id();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Return phase type if the current result is known to be of a particular
|
||||
/// fluid phase type. Otherwise the method will return PHASE_NOT_APPLICABLE.
|
||||
@@ -271,3 +250,13 @@ bool RimSummaryAddress::isEnsemble() const
|
||||
{
|
||||
return m_ensembleId >= 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryAddress::iconResourceText() const
|
||||
{
|
||||
if ( m_calculationId != -1 ) return ":/summary/components/images/calculated.svg";
|
||||
|
||||
return ":/DataVector.png";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user