mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1942 HDF5 reader. Using RiaQDateTimeTools for parts of the reading. See issue comment for more info
This commit is contained in:
@@ -72,6 +72,14 @@ QDateTime RiaQDateTimeTools::fromYears(double years)
|
||||
return RiaQDateTimeTools::addYears(dt, yearsAfterEpoch);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::addMSecs(const QDateTime& dt, double msecs)
|
||||
{
|
||||
return dt.addMSecs(msecs);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
static QDateTime fromString(const QString& dateString, const QString& format);
|
||||
static QDateTime fromYears(double years);
|
||||
|
||||
static QDateTime addMSecs(const QDateTime& dt, double msecs);
|
||||
static QDateTime addDays(const QDateTime& dt, double days);
|
||||
static QDateTime addYears(const QDateTime& dt, double years);
|
||||
|
||||
|
||||
@@ -121,8 +121,6 @@ std::vector<QDateTime> RifHdf5Reader::timeSteps() const
|
||||
|
||||
QDateTime dtInitial = sourSimDateTimeToQDateTime(dateString);
|
||||
|
||||
int secondsPerDay = 60 * 60 * 24;
|
||||
|
||||
for (size_t i = 0; i < m_timeStepFileNames.size(); i++)
|
||||
{
|
||||
std::string fileName = m_timeStepFileNames[i];
|
||||
@@ -137,8 +135,8 @@ std::vector<QDateTime> RifHdf5Reader::timeSteps() const
|
||||
double milliseconds = fractionOfDay * 24.0 * 60.0 * 60.0 * 1000.0;
|
||||
|
||||
QDateTime dt = dtInitial;
|
||||
dt = dt.addDays(timeStepDays);
|
||||
dt = dt.addMSecs(milliseconds);
|
||||
dt = RiaQDateTimeTools::addDays(dt, timeStepDays);
|
||||
dt = RiaQDateTimeTools::addMSecs(dt, milliseconds);
|
||||
|
||||
times.push_back(dt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user