#1356 Added possibility to change sour sim file for eclipse result case

This commit is contained in:
Magne Sjaastad
2017-03-31 11:37:07 +02:00
parent 62d345cf1e
commit 24d4e6d094
3 changed files with 54 additions and 7 deletions

View File

@@ -454,12 +454,27 @@ void RifReaderEclipseOutput::setHdf5FileName(const QString& fileName)
RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RifReaderInterface::MATRIX_RESULTS);
CVF_ASSERT(matrixModelResults);
RiaLogging::info(QString("HDF: Start import of data from : ").arg(fileName));
RiaLogging::info("HDF: Removing all existing Sour Sim data ...");
matrixModelResults->eraseAllSourSimData();
if (m_dynamicResultsAccess.isNull())
{
m_timeSteps.clear();
}
std::unique_ptr<RifHdf5ReaderInterface> myReader;
#ifdef USE_HDF5
myReader = std::unique_ptr<RifHdf5ReaderInterface>(new RifHdf5Reader(fileName));
#endif // USE_HDF5
if (!myReader) return;
if (!myReader)
{
RiaLogging::error("HDF: Failed to import Sour Sim data ");
return;
}
std::vector<QDateTime> hdfTimeSteps = myReader->timeSteps();
if (m_timeSteps.size() > 0)
@@ -505,6 +520,7 @@ void RifReaderEclipseOutput::setHdf5FileName(const QString& fileName)
{
size_t resIndex = matrixModelResults->addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, resultNames[i], false);
matrixModelResults->setTimeStepDates(resIndex, m_timeSteps, reportNumbers);
matrixModelResults->setSourSimData(resIndex);
}
m_hdfReaderInterface = std::move(myReader);