mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
##7903: Improve ensemble surface names
Update the name of statistics surface when created Regenerate surface geo only when required Create statistics surfaces when importing surface ensemble
This commit is contained in:
parent
795d9eecca
commit
49fa169db8
@ -46,6 +46,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.inl
|
${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.inl
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.h
|
${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.h
|
${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
@ -88,6 +89,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
161
ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.cpp
Normal file
161
ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.cpp
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2021 Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RiaEnsembleNameTools.h"
|
||||||
|
|
||||||
|
#include "RiaFilePathTools.h"
|
||||||
|
|
||||||
|
#include "RimCaseDisplayNameTools.h"
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RiaEnsembleNameTools::findSuitableEnsembleName( const QStringList& fileNames )
|
||||||
|
{
|
||||||
|
std::vector<QStringList> componentsForAllFilePaths;
|
||||||
|
|
||||||
|
for ( const auto& filePath : fileNames )
|
||||||
|
{
|
||||||
|
QStringList components = RiaFilePathTools::splitPathIntoComponents( filePath );
|
||||||
|
componentsForAllFilePaths.push_back( components );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find list of all folders inside a folder matching realization-*
|
||||||
|
QRegularExpression realizationRe( "realization\\-\\d+" );
|
||||||
|
|
||||||
|
QStringList iterations;
|
||||||
|
for ( const auto& fileComponents : componentsForAllFilePaths )
|
||||||
|
{
|
||||||
|
QString lastComponent = "";
|
||||||
|
for ( auto it = fileComponents.rbegin(); it != fileComponents.rend(); ++it )
|
||||||
|
{
|
||||||
|
if ( realizationRe.match( *it ).hasMatch() )
|
||||||
|
{
|
||||||
|
iterations.push_back( lastComponent );
|
||||||
|
}
|
||||||
|
lastComponent = *it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
iterations.removeDuplicates();
|
||||||
|
|
||||||
|
if ( iterations.size() == 1u )
|
||||||
|
{
|
||||||
|
return iterations.front();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !iterations.empty() )
|
||||||
|
{
|
||||||
|
return QString( "Multiple iterations: %1" ).arg( iterations.join( ", " ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
QString root = RiaFilePathTools::commonRootOfFileNames( fileNames );
|
||||||
|
|
||||||
|
QRegularExpression trimRe( "[^a-zA-Z0-9]+$" );
|
||||||
|
QString trimmedRoot = root.replace( trimRe, "" );
|
||||||
|
if ( trimmedRoot.length() >= 4 )
|
||||||
|
{
|
||||||
|
return trimmedRoot;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Ensemble";
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RiaEnsembleNameTools::findCommonBaseName( const QStringList& fileNames )
|
||||||
|
{
|
||||||
|
QStringList baseNames;
|
||||||
|
for ( const auto& f : fileNames )
|
||||||
|
{
|
||||||
|
QFileInfo fi( f );
|
||||||
|
baseNames.push_back( fi.baseName() );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( baseNames.isEmpty() ) return "Empty";
|
||||||
|
|
||||||
|
auto firstName = baseNames.front();
|
||||||
|
for ( int i = 0; i < firstName.size(); i++ )
|
||||||
|
{
|
||||||
|
auto candidate = firstName.left( firstName.size() - i );
|
||||||
|
bool identicalNames = true;
|
||||||
|
|
||||||
|
for ( const auto& baseName : baseNames )
|
||||||
|
{
|
||||||
|
auto str = baseName.left( firstName.size() - i );
|
||||||
|
if ( candidate != str ) identicalNames = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( identicalNames )
|
||||||
|
{
|
||||||
|
return candidate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Mixed Items";
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RiaEnsembleNameTools::uniqueShortName( const QString& sourceFileName,
|
||||||
|
const QStringList& allFileNames,
|
||||||
|
const QString& ensembleCaseName )
|
||||||
|
{
|
||||||
|
QRegularExpression trimRe( "^[^a-zA-Z0-9]+" );
|
||||||
|
|
||||||
|
std::map<QString, QStringList> keyFileComponentsForAllFiles =
|
||||||
|
RiaFilePathTools::keyPathComponentsForEachFilePath( allFileNames );
|
||||||
|
|
||||||
|
QStringList keyFileComponents = keyFileComponentsForAllFiles[sourceFileName];
|
||||||
|
if ( keyFileComponents.empty() ) return "Unnamed";
|
||||||
|
|
||||||
|
if ( !ensembleCaseName.isEmpty() )
|
||||||
|
{
|
||||||
|
for ( auto& component : keyFileComponents )
|
||||||
|
{
|
||||||
|
component = component.replace( ensembleCaseName, "" );
|
||||||
|
component = component.replace( trimRe, "" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList shortNameComponents;
|
||||||
|
QRegularExpression numberRe( "[0-9]+" );
|
||||||
|
for ( auto keyComponent : keyFileComponents )
|
||||||
|
{
|
||||||
|
QStringList subComponents;
|
||||||
|
QString numberGroup = numberRe.match( keyComponent ).captured();
|
||||||
|
if ( !numberGroup.isEmpty() )
|
||||||
|
{
|
||||||
|
keyComponent = keyComponent.replace( numberGroup, "" );
|
||||||
|
QString stem = keyComponent.left( RimCaseDisplayNameTools::CASE_SHORT_NAME_LENGTH );
|
||||||
|
if ( !stem.isEmpty() ) subComponents.push_back( stem );
|
||||||
|
subComponents.push_back( numberGroup );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
subComponents.push_back( keyComponent.left( RimCaseDisplayNameTools::CASE_SHORT_NAME_LENGTH ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
shortNameComponents.push_back( subComponents.join( "-" ) );
|
||||||
|
}
|
||||||
|
return shortNameComponents.join( "," );
|
||||||
|
}
|
35
ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.h
Normal file
35
ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.h
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2021 Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
//
|
||||||
|
//==================================================================================================
|
||||||
|
class RiaEnsembleNameTools
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static QString findSuitableEnsembleName( const QStringList& fileNames );
|
||||||
|
static QString findCommonBaseName( const QStringList& fileNames );
|
||||||
|
|
||||||
|
static QString uniqueShortName( const QString& sourceFileName,
|
||||||
|
const QStringList& allFileNames,
|
||||||
|
const QString& ensembleCaseName = QString() );
|
||||||
|
};
|
@ -215,59 +215,6 @@ void RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
QString RiaSummaryTools::findSuitableEnsembleName( const QStringList& summaryCaseFileNames )
|
|
||||||
{
|
|
||||||
std::vector<QStringList> componentsForAllFilePaths;
|
|
||||||
|
|
||||||
for ( auto filePath : summaryCaseFileNames )
|
|
||||||
{
|
|
||||||
QStringList components = RiaFilePathTools::splitPathIntoComponents( filePath );
|
|
||||||
componentsForAllFilePaths.push_back( components );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find list of all folders inside a folder matching realization-*
|
|
||||||
QRegularExpression realizationRe( "realization\\-\\d+" );
|
|
||||||
|
|
||||||
QStringList iterations;
|
|
||||||
for ( const auto& fileComponents : componentsForAllFilePaths )
|
|
||||||
{
|
|
||||||
QString lastComponent = "";
|
|
||||||
for ( auto it = fileComponents.rbegin(); it != fileComponents.rend(); ++it )
|
|
||||||
{
|
|
||||||
if ( realizationRe.match( *it ).hasMatch() )
|
|
||||||
{
|
|
||||||
iterations.push_back( lastComponent );
|
|
||||||
}
|
|
||||||
lastComponent = *it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
iterations.removeDuplicates();
|
|
||||||
|
|
||||||
if ( iterations.size() == 1u )
|
|
||||||
{
|
|
||||||
return iterations.front();
|
|
||||||
}
|
|
||||||
else if ( !iterations.empty() )
|
|
||||||
{
|
|
||||||
return QString( "Multiple iterations: %1" ).arg( iterations.join( ", " ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
QString root = RiaFilePathTools::commonRootOfFileNames( summaryCaseFileNames );
|
|
||||||
|
|
||||||
QRegularExpression trimRe( "[^a-zA-Z0-9]+$" );
|
|
||||||
QString trimmedRoot = root.replace( trimRe, "" );
|
|
||||||
if ( trimmedRoot.length() >= 4 )
|
|
||||||
{
|
|
||||||
return trimmedRoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
return "Ensemble";
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -64,8 +64,6 @@ public:
|
|||||||
std::vector<RimSummaryCase*>& cases,
|
std::vector<RimSummaryCase*>& cases,
|
||||||
std::vector<RifEclipseSummaryAddress>& addresses );
|
std::vector<RifEclipseSummaryAddress>& addresses );
|
||||||
|
|
||||||
static QString findSuitableEnsembleName( const QStringList& summaryCaseFileNames );
|
|
||||||
|
|
||||||
static std::pair<std::vector<time_t>, std::vector<double>>
|
static std::pair<std::vector<time_t>, std::vector<double>>
|
||||||
resampledValuesForPeriod( const RifEclipseSummaryAddress& address,
|
resampledValuesForPeriod( const RifEclipseSummaryAddress& address,
|
||||||
const std::vector<time_t>& timeSteps,
|
const std::vector<time_t>& timeSteps,
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "RicImportEnsembleFeature.h"
|
#include "RicImportEnsembleFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaEnsembleNameTools.h"
|
||||||
#include "RiaFilePathTools.h"
|
#include "RiaFilePathTools.h"
|
||||||
#include "RiaPreferences.h"
|
#include "RiaPreferences.h"
|
||||||
#include "RiaSummaryTools.h"
|
#include "RiaSummaryTools.h"
|
||||||
@ -76,7 +77,7 @@ void RicImportEnsembleFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
if ( fileNames.isEmpty() ) return;
|
if ( fileNames.isEmpty() ) return;
|
||||||
|
|
||||||
QString ensembleNameSuggestion = RiaSummaryTools::findSuitableEnsembleName( fileNames );
|
QString ensembleNameSuggestion = RiaEnsembleNameTools::findSuitableEnsembleName( fileNames );
|
||||||
|
|
||||||
QString ensembleName = askForEnsembleName( ensembleNameSuggestion );
|
QString ensembleName = askForEnsembleName( ensembleNameSuggestion );
|
||||||
if ( ensembleName.isEmpty() ) return;
|
if ( ensembleName.isEmpty() ) return;
|
||||||
|
@ -19,7 +19,11 @@
|
|||||||
#include "RicImportEnsembleSurfaceFeature.h"
|
#include "RicImportEnsembleSurfaceFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaEnsembleNameTools.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
#include "RiaSummaryTools.h"
|
||||||
|
|
||||||
|
#include "RicRecursiveFileSearchDialog.h"
|
||||||
|
|
||||||
#include "RimEnsembleSurface.h"
|
#include "RimEnsembleSurface.h"
|
||||||
#include "RimFileSurface.h"
|
#include "RimFileSurface.h"
|
||||||
@ -27,7 +31,7 @@
|
|||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSurfaceCollection.h"
|
#include "RimSurfaceCollection.h"
|
||||||
|
|
||||||
#include "RicRecursiveFileSearchDialog.h"
|
#include "Riu3DMainWindowTools.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@ -61,15 +65,24 @@ void RicImportEnsembleSurfaceFeature::onActionTriggered( bool isChecked )
|
|||||||
QStringList fileNames = runRecursiveFileSearchDialog( "Import Ensemble Surface", pathCacheName );
|
QStringList fileNames = runRecursiveFileSearchDialog( "Import Ensemble Surface", pathCacheName );
|
||||||
if ( fileNames.isEmpty() ) return;
|
if ( fileNames.isEmpty() ) return;
|
||||||
|
|
||||||
QString ensembleName = "Ensemble Surface";
|
QString ensembleName = RiaEnsembleNameTools::findSuitableEnsembleName( fileNames );
|
||||||
if ( ensembleName.isEmpty() ) return;
|
QString layerName = RiaEnsembleNameTools::findCommonBaseName( fileNames );
|
||||||
|
if ( !layerName.isEmpty() )
|
||||||
|
{
|
||||||
|
ensembleName += QString( " : %1" ).arg( layerName );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ensembleName.isEmpty() ) ensembleName = "Ensemble Surface";
|
||||||
|
|
||||||
std::vector<RimFileSurface*> surfaces;
|
std::vector<RimFileSurface*> surfaces;
|
||||||
for ( QString fileName : fileNames )
|
for ( const auto& fileName : fileNames )
|
||||||
{
|
{
|
||||||
RimFileSurface* fileSurface = new RimFileSurface;
|
RimFileSurface* fileSurface = new RimFileSurface;
|
||||||
fileSurface->setSurfaceFilePath( fileName );
|
fileSurface->setSurfaceFilePath( fileName );
|
||||||
|
|
||||||
|
auto shortName = RiaEnsembleNameTools::uniqueShortName( fileName, fileNames );
|
||||||
|
fileSurface->setUserDescription( shortName );
|
||||||
|
|
||||||
if ( fileSurface->onLoadData() )
|
if ( fileSurface->onLoadData() )
|
||||||
{
|
{
|
||||||
surfaces.push_back( fileSurface );
|
surfaces.push_back( fileSurface );
|
||||||
@ -84,7 +97,11 @@ void RicImportEnsembleSurfaceFeature::onActionTriggered( bool isChecked )
|
|||||||
ensemble->addFileSurface( surface );
|
ensemble->addFileSurface( surface );
|
||||||
|
|
||||||
RimProject::current()->activeOilField()->surfaceCollection->addEnsembleSurface( ensemble );
|
RimProject::current()->activeOilField()->surfaceCollection->addEnsembleSurface( ensemble );
|
||||||
|
|
||||||
|
ensemble->loadDataAndUpdate();
|
||||||
|
|
||||||
RimProject::current()->activeOilField()->surfaceCollection->updateConnectedEditors();
|
RimProject::current()->activeOilField()->surfaceCollection->updateConnectedEditors();
|
||||||
|
Riu3DMainWindowTools::selectAsCurrentItem( ensemble );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -597,7 +597,6 @@ void RimEclipseView::onCreateDisplayModel()
|
|||||||
m_surfaceVizModel->removeAllParts();
|
m_surfaceVizModel->removeAllParts();
|
||||||
if ( m_surfaceCollection )
|
if ( m_surfaceCollection )
|
||||||
{
|
{
|
||||||
m_surfaceCollection->clearGeometry();
|
|
||||||
m_surfaceCollection->appendPartsToModel( m_surfaceVizModel.p(), m_reservoirGridPartManager->scaleTransform() );
|
m_surfaceCollection->appendPartsToModel( m_surfaceVizModel.p(), m_reservoirGridPartManager->scaleTransform() );
|
||||||
nativeOrOverrideViewer()->addStaticModelOnce( m_surfaceVizModel.p(), isUsingOverrideViewer() );
|
nativeOrOverrideViewer()->addStaticModelOnce( m_surfaceVizModel.p(), isUsingOverrideViewer() );
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
|
#include "RiaEnsembleNameTools.h"
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
@ -296,42 +297,7 @@ QString RimSummaryCase::uniqueShortNameForEnsembleCase( RimSummaryCase* summaryC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<QString, QStringList> keyFileComponentsForAllFiles =
|
return RiaEnsembleNameTools::uniqueShortName( summaryCase->summaryHeaderFilename(), summaryFilePaths, ensembleCaseName );
|
||||||
RiaFilePathTools::keyPathComponentsForEachFilePath( summaryFilePaths );
|
|
||||||
|
|
||||||
QStringList keyFileComponents = keyFileComponentsForAllFiles[summaryCase->summaryHeaderFilename()];
|
|
||||||
if ( keyFileComponents.empty() ) return ensembleCaseName;
|
|
||||||
|
|
||||||
if ( !ensembleCaseName.isEmpty() )
|
|
||||||
{
|
|
||||||
for ( auto& component : keyFileComponents )
|
|
||||||
{
|
|
||||||
component = component.replace( ensembleCaseName, "" );
|
|
||||||
component = component.replace( trimRe, "" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList shortNameComponents;
|
|
||||||
QRegularExpression numberRe( "[0-9]+" );
|
|
||||||
for ( auto keyComponent : keyFileComponents )
|
|
||||||
{
|
|
||||||
QStringList subComponents;
|
|
||||||
QString numberGroup = numberRe.match( keyComponent ).captured();
|
|
||||||
if ( !numberGroup.isEmpty() )
|
|
||||||
{
|
|
||||||
keyComponent = keyComponent.replace( numberGroup, "" );
|
|
||||||
QString stem = keyComponent.left( RimCaseDisplayNameTools::CASE_SHORT_NAME_LENGTH );
|
|
||||||
if ( !stem.isEmpty() ) subComponents.push_back( stem );
|
|
||||||
subComponents.push_back( numberGroup );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
subComponents.push_back( keyComponent.left( RimCaseDisplayNameTools::CASE_SHORT_NAME_LENGTH ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
shortNameComponents.push_back( subComponents.join( "-" ) );
|
|
||||||
}
|
|
||||||
return shortNameComponents.join( "," );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -56,6 +56,8 @@ RimEnsembleStatisticsSurface::~RimEnsembleStatisticsSurface()
|
|||||||
void RimEnsembleStatisticsSurface::setStatisticsType( RigSurfaceStatisticsCalculator::StatisticsType statisticsType )
|
void RimEnsembleStatisticsSurface::setStatisticsType( RigSurfaceStatisticsCalculator::StatisticsType statisticsType )
|
||||||
{
|
{
|
||||||
m_statisticsType = statisticsType;
|
m_statisticsType = statisticsType;
|
||||||
|
|
||||||
|
setUserDescription( fullName() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -73,7 +73,7 @@ caf::PdmFieldHandle* RimEnsembleSurfaceInView::userDescriptionField()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RimEnsembleSurfaceInView::name() const
|
QString RimEnsembleSurfaceInView::name() const
|
||||||
{
|
{
|
||||||
if ( m_ensembleSurface ) return m_ensembleSurface->uiName();
|
if ( m_ensembleSurface ) return m_ensembleSurface->name();
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user