#1693 Remove and move stuff away from RimReservoirCellResultsStorage

To make its sole responsibility to store/restore generated results to/from cache file
This commit is contained in:
Jacob Støren
2017-09-11 11:03:05 +02:00
parent 1999d2b6e4
commit 337ad4d356
9 changed files with 50 additions and 88 deletions

View File

@@ -440,6 +440,22 @@ bool RigCaseCellResultsData::hasFlowDiagUsableFluxes() const
return hasFlowFluxes;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<QDateTime> RigCaseCellResultsData::allTimeStepDatesFromEclipseReader() const
{
const RifReaderEclipseOutput* rifReaderOutput = dynamic_cast<const RifReaderEclipseOutput*>(m_readerInterface.p());
if (rifReaderOutput)
{
return rifReaderOutput->allTimeSteps();
}
else
{
return std::vector<QDateTime>();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -597,14 +613,14 @@ QString RigCaseCellResultsData::makeResultNameUnique(const QString& resultNamePr
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::removeResult(const QString& resultName)
void RigCaseCellResultsData::clearScalarResult(RiaDefines::ResultCatType type, const QString & resultName)
{
size_t resultIdx = findScalarResultIndex(resultName);
if (resultIdx == cvf::UNDEFINED_SIZE_T) return;
size_t scalarResultIndex = this->findScalarResultIndex(type, resultName);
if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) return;
m_cellScalarResults[resultIdx].clear();
m_cellScalarResults[scalarResultIndex].clear();
m_resultInfos[resultIdx].m_resultType = RiaDefines::REMOVED;
//m_resultInfos[scalarResultIndex].m_resultType = RiaDefines::REMOVED;
}
//--------------------------------------------------------------------------------------------------
@@ -2124,6 +2140,18 @@ void RigCaseCellResultsData::setReaderInterface(RifReaderInterface* readerInterf
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::setHdf5Filename(const QString& hdf5SourSimFilename)
{
RifReaderEclipseOutput* rifReaderOutput = dynamic_cast<RifReaderEclipseOutput*>(m_readerInterface.p());
if (rifReaderOutput)
{
rifReaderOutput->setHdf5FileName(hdf5SourSimFilename);
}
}
//--------------------------------------------------------------------------------------------------
/// If we have any results on any time step, assume we have loaded results
//--------------------------------------------------------------------------------------------------