mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4699 Guard use of TERNARY cell result in property filters
This commit is contained in:
parent
da47acfc1c
commit
b38904d158
@ -118,8 +118,12 @@ void RicEclipsePropertyFilterFeatureImpl::setDefaults(RimEclipsePropertyFilter*
|
||||
RimEclipseView* reservoirView = nullptr;
|
||||
propertyFilter->firstAncestorOrThisOfTypeAsserted(reservoirView);
|
||||
|
||||
propertyFilter->resultDefinition()->setEclipseCase(reservoirView->eclipseCase());
|
||||
propertyFilter->resultDefinition()->simpleCopy(reservoirView->cellResult());
|
||||
propertyFilter->resultDefinition()->setEclipseCase( reservoirView->eclipseCase() );
|
||||
|
||||
if ( !RiaDefines::isPerCellFaceResult( reservoirView->cellResult()->resultVariable() ) )
|
||||
{
|
||||
propertyFilter->resultDefinition()->simpleCopy( reservoirView->cellResult() );
|
||||
}
|
||||
|
||||
propertyFilter->resultDefinition()->loadResult();
|
||||
propertyFilter->setToDefaultValues();
|
||||
|
@ -1529,39 +1529,41 @@ QList<caf::PdmOptionItemInfo>
|
||||
optionList.push_back(caf::PdmOptionItemInfo(s, s));
|
||||
}
|
||||
|
||||
// Ternary Result
|
||||
if (ternaryEnabled)
|
||||
if ( addPerCellFaceOptionItems )
|
||||
{
|
||||
bool hasAtLeastOneTernaryComponent = false;
|
||||
if (cellCenterResultNames.contains("SOIL"))
|
||||
hasAtLeastOneTernaryComponent = true;
|
||||
else if (cellCenterResultNames.contains("SGAS"))
|
||||
hasAtLeastOneTernaryComponent = true;
|
||||
else if (cellCenterResultNames.contains("SWAT"))
|
||||
hasAtLeastOneTernaryComponent = true;
|
||||
|
||||
if (resultCatType == RiaDefines::DYNAMIC_NATIVE && hasAtLeastOneTernaryComponent)
|
||||
for ( const QString& s : cellFaceResultNames )
|
||||
{
|
||||
optionList.push_front(
|
||||
caf::PdmOptionItemInfo(RiaDefines::ternarySaturationResultName(), RiaDefines::ternarySaturationResultName()));
|
||||
}
|
||||
}
|
||||
if (addPerCellFaceOptionItems)
|
||||
{
|
||||
for (const QString& s : cellFaceResultNames)
|
||||
{
|
||||
if (showDerivedResultsFirst)
|
||||
if ( showDerivedResultsFirst )
|
||||
{
|
||||
optionList.push_front(caf::PdmOptionItemInfo(s, s));
|
||||
optionList.push_front( caf::PdmOptionItemInfo( s, s ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
optionList.push_back(caf::PdmOptionItemInfo(s, s));
|
||||
optionList.push_back( caf::PdmOptionItemInfo( s, s ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Ternary Result
|
||||
if ( ternaryEnabled )
|
||||
{
|
||||
bool hasAtLeastOneTernaryComponent = false;
|
||||
if ( cellCenterResultNames.contains( "SOIL" ) )
|
||||
hasAtLeastOneTernaryComponent = true;
|
||||
else if ( cellCenterResultNames.contains( "SGAS" ) )
|
||||
hasAtLeastOneTernaryComponent = true;
|
||||
else if ( cellCenterResultNames.contains( "SWAT" ) )
|
||||
hasAtLeastOneTernaryComponent = true;
|
||||
|
||||
if ( resultCatType == RiaDefines::DYNAMIC_NATIVE && hasAtLeastOneTernaryComponent )
|
||||
{
|
||||
optionList.push_front( caf::PdmOptionItemInfo( RiaDefines::ternarySaturationResultName(),
|
||||
RiaDefines::ternarySaturationResultName() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
optionList.push_front(caf::PdmOptionItemInfo(RiaDefines::undefinedResultName(), RiaDefines::undefinedResultName()));
|
||||
optionList.push_front(
|
||||
caf::PdmOptionItemInfo( RiaDefines::undefinedResultName(), RiaDefines::undefinedResultName() ) );
|
||||
|
||||
return optionList;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user