mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-13 17:05:59 -06:00
#950 Improved the updates, but there is still work to be done.
This commit is contained in:
parent
296dac48d3
commit
2c6e6f4a80
@ -310,8 +310,33 @@ void RimEclipseCase::updateFormationNamesData()
|
||||
std::vector<RimView*> views = this->views();
|
||||
for(RimView* view : views)
|
||||
{
|
||||
if(view && view->isUsingFormationNames())
|
||||
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>(view);
|
||||
|
||||
if(eclView && eclView->isUsingFormationNames())
|
||||
{
|
||||
if (!activeFormationNames())
|
||||
{
|
||||
if (eclView->cellResult()->resultType() == RimDefines::FORMATION_NAMES)
|
||||
{
|
||||
eclView->cellResult()->setResultVariable(RimDefines::undefinedResultName());
|
||||
}
|
||||
|
||||
RimEclipsePropertyFilterCollection* eclFilColl = eclView->eclipsePropertyFilterCollection();
|
||||
for ( RimEclipsePropertyFilter* propFilter : eclFilColl->propertyFilters )
|
||||
{
|
||||
if ( propFilter->resultDefinition->resultType() == RimDefines::FORMATION_NAMES )
|
||||
{
|
||||
propFilter->resultDefinition()->setResultVariable(RimDefines::undefinedResultName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RimEclipsePropertyFilterCollection* eclFilColl = eclView->eclipsePropertyFilterCollection();
|
||||
for ( RimEclipsePropertyFilter* propFilter : eclFilColl->propertyFilters )
|
||||
{
|
||||
if ( propFilter->resultDefinition->resultType() == RimDefines::FORMATION_NAMES ) propFilter->setToDefaultValues();
|
||||
}
|
||||
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
@ -342,7 +367,15 @@ void RimEclipseCase::computeCachedData()
|
||||
pInf.incrementProgress();
|
||||
|
||||
pInf.setProgressDescription("Calculating Formation Names Result");
|
||||
this->updateFormationNamesData();
|
||||
if ( activeFormationNames() )
|
||||
{
|
||||
rigEclipseCase->setActiveFormationNames(activeFormationNames()->formationNamesData());
|
||||
}
|
||||
else
|
||||
{
|
||||
rigEclipseCase->setActiveFormationNames(nullptr);
|
||||
}
|
||||
|
||||
pInf.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
@ -114,6 +114,24 @@ bool RimEclipsePropertyFilterCollection::hasActiveDynamicFilters() const
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipsePropertyFilterCollection::isUsingFormationNames() const
|
||||
{
|
||||
if ( !isActive ) return false;
|
||||
|
||||
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
||||
{
|
||||
RimEclipsePropertyFilter* propertyFilter = propertyFilters[i];
|
||||
if ( propertyFilter->isActive()
|
||||
&& propertyFilter->resultDefinition->resultType() == RimDefines::FORMATION_NAMES
|
||||
&& propertyFilter->resultDefinition->resultVariable() != RimDefines::undefinedResultName()) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
// Methods
|
||||
bool hasActiveFilters() const;
|
||||
bool hasActiveDynamicFilters() const;
|
||||
bool isUsingFormationNames() const;
|
||||
|
||||
void loadAndInitializePropertyFilters();
|
||||
|
||||
|
@ -1700,7 +1700,9 @@ void RimEclipseView::axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::S
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseView::isUsingFormationNames() const
|
||||
{
|
||||
return (cellResult()->resultType() == RimDefines::FORMATION_NAMES) ;
|
||||
if ((cellResult()->resultType() == RimDefines::FORMATION_NAMES)) return true;
|
||||
|
||||
return eclipsePropertyFilterCollection()->isUsingFormationNames();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user