mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6367 Improve the way we automatically name ensembles and cases
This commit is contained in:
@@ -274,7 +274,8 @@ void RimCorrelationPlot::addDataToChartBuilder( RiuGroupedBarChartBuilder& chart
|
||||
{
|
||||
double value = m_showAbsoluteValues() ? std::abs( parameterCorrPair.second ) : parameterCorrPair.second;
|
||||
double sortValue = m_sortByAbsoluteValues() ? std::abs( value ) : value;
|
||||
QString barText = QString( "%1 (%2)" ).arg( parameterCorrPair.first.name ).arg( parameterCorrPair.second );
|
||||
QString barText =
|
||||
QString( "%1 (%2)" ).arg( parameterCorrPair.first.name ).arg( parameterCorrPair.second, 5, 'f', 2 );
|
||||
QString majorText = "", medText = "", minText = "", legendText = barText;
|
||||
chartBuilder.addBarEntry( majorText, medText, minText, sortValue, legendText, barText, value );
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ RimCalculatedSummaryCase::RimCalculatedSummaryCase()
|
||||
CAF_PDM_InitObject( "Calculated", ":/SummaryCase48x48.png", "", "" );
|
||||
|
||||
m_calculatedCurveReader = nullptr;
|
||||
m_shortName = "Calculated";
|
||||
m_displayName = "Calculated";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -272,7 +272,7 @@ std::pair<std::vector<time_t>, std::vector<double>>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimDerivedSummaryCase::caseName() const
|
||||
{
|
||||
return m_shortName;
|
||||
return m_displayName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -413,7 +413,7 @@ void RimDerivedSummaryCase::updateDisplayNameFromCases()
|
||||
|
||||
QString name = operatorText + QString( "(%1 , %2)" ).arg( case1Name, case2Name );
|
||||
|
||||
m_shortName = name;
|
||||
m_displayName = name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -422,7 +422,7 @@ void RimDerivedSummaryCase::updateDisplayNameFromCases()
|
||||
void RimDerivedSummaryCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
// Base class
|
||||
uiOrdering.add( &m_shortName );
|
||||
uiOrdering.add( &m_displayName );
|
||||
|
||||
uiOrdering.add( &m_summaryCase1 );
|
||||
uiOrdering.add( &m_operator );
|
||||
|
||||
@@ -18,18 +18,15 @@
|
||||
|
||||
#include "RimSummaryCase.h"
|
||||
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
|
||||
#include "RicfCommandObject.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimObservedDataCollection.h"
|
||||
#include "RimObservedSummaryData.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
@@ -37,20 +34,36 @@
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QRegularExpression>
|
||||
|
||||
CAF_PDM_ABSTRACT_SOURCE_INIT( RimSummaryCase, "SummaryCase" );
|
||||
|
||||
const QString RimSummaryCase::DEFAULT_DISPLAY_NAME = "Display Name";
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void AppEnum<RimSummaryCase::DisplayName>::setUp()
|
||||
{
|
||||
addItem( RimSummaryCase::DisplayName::FULL_CASE_NAME, "FULL_CASE_NAME", "Full Case Name" );
|
||||
addItem( RimSummaryCase::DisplayName::SHORT_CASE_NAME, "SHORT_CASE_NAME", "Shortened Case Name" );
|
||||
addItem( RimSummaryCase::DisplayName::CUSTOM, "CUSTOM_NAME", "Custom Name" );
|
||||
setDefault( RimSummaryCase::DisplayName::SHORT_CASE_NAME );
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCase::RimSummaryCase()
|
||||
: nameChanged( this )
|
||||
{
|
||||
CAF_PDM_InitScriptableObject( "Summary Case", ":/SummaryCase16x16.png", "", "The Base Class for all Summary Cases" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_shortName, "ShortName", QString( "Display Name" ), DEFAULT_DISPLAY_NAME, "", "", "" );
|
||||
CAF_PDM_InitScriptableField( &m_useAutoShortName, "AutoShortyName", false, "Use Auto Display Name", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_displayName, "ShortName", "Display Name", "", "", "" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_displayNameOption, "NameSetting", "Name Setting", "", "", "" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_useAutoShortName_OBSOLETE, "AutoShortyName", false, "Use Auto Display Name", "", "", "" );
|
||||
m_useAutoShortName_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
m_useAutoShortName_OBSOLETE.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_summaryHeaderFilename, "SummaryHeaderFilename", "Summary Header File", "", "", "" );
|
||||
m_summaryHeaderFilename.uiCapability()->setUiReadOnly( true );
|
||||
@@ -92,7 +105,7 @@ void RimSummaryCase::setSummaryHeaderFileName( const QString& fileName )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryCase::isObservedData()
|
||||
bool RimSummaryCase::isObservedData() const
|
||||
{
|
||||
return m_isObservedData;
|
||||
}
|
||||
@@ -136,10 +149,10 @@ RimSummaryCaseCollection* RimSummaryCase::ensemble() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCase::copyFrom( const RimSummaryCase& rhs )
|
||||
{
|
||||
m_shortName = rhs.m_shortName;
|
||||
m_useAutoShortName = rhs.m_useAutoShortName;
|
||||
m_summaryHeaderFilename = rhs.m_summaryHeaderFilename;
|
||||
m_isObservedData = rhs.m_isObservedData;
|
||||
m_displayName = rhs.m_displayName;
|
||||
m_useAutoShortName_OBSOLETE = rhs.m_useAutoShortName_OBSOLETE;
|
||||
m_summaryHeaderFilename = rhs.m_summaryHeaderFilename;
|
||||
m_isObservedData = rhs.m_isObservedData;
|
||||
|
||||
this->updateTreeItemName();
|
||||
this->updateOptionSensitivity();
|
||||
@@ -160,18 +173,17 @@ void RimSummaryCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
if ( changedField == &m_useAutoShortName )
|
||||
if ( changedField == &m_displayNameOption )
|
||||
{
|
||||
this->updateAutoShortName();
|
||||
updateAutoShortName();
|
||||
nameChanged.send();
|
||||
}
|
||||
else if ( changedField == &m_shortName )
|
||||
else if ( changedField == &m_displayName )
|
||||
{
|
||||
updateTreeItemName();
|
||||
nameChanged.send();
|
||||
}
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotColl = RiaSummaryTools::summaryPlotCollection();
|
||||
summaryPlotColl->updateSummaryNameHasChanged();
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
@@ -180,7 +192,7 @@ void RimSummaryCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCase::updateOptionSensitivity()
|
||||
{
|
||||
m_shortName.uiCapability()->setUiReadOnly( m_useAutoShortName );
|
||||
m_displayName.uiCapability()->setUiReadOnly( m_displayNameOption != DisplayName::CUSTOM );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -212,10 +224,7 @@ void RimSummaryCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCase::updateTreeItemName()
|
||||
{
|
||||
if ( caseName() != displayCaseName() )
|
||||
this->setUiName( caseName() + " (" + displayCaseName() + ")" );
|
||||
else
|
||||
this->setUiName( caseName() );
|
||||
this->setUiName( displayCaseName() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -223,7 +232,7 @@ void RimSummaryCase::updateTreeItemName()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryCase::displayCaseName() const
|
||||
{
|
||||
return m_shortName();
|
||||
return m_displayName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -257,6 +266,11 @@ void RimSummaryCase::initAfterRead()
|
||||
RimProject::current()->assignCaseIdToSummaryCase( this );
|
||||
}
|
||||
|
||||
if ( m_useAutoShortName_OBSOLETE )
|
||||
{
|
||||
m_displayNameOption = DisplayName::SHORT_CASE_NAME;
|
||||
}
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
@@ -265,70 +279,69 @@ void RimSummaryCase::initAfterRead()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryCase::uniqueShortNameForCase( RimSummaryCase* summaryCase )
|
||||
{
|
||||
RimOilField* oilField = nullptr;
|
||||
summaryCase->firstAncestorOrThisOfType( oilField );
|
||||
CVF_ASSERT( oilField );
|
||||
QString ensembleName;
|
||||
std::vector<RimSummaryCase*> summaryCases;
|
||||
|
||||
std::set<QString> allAutoShortNames;
|
||||
|
||||
std::vector<RimSummaryCase*> allCases = oilField->summaryCaseMainCollection->allSummaryCases();
|
||||
std::vector<RimObservedSummaryData*> observedDataCases = oilField->observedDataCollection->allObservedSummaryData();
|
||||
|
||||
for ( auto observedData : observedDataCases )
|
||||
auto ensemble = summaryCase->ensemble();
|
||||
if ( ensemble )
|
||||
{
|
||||
allCases.push_back( observedData );
|
||||
}
|
||||
|
||||
for ( RimSummaryCase* sumCase : allCases )
|
||||
{
|
||||
if ( sumCase && sumCase != summaryCase )
|
||||
{
|
||||
allAutoShortNames.insert( sumCase->displayCaseName() );
|
||||
}
|
||||
}
|
||||
|
||||
bool foundUnique = false;
|
||||
|
||||
QString caseName = summaryCase->caseName();
|
||||
QString shortName;
|
||||
|
||||
if ( caseName.size() > 2 )
|
||||
{
|
||||
QString candidate;
|
||||
candidate += caseName[0];
|
||||
|
||||
for ( int i = 1; i < caseName.size(); ++i )
|
||||
{
|
||||
if ( allAutoShortNames.count( candidate + caseName[i] ) == 0 )
|
||||
{
|
||||
shortName = candidate + caseName[i];
|
||||
foundUnique = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
summaryCases = ensemble->allSummaryCases();
|
||||
}
|
||||
else
|
||||
{
|
||||
shortName = caseName.left( 2 );
|
||||
if ( allAutoShortNames.count( shortName ) == 0 )
|
||||
{
|
||||
foundUnique = true;
|
||||
}
|
||||
RimProject::current()->descendantsIncludingThisOfType( summaryCases );
|
||||
}
|
||||
|
||||
int autoNumber = 0;
|
||||
QRegularExpression trimRe( "^[^a-zA-Z0-9]+" );
|
||||
|
||||
while ( !foundUnique )
|
||||
QStringList summaryFilePaths;
|
||||
summaryFilePaths.push_back( summaryCase->summaryHeaderFilename() );
|
||||
|
||||
for ( auto otherSummaryCase : summaryCases )
|
||||
{
|
||||
QString candidate = shortName + QString::number( autoNumber++ );
|
||||
if ( allAutoShortNames.count( candidate ) == 0 )
|
||||
if ( otherSummaryCase != summaryCase )
|
||||
{
|
||||
shortName = candidate;
|
||||
foundUnique = true;
|
||||
summaryFilePaths.push_back( otherSummaryCase->summaryHeaderFilename() );
|
||||
}
|
||||
}
|
||||
|
||||
return shortName;
|
||||
std::map<QString, QStringList> keyFileComponentsForAllFiles =
|
||||
RiaFilePathTools::keyPathComponentsForEachFilePath( summaryFilePaths );
|
||||
|
||||
QStringList keyFileComponents = keyFileComponentsForAllFiles[summaryCase->summaryHeaderFilename()];
|
||||
CAF_ASSERT( !keyFileComponents.empty() );
|
||||
|
||||
if ( !ensembleName.isEmpty() )
|
||||
{
|
||||
for ( auto& component : keyFileComponents )
|
||||
{
|
||||
component = component.replace( ensembleName, "" );
|
||||
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( 2 );
|
||||
if ( !stem.isEmpty() ) subComponents.push_back( stem );
|
||||
subComponents.push_back( numberGroup );
|
||||
}
|
||||
else
|
||||
{
|
||||
subComponents.push_back( keyComponent.left( 4 ) );
|
||||
}
|
||||
|
||||
shortNameComponents.push_back( subComponents.join( "-" ) );
|
||||
}
|
||||
return shortNameComponents.join( "," );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -336,27 +349,18 @@ QString RimSummaryCase::uniqueShortNameForCase( RimSummaryCase* summaryCase )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCase::updateAutoShortName()
|
||||
{
|
||||
if ( m_useAutoShortName )
|
||||
if ( m_displayNameOption == DisplayName::FULL_CASE_NAME )
|
||||
{
|
||||
m_shortName = RimSummaryCase::uniqueShortNameForCase( this );
|
||||
m_displayName = caseName();
|
||||
}
|
||||
else if ( m_shortName() == DEFAULT_DISPLAY_NAME )
|
||||
else if ( m_displayNameOption == DisplayName::SHORT_CASE_NAME )
|
||||
{
|
||||
m_shortName = caseName();
|
||||
m_displayName = RimSummaryCase::uniqueShortNameForCase( this );
|
||||
}
|
||||
|
||||
updateTreeItemName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCase::resetAutoShortName()
|
||||
{
|
||||
m_shortName = DEFAULT_DISPLAY_NAME;
|
||||
updateAutoShortName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -40,6 +40,17 @@ class RimSummaryCase : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
caf::Signal<> nameChanged;
|
||||
|
||||
enum class DisplayName
|
||||
{
|
||||
FULL_CASE_NAME,
|
||||
SHORT_CASE_NAME,
|
||||
CUSTOM
|
||||
};
|
||||
using DisplayNameEnum = caf::AppEnum<DisplayName>;
|
||||
|
||||
public:
|
||||
RimSummaryCase();
|
||||
~RimSummaryCase() override;
|
||||
@@ -53,7 +64,6 @@ public:
|
||||
RiaEclipseUnitTools::UnitSystemType unitsSystem();
|
||||
|
||||
void updateAutoShortName();
|
||||
void resetAutoShortName();
|
||||
void updateOptionSensitivity();
|
||||
|
||||
virtual void createSummaryReaderInterface() = 0;
|
||||
@@ -66,7 +76,7 @@ public:
|
||||
|
||||
void setSummaryHeaderFileName( const QString& fileName );
|
||||
|
||||
bool isObservedData();
|
||||
bool isObservedData() const;
|
||||
|
||||
void setCaseRealizationParameters( const std::shared_ptr<RigCaseRealizationParameters>& crlParameters );
|
||||
std::shared_ptr<RigCaseRealizationParameters> caseRealizationParameters() const;
|
||||
@@ -88,13 +98,16 @@ private:
|
||||
static QString uniqueShortNameForCase( RimSummaryCase* summaryCase );
|
||||
|
||||
protected:
|
||||
caf::PdmField<QString> m_shortName;
|
||||
caf::PdmField<bool> m_useAutoShortName;
|
||||
caf::PdmField<caf::FilePath> m_summaryHeaderFilename;
|
||||
bool m_isObservedData;
|
||||
caf::PdmField<int> m_caseId;
|
||||
caf::PdmField<QString> m_displayName;
|
||||
caf::PdmField<DisplayNameEnum> m_displayNameOption;
|
||||
caf::PdmField<caf::FilePath> m_summaryHeaderFilename;
|
||||
|
||||
bool m_isObservedData;
|
||||
caf::PdmField<int> m_caseId;
|
||||
|
||||
std::shared_ptr<RigCaseRealizationParameters> m_crlParameters;
|
||||
|
||||
caf::PdmField<bool> m_useAutoShortName_OBSOLETE;
|
||||
|
||||
static const QString DEFAULT_DISPLAY_NAME;
|
||||
};
|
||||
|
||||
@@ -187,6 +187,7 @@ QString EnsembleParameter::uiName() const
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCaseCollection::RimSummaryCaseCollection()
|
||||
: caseNameChanged( this )
|
||||
{
|
||||
CAF_PDM_InitScriptableObject( "Summary Case Group", ":/SummaryGroup16x16.png", "", "" );
|
||||
|
||||
@@ -227,6 +228,8 @@ RimSummaryCaseCollection::~RimSummaryCaseCollection()
|
||||
void RimSummaryCaseCollection::removeCase( RimSummaryCase* summaryCase )
|
||||
{
|
||||
size_t caseCountBeforeRemove = m_cases.size();
|
||||
|
||||
summaryCase->nameChanged.disconnect( this );
|
||||
m_cases.removeChildObject( summaryCase );
|
||||
|
||||
m_cachedSortedEnsembleParameters.clear();
|
||||
@@ -245,6 +248,8 @@ void RimSummaryCaseCollection::removeCase( RimSummaryCase* summaryCase )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::addCase( RimSummaryCase* summaryCase, bool updateCurveSets )
|
||||
{
|
||||
summaryCase->nameChanged.connect( this, &RimSummaryCaseCollection::onCaseNameChanged );
|
||||
|
||||
m_cases.push_back( summaryCase );
|
||||
m_cachedSortedEnsembleParameters.clear();
|
||||
|
||||
@@ -982,6 +987,14 @@ void RimSummaryCaseCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::onCaseNameChanged( const SignalEmitter* emitter )
|
||||
{
|
||||
caseNameChanged.send();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -91,6 +91,9 @@ class RimSummaryCaseCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
caf::Signal<> caseNameChanged;
|
||||
|
||||
public:
|
||||
RimSummaryCaseCollection();
|
||||
~RimSummaryCaseCollection() override;
|
||||
@@ -146,6 +149,8 @@ private:
|
||||
void initAfterRead() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
void onCaseNameChanged( const SignalEmitter* emitter );
|
||||
|
||||
protected:
|
||||
virtual void onLoadDataAndUpdate();
|
||||
void updateReferringCurveSets();
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RifCaseRealizationParametersReader.h"
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
#include "RifSummaryCaseRestartSelector.h"
|
||||
@@ -30,6 +33,7 @@
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
#include <QDir>
|
||||
@@ -213,6 +217,7 @@ void RimSummaryCaseMainCollection::addCases( const std::vector<RimSummaryCase*>
|
||||
void RimSummaryCaseMainCollection::addCase( RimSummaryCase* summaryCase )
|
||||
{
|
||||
m_cases.push_back( summaryCase );
|
||||
summaryCase->nameChanged.connect( this, &RimSummaryCaseMainCollection::onCaseNameChanged );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -235,7 +240,9 @@ void RimSummaryCaseMainCollection::removeCase( RimSummaryCase* summaryCase )
|
||||
}
|
||||
}
|
||||
|
||||
summaryCase->nameChanged.disconnect( this );
|
||||
m_cases.removeChildObject( summaryCase );
|
||||
|
||||
for ( RimSummaryCaseCollection* summaryCaseCollection : m_caseCollections )
|
||||
{
|
||||
summaryCaseCollection->removeCase( summaryCase );
|
||||
@@ -285,6 +292,7 @@ RimSummaryCaseCollection*
|
||||
|
||||
summaryCaseCollection->setAsEnsemble( isEnsemble );
|
||||
|
||||
summaryCaseCollection->caseNameChanged.connect( this, &RimSummaryCaseMainCollection::onCaseNameChanged );
|
||||
m_caseCollections.push_back( summaryCaseCollection );
|
||||
|
||||
return summaryCaseCollection;
|
||||
@@ -295,6 +303,7 @@ RimSummaryCaseCollection*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseMainCollection::removeCaseCollection( RimSummaryCaseCollection* caseCollection )
|
||||
{
|
||||
caseCollection->caseNameChanged.disconnect( this );
|
||||
m_caseCollections.removeChildObject( caseCollection );
|
||||
}
|
||||
|
||||
@@ -487,6 +496,15 @@ RimSummaryCaseCollection* RimSummaryCaseMainCollection::defaultAllocator()
|
||||
return new RimSummaryCaseCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseMainCollection::onCaseNameChanged( const SignalEmitter* emitter )
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotColl = RiaSummaryTools::summaryPlotCollection();
|
||||
summaryPlotColl->updateSummaryNameHasChanged();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -78,6 +78,8 @@ private:
|
||||
static void reassignSummaryCurves( const RimGridSummaryCase* fromGridCase, RimFileSummaryCase* toFileCase );
|
||||
static RimSummaryCaseCollection* defaultAllocator();
|
||||
|
||||
void onCaseNameChanged( const SignalEmitter* emitter );
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimSummaryCase*> m_cases;
|
||||
caf::PdmChildArrayField<RimSummaryCaseCollection*> m_caseCollections;
|
||||
|
||||
Reference in New Issue
Block a user