From 9493a1dfc02189b79923835fb0b633c5bd590ac0 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 2 Feb 2017 12:52:32 +0100 Subject: [PATCH] Use hasWellResult instead of firstResultTimeStep --- .../ModelVisualization/RivSimWellPipesPartMgr.cpp | 2 +- .../RigSingleWellResultsData.cpp | 14 -------------- .../ReservoirDataModel/RigSingleWellResultsData.h | 1 - .../UserInterface/RiuResultTextBuilder.cpp | 2 +- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp b/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp index ff3237d02c..9926d01b01 100644 --- a/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp @@ -205,7 +205,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex) RigSingleWellResultsData* wRes = m_rimWell->wellResults(); if (wRes == NULL) return; - if (frameIndex < wRes->firstResultTimeStep()) return; // Or reset colors or something + if (!wRes->hasWellResult(frameIndex)) return; // Or reset colors or something const double closed = -0.1, producing = 1.5, water = 2.5, hcInjection = 3.5; // Closed set to -0.1 instead of 0.5 to workaround bug in the scalar mapper. diff --git a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp index 4cb37ea4e4..5e733241e8 100644 --- a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp @@ -95,20 +95,6 @@ bool RigSingleWellResultsData::hasWellResult(size_t resultTimeStepIndex) const return wellTimeStepIndex != cvf::UNDEFINED_SIZE_T; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -size_t RigSingleWellResultsData::firstResultTimeStep() const -{ - size_t i = 0; - for(i = 0; i < m_resultTimeStepIndexToWellTimeStepIndex.size(); ++i) - { - if (m_resultTimeStepIndexToWellTimeStepIndex[i] != cvf::UNDEFINED_SIZE_T) return i; - } - - return cvf::UNDEFINED_SIZE_T; -} - bool operator== (const RigWellResultPoint& p1, const RigWellResultPoint& p2) { return diff --git a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h index b489762d45..49fa771008 100644 --- a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h @@ -135,7 +135,6 @@ public: bool isMultiSegmentWell() const; bool hasWellResult(size_t resultTimeStepIndex) const; - size_t firstResultTimeStep() const; const RigWellResultFrame& wellResultFrame(size_t resultTimeStepIndex) const; diff --git a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp index c5ca780486..91a873e4d2 100644 --- a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp +++ b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp @@ -729,7 +729,7 @@ QString RiuResultTextBuilder::wellResultText() { RigSingleWellResultsData* singleWellResultData = wellResults.at(i); - if (m_timeStepIndex < singleWellResultData->firstResultTimeStep()) + if (!singleWellResultData->hasWellResult(m_timeStepIndex)) { continue; }