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:
@@ -180,10 +180,22 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::set<RifEclip
|
||||
auto* lgrwell = getOrCreateSubfolder( CollectionContentType::WELL_LGR );
|
||||
auto* lgrcompletion = getOrCreateSubfolder( CollectionContentType::WELL_COMPLETION_LGR );
|
||||
auto* lgrblock = getOrCreateSubfolder( CollectionContentType::BLOCK_LGR );
|
||||
auto* calculated = getOrCreateSubfolder( CollectionContentType::CALCULATED );
|
||||
auto* imported = getOrCreateSubfolder( CollectionContentType::IMPORTED );
|
||||
|
||||
for ( const auto& address : addresses )
|
||||
// Sort addresses to have calculated results last per category
|
||||
std::vector<RifEclipseSummaryAddress> sortedAddresses( addresses.size() );
|
||||
std::copy( addresses.begin(), addresses.end(), sortedAddresses.begin() );
|
||||
std::sort( sortedAddresses.begin(),
|
||||
sortedAddresses.end(),
|
||||
[]( const RifEclipseSummaryAddress& a, const RifEclipseSummaryAddress& b ) -> bool {
|
||||
if ( a.category() < b.category() ) return false;
|
||||
// Calculated results are sorted last.
|
||||
if ( a.isCalculated() && !b.isCalculated() ) return false;
|
||||
if ( !a.isCalculated() && b.isCalculated() ) return true;
|
||||
return a.vectorName() < b.vectorName();
|
||||
} );
|
||||
|
||||
for ( const auto& address : sortedAddresses )
|
||||
{
|
||||
switch ( address.category() )
|
||||
{
|
||||
@@ -301,14 +313,6 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::set<RifEclip
|
||||
ensembleId );
|
||||
break;
|
||||
|
||||
case RifEclipseSummaryAddress::SummaryVarCategory::SUMMARY_CALCULATED:
|
||||
calculated->addToSubfolder( QString::fromStdString( address.itemUiText() ),
|
||||
CollectionContentType::CALCULATED,
|
||||
address,
|
||||
caseId,
|
||||
ensembleId );
|
||||
break;
|
||||
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user