From 23ecdffe018fb8258459a94b8b83d8cb77dbdb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Mon, 21 Aug 2017 09:11:37 +0200 Subject: [PATCH] #1785 Store/restore generated data from Octave in project cache --- .../ProjectDataModel/RimReservoirCellResultsStorage.cpp | 2 +- ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index 1cb3b74753..565292638a 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -1576,7 +1576,7 @@ void RimReservoirCellResultsStorage::setCellResults(RigCaseCellResultsData* cell { std::vector* data = NULL; - data = &(m_cellResults->cellScalarResults(rIdx, tsIdx)); + data = &(m_cellResults->cellScalarResults(resultIndex, tsIdx)); quint64 cellCount = 0; stream >> cellCount; diff --git a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp index 051764ad36..47c4b6c69a 100644 --- a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp @@ -30,6 +30,7 @@ #include "RigResultAccessorFactory.h" #include "RigResultModifier.h" #include "RigResultModifierFactory.h" +#include "RigEclipseResultInfo.h" #include "RimEclipseCase.h" #include "RimEclipseCellColors.h" @@ -415,6 +416,11 @@ public: if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) { scalarResultIndex = rimCase->results(m_porosityModelEnum)->cellResults()->addEmptyScalarResult(RiaDefines::GENERATED, propertyName, true); + + size_t scalarResWithMostTimeSteps = cvf::UNDEFINED_SIZE_T; + rimCase->results(m_porosityModelEnum)->cellResults()->maxTimeStepCount(&scalarResWithMostTimeSteps); + const std::vector timeStepInfos = rimCase->results(m_porosityModelEnum)->cellResults()->timeStepInfos(scalarResWithMostTimeSteps); + rimCase->results(m_porosityModelEnum)->cellResults()->setTimeStepInfos(scalarResultIndex, timeStepInfos); } if (scalarResultIndex != cvf::UNDEFINED_SIZE_T)