mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Simplify ensemble case naming
This commit is contained in:
parent
462f8026e3
commit
7f9cab5300
@ -36,7 +36,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#define SUMMARY_CASE_SHORT_NAME_LENGTH 6 // TODO: Could make this a preference if required.
|
||||
#define SUMMARY_CASE_SHORT_NAME_LENGTH 4 // TODO: Could make this a preference if required.
|
||||
|
||||
CAF_PDM_ABSTRACT_SOURCE_INIT( RimSummaryCase, "SummaryCase" );
|
||||
namespace caf
|
||||
@ -330,13 +330,10 @@ QString RimSummaryCase::uniqueShortNameForEnsembleCase( RimSummaryCase* summaryC
|
||||
{
|
||||
QStringList subComponents;
|
||||
QString numberGroup = numberRe.match( keyComponent ).captured();
|
||||
int numberGroupAndDelimiterLength = numberGroup.length() + 1;
|
||||
if ( !numberGroup.isEmpty() )
|
||||
{
|
||||
keyComponent = keyComponent.replace( numberGroup, "" );
|
||||
|
||||
QString stem =
|
||||
keyComponent.left( std::max( 1, SUMMARY_CASE_SHORT_NAME_LENGTH - numberGroupAndDelimiterLength ) );
|
||||
QString stem = keyComponent.left( SUMMARY_CASE_SHORT_NAME_LENGTH );
|
||||
if ( !stem.isEmpty() ) subComponents.push_back( stem );
|
||||
subComponents.push_back( numberGroup );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user