When no ternary component is present, hide TERNARY result

This commit is contained in:
Magne Sjaastad 2014-05-09 07:34:27 +02:00
parent 071abb2c97
commit dbdd28fcde
2 changed files with 8 additions and 2 deletions

View File

@ -1453,7 +1453,8 @@ void RimReservoirView::updateLegends()
viewer()->removeOverlayItem(this->cellResult()->ternaryLegendConfig->legend());
if (this->cellResult()->isTernarySaturationSelected())
size_t maxTimeStepCount = results->maxTimeStepCount();
if (this->cellResult()->isTernarySaturationSelected() && maxTimeStepCount > 1)
{
RimReservoirCellResultsStorage* gridCellResults = this->cellResult()->currentGridCellResults();
{

View File

@ -178,7 +178,12 @@ QList<caf::PdmOptionItemInfo> RimResultDefinition::calculateValueOptions(const c
optionList.push_front(caf::PdmOptionItemInfo(RimDefines::combinedTransmissibilityResultName(), RimDefines::combinedTransmissibilityResultName()));
}
if (m_resultTypeUiField == RimDefines::DYNAMIC_NATIVE)
bool hasAtLeastOneTernaryComponent = false;
if (varList.contains("SOIL")) hasAtLeastOneTernaryComponent = true;
else if (varList.contains("SGAS")) hasAtLeastOneTernaryComponent = true;
else if (varList.contains("SWAT")) hasAtLeastOneTernaryComponent = true;
if (m_resultTypeUiField == RimDefines::DYNAMIC_NATIVE && hasAtLeastOneTernaryComponent)
{
optionList.push_front(caf::PdmOptionItemInfo(RimDefines::ternarySaturationResultName(), RimDefines::ternarySaturationResultName()));
}