mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7585 Multi Lateral Well Adjustments : Make sure lateral number is unique
This commit is contained in:
parent
dd605f5445
commit
a1d85f2ed8
@ -174,27 +174,18 @@ QString RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSide
|
||||
}
|
||||
|
||||
{
|
||||
QString commonRoot = RiaTextStringTools::commonRoot( allNames );
|
||||
QString trimmedCommonRoot = RiaTextStringTools::trimNonAlphaNumericCharacters( commonRoot );
|
||||
|
||||
// Remove side step prefix
|
||||
trimmedCommonRoot.replace( " Y", "" );
|
||||
QString commonRoot = RiaTextStringTools::commonRoot( allNames );
|
||||
|
||||
int maxYValue = 0;
|
||||
for ( auto n : allNames )
|
||||
{
|
||||
auto suffix = n.replace( trimmedCommonRoot, "" );
|
||||
auto suffix = n.replace( commonRoot, "" );
|
||||
|
||||
int candidate = suffix.toInt();
|
||||
maxYValue = std::max( maxYValue, candidate );
|
||||
}
|
||||
|
||||
if ( !trimmedCommonRoot.isEmpty() && trimmedCommonRoot.endsWith( "Y" ) )
|
||||
{
|
||||
trimmedCommonRoot = trimmedCommonRoot.left( trimmedCommonRoot.size() - 1 ).trimmed();
|
||||
}
|
||||
|
||||
nameOfNewWell = QString( "%1 Y%2" ).arg( trimmedCommonRoot ).arg( maxYValue + 1 );
|
||||
nameOfNewWell = QString( "%1%2" ).arg( commonRoot ).arg( maxYValue + 1 );
|
||||
}
|
||||
|
||||
return nameOfNewWell;
|
||||
|
Loading…
Reference in New Issue
Block a user