mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve summary case import performance (#8897)
* Improve summary case import performance
This commit is contained in:
parent
7d440a9c2f
commit
65827f9c1c
@ -104,10 +104,9 @@ RimSummaryMultiPlot* RicSummaryPlotTemplateTools::create( const QString& fileNam
|
|||||||
{
|
{
|
||||||
auto caseCollection = sumCaseCollections.front();
|
auto caseCollection = sumCaseCollections.front();
|
||||||
|
|
||||||
if ( !caseCollection->allSummaryCases().empty() )
|
auto firstCase = caseCollection->firstSummaryCase();
|
||||||
|
if ( firstCase != nullptr )
|
||||||
{
|
{
|
||||||
auto firstCase = caseCollection->allSummaryCases().front();
|
|
||||||
|
|
||||||
analyzer.appendAddresses( firstCase->summaryReader()->allResultAddresses() );
|
analyzer.appendAddresses( firstCase->summaryReader()->allResultAddresses() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -675,10 +675,13 @@ std::vector<RimSummaryCase*> RimProject::allSummaryCases() const
|
|||||||
if ( sumCaseMainColl )
|
if ( sumCaseMainColl )
|
||||||
{
|
{
|
||||||
std::vector<RimSummaryCase*> allSummaryCases = sumCaseMainColl->allSummaryCases();
|
std::vector<RimSummaryCase*> allSummaryCases = sumCaseMainColl->allSummaryCases();
|
||||||
sumCases.insert( sumCases.end(), allSummaryCases.begin(), allSummaryCases.end() );
|
if ( !allSummaryCases.empty() )
|
||||||
|
{
|
||||||
|
sumCases.insert( sumCases.end(), allSummaryCases.begin(), allSummaryCases.end() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto observedDataColl = oilField->observedDataCollection();
|
auto& observedDataColl = oilField->observedDataCollection();
|
||||||
if ( observedDataColl != nullptr && observedDataColl->allObservedSummaryData().size() > 0 )
|
if ( observedDataColl != nullptr && observedDataColl->allObservedSummaryData().size() > 0 )
|
||||||
{
|
{
|
||||||
auto observedData = observedDataColl->allObservedSummaryData();
|
auto observedData = observedDataColl->allObservedSummaryData();
|
||||||
|
@ -169,7 +169,7 @@ void RimSummaryCaseCollection::removeCase( RimSummaryCase* summaryCase )
|
|||||||
calculateEnsembleParametersIntersectionHash();
|
calculateEnsembleParametersIntersectionHash();
|
||||||
}
|
}
|
||||||
|
|
||||||
buildChildNodes();
|
clearChildNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -201,7 +201,7 @@ void RimSummaryCaseCollection::addCase( RimSummaryCase* summaryCase )
|
|||||||
|
|
||||||
updateReferringCurveSets();
|
updateReferringCurveSets();
|
||||||
|
|
||||||
buildChildNodes();
|
clearChildNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -212,6 +212,16 @@ std::vector<RimSummaryCase*> RimSummaryCaseCollection::allSummaryCases() const
|
|||||||
return m_cases.childObjects();
|
return m_cases.childObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimSummaryCase* RimSummaryCaseCollection::firstSummaryCase() const
|
||||||
|
{
|
||||||
|
if ( !m_cases.empty() ) return m_cases[0];
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -891,7 +901,7 @@ void RimSummaryCaseCollection::onLoadDataAndUpdate()
|
|||||||
if ( m_isEnsemble )
|
if ( m_isEnsemble )
|
||||||
{
|
{
|
||||||
calculateEnsembleParametersIntersectionHash();
|
calculateEnsembleParametersIntersectionHash();
|
||||||
buildChildNodes();
|
clearChildNodes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -953,8 +963,6 @@ void RimSummaryCaseCollection::initAfterRead()
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateIcon();
|
updateIcon();
|
||||||
|
|
||||||
buildChildNodes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -999,10 +1007,8 @@ void RimSummaryCaseCollection::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiT
|
|||||||
{
|
{
|
||||||
if ( m_isEnsemble() )
|
if ( m_isEnsemble() )
|
||||||
{
|
{
|
||||||
if ( m_dataVectorFolders->isEmpty() )
|
buildChildNodes();
|
||||||
{
|
|
||||||
buildChildNodes();
|
|
||||||
}
|
|
||||||
m_dataVectorFolders->updateUiTreeOrdering( uiTreeOrdering );
|
m_dataVectorFolders->updateUiTreeOrdering( uiTreeOrdering );
|
||||||
|
|
||||||
if ( !m_cases.empty() )
|
if ( !m_cases.empty() )
|
||||||
@ -1063,13 +1069,14 @@ bool RimSummaryCaseCollection::hasEnsembleParameters() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryCaseCollection::buildChildNodes()
|
void RimSummaryCaseCollection::buildChildNodes()
|
||||||
{
|
{
|
||||||
m_dataVectorFolders->clear();
|
if ( m_dataVectorFolders->isEmpty() )
|
||||||
|
|
||||||
for ( auto& smcase : m_cases )
|
|
||||||
{
|
{
|
||||||
m_dataVectorFolders->updateFolderStructure( smcase->summaryReader()->allResultAddresses(),
|
for ( auto& smcase : m_cases )
|
||||||
smcase->caseId(),
|
{
|
||||||
m_ensembleId );
|
m_dataVectorFolders->updateFolderStructure( smcase->summaryReader()->allResultAddresses(),
|
||||||
|
smcase->caseId(),
|
||||||
|
m_ensembleId );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1078,6 +1085,15 @@ void RimSummaryCaseCollection::buildChildNodes()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryCaseCollection::refreshMetaData()
|
void RimSummaryCaseCollection::refreshMetaData()
|
||||||
{
|
{
|
||||||
|
clearChildNodes();
|
||||||
buildChildNodes();
|
buildChildNodes();
|
||||||
updateConnectedEditors();
|
updateConnectedEditors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryCaseCollection::clearChildNodes()
|
||||||
|
{
|
||||||
|
m_dataVectorFolders->clear();
|
||||||
|
}
|
||||||
|
@ -58,21 +58,25 @@ public:
|
|||||||
RimSummaryCaseCollection();
|
RimSummaryCaseCollection();
|
||||||
~RimSummaryCaseCollection() override;
|
~RimSummaryCaseCollection() override;
|
||||||
|
|
||||||
void removeCase( RimSummaryCase* summaryCase );
|
void removeCase( RimSummaryCase* summaryCase );
|
||||||
void addCase( RimSummaryCase* summaryCase );
|
void addCase( RimSummaryCase* summaryCase );
|
||||||
virtual std::vector<RimSummaryCase*> allSummaryCases() const;
|
virtual std::vector<RimSummaryCase*> allSummaryCases() const;
|
||||||
void setName( const QString& name );
|
RimSummaryCase* firstSummaryCase() const;
|
||||||
QString name() const;
|
|
||||||
|
void setName( const QString& name );
|
||||||
|
QString name() const;
|
||||||
|
|
||||||
bool isEnsemble() const;
|
bool isEnsemble() const;
|
||||||
void setAsEnsemble( bool isEnsemble );
|
void setAsEnsemble( bool isEnsemble );
|
||||||
virtual std::set<RifEclipseSummaryAddress> ensembleSummaryAddresses() const;
|
virtual std::set<RifEclipseSummaryAddress> ensembleSummaryAddresses() const;
|
||||||
virtual std::set<time_t> ensembleTimeSteps() const;
|
virtual std::set<time_t> ensembleTimeSteps() const;
|
||||||
std::set<QString> wellsWithRftData() const;
|
|
||||||
std::set<QDateTime> rftTimeStepsForWell( const QString& wellName ) const;
|
std::set<QString> wellsWithRftData() const;
|
||||||
RifReaderRftInterface* rftStatisticsReader();
|
std::set<QDateTime> rftTimeStepsForWell( const QString& wellName ) const;
|
||||||
void setEnsembleId( int ensembleId );
|
RifReaderRftInterface* rftStatisticsReader();
|
||||||
int ensembleId() const;
|
void setEnsembleId( int ensembleId );
|
||||||
bool hasEnsembleParameters() const;
|
int ensembleId() const;
|
||||||
|
bool hasEnsembleParameters() const;
|
||||||
|
|
||||||
std::vector<RigEnsembleParameter> variationSortedEnsembleParameters( bool excludeNoVariation = false ) const;
|
std::vector<RigEnsembleParameter> variationSortedEnsembleParameters( bool excludeNoVariation = false ) const;
|
||||||
std::vector<std::pair<RigEnsembleParameter, double>>
|
std::vector<std::pair<RigEnsembleParameter, double>>
|
||||||
@ -119,6 +123,7 @@ private:
|
|||||||
void onCaseNameChanged( const SignalEmitter* emitter );
|
void onCaseNameChanged( const SignalEmitter* emitter );
|
||||||
|
|
||||||
void buildChildNodes();
|
void buildChildNodes();
|
||||||
|
void clearChildNodes();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void onLoadDataAndUpdate();
|
virtual void onLoadDataAndUpdate();
|
||||||
|
@ -223,8 +223,10 @@ void RimSummaryCaseMainCollection::addCases( const std::vector<RimSummaryCase*>
|
|||||||
{
|
{
|
||||||
for ( RimSummaryCase* sumCase : cases )
|
for ( RimSummaryCase* sumCase : cases )
|
||||||
{
|
{
|
||||||
addCase( sumCase );
|
m_cases.push_back( sumCase );
|
||||||
|
sumCase->nameChanged.connect( this, &RimSummaryCaseMainCollection::onCaseNameChanged );
|
||||||
}
|
}
|
||||||
|
dataSourceHasChanged.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -355,7 +357,15 @@ size_t RimSummaryCaseMainCollection::summaryCaseCount() const
|
|||||||
std::vector<RimSummaryCase*> RimSummaryCaseMainCollection::allSummaryCases() const
|
std::vector<RimSummaryCase*> RimSummaryCaseMainCollection::allSummaryCases() const
|
||||||
{
|
{
|
||||||
std::vector<RimSummaryCase*> cases;
|
std::vector<RimSummaryCase*> cases;
|
||||||
this->descendantsIncludingThisOfType( cases );
|
|
||||||
|
if ( !m_cases.empty() ) cases.insert( cases.end(), m_cases.begin(), m_cases.end() );
|
||||||
|
|
||||||
|
for ( auto& coll : m_caseCollections )
|
||||||
|
{
|
||||||
|
auto collCases = coll->allSummaryCases();
|
||||||
|
if ( collCases.empty() ) continue;
|
||||||
|
cases.insert( cases.end(), collCases.begin(), collCases.end() );
|
||||||
|
}
|
||||||
|
|
||||||
return cases;
|
return cases;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user