From baf00eaeab8355686d87d34a1553b8f30d3ab02e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 16 Jan 2019 13:51:13 +0100 Subject: [PATCH] #3968 Ensemble : Not possible to plot two ensembles at the same time Due to wrong usage of cached number of curves, curves will not be added in some cases. Multiple checking of check boxes will work as a workaround. --- .../UserInterface/RiuSummaryCurveDefSelection.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/UserInterface/RiuSummaryCurveDefSelection.cpp b/ApplicationCode/UserInterface/RiuSummaryCurveDefSelection.cpp index c5dde90a83..b3dcc8aff1 100644 --- a/ApplicationCode/UserInterface/RiuSummaryCurveDefSelection.cpp +++ b/ApplicationCode/UserInterface/RiuSummaryCurveDefSelection.cpp @@ -557,12 +557,16 @@ void RiuSummaryCurveDefSelection::fieldChangedByUi(const caf::PdmFieldHandle* ch size_t curveCount = allCurveDefinitionsFromSelection().size(); size_t curveSetCount = allCurveSetDefinitionsFromSelections().size(); - if (m_toggleChangedHandler != nullptr && (curveCount != m_prevCurveCount || curveSetCount != m_prevCurveSetCount)) + if (m_toggleChangedHandler != nullptr) { - m_toggleChangedHandler(); + // Do nothing if the curve count and curve set count is identical + if ((curveCount != m_prevCurveCount || curveSetCount != m_prevCurveSetCount)) + { + m_toggleChangedHandler(); - m_prevCurveCount = curveCount; - m_prevCurveSetCount = curveSetCount; + m_prevCurveCount = curveCount; + m_prevCurveSetCount = curveSetCount; + } } } @@ -1204,6 +1208,9 @@ void RiuSummaryCurveDefSelection::resetAllFields() a->pdmField()->v().clear(); } } + + m_prevCurveCount = 0; + m_prevCurveSetCount = 0; } //--------------------------------------------------------------------------------------------------