Refactor: extract code for detecting logarithmic result

This commit is contained in:
Kristian Bendiksen
2021-09-20 12:12:51 +02:00
parent e9b070c57f
commit ea3fdef281
5 changed files with 22 additions and 23 deletions

View File

@@ -20,6 +20,8 @@
#include "RimEclipseCellColors.h"
#include "RiaResultNames.h"
#include "RicfCommandObject.h"
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
@@ -184,19 +186,7 @@ RimRegularLegendConfig* RimEclipseCellColors::createLegendForResult( const QStri
bool useDiscreteLogLevels,
bool isCategoryResult )
{
bool useLog = false;
{
QStringList subStringsToMatch{ "TRAN", "MULT", "PERM" };
for ( const auto& s : subStringsToMatch )
{
if ( resultName.contains( s, Qt::CaseInsensitive ) )
{
useLog = true;
break;
}
}
}
bool useLog = RiaResultNames::isLogarithmicResult( resultName );
RimRegularLegendConfig::ColorRangesType colorRangeType = RimRegularLegendConfig::ColorRangesType::UNDEFINED;
if ( isCategoryResult )