mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5665 Fix import of element properties in saved projects.
The RigFemPartResultsCollection result cache could contain entries without data if a query for that particular result had been made before the file had been imported.
This commit is contained in:
parent
2a11e8f4a1
commit
a0014f9d05
@ -165,9 +165,23 @@ const RigFormationNames* RigFemPartResultsCollection::activeFormationNames() con
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemPartResultsCollection::addElementPropertyFiles( const std::vector<QString>& filenames )
|
||||
{
|
||||
std::vector<RigFemResultAddress> newAddresses;
|
||||
for ( const QString& filename : filenames )
|
||||
{
|
||||
m_elementPropertyReader->addFile( filename.toStdString() );
|
||||
|
||||
// Collect all addresses which was added in this file
|
||||
std::vector<std::string> fields = m_elementPropertyReader->fieldsInFile( filename.toStdString() );
|
||||
for ( const std::string& field : fields )
|
||||
{
|
||||
newAddresses.push_back( RigFemResultAddress( RIG_ELEMENT, field, "" ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Invalidate previous result if already in cache
|
||||
for ( const RigFemResultAddress& address : newAddresses )
|
||||
{
|
||||
this->deleteResult( address );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user