#5407 Color Legend : Set log as default color legend for results based on substring match

This commit is contained in:
Magne Sjaastad 2020-01-28 15:34:01 +01:00
parent 82ef81b51f
commit bbe2eddad6

View File

@ -143,11 +143,30 @@ void RimEclipseCellColors::changeLegendConfig( QString resultVarNameOfNewLegend
}
}
// Not found ?
if ( !found )
{
RimRegularLegendConfig* newLegend = new RimRegularLegendConfig;
newLegend->resultVariableName = resultVarNameOfNewLegend;
bool useLog = false;
{
QStringList subStringsToMatch{"TRAN", "MULT", "PERM"};
for ( const auto& s : subStringsToMatch )
{
if ( resultVarNameOfNewLegend.contains( s, Qt::CaseInsensitive ) )
{
useLog = true;
}
}
}
if ( useLog )
{
newLegend->setMappingMode( RimRegularLegendConfig::LOG10_CONTINUOUS );
newLegend->setTickNumberFormat( RimRegularLegendConfig::AUTO );
}
m_legendConfigData.push_back( newLegend );
this->m_legendConfigPtrField = newLegend;