#4076 Result difference options : Show result diff on "Cell Result"

This commit is contained in:
Magne Sjaastad 2019-02-13 09:37:02 +01:00
parent d9da9a7752
commit 237f31ca17
3 changed files with 28 additions and 7 deletions

View File

@ -73,6 +73,7 @@ CAF_PDM_SOURCE_INIT(RimEclipseResultDefinition, "ResultDefinition");
///
//--------------------------------------------------------------------------------------------------
RimEclipseResultDefinition::RimEclipseResultDefinition()
: m_showUiForDerivedDifferenceResults(false)
{
CAF_PDM_InitObject("Result Definition", "", "", "");
@ -1102,6 +1103,14 @@ void RimEclipseResultDefinition::updateUiFieldsFromActiveResult()
m_resultVariableUiField = resultVariable();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::enableUiForDerivedDifferenceResults()
{
m_showUiForDerivedDifferenceResults = true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -1208,17 +1217,25 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
uiOrdering.add(&m_resultVariableUiField);
}
if (m_resultTypeUiField() == RiaDefines::DYNAMIC_NATIVE || m_resultTypeUiField() == RiaDefines::STATIC_NATIVE ||
m_resultTypeUiField() == RiaDefines::GENERATED)
if (m_showUiForDerivedDifferenceResults)
{
caf::PdmUiGroup* differenceGroup = uiOrdering.addNewGroup("Difference Options");
// NOTE
//
// It is possible to use the case/time diff results in property filter, fault result, etc
// but to limit the number of UI items, the time/case diff is only available as part of "Cell Result"
if (m_resultTypeUiField() == RiaDefines::DYNAMIC_NATIVE)
if (m_resultTypeUiField() == RiaDefines::DYNAMIC_NATIVE || m_resultTypeUiField() == RiaDefines::STATIC_NATIVE ||
m_resultTypeUiField() == RiaDefines::GENERATED)
{
differenceGroup->add(&m_timeLapseBaseTimestepUiField);
}
caf::PdmUiGroup* differenceGroup = uiOrdering.addNewGroup("Difference Options");
differenceGroup->add(&m_differenceCaseUiField);
if (m_resultTypeUiField() == RiaDefines::DYNAMIC_NATIVE)
{
differenceGroup->add(&m_timeLapseBaseTimestepUiField);
}
differenceGroup->add(&m_differenceCaseUiField);
}
}
uiOrdering.skipRemainingFields(true);

View File

@ -116,6 +116,7 @@ public:
void updateUiFieldsFromActiveResult();
void enableUiForDerivedDifferenceResults();
protected:
virtual void updateLegendCategorySettings() {};
@ -208,5 +209,7 @@ private:
bool isTimeDiffResult() const;
bool isCaseDifferenceResult() const;
bool m_showUiForDerivedDifferenceResults;
};

View File

@ -121,6 +121,7 @@ RimEclipseView::RimEclipseView()
CAF_PDM_InitFieldNoDefault(&m_cellResult, "GridCellResult", "Cell Result", ":/CellResult.png", "", "");
m_cellResult = new RimEclipseCellColors();
m_cellResult.uiCapability()->setUiHidden(true);
m_cellResult->enableUiForDerivedDifferenceResults();
CAF_PDM_InitFieldNoDefault(&m_cellEdgeResult, "GridCellEdgeResult", "Cell Edge Result", ":/EdgeResult_1.png", "", "");
m_cellEdgeResult = new RimCellEdgeColors();