#7405 StimPlanModel: Case-insensitive facies/formation mapping for elastic properties

This commit is contained in:
Kristian Bendiksen 2021-03-15 10:00:20 +01:00 committed by Magne Sjaastad
parent 6c540ac762
commit 915b16dd78
2 changed files with 20 additions and 4 deletions

View File

@ -103,9 +103,10 @@ void RicElasticPropertiesImportTools::importElasticPropertiesFromFile( const QSt
// Group the items with a given facies key
for ( RifElasticProperties item : rifElasticProperties )
{
if ( item.fieldName == fieldName &&
( item.formationName == formationName || item.formationName == formationWildCard ) &&
item.faciesName == faciesName )
if ( item.fieldName.compare( fieldName, Qt::CaseInsensitive ) == 0 &&
( item.formationName.compare( formationName, Qt::CaseInsensitive ) == 0 ||
item.formationName == formationWildCard ) &&
item.faciesName.compare( faciesName, Qt::CaseInsensitive ) == 0 )
{
matchingFacies.push_back( item );
}

View File

@ -81,5 +81,20 @@ private:
caf::PdmChildField<RimElasticPropertyScalingCollection*> m_scalings;
caf::PdmField<bool> m_showScaledProperties;
std::map<FaciesKey, RigElasticProperties> m_properties;
struct CaseInsensitiveFaciesKeyCompare
{
bool operator()( const FaciesKey& f1, const FaciesKey& f2 ) const
{
int fieldCompare = std::get<0>( f1 ).compare( std::get<0>( f2 ), Qt::CaseInsensitive );
if ( fieldCompare != 0 ) return fieldCompare < 0;
int formationCompare = std::get<1>( f1 ).compare( std::get<1>( f2 ), Qt::CaseInsensitive );
if ( formationCompare != 0 ) return formationCompare < 0;
int faciesCompare = std::get<2>( f1 ).compare( std::get<2>( f2 ), Qt::CaseInsensitive );
return faciesCompare < 0;
}
};
std::map<FaciesKey, RigElasticProperties, CaseInsensitiveFaciesKeyCompare> m_properties;
};