mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6721 Ensemble Parameters : Improve performance for list in Property Editor
Introduce hasEnsembleParameters() for efficient check if any case has ensemble parameters. Use first timestep definition from a summary case, as the time steps usually not differ between different summary vectors.
This commit is contained in:
parent
3a2704e212
commit
ef15a98e3a
@ -759,7 +759,9 @@ QList<caf::PdmOptionItemInfo> RimEnsembleCurveSet::calculateValueOptions( const
|
||||
auto byEnsParamOption = ColorModeEnum( ColorMode::BY_ENSEMBLE_PARAM );
|
||||
|
||||
options.push_back( caf::PdmOptionItemInfo( singleColorOption.uiText(), ColorMode::SINGLE_COLOR ) );
|
||||
if ( !correlationSortedEnsembleParameters().empty() )
|
||||
|
||||
RimSummaryCaseCollection* group = m_yValuesSummaryCaseCollection();
|
||||
if ( group && group->hasEnsembleParameters() )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( byEnsParamOption.uiText(), ColorMode::BY_ENSEMBLE_PARAM ) );
|
||||
}
|
||||
|
@ -385,11 +385,17 @@ std::set<time_t> RimSummaryCaseCollection::ensembleTimeSteps() const
|
||||
|
||||
if ( maxAddrIndex >= 0 && m_cases[maxAddrIndex]->summaryReader() )
|
||||
{
|
||||
const std::set<RifEclipseSummaryAddress>& addrs = m_cases[maxAddrIndex]->summaryReader()->allResultAddresses();
|
||||
RifSummaryReaderInterface* reader = m_cases[maxAddrIndex]->summaryReader();
|
||||
|
||||
const std::set<RifEclipseSummaryAddress>& addrs = reader->allResultAddresses();
|
||||
for ( RifEclipseSummaryAddress addr : addrs )
|
||||
{
|
||||
std::vector<time_t> timeSteps = m_cases[maxAddrIndex]->summaryReader()->timeSteps( addr );
|
||||
allTimeSteps.insert( timeSteps.begin(), timeSteps.end() );
|
||||
std::vector<time_t> timeSteps = reader->timeSteps( addr );
|
||||
if ( !timeSteps.empty() )
|
||||
{
|
||||
allTimeSteps.insert( timeSteps.begin(), timeSteps.end() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return allTimeSteps;
|
||||
@ -1066,3 +1072,19 @@ int RimSummaryCaseCollection::ensembleId() const
|
||||
{
|
||||
return m_ensembleId();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryCaseCollection::hasEnsembleParameters() const
|
||||
{
|
||||
for ( RimSummaryCase* rimCase : this->allSummaryCases() )
|
||||
{
|
||||
if ( rimCase->caseRealizationParameters() != nullptr )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -113,6 +113,7 @@ public:
|
||||
RifReaderRftInterface* rftStatisticsReader();
|
||||
void setEnsembleId( int ensembleId );
|
||||
int ensembleId() const;
|
||||
bool hasEnsembleParameters() const;
|
||||
|
||||
const std::vector<EnsembleParameter>& variationSortedEnsembleParameters( bool excludeNoVariation = false ) const;
|
||||
std::vector<std::pair<EnsembleParameter, double>>
|
||||
|
Loading…
Reference in New Issue
Block a user