mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #5431 from OPM/default-log-legend
Color Legend : Set log as default color legend for results based on substring match
This commit is contained in:
commit
256c91572b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user