#1691 Move RigResultInfo into separate file

This commit is contained in:
Magne Sjaastad 2017-08-11 07:47:40 +02:00
parent 78da4c6469
commit 3253c8968e
7 changed files with 87 additions and 24 deletions

View File

@ -22,10 +22,10 @@
#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
#include "RigGridManager.h"
#include "RigMainGrid.h"
#include "RigResultInfo.h"
#include "RimCaseCollection.h"
#include "RimCellEdgeColors.h"
@ -242,7 +242,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
std::vector<double> daysSinceSimulationStart = rigCaseData->results(poroModel)->daysSinceSimulationStart(0);
std::vector<int> reportStepNumbers = rigCaseData->results(poroModel)->reportStepNumbers(0);
const std::vector<RigCaseCellResultsData::ResultInfo> resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex();
const std::vector<ResultInfo> resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex();
for (size_t i = 1; i < caseCollection()->reservoirs.size(); i++)
{

View File

@ -21,9 +21,10 @@
#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
#include "RigCell.h"
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
#include "RigResultInfo.h"
#include "RimEclipseCase.h"
#include "RimTools.h"
@ -90,7 +91,7 @@ void RimReservoirCellResultsStorage::setupBeforeSave()
if (!m_cellResults) return;
const std::vector<RigCaseCellResultsData::ResultInfo>& resInfo = m_cellResults->infoForEachResultIndex();
const std::vector<ResultInfo>& resInfo = m_cellResults->infoForEachResultIndex();
bool hasResultsToStore = false;
for (size_t rIdx = 0; rIdx < resInfo.size(); ++rIdx)

View File

@ -58,6 +58,7 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.h
${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.h
${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.h
${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.h
${CEE_CURRENT_LIST_DIR}RigResultInfo.h
${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator.h
@ -112,6 +113,7 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.cpp
${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.cpp
${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.cpp
${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.cpp
${CEE_CURRENT_LIST_DIR}RigResultInfo.cpp
${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator.cpp
)

View File

@ -20,13 +20,15 @@
#include "RigCaseCellResultsData.h"
#include "RigMainGrid.h"
#include "RigStatisticsDataCache.h"
#include "RigStatisticsMath.h"
#include "RigEclipseMultiPropertyStatCalc.h"
#include "RigEclipseNativeStatCalc.h"
#include "RigMainGrid.h"
#include "RigResultInfo.h"
#include "RigStatisticsDataCache.h"
#include "RigStatisticsMath.h"
#include <QDateTime>
#include <math.h>

View File

@ -35,6 +35,7 @@ class RifReaderInterface;
class RigMainGrid;
class RigActiveCellInfo;
class RigStatisticsDataCache;
class ResultInfo;
//==================================================================================================
/// Class containing the results for the complete number of active cells. Both main grid and LGR's
@ -107,23 +108,6 @@ public:
bool updateResultName(RiaDefines::ResultCatType resultType, QString& oldName, const QString& newName);
public:
class ResultInfo
{
public:
ResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, QString resultName, size_t gridScalarResultIndex)
: m_resultType(resultType), m_needsToBeStored(needsToBeStored), m_resultName(resultName), m_gridScalarResultIndex(gridScalarResultIndex), m_mustBeCalculated(mustBeCalculated) { }
public:
RiaDefines::ResultCatType m_resultType;
bool m_needsToBeStored;
bool m_mustBeCalculated;
QString m_resultName;
size_t m_gridScalarResultIndex;
std::vector<QDateTime> m_timeStepDates;
std::vector<int> m_timeStepReportNumbers;
std::vector<double> m_daysSinceSimulationStart;
};
const std::vector<ResultInfo>& infoForEachResultIndex() { return m_resultInfos;}
bool mustBeCalculated(size_t scalarResultIndex) const;

View File

@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RigResultInfo.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
ResultInfo::ResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated,
QString resultName, size_t gridScalarResultIndex)
: m_resultType(resultType),
m_needsToBeStored(needsToBeStored),
m_mustBeCalculated(mustBeCalculated),
m_resultName(resultName),
m_gridScalarResultIndex(gridScalarResultIndex)
{
}

View File

@ -0,0 +1,42 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaDefines.h"
#include <vector>
class QString;
class ResultInfo
{
public:
ResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated,
QString resultName, size_t gridScalarResultIndex);
public:
RiaDefines::ResultCatType m_resultType;
bool m_needsToBeStored;
bool m_mustBeCalculated;
QString m_resultName;
size_t m_gridScalarResultIndex;
std::vector<QDateTime> m_timeStepDates;
std::vector<int> m_timeStepReportNumbers;
std::vector<double> m_daysSinceSimulationStart;
};