mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#579) Removing cached well log extractors when deleting cases and well paths
Cached well log extractors with references to well paths or cases to be deleted are removed before deletion.
This commit is contained in:
@@ -30,6 +30,8 @@
|
|||||||
#include "RimIdenticalGridCaseGroup.h"
|
#include "RimIdenticalGridCaseGroup.h"
|
||||||
#include "RimOilField.h"
|
#include "RimOilField.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
#include "RimMainPlotCollection.h"
|
||||||
|
#include "RimWellLogPlotCollection.h"
|
||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
@@ -159,6 +161,19 @@ void RicCloseCaseFeature::deleteEclipseCase(RimEclipseCase* eclipseCase)
|
|||||||
removeCaseFromAllGroups(eclipseCase);
|
removeCaseFromAllGroups(eclipseCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
|
if (project)
|
||||||
|
{
|
||||||
|
if (project->mainPlotCollection())
|
||||||
|
{
|
||||||
|
RimWellLogPlotCollection* plotCollection = project->mainPlotCollection()->wellLogPlotCollection();
|
||||||
|
if (plotCollection)
|
||||||
|
{
|
||||||
|
plotCollection->removeExtractors(eclipseCase->reservoirData());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delete eclipseCase;
|
delete eclipseCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,6 +193,19 @@ void RicCloseCaseFeature::deleteGeoMechCase(RimGeoMechCase* geoMechCase)
|
|||||||
models->updateConnectedEditors();
|
models->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
|
if (project)
|
||||||
|
{
|
||||||
|
if (project->mainPlotCollection())
|
||||||
|
{
|
||||||
|
RimWellLogPlotCollection* plotCollection = project->mainPlotCollection()->wellLogPlotCollection();
|
||||||
|
if (plotCollection)
|
||||||
|
{
|
||||||
|
plotCollection->removeExtractors(geoMechCase->geoMechData());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delete geoMechCase;
|
delete geoMechCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "cafPdmUiTreeView.h"
|
#include "cafPdmUiTreeView.h"
|
||||||
#include "RigCaseData.h"
|
#include "RigCaseData.h"
|
||||||
|
#include "RigGeoMechCaseData.h"
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RigEclipseWellLogExtractor.h"
|
#include "RigEclipseWellLogExtractor.h"
|
||||||
@@ -125,3 +126,53 @@ RimWellLogPlot* RimWellLogPlotCollection::wellLogPlotFromViewer(RiuWellLogPlot*
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogPlotCollection::removeExtractors(const RigWellPath* wellPath)
|
||||||
|
{
|
||||||
|
for (int eIdx = (int) m_extractors.size() - 1; eIdx >= 0; eIdx--)
|
||||||
|
{
|
||||||
|
if (m_extractors[eIdx]->wellPathData() == wellPath)
|
||||||
|
{
|
||||||
|
m_extractors.eraseAt(eIdx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int eIdx = (int) m_geomExtractors.size() - 1; eIdx >= 0; eIdx--)
|
||||||
|
{
|
||||||
|
if (m_geomExtractors[eIdx]->wellPathData() == wellPath)
|
||||||
|
{
|
||||||
|
m_geomExtractors.eraseAt(eIdx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogPlotCollection::removeExtractors(const RigCaseData* caseData)
|
||||||
|
{
|
||||||
|
for (int eIdx = (int) m_extractors.size() - 1; eIdx >= 0; eIdx--)
|
||||||
|
{
|
||||||
|
if (m_extractors[eIdx]->caseData() == caseData)
|
||||||
|
{
|
||||||
|
m_extractors.eraseAt(eIdx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogPlotCollection::removeExtractors(const RigGeoMechCaseData* caseData)
|
||||||
|
{
|
||||||
|
for (int eIdx = (int) m_geomExtractors.size() - 1; eIdx >= 0; eIdx--)
|
||||||
|
{
|
||||||
|
if (m_geomExtractors[eIdx]->caseData() == caseData)
|
||||||
|
{
|
||||||
|
m_geomExtractors.eraseAt(eIdx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ class RimWellLogPlot;
|
|||||||
class RigEclipseWellLogExtractor;
|
class RigEclipseWellLogExtractor;
|
||||||
class RigGeoMechWellLogExtractor;
|
class RigGeoMechWellLogExtractor;
|
||||||
class RimGeoMechCase;
|
class RimGeoMechCase;
|
||||||
|
class RigCaseData;
|
||||||
|
class RigGeoMechCaseData;
|
||||||
|
class RigWellPath;
|
||||||
class RimWellPath;
|
class RimWellPath;
|
||||||
class RimEclipseCase;
|
class RimEclipseCase;
|
||||||
class RiuWellLogPlot;
|
class RiuWellLogPlot;
|
||||||
@@ -46,6 +49,10 @@ public:
|
|||||||
RigEclipseWellLogExtractor* findOrCreateExtractor(RimWellPath* wellPath, RimEclipseCase* eclCase);
|
RigEclipseWellLogExtractor* findOrCreateExtractor(RimWellPath* wellPath, RimEclipseCase* eclCase);
|
||||||
RigGeoMechWellLogExtractor* findOrCreateExtractor(RimWellPath* wellPath, RimGeoMechCase* eclCase);
|
RigGeoMechWellLogExtractor* findOrCreateExtractor(RimWellPath* wellPath, RimGeoMechCase* eclCase);
|
||||||
|
|
||||||
|
void removeExtractors(const RigWellPath* wellPath);
|
||||||
|
void removeExtractors(const RigCaseData* caseData);
|
||||||
|
void removeExtractors(const RigGeoMechCaseData* caseData);
|
||||||
|
|
||||||
RimWellLogPlot* wellLogPlotFromViewer(RiuWellLogPlot* viewer) const;
|
RimWellLogPlot* wellLogPlotFromViewer(RiuWellLogPlot* viewer) const;
|
||||||
|
|
||||||
caf::PdmChildArrayField<RimWellLogPlot*> wellLogPlots;
|
caf::PdmChildArrayField<RimWellLogPlot*> wellLogPlots;
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include "RimTools.h"
|
#include "RimTools.h"
|
||||||
#include "RimWellLogFile.h"
|
#include "RimWellLogFile.h"
|
||||||
#include "RimWellPathCollection.h"
|
#include "RimWellPathCollection.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimMainPlotCollection.h"
|
||||||
|
#include "RimWellLogPlotCollection.h"
|
||||||
#include "RivWellPathPartMgr.h"
|
#include "RivWellPathPartMgr.h"
|
||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
@@ -102,6 +105,21 @@ RimWellPath::~RimWellPath()
|
|||||||
{
|
{
|
||||||
delete m_wellLogFile;
|
delete m_wellLogFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RimProject* project;
|
||||||
|
firstAnchestorOrThisOfType(project);
|
||||||
|
if (project)
|
||||||
|
{
|
||||||
|
if (project->mainPlotCollection())
|
||||||
|
{
|
||||||
|
RimWellLogPlotCollection* plotCollection = project->mainPlotCollection()->wellLogPlotCollection();
|
||||||
|
if (plotCollection)
|
||||||
|
{
|
||||||
|
plotCollection->removeExtractors(m_wellPath.p());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user