From 25c692d3dbc70c15f3d2595cac5d1e6513a16cc4 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Tue, 10 Sep 2019 09:18:40 +0200 Subject: [PATCH] #4668 Make contour time and case diff work --- .../RimEclipseContourMapProjection.cpp | 7 ++++-- .../RimEclipseResultDefinition.cpp | 20 ++++++++++++++++ .../RimEclipseResultDefinition.h | 23 +++++++++++-------- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseContourMapProjection.cpp b/ApplicationCode/ProjectDataModel/RimEclipseContourMapProjection.cpp index 9ee5933e0a..4038045578 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseContourMapProjection.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseContourMapProjection.cpp @@ -202,8 +202,11 @@ std::vector RimEclipseContourMapProjection::generateResults(int timeStep else if (!(cellColors->hasStaticResult() && timeStep > 0)) { m_currentResultName = cellColors->resultVariable(); - RigEclipseResultAddress resAddr(cellColors->resultType(), cellColors->resultVariable()); - if (resAddr.isValid() && resultData->hasResultEntry(resAddr)) + RigEclipseResultAddress resAddr( cellColors->resultType(), + cellColors->resultVariable(), + cellColors->timeLapseBaseTimeStep(), + cellColors->caseDiffIndex() ); + if ( resAddr.isValid() && resultData->hasResultEntry( resAddr ) ) { gridResultValues = resultData->cellScalarResults(resAddr, timeStep); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index d1551a13cb..506a3739b9 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -968,6 +968,26 @@ QString RimEclipseResultDefinition::diffResultUiShortNameHTML() const return diffResult.join("
"); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimEclipseResultDefinition::timeLapseBaseTimeStep() const +{ + return m_timeLapseBaseTimestep; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimEclipseResultDefinition::caseDiffIndex() const +{ + if ( m_differenceCase ) + { + return m_differenceCase->caseId(); + } + return -1; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h index 2f7dc83962..0d062cce1d 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.h @@ -98,16 +98,19 @@ public: QString diffResultUiShortName() const; QString diffResultUiShortNameHTML() const; - void loadResult(); - RigEclipseResultAddress eclipseResultAddress() const; - void setFromEclipseResultAddress(const RigEclipseResultAddress& resultAddress); - bool hasStaticResult() const; - bool hasDynamicResult() const; - bool hasResult() const; - bool isTernarySaturationSelected() const; - bool isCompletionTypeSelected() const; - bool hasCategoryResult() const; - bool isFlowDiagOrInjectionFlooding() const; + int timeLapseBaseTimeStep() const; + int caseDiffIndex() const; + + void loadResult(); + RigEclipseResultAddress eclipseResultAddress() const; + void setFromEclipseResultAddress( const RigEclipseResultAddress& resultAddress ); + bool hasStaticResult() const; + bool hasDynamicResult() const; + bool hasResult() const; + bool isTernarySaturationSelected() const; + bool isCompletionTypeSelected() const; + bool hasCategoryResult() const; + bool isFlowDiagOrInjectionFlooding() const; RigCaseCellResultsData* currentGridCellResults() const;