From c613c389f3029bf89e68de69226ab009461f7d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Thu, 2 Feb 2017 16:08:37 +0100 Subject: [PATCH] #1118 When no tracer data is available, show the total well flow instead. --- .../Flow/RimWellAllocationPlot.cpp | 22 +++++++++++-------- .../ProjectDataModel/RimWellLogPlot.h | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index 091016f94e..8fc067f32a 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -194,14 +194,17 @@ void RimWellAllocationPlot::updateFromWell() } } - RigEclCellIndexCalculator cellIdxCalc(m_case->reservoirData()->mainGrid(), m_case->reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)); - wfCalculator.reset(new RigAccWellFlowCalculator(pipeBranchesCLCoords, - pipeBranchesCellIds, - tracerCellFractionValues, - cellIdxCalc)); - + if ( tracerCellFractionValues.size() ) + { + RigEclCellIndexCalculator cellIdxCalc(m_case->reservoirData()->mainGrid(), m_case->reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)); + wfCalculator.reset(new RigAccWellFlowCalculator(pipeBranchesCLCoords, + pipeBranchesCellIds, + tracerCellFractionValues, + cellIdxCalc)); + } } - else + + if (!wfCalculator) { if (pipeBranchesCLCoords.size() > 0) { @@ -249,6 +252,8 @@ void RimWellAllocationPlot::updateFromWell() } + setDescription(m_wellName + " - Allocation"); + /// Pie chart m_totalWellAllocationPlot->clearSlices(); @@ -284,10 +289,9 @@ void RimWellAllocationPlot::updateFromWell() } } } + m_totalWellAllocationPlot->updateConnectedEditors(); - setDescription("Well Allocation (" + m_wellName + ")"); - accumulatedWellFlowPlot()->updateConnectedEditors(); } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h index df7fb5881b..8c961158a1 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h @@ -74,7 +74,7 @@ public: RimWellLogTrack* trackByIndex(size_t index); - void loadDataAndUpdate(); + virtual void loadDataAndUpdate() override; void updateTracks(); void updateTrackNames();