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:
Magne Sjaastad 2023-03-03 15:28:34 +01:00 committed by GitHub
parent 3d663797b6
commit 9bc3659584
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 120 additions and 1344 deletions

View File

@ -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 };
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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;

View File

@ -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 );

View File

@ -30,12 +30,12 @@
#include "RiaSummaryTools.h"
#include "Rim3dView.h"
#include "RimEclipseResultCase.h"
#include "RimGridSummaryCase.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimSimWellInView.h"
#include "RimSimWellInViewTools.h"
#include "RimSummaryCase.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSummaryCurve.h"
#include "RimSummaryCurveAppearanceCalculator.h"
@ -60,8 +60,8 @@ bool RicPlotProductionRateFeature::isCommandEnabled()
for ( RimSimWellInView* well : collection )
{
RimGridSummaryCase* gridSummaryCase = RimSimWellInViewTools::gridSummaryCaseForWell( well );
if ( gridSummaryCase )
auto summaryCase = RimSimWellInViewTools::summaryCaseForWell( well );
if ( summaryCase )
{
return true;
}
@ -88,8 +88,8 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
for ( RimSimWellInView* well : collection )
{
RimGridSummaryCase* gridSummaryCase = RimSimWellInViewTools::gridSummaryCaseForWell( well );
if ( !gridSummaryCase ) continue;
auto summaryCase = RimSimWellInViewTools::summaryCaseForWell( well );
if ( !summaryCase ) continue;
QString description = "Well Production Rates : ";
@ -115,7 +115,7 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
QString parameterName = "WOIR";
RicPlotProductionRateFeature::addSummaryCurve( plot,
well,
gridSummaryCase,
summaryCase,
parameterName,
plotAxis,
RimSummaryCurveAppearanceCalculator::cycledGreenColor( 0 ) );
@ -126,7 +126,7 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
QString parameterName = "WWIR";
RicPlotProductionRateFeature::addSummaryCurve( plot,
well,
gridSummaryCase,
summaryCase,
parameterName,
plotAxis,
RimSummaryCurveAppearanceCalculator::cycledBlueColor( 0 ) );
@ -137,7 +137,7 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
QString parameterName = "WGIR";
RicPlotProductionRateFeature::addSummaryCurve( plot,
well,
gridSummaryCase,
summaryCase,
parameterName,
plotAxis,
RimSummaryCurveAppearanceCalculator::cycledRedColor( 0 ) );
@ -154,7 +154,7 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
QString parameterName = "WOPR";
RicPlotProductionRateFeature::addSummaryCurve( plot,
well,
gridSummaryCase,
summaryCase,
parameterName,
plotAxis,
RimSummaryCurveAppearanceCalculator::cycledGreenColor( 0 ) );
@ -165,7 +165,7 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
QString parameterName = "WWPR";
RicPlotProductionRateFeature::addSummaryCurve( plot,
well,
gridSummaryCase,
summaryCase,
parameterName,
plotAxis,
RimSummaryCurveAppearanceCalculator::cycledBlueColor( 0 ) );
@ -176,7 +176,7 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
QString parameterName = "WGPR";
RicPlotProductionRateFeature::addSummaryCurve( plot,
well,
gridSummaryCase,
summaryCase,
parameterName,
plotAxis,
RimSummaryCurveAppearanceCalculator::cycledRedColor( 0 ) );
@ -192,7 +192,7 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
QString parameterName = "WTHP";
RicPlotProductionRateFeature::addSummaryCurve( plot,
well,
gridSummaryCase,
summaryCase,
parameterName,
plotAxis,
RimSummaryCurveAppearanceCalculator::cycledNoneRGBBrColor( 0 ) );
@ -202,7 +202,7 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
QString parameterName = "WBHP";
RicPlotProductionRateFeature::addSummaryCurve( plot,
well,
gridSummaryCase,
summaryCase,
parameterName,
plotAxis,
RimSummaryCurveAppearanceCalculator::cycledNoneRGBBrColor( 1 ) );
@ -240,13 +240,13 @@ void RicPlotProductionRateFeature::setupActionLook( QAction* actionToSetup )
//--------------------------------------------------------------------------------------------------
RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot* plot,
const RimSimWellInView* well,
RimGridSummaryCase* gridSummaryCase,
RimSummaryCase* summaryCase,
const QString& vectorName,
RiaDefines::PlotAxis plotAxis,
const cvf::Color3f& color )
{
CVF_ASSERT( plot );
CVF_ASSERT( gridSummaryCase );
CVF_ASSERT( summaryCase );
CVF_ASSERT( well );
RifEclipseSummaryAddress addr( RifEclipseSummaryAddress::SUMMARY_WELL,
@ -264,7 +264,7 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot*
false,
-1 );
if ( !gridSummaryCase->summaryReader()->hasAddress( addr ) )
if ( !summaryCase->summaryReader()->hasAddress( addr ) )
{
return nullptr;
}
@ -272,7 +272,7 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot*
RimSummaryCurve* newCurve = new RimSummaryCurve();
plot->addCurveAndUpdate( newCurve );
newCurve->setSummaryCaseY( gridSummaryCase );
newCurve->setSummaryCaseY( summaryCase );
newCurve->setSummaryAddressYAndApplyInterpolation( addr );
newCurve->setColor( color );
newCurve->setLeftOrRightAxisY( RiuPlotAxis( plotAxis ) );

View File

@ -23,7 +23,7 @@
#include "RiaPlotDefines.h"
#include "RimFlowDiagSolution.h"
class RimGridSummaryCase;
class RimSummaryCase;
class RimSimWellInView;
class RimSummaryCurve;
class RimSummaryPlot;
@ -41,12 +41,12 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
private:
static RimGridSummaryCase* gridSummaryCaseForWell( RimSimWellInView* well );
static bool isInjector( RimSimWellInView* well );
static RimSummaryCurve* addSummaryCurve( RimSummaryPlot* plot,
const RimSimWellInView* well,
RimGridSummaryCase* gridSummaryCase,
const QString& vectorName,
RiaDefines::PlotAxis plotAxis,
const cvf::Color3f& color );
static RimSummaryCase* gridSummaryCaseForWell( RimSimWellInView* well );
static bool isInjector( RimSimWellInView* well );
static RimSummaryCurve* addSummaryCurve( RimSummaryPlot* plot,
const RimSimWellInView* well,
RimSummaryCase* summaryCase,
const QString& vectorName,
RiaDefines::PlotAxis plotAxis,
const cvf::Color3f& color );
};

View File

@ -27,7 +27,6 @@
#include "RimEclipseStatisticsCase.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechModels.h"
#include "RimGridSummaryCase.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
@ -185,24 +184,6 @@ void RicCloseCaseFeature::deleteEclipseCase( RimEclipseCase* eclipseCase )
removeCaseFromAllGroups( eclipseCase );
}
RimEclipseResultCase* resultCase = dynamic_cast<RimEclipseResultCase*>( eclipseCase );
if ( resultCase )
{
RimProject* project = RimProject::current();
RimSummaryCaseMainCollection* sumCaseColl = project->activeOilField() ? project->activeOilField()->summaryCaseMainCollection()
: nullptr;
if ( sumCaseColl )
{
RimSummaryCase* summaryCase = sumCaseColl->findSummaryCaseFromEclipseResultCase( resultCase );
if ( summaryCase )
{
RimGridSummaryCase* gridSummaryCase = dynamic_cast<RimGridSummaryCase*>( summaryCase );
sumCaseColl->convertGridSummaryCasesToFileSummaryCases( gridSummaryCase );
sumCaseColl->updateConnectedEditors();
}
}
}
delete eclipseCase;
{

View File

@ -25,7 +25,6 @@
#include "RifSummaryCaseRestartSelector.h"
#include "RimGridSummaryCase.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"

View File

@ -31,7 +31,6 @@
#include "RifSummaryCaseRestartSelector.h"
#include "RimEnsembleCurveSet.h"
#include "RimGridSummaryCase.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"

View File

@ -21,7 +21,6 @@
#include "RiaFilePathTools.h"
#include "RiaPreferences.h"
#include "RimGridSummaryCase.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"

View File

@ -29,7 +29,6 @@
#include "RifSummaryCaseRestartSelector.h"
#include "RimEnsembleCurveSet.h"
#include "RimGridSummaryCase.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"

View File

@ -26,7 +26,6 @@
#include "RifSummaryCaseRestartSelector.h"
#include "RimGridSummaryCase.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"

View File

@ -26,7 +26,6 @@
#include "RimEclipseCase.h"
#include "RimEclipseResultCase.h"
#include "RimGridSummaryCase.h"
#include "RimReloadCaseTools.h"
#include "RimSummaryCase.h"
#include "RimSummaryCaseMainCollection.h"
@ -101,14 +100,12 @@ void RicReplaceCaseFeature::onActionTriggered( bool isChecked )
RimSummaryCaseMainCollection* sumCaseColl = RiaSummaryTools::summaryCaseMainCollection();
if ( sumCaseColl )
{
RimGridSummaryCase* gridSummaryCase =
dynamic_cast<RimGridSummaryCase*>( sumCaseColl->findSummaryCaseFromEclipseResultCase( selectedCase ) );
if ( gridSummaryCase )
auto summaryCase = sumCaseColl->findSummaryCaseFromEclipseResultCase( selectedCase );
if ( summaryCase )
{
gridSummaryCase->setAssociatedEclipseCase( selectedCase );
gridSummaryCase->updateAutoShortName();
gridSummaryCase->createSummaryReaderInterface();
gridSummaryCase->createRftReaderInterface();
summaryCase->updateAutoShortName();
summaryCase->createSummaryReaderInterface();
summaryCase->createRftReaderInterface();
RimSummaryMultiPlotCollection* summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
for ( RimSummaryMultiPlot* multiPlot : summaryPlotColl->multiPlots() )

View File

@ -219,15 +219,16 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
else
{
RiaEclipseFileNameTools nameTool( arguments[optionIdx] );
QString smSpecFileName = nameTool.findRelatedSummarySpecFile();
QString gridFileName = nameTool.findRelatedGridFile();
if ( smSpecFileName != "" || gridFileName != "" )
for ( const auto& fileName : nameTool.findSummaryFileCandidates() )
{
if ( smSpecFileName != "" ) summaryFileNames.push_back( smSpecFileName );
if ( gridFileName != "" ) gridFileNames.push_back( gridFileName );
if ( !fileName.isEmpty() ) summaryFileNames.push_back( fileName );
}
else
QString gridFileName = nameTool.findRelatedGridFile();
if ( !gridFileName.isEmpty() ) gridFileNames.push_back( gridFileName );
if ( summaryFileNames.empty() && gridFileNames.empty() )
{
// Remove space from address string https://github.com/OPM/ResInsight/issues/9707

View File

@ -1427,11 +1427,6 @@ void RimAnalysisPlot::addDataToChartBuilder( RiuGroupedBarChartBuilder& chartBui
if ( !reader ) continue;
// Todo:
// If curveDef.summaryCase() is a RimGridSummaryCase and we are using summary item as legend and the summary
// items are wells, then:
/// use color from eclCase->defaultWellColor( wellName );
std::vector<time_t> timeSteps;
std::vector<double> values;

View File

@ -58,7 +58,6 @@
#include "RimGeoMechModels.h"
#include "RimGridCalculationCollection.h"
#include "RimGridCrossPlotCollection.h"
#include "RimGridSummaryCase.h"
#include "RimGridView.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimMainPlotCollection.h"

View File

@ -35,13 +35,13 @@
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimExtrudedCurveIntersection.h"
#include "RimGridSummaryCase.h"
#include "RimIntersectionCollection.h"
#include "RimPropertyFilterCollection.h"
#include "RimSimWellFracture.h"
#include "RimSimWellFractureCollection.h"
#include "RimSimWellInViewCollection.h"
#include "RimSimWellInViewTools.h"
#include "RimSummaryCase.h"
#include "RimWellDiskConfig.h"
#include "RiuMainWindow.h"

View File

@ -31,12 +31,12 @@
#include "RimEclipseContourMapView.h"
#include "RimEclipseResultCase.h"
#include "RimEclipseView.h"
#include "RimGridSummaryCase.h"
#include "RimIntersectionCollection.h"
#include "RimProject.h"
#include "RimSimWellFractureCollection.h"
#include "RimSimWellInView.h"
#include "RimSimWellInViewTools.h"
#include "RimSummaryCase.h"
#include "RimVirtualPerforationResults.h"
#include "RimWellAllocationPlot.h"
#include "RimWellDiskConfig.h"
@ -617,11 +617,7 @@ void RimSimWellInViewCollection::setDefaultSourceCaseForWellDisks()
{
if ( m_wellDiskSummaryCase == nullptr && !wells.empty() )
{
RimGridSummaryCase* gridSummaryCase = RimSimWellInViewTools::gridSummaryCaseForWell( wells[0] );
if ( gridSummaryCase )
{
m_wellDiskSummaryCase = gridSummaryCase;
}
m_wellDiskSummaryCase = RimSimWellInViewTools::summaryCaseForWell( wells[0] );
}
}

View File

@ -29,7 +29,6 @@
#include "Rim3dView.h"
#include "RimEclipseResultCase.h"
#include "RimGridSummaryCase.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimSimWellInView.h"
@ -41,7 +40,7 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridSummaryCase* RimSimWellInViewTools::gridSummaryCaseForWell( RimSimWellInView* well )
RimSummaryCase* RimSimWellInViewTools::summaryCaseForWell( RimSimWellInView* well )
{
RimProject* project = RimProject::current();
if ( !project ) return nullptr;
@ -53,11 +52,7 @@ RimGridSummaryCase* RimSimWellInViewTools::gridSummaryCaseForWell( RimSimWellInV
well->firstAncestorOrThisOfType( eclCase );
if ( eclCase )
{
RimGridSummaryCase* gridSummaryCase = dynamic_cast<RimGridSummaryCase*>( sumCaseColl->findSummaryCaseFromEclipseResultCase( eclCase ) );
if ( gridSummaryCase )
{
return gridSummaryCase;
}
return sumCaseColl->findSummaryCaseFromEclipseResultCase( eclCase );
}
return nullptr;

View File

@ -25,7 +25,6 @@ class QString;
class QDateTime;
class RimSimWellInView;
class RimGridSummaryCase;
class RifSummaryReaderInterface;
class RimSummaryCase;
@ -36,7 +35,7 @@ class RimSummaryCase;
class RimSimWellInViewTools
{
public:
static RimGridSummaryCase* gridSummaryCaseForWell( RimSimWellInView* well );
static RimSummaryCase* summaryCaseForWell( RimSimWellInView* well );
static std::vector<RimSummaryCase*> summaryCases();
static bool isInjector( RimSimWellInView* well );

View File

@ -1,7 +1,6 @@
set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimAsciiDataCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimFileSummaryCase.h
${CMAKE_CURRENT_LIST_DIR}/RimGridSummaryCase.h
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCase.h
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseMainCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseCollection.h
@ -33,7 +32,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsCase.h
${CMAKE_CURRENT_LIST_DIR}/RimDerivedSummaryCase.h
${CMAKE_CURRENT_LIST_DIR}/RimDerivedEnsembleCaseCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotFilterTextCurveSetEditor.h
${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunction.h
${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.h
${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotManager.h
@ -52,7 +50,6 @@ set(SOURCE_GROUP_HEADER_FILES
set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimAsciiDataCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFileSummaryCase.cpp
${CMAKE_CURRENT_LIST_DIR}/RimGridSummaryCase.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCase.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseMainCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseCollection.cpp
@ -84,7 +81,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsCase.cpp
${CMAKE_CURRENT_LIST_DIR}/RimDerivedSummaryCase.cpp
${CMAKE_CURRENT_LIST_DIR}/RimDerivedEnsembleCaseCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotFilterTextCurveSetEditor.cpp
${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunction.cpp
${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotManager.cpp

View File

@ -1,221 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimGridSummaryCase.h"
#include "RicfCommandObject.h"
#include "RifMultipleSummaryReaders.h"
#include "RifSummaryReaderInterface.h"
#include "RimCalculatedSummaryCurveReader.h"
#include "RimEclipseCase.h"
#include "RimFileSummaryCase.h"
#include "RimProject.h"
#include "RimSummaryCalculationCollection.h"
#include "cafPdmObjectScriptingCapability.h"
#include <QFileInfo>
//==================================================================================================
//
//
//
//==================================================================================================
CAF_PDM_SOURCE_INIT( RimGridSummaryCase, "GridSummaryCase" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridSummaryCase::RimGridSummaryCase()
{
CAF_PDM_InitScriptableObject( "Grid Summary Case", ":/SummaryCases16x16.png", "", "A Summary Case based on extracting grid data." );
CAF_PDM_InitFieldNoDefault( &m_eclipseCase, "Associated3DCase", "Eclipse Case" );
m_eclipseCase.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_cachedCaseName, "CachedCasename", "Case Name" );
m_cachedCaseName.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_eclipseGridFileName, "Associated3DCaseGridFileName", "Grid File Name" );
m_eclipseGridFileName.registerGetMethod( this, &RimGridSummaryCase::eclipseGridFileName );
m_eclipseGridFileName.uiCapability()->setUiReadOnly( true );
m_eclipseGridFileName.xmlCapability()->setIOWritable( false );
CAF_PDM_InitField( &m_includeRestartFiles, "IncludeRestartFiles", false, "Include Restart Files" );
m_includeRestartFiles.uiCapability()->setUiHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridSummaryCase::~RimGridSummaryCase()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString summaryHeaderFilenameFromEclipseCase( RimEclipseCase* eclCase )
{
if ( !eclCase ) return QString();
QFileInfo gridFileInfo( eclCase->gridFileName() );
QString possibleSumHeaderFileName = gridFileInfo.path() + "/" + gridFileInfo.completeBaseName() + ".SMSPEC";
return possibleSumHeaderFileName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString caseNameFromEclipseCase( RimEclipseCase* eclCase )
{
if ( !eclCase ) return QString();
return eclCase->caseUserDescription();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridSummaryCase::setAssociatedEclipseCase( RimEclipseCase* eclipseCase )
{
m_eclipseCase = eclipseCase;
m_summaryHeaderFilename = summaryHeaderFilenameFromEclipseCase( eclipseCase );
m_cachedCaseName = caseNameFromEclipseCase( eclipseCase );
this->updateAutoShortName();
this->updateTreeItemName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseCase* RimGridSummaryCase::associatedEclipseCase()
{
if ( !m_eclipseCase() )
{
// Find a possible associated eclipse case
RimProject* project;
firstAncestorOrThisOfTypeAsserted( project );
std::vector<RimCase*> allCases;
project->allCases( allCases );
for ( RimCase* someCase : allCases )
{
auto eclCase = dynamic_cast<RimEclipseCase*>( someCase );
if ( eclCase )
{
QString sumHeaderFileName = summaryHeaderFilenameFromEclipseCase( eclCase );
if ( sumHeaderFileName == m_summaryHeaderFilename().path() )
{
m_eclipseCase = eclCase;
this->updateAutoShortName();
this->updateTreeItemName();
break;
}
}
}
}
return m_eclipseCase();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridSummaryCase::summaryHeaderFilename() const
{
if ( m_eclipseCase() )
{
auto candidate = summaryHeaderFilenameFromEclipseCase( m_eclipseCase );
if ( QFileInfo::exists( candidate ) ) return candidate;
}
return m_summaryHeaderFilename().path();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridSummaryCase::caseName() const
{
if ( m_eclipseCase() ) m_cachedCaseName = caseNameFromEclipseCase( m_eclipseCase() );
return m_cachedCaseName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridSummaryCase::eclipseGridFileName() const
{
if ( !m_eclipseCase() ) return QString();
return m_eclipseCase()->gridFileName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridSummaryCase::createSummaryReaderInterface()
{
m_fileSummaryReader = RimFileSummaryCase::findRelatedFilesAndCreateReader( this->summaryHeaderFilename(), m_includeRestartFiles, nullptr );
m_multiSummaryReader = new RifMultipleSummaryReaders;
m_multiSummaryReader->addReader( m_fileSummaryReader.p() );
RimSummaryCalculationCollection* calcColl = RimProject::current()->calculationCollection();
m_calculatedSummaryReader = new RifCalculatedSummaryCurveReader( calcColl, this );
m_multiSummaryReader->addReader( m_calculatedSummaryReader.p() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifSummaryReaderInterface* RimGridSummaryCase::summaryReader()
{
if ( m_multiSummaryReader.isNull() )
{
createSummaryReaderInterface();
}
return m_multiSummaryReader.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridSummaryCase::setIncludeRestartFiles( bool includeRestartFiles )
{
m_includeRestartFiles = includeRestartFiles;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFileSummaryCase* RimGridSummaryCase::createFileSummaryCaseCopy()
{
RimFileSummaryCase* fileSummaryCase = new RimFileSummaryCase();
fileSummaryCase->copyFrom( *this );
fileSummaryCase->setIncludeRestartFiles( m_includeRestartFiles() );
return fileSummaryCase;
}

View File

@ -1,73 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RifMultipleSummaryReaders.h"
#include "RimSummaryCase.h"
#include "cafPdmProxyValueField.h"
#include "cafPdmPtrField.h"
#include "cvfObject.h"
class RimEclipseCase;
class RifSummaryReaderInterface;
class RimFileSummaryCase;
class RifCalculatedSummaryCurveReader;
class RifMultipleSummaryReaders;
//==================================================================================================
//
//
//
//==================================================================================================
class RimGridSummaryCase : public RimSummaryCase
{
CAF_PDM_HEADER_INIT;
public:
RimGridSummaryCase();
~RimGridSummaryCase() override;
void setAssociatedEclipseCase( RimEclipseCase* eclipseCase );
RimEclipseCase* associatedEclipseCase();
QString summaryHeaderFilename() const override;
QString caseName() const override;
void createSummaryReaderInterface() override;
RifSummaryReaderInterface* summaryReader() override;
void setIncludeRestartFiles( bool includeRestartFiles );
RimFileSummaryCase* createFileSummaryCaseCopy();
private:
QString eclipseGridFileName() const;
private:
caf::PdmPtrField<RimEclipseCase*> m_eclipseCase;
mutable caf::PdmField<QString> m_cachedCaseName;
caf::PdmProxyValueField<QString> m_eclipseGridFileName;
cvf::ref<RifSummaryReaderInterface> m_fileSummaryReader;
cvf::ref<RifCalculatedSummaryCurveReader> m_calculatedSummaryReader;
cvf::ref<RifMultipleSummaryReaders> m_multiSummaryReader;
caf::PdmField<bool> m_includeRestartFiles;
};

View File

@ -31,7 +31,6 @@
#include "RimAnalysisPlotDataEntry.h"
#include "RimDerivedEnsembleCaseCollection.h"
#include "RimEnsembleCurveSet.h"
#include "RimGridSummaryCase.h"
#include "RimProject.h"
#include "RimSummaryAddressCollection.h"
#include "RimSummaryCalculationCollection.h"

View File

@ -36,7 +36,6 @@
#include "RimDerivedEnsembleCaseCollection.h"
#include "RimEclipseResultCase.h"
#include "RimFileSummaryCase.h"
#include "RimGridSummaryCase.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimSummaryCase.h"
@ -115,27 +114,15 @@ RimSummaryCaseMainCollection::~RimSummaryCaseMainCollection()
//--------------------------------------------------------------------------------------------------
RimSummaryCase* RimSummaryCaseMainCollection::findSummaryCaseFromEclipseResultCase( const RimEclipseResultCase* eclipseResultCase ) const
{
for ( RimSummaryCase* summaryCase : m_cases )
{
RimGridSummaryCase* gridSummaryCase = dynamic_cast<RimGridSummaryCase*>( summaryCase );
if ( gridSummaryCase && gridSummaryCase->associatedEclipseCase() )
{
if ( gridSummaryCase->associatedEclipseCase()->gridFileName() == eclipseResultCase->gridFileName() )
{
return gridSummaryCase;
}
}
}
RiaEclipseFileNameTools helper( eclipseResultCase->gridFileName() );
for ( auto collection : m_caseCollections )
auto summaryFileName = helper.findSummaryFileCandidates();
for ( const auto& candidateFileName : summaryFileName )
{
for ( RimSummaryCase* sumCase : collection->allSummaryCases() )
auto summaryCase = findSummaryCaseFromFileName( candidateFileName );
if ( summaryCase )
{
RimGridSummaryCase* gridSummaryCase = dynamic_cast<RimGridSummaryCase*>( sumCase );
if ( gridSummaryCase && gridSummaryCase->associatedEclipseCase()->gridFileName() == eclipseResultCase->gridFileName() )
{
return gridSummaryCase;
}
return summaryCase;
}
}
@ -147,69 +134,17 @@ RimSummaryCase* RimSummaryCaseMainCollection::findSummaryCaseFromEclipseResultCa
//--------------------------------------------------------------------------------------------------
RimSummaryCase* RimSummaryCaseMainCollection::findSummaryCaseFromFileName( const QString& fileName ) const
{
// Use QFileInfo object to compare two file names to avoid mix of '/' and '\\'
QFileInfo incomingFileInfo( fileName );
for ( RimSummaryCase* summaryCase : m_cases )
for ( const auto& summaryCase : allSummaryCases() )
{
if ( summaryCase )
if ( summaryCase->summaryHeaderFilename() == fileName )
{
QFileInfo summaryFileInfo( summaryCase->summaryHeaderFilename() );
if ( incomingFileInfo == summaryFileInfo )
{
return summaryCase;
}
}
}
for ( auto collection : m_caseCollections )
{
for ( RimSummaryCase* summaryCase : collection->allSummaryCases() )
{
if ( summaryCase )
{
QFileInfo summaryFileInfo( summaryCase->summaryHeaderFilename() );
if ( incomingFileInfo == summaryFileInfo )
{
return summaryCase;
}
}
return summaryCase;
}
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCaseMainCollection::convertGridSummaryCasesToFileSummaryCases( RimGridSummaryCase* gridSummaryCase )
{
RimFileSummaryCase* fileSummaryCase = gridSummaryCase->createFileSummaryCaseCopy();
addCaseRealizationParametersIfFound( *fileSummaryCase, fileSummaryCase->summaryHeaderFilename() );
RimSummaryCaseCollection* collection;
gridSummaryCase->firstAncestorOrThisOfType( collection );
if ( collection )
{
collection->addCase( fileSummaryCase );
collection->updateConnectedEditors();
}
else
{
this->addCase( fileSummaryCase );
this->updateConnectedEditors();
}
loadSummaryCaseData( { fileSummaryCase } );
reassignSummaryCurves( gridSummaryCase, fileSummaryCase );
removeCase( gridSummaryCase );
delete gridSummaryCase;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -575,38 +510,6 @@ void RimSummaryCaseMainCollection::loadFileSummaryCaseData( std::vector<RimFileS
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCaseMainCollection::reassignSummaryCurves( const RimGridSummaryCase* gridSummaryCase, RimFileSummaryCase* fileSummaryCase )
{
std::vector<caf::PdmFieldHandle*> referringFields;
gridSummaryCase->referringPtrFields( referringFields );
for ( caf::PdmFieldHandle* field : referringFields )
{
RimSummaryCurve* summaryCurve = dynamic_cast<RimSummaryCurve*>( field->ownerObject() );
if ( summaryCurve )
{
bool updated = false;
if ( summaryCurve->summaryCaseX() == gridSummaryCase )
{
summaryCurve->setSummaryCaseX( fileSummaryCase );
updated = true;
}
if ( summaryCurve->summaryCaseY() == gridSummaryCase )
{
summaryCurve->setSummaryCaseY( fileSummaryCase );
updated = true;
}
if ( updated )
{
summaryCurve->loadDataAndUpdate( false );
summaryCurve->updateConnectedEditors();
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -650,27 +553,8 @@ std::vector<RimSummaryCase*>
{
QCoreApplication::processEvents( QEventLoop::ExcludeUserInputEvents );
RimEclipseCase* eclCase = nullptr;
QString gridCaseFile = RifEclipseSummaryTools::findGridCaseFileFromSummaryHeaderFile( fileInfo.summaryFileName() );
if ( !gridCaseFile.isEmpty() )
{
eclCase = project->eclipseCaseFromGridFileName( gridCaseFile );
}
RimGridSummaryCase* existingGridSummaryCase =
dynamic_cast<RimGridSummaryCase*>( findSummaryCaseFromFileName( fileInfo.summaryFileName() ) );
if ( eclCase && !existingGridSummaryCase )
{
RimGridSummaryCase* newSumCase = new RimGridSummaryCase();
newSumCase->setIncludeRestartFiles( fileInfo.includeRestartFiles() );
newSumCase->setAssociatedEclipseCase( eclCase );
newSumCase->updateOptionSensitivity();
project->assignCaseIdToSummaryCase( newSumCase );
sumCases.push_back( newSumCase );
}
else
auto existingSummaryCase = findSummaryCaseFromFileName( fileInfo.summaryFileName() );
if ( !existingSummaryCase )
{
const QString& smspecFileName = fileInfo.summaryFileName();

View File

@ -24,7 +24,6 @@
#include <functional>
#include <vector>
class RimGridSummaryCase;
class RimSummaryCase;
class RimFileSummaryCase;
class RimEclipseResultCase;
@ -57,7 +56,6 @@ public:
RimSummaryCase* findSummaryCaseFromEclipseResultCase( const RimEclipseResultCase* eclResCase ) const;
RimSummaryCase* findSummaryCaseFromFileName( const QString& fileName ) const;
void convertGridSummaryCasesToFileSummaryCases( RimGridSummaryCase* gridSummaryCase );
void addCases( const std::vector<RimSummaryCase*> cases );
void addCase( RimSummaryCase* summaryCase );
@ -82,7 +80,6 @@ private:
static void loadSummaryCaseData( std::vector<RimSummaryCase*> summaryCases );
static void loadFileSummaryCaseData( std::vector<RimFileSummaryCase*> fileSummaryCases );
static void reassignSummaryCurves( const RimGridSummaryCase* fromGridCase, RimFileSummaryCase* toFileCase );
static RimSummaryCaseCollection* defaultAllocator();
void onCaseNameChanged( const SignalEmitter* emitter );

View File

@ -59,7 +59,6 @@
#include "RimSummaryCurvesData.h"
#include "RimSummaryPlotAxisFormatter.h"
#include "RimSummaryPlotControls.h"
#include "RimSummaryPlotFilterTextCurveSetEditor.h"
#include "RimSummaryPlotNameHelper.h"
#include "RimSummaryTimeAxisProperties.h"
@ -161,10 +160,6 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot )
auto rightAxis = addNewAxisProperties( RiuPlotAxis::defaultRight(), "Right" );
rightAxis->setAlwaysRequired( true );
CAF_PDM_InitFieldNoDefault( &m_textCurveSetEditor, "SummaryPlotFilterTextCurveSetEditor", "Text Filter Curve Creator" );
m_textCurveSetEditor.uiCapability()->setUiTreeHidden( true );
m_textCurveSetEditor = new RimSummaryPlotFilterTextCurveSetEditor;
m_nameHelperAllCurves = std::make_unique<RimSummaryPlotNameHelper>();
CAF_PDM_InitFieldNoDefault( &m_sourceStepping, "SourceStepping", "" );
@ -1803,8 +1798,6 @@ void RimSummaryPlot::onLoadDataAndUpdate()
}
this->updateAxes();
m_textCurveSetEditor->updateTextFilter();
updateStackedCurveData();
}
@ -2914,39 +2907,6 @@ RimSummaryPlotSourceStepping* RimSummaryPlot::sourceSteppingObjectForKeyEventHan
return m_sourceStepping;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<caf::PdmFieldHandle*> RimSummaryPlot::fieldsToShowInToolbar()
{
std::vector<caf::PdmFieldHandle*> toolBarFields;
{
auto fields = m_textCurveSetEditor->fieldsToShowInToolbar();
toolBarFields.insert( std::end( toolBarFields ), std::begin( fields ), std::end( fields ) );
}
bool anyFieldsAvailableForSummary = false;
auto sourceObject = sourceSteppingObjectForKeyEventHandling();
if ( sourceObject )
{
auto fields = sourceObject->fieldsToShowInToolbar();
toolBarFields.insert( std::end( toolBarFields ), std::begin( fields ), std::end( fields ) );
anyFieldsAvailableForSummary = !fields.empty();
}
if ( !anyFieldsAvailableForSummary )
{
// Show ensemble stepping if no fields are available from summary stepping
auto fields = ensembleCurveSetCollection()->fieldsToShowInToolbar();
toolBarFields.insert( std::end( toolBarFields ), std::begin( fields ), std::end( fields ) );
}
return toolBarFields;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -59,7 +59,6 @@ class RiuSummaryQwtPlot;
class RimSummaryNameHelper;
class RimSummaryPlotNameHelper;
class RimPlotTemplateFileItem;
class RimSummaryPlotFilterTextCurveSetEditor;
class RimSummaryPlotSourceStepping;
class RiaSummaryCurveDefinition;
@ -174,8 +173,7 @@ public:
void setNormalizationEnabled( bool enable );
bool isNormalizationEnabled();
virtual RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const;
virtual std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
virtual RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const;
void setAutoScaleXEnabled( bool enabled ) override;
void setAutoScaleYEnabled( bool enabled ) override;
@ -336,8 +334,6 @@ private:
caf::PdmChildArrayField<RimPlotAxisPropertiesInterface*> m_axisPropertiesArray;
caf::PdmChildField<RimSummaryPlotFilterTextCurveSetEditor*> m_textCurveSetEditor;
std::unique_ptr<RiuSummaryPlot> m_summaryPlot;
std::unique_ptr<QwtPlotTextLabel> m_plotInfoLabel;

View File

@ -1,641 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimSummaryPlotFilterTextCurveSetEditor.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaStdStringTools.h"
#include "RiaStringListSerializer.h"
#include "RiaSummaryCurveDefinition.h"
#include "RiaTextStringTools.h"
#include "RifReaderEclipseSummary.h"
#include "RifSummaryReaderInterface.h"
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
#include "RimEclipseCase.h"
#include "RimEnsembleCurveSet.h"
#include "RimEnsembleCurveSetCollection.h"
#include "RimGridSummaryCase.h"
#include "RimGridTimeHistoryCurve.h"
#include "RimObservedDataCollection.h"
#include "RimObservedSummaryData.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimSummaryCalculationCollection.h"
#include "RimSummaryCase.h"
#include "RimSummaryCaseCollection.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSummaryCurve.h"
#include "RimSummaryCurveCollection.h"
#include "RimSummaryPlot.h"
#include "RiuPlotMainWindow.h"
#include "RiuSummaryVectorSelectionUi.h"
#include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h"
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
#include "cafPdmUiComboBoxEditor.h"
#include "cafPdmUiLabelEditor.h"
#include "cafPdmUiLineEditor.h"
#include "cafPdmUiToolBarEditor.h"
#include "cafPdmUiTreeSelectionEditor.h"
#include <QRegularExpression>
#define FILTER_TEXT_OUTDATED_TEXT "<Outdated>"
CAF_PDM_SOURCE_INIT( RimSummaryPlotFilterTextCurveSetEditor, "SummaryPlotFilterTextCurveSetEditor" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryPlotFilterTextCurveSetEditor::RimSummaryPlotFilterTextCurveSetEditor()
: m_isFieldRecentlyChangedFromGui( false )
{
CAF_PDM_InitObject( "Curve Set Filter Text" );
// clang-format off
QString filterTextHeading = "Create Summary Curves from Text";
QString filterTextShortcut = " (Ctrl + F)";
QString filterTextToolTip =
"A list of vector addresses separated by spaces using the syntax: <vectorshortname>[:<item>[:<subitem>[:i,j,k]]]\n"
"Wildcards can also be used. Examples:\n"
" \"WOPT:*\" One total oil production curve for each well.\n"
" \"FOPT FWPT\" Two curves with oil and water total production.\n"
" \"BPR:15,28,*\" (no space) Oil phase pressure for all blocks along k as separate curves.\n";
// clang-format on
QString toolTipPropertyEditor = filterTextHeading + "\n\n" + filterTextToolTip;
QString toolTipToolbar = filterTextHeading + filterTextShortcut + "\n\n" + filterTextToolTip;
CAF_PDM_InitFieldNoDefault( &m_curveFilterLabelText, "Summary", "Summary" );
m_curveFilterLabelText.uiCapability()->setUiEditorTypeName( caf::PdmUiLabelEditor::uiEditorTypeName() );
m_curveFilterLabelText.xmlCapability()->disableIO();
CAF_PDM_InitFieldNoDefault( &m_curveFilterText, "CurveFilterText", "Curve Filter Text", "", toolTipPropertyEditor, "" );
m_curveFilterText.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
m_curveFilterText.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() );
// Special tool tip for toolbar
m_curveFilterText.uiCapability()->setUiToolTip( toolTipToolbar, caf::PdmUiToolBarEditor::uiEditorConfigName() );
CAF_PDM_InitFieldNoDefault( &m_selectedSources, "SummaryCases", "Sources" );
m_selectedSources.uiCapability()->setAutoAddingOptionFromValue( false );
m_selectedSources.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
m_selectedSources.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryPlotFilterTextCurveSetEditor::~RimSummaryPlotFilterTextCurveSetEditor()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<caf::PdmFieldHandle*> RimSummaryPlotFilterTextCurveSetEditor::fieldsToShowInToolbar()
{
std::vector<caf::PdmFieldHandle*> fields;
fields.push_back( &m_curveFilterLabelText );
fields.push_back( &m_curveFilterText );
return fields;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimSummaryPlotFilterTextCurveSetEditor::curveFilterFieldKeyword()
{
return "CurveFilterText";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotFilterTextCurveSetEditor::updateTextFilter()
{
RimSummaryPlot* parentPlot;
this->firstAncestorOrThisOfType( parentPlot );
std::set<SummarySource*> sourcesFromExistingCurves;
std::set<RifEclipseSummaryAddress> addressesInUse;
std::vector<RigGridCellResultAddress> gridaddressesInUse;
if ( parentPlot )
{
std::vector<RimEnsembleCurveSet*> ensembleCurveSets = parentPlot->ensembleCurveSetCollection()->curveSets();
for ( auto ensCurvSet : ensembleCurveSets )
{
sourcesFromExistingCurves.insert( ensCurvSet->summaryCaseCollection() );
addressesInUse.insert( ensCurvSet->summaryAddress() );
}
std::vector<RimSummaryCurve*> sumCurves = parentPlot->summaryCurveCollection()->curves();
for ( auto sumCurve : sumCurves )
{
sourcesFromExistingCurves.insert( sumCurve->summaryCaseY() );
addressesInUse.insert( sumCurve->summaryAddressY() );
}
std::vector<RimGridTimeHistoryCurve*> gridTimeHistoryCurves = parentPlot->gridTimeHistoryCurves();
for ( auto grCurve : gridTimeHistoryCurves )
{
RimEclipseCase* eclCase = dynamic_cast<RimEclipseCase*>( grCurve->gridCase() );
if ( eclCase )
{
sourcesFromExistingCurves.insert( eclCase );
gridaddressesInUse.push_back( grCurve->resultAddress() );
}
}
}
std::vector<caf::PdmPointer<SummarySource>> usedSources( sourcesFromExistingCurves.begin(), sourcesFromExistingCurves.end() );
if ( !usedSources.empty() )
{
m_selectedSources.clearWithoutDelete();
m_selectedSources.setValue( usedSources );
}
// Check if existing filter text matches all the curves
// Todo: possibly check grid time history curves also
QStringList allCurveAddressFilters = RiaTextStringTools::splitSkipEmptyParts( curveFilterTextWithoutOutdatedLabel(), QRegExp( "\\s+" ) );
std::vector<bool> usedFilters;
std::set<RifEclipseSummaryAddress> filteredAddressesFromSource;
RicSummaryPlotFeatureImpl::insertFilteredAddressesInSet( allCurveAddressFilters, addressesInUse, &filteredAddressesFromSource, &usedFilters );
if ( filteredAddressesFromSource != addressesInUse )
{
// m_curveFilterText = FILTER_TEXT_OUTDATED_TEXT + curveFilterTextWithoutOutdatedLabel();
m_curveFilterText = "";
}
else
{
m_curveFilterText = curveFilterTextWithoutOutdatedLabel();
}
m_curveFilterText.uiCapability()->updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotFilterTextCurveSetEditor::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
updateParentPlot();
if ( changedField == &m_curveFilterText )
{
m_curveFilterText = curveFilterTextWithoutOutdatedLabel();
{
RiaStringListSerializer stringListSerializer( curveFilterRecentlyUsedRegistryKey() );
int maxItemCount = 10;
stringListSerializer.addString( m_curveFilterText, maxItemCount );
}
m_curveFilterText.uiCapability()->updateConnectedEditors();
}
m_isFieldRecentlyChangedFromGui = true;
if ( RiaGuiApplication::isRunning() )
{
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
if ( mainPlotWindow )
{
mainPlotWindow->updateMultiPlotToolBar();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotFilterTextCurveSetEditor::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_curveFilterText );
uiOrdering.add( &m_selectedSources );
uiOrdering.skipRemainingFields();
if ( !m_isFieldRecentlyChangedFromGui )
{
updateTextFilter();
}
m_isFieldRecentlyChangedFromGui = false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotFilterTextCurveSetEditor::setupBeforeSave()
{
m_curveFilterText = curveFilterTextWithoutOutdatedLabel();
// If a source case has been deleted, make sure null pointers are removed
m_selectedSources.removePtr( nullptr );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotFilterTextCurveSetEditor::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{
if ( field == &m_curveFilterText )
{
auto attr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
if ( attr )
{
attr->enableEditableContent = true;
attr->adjustWidthToContents = true;
attr->placeholderText = "Click to edit curves";
if ( uiConfigName == caf::PdmUiToolBarEditor::uiEditorConfigName() )
{
attr->minimumWidth = 140;
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimSummaryPlotFilterTextCurveSetEditor::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_selectedSources )
{
appendOptionItemsForSources( options );
}
if ( fieldNeedingOptions == &m_curveFilterText )
{
RiaStringListSerializer stringListSerializer( curveFilterRecentlyUsedRegistryKey() );
for ( const auto& s : stringListSerializer.textStrings() )
{
options.push_back( caf::PdmOptionItemInfo( s, s ) );
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotFilterTextCurveSetEditor::appendOptionItemsForSources( QList<caf::PdmOptionItemInfo>& options )
{
RimProject* proj = RimProject::current();
std::vector<RimOilField*> oilFields;
proj->allOilFields( oilFields );
for ( RimOilField* oilField : oilFields )
{
RimSummaryCaseMainCollection* sumCaseMainColl = oilField->summaryCaseMainCollection();
if ( sumCaseMainColl )
{
// Top level cases
for ( const auto& sumCase : sumCaseMainColl->topLevelSummaryCases() )
{
options.push_back( caf::PdmOptionItemInfo( sumCase->displayCaseName(), sumCase ) );
}
// Ensembles
bool ensembleHeaderCreated = false;
for ( const auto& sumCaseColl : sumCaseMainColl->summaryCaseCollections() )
{
if ( !sumCaseColl->isEnsemble() ) continue;
if ( !ensembleHeaderCreated )
{
options.push_back( caf::PdmOptionItemInfo::createHeader( "Ensembles", true ) );
ensembleHeaderCreated = true;
}
auto optionItem = caf::PdmOptionItemInfo( sumCaseColl->name(), sumCaseColl );
optionItem.setLevel( 1 );
options.push_back( optionItem );
}
// Grouped cases
for ( const auto& sumCaseColl : sumCaseMainColl->summaryCaseCollections() )
{
if ( sumCaseColl->isEnsemble() ) continue;
options.push_back( caf::PdmOptionItemInfo::createHeader( sumCaseColl->name(), true ) );
for ( const auto& sumCase : sumCaseColl->allSummaryCases() )
{
auto optionItem = caf::PdmOptionItemInfo( sumCase->displayCaseName(), sumCase );
optionItem.setLevel( 1 );
options.push_back( optionItem );
}
}
// Observed data
auto observedDataColl = oilField->observedDataCollection();
if ( observedDataColl->allObservedSummaryData().size() > 0 )
{
options.push_back( caf::PdmOptionItemInfo::createHeader( "Observed Data", true ) );
for ( const auto& obsData : observedDataColl->allObservedSummaryData() )
{
auto optionItem = caf::PdmOptionItemInfo( obsData->caseName(), obsData );
optionItem.setLevel( 1 );
options.push_back( optionItem );
}
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<SummarySource*> RimSummaryPlotFilterTextCurveSetEditor::selectedSummarySources() const
{
std::vector<SummarySource*> sources;
for ( const auto& source : m_selectedSources )
{
sources.push_back( source );
}
return sources;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimSummaryPlotFilterTextCurveSetEditor::curveFilterTextWithoutOutdatedLabel() const
{
QString filterText = m_curveFilterText();
if ( filterText.startsWith( FILTER_TEXT_OUTDATED_TEXT ) )
{
return filterText.right( filterText.length() - QString( FILTER_TEXT_OUTDATED_TEXT ).length() );
}
return filterText;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotFilterTextCurveSetEditor::updateParentPlot()
{
RimSummaryPlot* parentPlot;
this->firstAncestorOrThisOfType( parentPlot );
if ( parentPlot )
{
// Remove all curves, Create new ones
parentPlot->ensembleCurveSetCollection()->deleteAllCurveSets();
parentPlot->deleteAllSummaryCurves();
parentPlot->deleteAllGridTimeHistoryCurves();
std::set<RiaSummaryCurveDefinition> curveDefinitions;
QStringList allCurveAddressFilters =
RiaTextStringTools::splitSkipEmptyParts( curveFilterTextWithoutOutdatedLabel(), QRegExp( "\\s+" ) );
std::vector<bool> accumulatedUsedFilters( allCurveAddressFilters.size(), false );
for ( SummarySource* currSource : selectedSummarySources() )
{
std::set<RifEclipseSummaryAddress> allAddressesFromSource = addressesForSource( currSource );
std::vector<bool> usedFilters;
std::set<RifEclipseSummaryAddress> filteredAddressesFromSource;
insertFilteredAddressesInSet( allCurveAddressFilters, allAddressesFromSource, &filteredAddressesFromSource, &usedFilters );
for ( size_t fIdx = 0; fIdx < accumulatedUsedFilters.size(); ++fIdx )
{
accumulatedUsedFilters[fIdx] = accumulatedUsedFilters[fIdx] || usedFilters[fIdx];
}
auto sumCase = dynamic_cast<RimSummaryCase*>( currSource );
auto ensemble = dynamic_cast<RimSummaryCaseCollection*>( currSource );
for ( const auto& filteredAddress : filteredAddressesFromSource )
{
if ( sumCase )
{
curveDefinitions.insert( RiaSummaryCurveDefinition( sumCase, filteredAddress, ensemble != nullptr ) );
}
else if ( ensemble )
{
curveDefinitions.insert( RiaSummaryCurveDefinition( ensemble, filteredAddress ) );
}
}
}
// Find potensial grid result addresses
QRegularExpression gridAddressPattern( "^[A-Z]+:[0-9]+,[0-9]+,[0-9]+$" );
QStringList gridResultAddressFilters;
for ( int filterIdx = 0; filterIdx < allCurveAddressFilters.size(); ++filterIdx )
{
if ( !accumulatedUsedFilters[filterIdx] )
{
const QString& unusedAddressFilter = allCurveAddressFilters[filterIdx];
if ( gridAddressPattern.match( unusedAddressFilter ).hasMatch() )
{
gridResultAddressFilters.push_back( unusedAddressFilter );
}
else
{
RiaLogging::warning( "No summary or restart vectors matched \"" + unusedAddressFilter + "\"" );
}
}
}
// Create Summary curves and Ensemble curvesets:
for ( const RiaSummaryCurveDefinition& curveDef : curveDefinitions )
{
if ( curveDef.isEnsembleCurve() )
{
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
curveSet->setSummaryCaseCollection( curveDef.ensemble() );
curveSet->setSummaryAddressAndStatisticsFlag( curveDef.summaryAddress() );
parentPlot->ensembleCurveSetCollection()->addCurveSet( curveSet );
}
else
{
RimSummaryCurve* newCurve = new RimSummaryCurve();
parentPlot->addCurveNoUpdate( newCurve );
if ( curveDef.summaryCase() )
{
newCurve->setSummaryCaseY( curveDef.summaryCase() );
}
newCurve->setSummaryAddressYAndApplyInterpolation( curveDef.summaryAddress() );
}
}
// create Grid time history curves
{
std::vector<RimEclipseCase*> gridCasesToPlotFrom;
for ( SummarySource* currSource : selectedSummarySources() )
{
RimGridSummaryCase* gridSumCase = dynamic_cast<RimGridSummaryCase*>( currSource );
if ( gridSumCase )
{
RimEclipseCase* eclCase = gridSumCase->associatedEclipseCase();
if ( eclCase )
{
gridCasesToPlotFrom.push_back( eclCase );
}
}
}
bool isEnsembleMode = gridCasesToPlotFrom.size() > 1;
int curveColorIndex = 0;
for ( const QString& gridAddressFilter : gridResultAddressFilters )
{
std::vector<RigGridCellResultAddress> cellResAddrs =
RigGridCellResultAddress::createGridCellAddressesFromFilter( gridAddressFilter );
for ( RigGridCellResultAddress cellResAddr : cellResAddrs )
{
for ( RimEclipseCase* eclCase : gridCasesToPlotFrom )
{
RigCaseCellResultsData* gridCellResults =
eclCase->eclipseCaseData()->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
if ( !( gridCellResults && gridCellResults->resultInfo( cellResAddr.eclipseResultAddress ) ) )
{
RiaLogging::warning( "Could not find a restart result property with name: \"" +
cellResAddr.eclipseResultAddress.resultName() + "\"" );
continue;
}
RimGridTimeHistoryCurve* newCurve = new RimGridTimeHistoryCurve();
newCurve->setFromEclipseCellAndResult( eclCase,
cellResAddr.gridIndex,
cellResAddr.i,
cellResAddr.j,
cellResAddr.k,
cellResAddr.eclipseResultAddress );
newCurve->setLineThickness( 2 );
newCurve->setColor( RicWellLogPlotCurveFeatureImpl::curveColorFromTable( curveColorIndex ) );
if ( !isEnsembleMode ) ++curveColorIndex;
parentPlot->addGridTimeHistoryCurveNoUpdate( newCurve );
}
if ( isEnsembleMode ) ++curveColorIndex;
}
}
}
parentPlot->applyDefaultCurveAppearances();
parentPlot->loadDataAndUpdate();
parentPlot->zoomAll();
m_isFieldRecentlyChangedFromGui = true;
parentPlot->updateConnectedEditors();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<RifEclipseSummaryAddress> RimSummaryPlotFilterTextCurveSetEditor::addressesForSource( SummarySource* summarySource )
{
auto* ensemble = dynamic_cast<RimSummaryCaseCollection*>( summarySource );
if ( ensemble )
{
return ensemble->ensembleSummaryAddresses();
}
auto* sumCase = dynamic_cast<RimSummaryCase*>( summarySource );
if ( sumCase )
{
RifSummaryReaderInterface* reader = sumCase ? sumCase->summaryReader() : nullptr;
if ( reader )
{
return reader->allResultAddresses();
}
}
return {};
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotFilterTextCurveSetEditor::insertFilteredAddressesInSet( const QStringList& curveFilters,
const std::set<RifEclipseSummaryAddress>& allAddressesInCase,
std::set<RifEclipseSummaryAddress>* setToInsertFilteredAddressesIn,
std::vector<bool>* usedFilters )
{
std::set<RifEclipseSummaryAddress> candidateAddresses;
RicSummaryPlotFeatureImpl::insertFilteredAddressesInSet( curveFilters, allAddressesInCase, &candidateAddresses, usedFilters );
if ( !m_includeDiffCurves )
{
std::set<RifEclipseSummaryAddress> tmp;
const auto diffText = RifReaderEclipseSummary::differenceIdentifier();
for ( const auto& adr : candidateAddresses )
{
if ( RiaStdStringTools::endsWith( adr.vectorName(), diffText ) ) continue;
tmp.insert( adr );
}
std::swap( tmp, candidateAddresses );
}
setToInsertFilteredAddressesIn->insert( candidateAddresses.begin(), candidateAddresses.end() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimSummaryPlotFilterTextCurveSetEditor::curveFilterRecentlyUsedRegistryKey()
{
return "curveFilterRecentlyUsedStrings";
}

View File

@ -1,72 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPtrArrayField.h"
using SummarySource = caf::PdmObject;
class RifEclipseSummaryAddress;
class RimSummaryPlotFilterTextCurveSetEditor : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimSummaryPlotFilterTextCurveSetEditor();
~RimSummaryPlotFilterTextCurveSetEditor() override;
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
static QString curveFilterFieldKeyword();
void updateTextFilter();
protected:
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void setupBeforeSave() override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
private:
static void appendOptionItemsForSources( QList<caf::PdmOptionItemInfo>& options );
std::vector<SummarySource*> selectedSummarySources() const;
QString curveFilterTextWithoutOutdatedLabel() const;
void updateParentPlot();
static std::set<RifEclipseSummaryAddress> addressesForSource( SummarySource* summarySource );
void insertFilteredAddressesInSet( const QStringList& curveFilters,
const std::set<RifEclipseSummaryAddress>& allAddressesInCase,
std::set<RifEclipseSummaryAddress>* setToInsertFilteredAddressesIn,
std::vector<bool>* usedFilters );
static QString curveFilterRecentlyUsedRegistryKey();
private:
caf::PdmPtrArrayField<SummarySource*> m_selectedSources;
caf::PdmField<QString> m_curveFilterLabelText;
caf::PdmField<QString> m_curveFilterText;
caf::PdmField<bool> m_includeDiffCurves;
bool m_isFieldRecentlyChangedFromGui;
};

View File

@ -37,7 +37,6 @@
#include "RimSummaryMultiPlot.h"
#include "RimSummaryMultiPlotCollection.h"
#include "RimSummaryPlot.h"
#include "RimSummaryPlotFilterTextCurveSetEditor.h"
#include "RimSummaryPlotManager.h"
#include "RimViewWindow.h"
#include "RimWellAllocationPlot.h"