mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve reload and replace of cases
* Move code to from features to helper classes * Ask user if replace case should also happen for the associated grid or summary file
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "RimRftCase.h"
|
||||
|
||||
#include "RicReloadSummaryCaseFeature.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
@@ -84,7 +84,7 @@ void RimRftCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField, cons
|
||||
{
|
||||
auto parentCase = firstAncestorOfType<RimSummaryCase>();
|
||||
|
||||
if ( parentCase ) RicReloadSummaryCaseFeature::reloadSummaryCase( parentCase );
|
||||
if ( parentCase ) RiaSummaryTools::reloadSummaryCase( parentCase );
|
||||
|
||||
RimMainPlotCollection::current()->loadDataAndUpdateAllPlots();
|
||||
}
|
||||
|
||||
@@ -110,26 +110,6 @@ RimSummaryCaseMainCollection::~RimSummaryCaseMainCollection()
|
||||
m_caseCollections.deleteChildrenAsync();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCase* RimSummaryCaseMainCollection::findSummaryCaseFromEclipseResultCase( const RimEclipseResultCase* eclipseResultCase ) const
|
||||
{
|
||||
RiaEclipseFileNameTools helper( eclipseResultCase->gridFileName() );
|
||||
|
||||
auto summaryFileName = helper.findSummaryFileCandidates();
|
||||
for ( const auto& candidateFileName : summaryFileName )
|
||||
{
|
||||
auto summaryCase = findTopLevelSummaryCaseFromFileName( candidateFileName );
|
||||
if ( summaryCase )
|
||||
{
|
||||
return summaryCase;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -54,7 +54,6 @@ public:
|
||||
std::vector<RimSummaryCase*> createSummaryCasesFromFileInfos( const std::vector<RifSummaryCaseFileResultInfo>& summaryHeaderFileInfos,
|
||||
bool showProgress = false );
|
||||
|
||||
RimSummaryCase* findSummaryCaseFromEclipseResultCase( const RimEclipseResultCase* eclResCase ) const;
|
||||
RimSummaryCase* findTopLevelSummaryCaseFromFileName( const QString& fileName ) const;
|
||||
|
||||
void addCases( const std::vector<RimSummaryCase*> cases );
|
||||
|
||||
Reference in New Issue
Block a user