mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user