Improve summary calculation performance

* Only reload calculation data
* Make sure performance is good when a calculated object is added or changed
- avoid recreation of summary file readers
- delete all nodes in address tree representing calculated curves
- build address nodes for calculated curves
This commit is contained in:
Magne Sjaastad
2024-02-26 13:55:41 +01:00
committed by GitHub
parent 28d281e1d6
commit 672fbe177b
22 changed files with 143 additions and 81 deletions

View File

@@ -99,7 +99,7 @@ RimSummaryAddressCollection::~RimSummaryAddressCollection()
//--------------------------------------------------------------------------------------------------
bool RimSummaryAddressCollection::hasDataVector( const QString quantityName ) const
{
for ( auto& address : m_adresses )
for ( const auto& address : m_adresses )
{
if ( address->quantityName() == quantityName ) return true;
}
@@ -346,6 +346,32 @@ void RimSummaryAddressCollection::deleteChildren()
m_subfolders.deleteChildren();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryAddressCollection::deleteCalculatedObjects()
{
std::vector<RimSummaryAddress*> toDelete;
for ( const auto& a : m_adresses )
{
if ( a->address().isCalculated() )
{
toDelete.push_back( a );
}
}
for ( auto a : toDelete )
{
m_adresses.removeChild( a );
delete a;
}
for ( auto& folder : m_subfolders )
{
folder->deleteCalculatedObjects();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------