Added grouping of small contributions to well distribution plot

This commit is contained in:
sigurdp
2019-12-17 15:43:05 +01:00
committed by Magne Sjaastad
parent bf61c76e51
commit 260ff04b19
5 changed files with 51 additions and 21 deletions

View File

@@ -65,6 +65,8 @@ RimWellDistributionPlot::RimWellDistributionPlot(RiaDefines::PhaseType phase)
CAF_PDM_InitField(&m_timeStepIndex, "TimeStepIndex", -1, "Time Step", "", "", "");
CAF_PDM_InitField(&m_wellName, "WellName", QString("None"), "Well", "", "", "");
CAF_PDM_InitField(&m_phase, "Phase", caf::AppEnum<RiaDefines::PhaseType>(phase), "Phase", "", "", "");
CAF_PDM_InitField(&m_groupSmallContributions, "GroupSmallContributions", true, "Group Small Contributions", "", "", "");
CAF_PDM_InitField(&m_smallContributionsRelativeThreshold, "SmallContributionsRelativeThreshold", 0.005, "Relative Threshold [0, 1]", "", "", "");
m_showWindow = false;
m_showPlotLegends = true;
@@ -87,6 +89,15 @@ void RimWellDistributionPlot::setDataSourceParameters(RimEclipseResultCase* ecli
m_wellName = targetWellName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellDistributionPlot::setPlotOptions(bool groupSmallContributions, double smallContributionsRelativeThreshold)
{
m_groupSmallContributions = groupSmallContributions;
m_smallContributionsRelativeThreshold = smallContributionsRelativeThreshold;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -329,8 +340,11 @@ void RimWellDistributionPlot::onLoadDataAndUpdate()
RigTofWellDistributionCalculator calc(m_case, m_wellName, m_timeStepIndex, m_phase());
//tim.reportLapTimeMS("calc");
//calc.groupSmallContributions(0.005);
//tim.reportLapTimeMS("group");
if (m_groupSmallContributions)
{
calc.groupSmallContributions(m_smallContributionsRelativeThreshold);
//tim.reportLapTimeMS("group");
}
const RimFlowDiagSolution* flowDiagSolution = m_case->defaultFlowDiagSolution();
@@ -422,11 +436,14 @@ void RimWellDistributionPlot::populatePlotWidgetWithCurveData(const RigTofWellDi
//--------------------------------------------------------------------------------------------------
void RimWellDistributionPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Plot Data");
group->add(&m_case);
group->add(&m_timeStepIndex);
group->add(&m_wellName);
group->add(&m_phase);
uiOrdering.add(&m_case);
uiOrdering.add(&m_timeStepIndex);
uiOrdering.add(&m_wellName);
uiOrdering.add(&m_phase);
uiOrdering.add(&m_groupSmallContributions);
uiOrdering.add(&m_smallContributionsRelativeThreshold);
m_smallContributionsRelativeThreshold.uiCapability()->setUiReadOnly(m_groupSmallContributions == false);
RimPlot::defineUiOrdering(uiConfigName, uiOrdering);
//uiOrdering.skipRemainingFields();