mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
If no views are created for RimReservoird, delete the current RigEclipseCase.
Then all data will be read from file as if the case was opened as a stand alone case. p4#: 20876
This commit is contained in:
@@ -98,6 +98,13 @@ RimReservoir::~RimReservoir()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimReservoirView* RimReservoir::createAndAddReservoirView()
|
RimReservoirView* RimReservoir::createAndAddReservoirView()
|
||||||
{
|
{
|
||||||
|
// If parent is collection, and number of views is zero, make sure rig is set to NULL to initiate normal case loading
|
||||||
|
if (parentCaseCollection() != NULL && reservoirViews().size() == 0)
|
||||||
|
{
|
||||||
|
CVF_ASSERT(m_rigEclipseCase->refCount() == 1);
|
||||||
|
m_rigEclipseCase = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
RimReservoirView* riv = new RimReservoirView();
|
RimReservoirView* riv = new RimReservoirView();
|
||||||
riv->setEclipseCase(this);
|
riv->setEclipseCase(this);
|
||||||
|
|
||||||
@@ -253,3 +260,20 @@ void RimReservoir::computeCachedData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimCaseCollection* RimReservoir::parentCaseCollection()
|
||||||
|
{
|
||||||
|
std::vector<RimCaseCollection*> parentObjects;
|
||||||
|
this->parentObjectsOfType(parentObjects);
|
||||||
|
|
||||||
|
if (parentObjects.size() > 0)
|
||||||
|
{
|
||||||
|
return parentObjects[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class QString;
|
|||||||
class RigEclipseCase;
|
class RigEclipseCase;
|
||||||
class RigGridBase;
|
class RigGridBase;
|
||||||
class RimReservoirView;
|
class RimReservoirView;
|
||||||
|
class RimCaseCollection;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@@ -72,6 +73,9 @@ protected:
|
|||||||
|
|
||||||
void computeCachedData();
|
void computeCachedData();
|
||||||
|
|
||||||
|
private:
|
||||||
|
RimCaseCollection* parentCaseCollection();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
cvf::ref<RigEclipseCase> m_rigEclipseCase;
|
cvf::ref<RigEclipseCase> m_rigEclipseCase;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user