mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-10 08:03:05 -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:
parent
6e0c6b89b1
commit
272c328da3
@ -30,6 +30,8 @@
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
@ -159,6 +161,19 @@ void RicCloseCaseFeature::deleteEclipseCase(RimEclipseCase* 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;
|
||||
}
|
||||
|
||||
@ -178,6 +193,19 @@ void RicCloseCaseFeature::deleteGeoMechCase(RimGeoMechCase* geoMechCase)
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "cafPdmUiTreeView.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RigEclipseWellLogExtractor.h"
|
||||
@ -125,3 +126,53 @@ RimWellLogPlot* RimWellLogPlotCollection::wellLogPlotFromViewer(RiuWellLogPlot*
|
||||
|
||||
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 RigGeoMechWellLogExtractor;
|
||||
class RimGeoMechCase;
|
||||
class RigCaseData;
|
||||
class RigGeoMechCaseData;
|
||||
class RigWellPath;
|
||||
class RimWellPath;
|
||||
class RimEclipseCase;
|
||||
class RiuWellLogPlot;
|
||||
@ -46,6 +49,10 @@ public:
|
||||
RigEclipseWellLogExtractor* findOrCreateExtractor(RimWellPath* wellPath, RimEclipseCase* 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;
|
||||
|
||||
caf::PdmChildArrayField<RimWellLogPlot*> wellLogPlots;
|
||||
|
@ -25,6 +25,9 @@
|
||||
#include "RimTools.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RivWellPathPartMgr.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
@ -102,6 +105,21 @@ RimWellPath::~RimWellPath()
|
||||
{
|
||||
delete m_wellLogFile;
|
||||
}
|
||||
|
||||
RimProject* project;
|
||||
firstAnchestorOrThisOfType(project);
|
||||
if (project)
|
||||
{
|
||||
if (project->mainPlotCollection())
|
||||
{
|
||||
RimWellLogPlotCollection* plotCollection = project->mainPlotCollection()->wellLogPlotCollection();
|
||||
if (plotCollection)
|
||||
{
|
||||
plotCollection->removeExtractors(m_wellPath.p());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user