mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Remove special summary case connected to a grid model
* Remove use of RimGridSummaryCase * Remove unused summary plot filter text * Delete unused files
This commit is contained in:
@@ -31,6 +31,7 @@ void caf::AppEnum<RiaEclipseFileNameTools::EclipseFileType>::setUp()
|
||||
addItem( RiaEclipseFileNameTools::EclipseFileType::ECLIPSE_UNRST, "UNRST", "Unified Restart" );
|
||||
addItem( RiaEclipseFileNameTools::EclipseFileType::ECLIPSE_SMSPEC, "SMSPEC", "Summary Specification" );
|
||||
addItem( RiaEclipseFileNameTools::EclipseFileType::ECLIPSE_UNSMRY, "UNSMR", "Summary Vectors" );
|
||||
addItem( RiaEclipseFileNameTools::EclipseFileType::ECLIPSE_ESMRY, "ESMRY", "ESRMY Summary Vectors" );
|
||||
|
||||
addItem( RiaEclipseFileNameTools::EclipseFileType::RESINSIGHT_PROJECT, "rsp", "ResInsight Project" );
|
||||
}
|
||||
@@ -47,14 +48,6 @@ RiaEclipseFileNameTools::RiaEclipseFileNameTools( const QString& inputFilePath )
|
||||
m_baseName = fi.absolutePath() + "/" + fi.baseName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaEclipseFileNameTools::findRelatedSummarySpecFile()
|
||||
{
|
||||
return relatedFilePath( EclipseFileType::ECLIPSE_SMSPEC );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -69,6 +62,17 @@ QString RiaEclipseFileNameTools::findRelatedGridFile()
|
||||
return relatedFilePath( EclipseFileType::ECLIPSE_GRID );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RiaEclipseFileNameTools::findSummaryFileCandidates()
|
||||
{
|
||||
auto smryCandidate = relatedFilePath( EclipseFileType::ECLIPSE_SMSPEC );
|
||||
auto esmryCandidate = relatedFilePath( EclipseFileType::ECLIPSE_ESMRY );
|
||||
|
||||
return { smryCandidate, esmryCandidate };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -38,6 +38,7 @@ public:
|
||||
ECLIPSE_UNRST,
|
||||
ECLIPSE_SMSPEC,
|
||||
ECLIPSE_UNSMRY,
|
||||
ECLIPSE_ESMRY,
|
||||
RESINSIGHT_PROJECT,
|
||||
UNKNOWN
|
||||
};
|
||||
@@ -45,9 +46,10 @@ public:
|
||||
public:
|
||||
explicit RiaEclipseFileNameTools( const QString& fileName );
|
||||
|
||||
QString findRelatedGridFile();
|
||||
QString findRelatedSummarySpecFile();
|
||||
QString findRelatedDataFile();
|
||||
// Returns both files ending with SMSPEC and ESMRY
|
||||
std::vector<QString> findSummaryFileCandidates();
|
||||
QString findRelatedGridFile();
|
||||
QString findRelatedDataFile();
|
||||
|
||||
private:
|
||||
QString relatedFilePath( EclipseFileType fileType ) const;
|
||||
|
@@ -42,7 +42,6 @@
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFileSummaryCase.h"
|
||||
#include "RimGridSummaryCase.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimOilField.h"
|
||||
@@ -122,72 +121,61 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList&
|
||||
for ( RimSummaryCase* newSumCase : candidateCases )
|
||||
{
|
||||
RimSummaryCaseCollection* existingCollection = nullptr;
|
||||
QString gridCaseFile = RifEclipseSummaryTools::findGridCaseFileFromSummaryHeaderFile( newSumCase->summaryHeaderFilename() );
|
||||
RimEclipseCase* gridCase = project->eclipseCaseFromGridFileName( gridCaseFile );
|
||||
if ( gridCase )
|
||||
auto existingSummaryCase = sumCaseColl->findSummaryCaseFromFileName( newSumCase->summaryHeaderFilename() );
|
||||
if ( existingSummaryCase )
|
||||
{
|
||||
RimSummaryCase* existingSummaryCase = sumCaseColl->findSummaryCaseFromFileName( newSumCase->summaryHeaderFilename() );
|
||||
auto* existingGridSummaryCase = dynamic_cast<RimGridSummaryCase*>( existingSummaryCase );
|
||||
auto* existingFileSummaryCase = dynamic_cast<RimFileSummaryCase*>( existingSummaryCase );
|
||||
if ( existingGridSummaryCase )
|
||||
{
|
||||
duplicatedCases.push_back( newSumCase );
|
||||
continue;
|
||||
}
|
||||
else if ( existingFileSummaryCase )
|
||||
{
|
||||
existingFileSummaryCase->firstAncestorOrThisOfType( existingCollection );
|
||||
existingSummaryCase->firstAncestorOrThisOfType( existingCollection );
|
||||
|
||||
// Replace file summary case pointers in Rft Curves
|
||||
std::vector<RimWellLogRftCurve*> rftCurves;
|
||||
existingFileSummaryCase->objectsWithReferringPtrFieldsOfType( rftCurves );
|
||||
for ( RimWellLogRftCurve* curve : rftCurves )
|
||||
// Replace file summary case pointers in Rft Curves
|
||||
std::vector<RimWellLogRftCurve*> rftCurves;
|
||||
existingSummaryCase->objectsWithReferringPtrFieldsOfType( rftCurves );
|
||||
for ( RimWellLogRftCurve* curve : rftCurves )
|
||||
{
|
||||
if ( curve->summaryCase() == existingSummaryCase )
|
||||
{
|
||||
if ( curve->summaryCase() == existingSummaryCase )
|
||||
curve->setSummaryCase( newSumCase );
|
||||
}
|
||||
}
|
||||
|
||||
// Replace all occurrences of file sum with ecl sum
|
||||
|
||||
std::vector<RimSummaryCurve*> objects;
|
||||
existingSummaryCase->objectsWithReferringPtrFieldsOfType( objects );
|
||||
|
||||
// UI settings of a curve filter is updated based
|
||||
// on the new case association for the curves in the curve filter
|
||||
// UI is updated by loadDataAndUpdate()
|
||||
|
||||
for ( RimSummaryCurve* summaryCurve : objects )
|
||||
{
|
||||
if ( summaryCurve )
|
||||
{
|
||||
if ( summaryCurve->summaryCaseX() == existingSummaryCase )
|
||||
{
|
||||
curve->setSummaryCase( newSumCase );
|
||||
summaryCurve->setSummaryCaseX( newSumCase );
|
||||
}
|
||||
if ( summaryCurve->summaryCaseY() == existingSummaryCase )
|
||||
{
|
||||
summaryCurve->setSummaryCaseY( newSumCase );
|
||||
}
|
||||
|
||||
RimSummaryCurveCollection* parentCollection = nullptr;
|
||||
summaryCurve->firstAncestorOrThisOfType( parentCollection );
|
||||
if ( parentCollection )
|
||||
{
|
||||
parentCollection->loadDataAndUpdate( true );
|
||||
parentCollection->updateConnectedEditors();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Replace all occurrences of file sum with ecl sum
|
||||
|
||||
std::vector<RimSummaryCurve*> objects;
|
||||
existingFileSummaryCase->objectsWithReferringPtrFieldsOfType( objects );
|
||||
|
||||
// UI settings of a curve filter is updated based
|
||||
// on the new case association for the curves in the curve filter
|
||||
// UI is updated by loadDataAndUpdate()
|
||||
|
||||
for ( RimSummaryCurve* summaryCurve : objects )
|
||||
{
|
||||
if ( summaryCurve )
|
||||
{
|
||||
if ( summaryCurve->summaryCaseX() == existingSummaryCase )
|
||||
{
|
||||
summaryCurve->setSummaryCaseX( newSumCase );
|
||||
}
|
||||
if ( summaryCurve->summaryCaseY() == existingSummaryCase )
|
||||
{
|
||||
summaryCurve->setSummaryCaseY( newSumCase );
|
||||
}
|
||||
|
||||
RimSummaryCurveCollection* parentCollection = nullptr;
|
||||
summaryCurve->firstAncestorOrThisOfType( parentCollection );
|
||||
if ( parentCollection )
|
||||
{
|
||||
parentCollection->loadDataAndUpdate( true );
|
||||
parentCollection->updateConnectedEditors();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove existing case
|
||||
sumCaseColl->removeCase( existingFileSummaryCase );
|
||||
|
||||
duplicatedCases.push_back( existingFileSummaryCase );
|
||||
}
|
||||
|
||||
// Remove existing case
|
||||
sumCaseColl->removeCase( existingSummaryCase );
|
||||
|
||||
duplicatedCases.push_back( existingSummaryCase );
|
||||
}
|
||||
|
||||
if ( existingCollection )
|
||||
{
|
||||
existingCollection->addCase( newSumCase );
|
||||
|
Reference in New Issue
Block a user