#1357 Use recently created method

This commit is contained in:
Magne Sjaastad 2017-03-24 07:10:02 +01:00
parent 52b064c5ce
commit 881ba2986f
2 changed files with 3 additions and 8 deletions

View File

@ -170,15 +170,12 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl
CVF_ASSERT(mainEclipseCase && mainEclipseCase->mainGrid()); CVF_ASSERT(mainEclipseCase && mainEclipseCase->mainGrid());
eclipseCase->setMainGrid(mainEclipseCase->mainGrid()); eclipseCase->setMainGrid(mainEclipseCase->mainGrid());
size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T; std::vector<QDateTime> timeStepDates = mainEclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates();
mainEclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount); if (timeStepDates.size() == 0)
if (scalarIndexWithMaxTimeStepCount == cvf::UNDEFINED_SIZE_T)
{ {
return false; return false;
} }
std::vector<QDateTime> timeStepDates = mainEclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates(scalarIndexWithMaxTimeStepCount);
cvf::ref<RifReaderEclipseOutput> readerEclipseOutput = new RifReaderEclipseOutput; cvf::ref<RifReaderEclipseOutput> readerEclipseOutput = new RifReaderEclipseOutput;
if (!readerEclipseOutput->openAndReadActiveCellData(caseFileName(), timeStepDates, eclipseCase.p())) if (!readerEclipseOutput->openAndReadActiveCellData(caseFileName(), timeStepDates, eclipseCase.p()))
{ {

View File

@ -115,9 +115,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuEclipseSelec
{ {
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(eclipseView->cellResult()->porosityModel()); RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(eclipseView->cellResult()->porosityModel());
size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T; std::vector<QDateTime> timeStepDates = eclipseView->eclipseCase()->eclipseCaseData()->results(porosityModel)->timeStepDates();
eclipseView->eclipseCase()->eclipseCaseData()->results(porosityModel)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount);
std::vector<QDateTime> timeStepDates = eclipseView->eclipseCase()->eclipseCaseData()->results(porosityModel)->timeStepDates(scalarIndexWithMaxTimeStepCount);
QString curveName = eclipseView->eclipseCase()->caseUserDescription(); QString curveName = eclipseView->eclipseCase()->caseUserDescription();
curveName += ", "; curveName += ", ";