#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:
Magne Sjaastad
2023-02-26 08:08:06 +01:00
committed by GitHub
parent 69a668df50
commit 8768e186d8
51 changed files with 990 additions and 601 deletions

View File

@@ -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;
}