#4699 Guard use of TERNARY cell result in property filters

This commit is contained in:
Magne Sjaastad 2019-09-11 13:31:15 +02:00
parent da47acfc1c
commit b38904d158
2 changed files with 31 additions and 25 deletions

View File

@ -119,7 +119,11 @@ void RicEclipsePropertyFilterFeatureImpl::setDefaults(RimEclipsePropertyFilter*
propertyFilter->firstAncestorOrThisOfTypeAsserted(reservoirView);
propertyFilter->resultDefinition()->setEclipseCase( reservoirView->eclipseCase() );
if ( !RiaDefines::isPerCellFaceResult( reservoirView->cellResult()->resultVariable() ) )
{
propertyFilter->resultDefinition()->simpleCopy( reservoirView->cellResult() );
}
propertyFilter->resultDefinition()->loadResult();
propertyFilter->setToDefaultValues();

View File

@ -1529,23 +1529,6 @@ QList<caf::PdmOptionItemInfo>
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()));
}
}
if ( addPerCellFaceOptionItems )
{
for ( const QString& s : cellFaceResultNames )
@ -1559,9 +1542,28 @@ QList<caf::PdmOptionItemInfo>
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;
}