#1357 Added access function to return time step vector with most time steps

This commit is contained in:
Magne Sjaastad
2017-03-23 13:58:32 +01:00
parent fd23ec242e
commit d3eec3445f
3 changed files with 16 additions and 4 deletions

View File

@@ -176,7 +176,7 @@ std::vector<double> RimGridTimeHistoryCurve::yValues() const
RimReservoirCellResultsStorage* cellResStorage = m_eclipseResultDefinition->currentGridCellResults();
RigCaseCellResultsData* cellResultsData = cellResStorage->cellResults();
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates(m_eclipseResultDefinition->scalarResultIndex());
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
values = RigTimeHistoryResultAccessor::timeHistoryValues(eclTopItem->eclipseCase()->eclipseCaseData(), m_eclipseResultDefinition(), gridIndex, cellIndex, timeStepDates.size());
}
@@ -371,7 +371,7 @@ std::vector<time_t> RimGridTimeHistoryCurve::timeStepValues() const
RimReservoirCellResultsStorage* cellResStorage = m_eclipseResultDefinition->currentGridCellResults();
RigCaseCellResultsData* cellResultsData = cellResStorage->cellResults();
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates(m_eclipseResultDefinition->scalarResultIndex());
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
for (QDateTime dt : timeStepDates)
{

View File

@@ -403,12 +403,23 @@ QDateTime RigCaseCellResultsData::timeStepDate(size_t scalarResultIndex, size_t
//--------------------------------------------------------------------------------------------------
std::vector<QDateTime> RigCaseCellResultsData::timeStepDates(size_t scalarResultIndex) const
{
if (scalarResultIndex < m_resultInfos.size() )
return m_resultInfos[scalarResultIndex].m_timeStepDates;
if (scalarResultIndex < m_resultInfos.size())
return m_resultInfos[scalarResultIndex].m_timeStepDates;
else
return std::vector<QDateTime>();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<QDateTime> RigCaseCellResultsData::timeStepDates() const
{
size_t scalarResWithMostTimeSteps = cvf::UNDEFINED_SIZE_T;
maxTimeStepCount(&scalarResWithMostTimeSteps);
return timeStepDates(scalarResWithMostTimeSteps);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -73,6 +73,7 @@ public:
bool isUsingGlobalActiveIndex(size_t scalarResultIndex) const;
bool hasFlowDiagUsableFluxes() const;
std::vector<QDateTime> timeStepDates() const;
QDateTime timeStepDate(size_t scalarResultIndex, size_t timeStepIndex) const;
std::vector<QDateTime> timeStepDates(size_t scalarResultIndex) const;
int reportStepNumber(size_t scalarResultIndex, size_t timeStepIndex) const;