mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-30 17:10:19 -05:00
#8370: Include Python-defined vectors in ensemble data sources and selection
This commit is contained in:
1 parent
038dabc77b
commit
0d64a52115
3 files changed
+38
-9
No files matched your search
@@ -64,9 +64,14 @@ RimSummaryEnsemble::RimSummaryEnsemble()
|
||||
: caseNameChanged( this )
|
||||
, caseRemoved( this )
|
||||
{
|
||||
CAF_PDM_InitScriptableObject( "Summary Case Group", ":/SummaryGroup16x16.png" );
|
||||
CAF_PDM_InitScriptableObjectWithNameAndComment( "Summary Case Group",
|
||||
":/SummaryGroup16x16.png",
|
||||
"",
|
||||
"",
|
||||
"SummaryEnsemble",
|
||||
"A group of summary cases, typically an ensemble" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_cases, "SummaryCases", "" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_cases, "SummaryCases", "" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_name, "SummaryCollectionName", QString( "Group" ), "Name" );
|
||||
CAF_PDM_InitScriptableField( &m_autoName, "CreateAutoName", true, "Auto Name" );
|
||||
@@ -263,6 +268,14 @@ void RimSummaryEnsemble::setNameTemplate( const QString& name )
|
||||
m_nameTemplateString = name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryEnsemble::setAutoName( bool autoName )
|
||||
{
|
||||
m_autoName = autoName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1281,6 +1294,15 @@ void RimSummaryEnsemble::buildMetaData()
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryEnsemble::onSummaryVectorsChanged()
|
||||
{
|
||||
m_analyzer.reset();
|
||||
buildMetaData();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -69,6 +69,7 @@ public:
|
||||
QString name() const;
|
||||
|
||||
void setNameTemplate( const QString& name );
|
||||
void setAutoName( bool autoName );
|
||||
virtual void updateName( const std::set<QString>& existingEnsembleNames );
|
||||
void setUsePathKey1( bool useKey1 );
|
||||
void setUsePathKey2( bool useKey2 );
|
||||
@@ -119,6 +120,7 @@ public:
|
||||
RiaDefines::EclipseUnitSystem unitSystem() const;
|
||||
|
||||
void onCalculationUpdated();
|
||||
void onSummaryVectorsChanged();
|
||||
|
||||
void updateReferringCurveSets();
|
||||
void updateReferringCurveSetsZoomAll();
|
||||
|
||||
@@ -503,8 +503,9 @@ void RimSummaryEnsembleTools::resetHighlightAllPlots()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCase* RimSummaryEnsembleTools::caseWithMostDataObjects( const std::vector<RimSummaryCase*>& sourceCases )
|
||||
{
|
||||
size_t maxAddrCount = 0;
|
||||
size_t maxAddrIndex = sourceCases.size();
|
||||
size_t maxAddrCount = 0;
|
||||
size_t maxAddrIndex = sourceCases.size();
|
||||
bool maxHasBuiltAddresses = false;
|
||||
|
||||
for ( size_t i = 0; i < sourceCases.size(); i++ )
|
||||
{
|
||||
@@ -515,12 +516,16 @@ RimSummaryCase* RimSummaryEnsembleTools::caseWithMostDataObjects( const std::vec
|
||||
if ( !reader ) continue;
|
||||
|
||||
// If no RifSummaryAddress is created, the number of keywords on file is returned. This can be the case for a realization in an
|
||||
// ensemble.
|
||||
auto addrCount = reader->dataObjectCount();
|
||||
if ( addrCount > maxAddrCount )
|
||||
// ensemble. The keyword count is not comparable with the address count (e.g. user-defined vectors are not part of the keyword
|
||||
// count), so cases with created addresses are always preferred over cases with only a keyword count.
|
||||
const bool hasBuiltAddresses = !reader->allResultAddresses().empty();
|
||||
const auto addrCount = reader->dataObjectCount();
|
||||
|
||||
if ( ( hasBuiltAddresses && !maxHasBuiltAddresses ) || ( hasBuiltAddresses == maxHasBuiltAddresses && addrCount > maxAddrCount ) )
|
||||
{
|
||||
maxAddrCount = addrCount;
|
||||
maxAddrIndex = i;
|
||||
maxAddrCount = addrCount;
|
||||
maxAddrIndex = i;
|
||||
maxHasBuiltAddresses = hasBuiltAddresses;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user