mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1918 Observed Data : Scale time based on time unit
This commit is contained in:
parent
67c1ee2dbb
commit
330f8a43b3
@ -89,11 +89,23 @@ bool RifColumnBasedUserData::parse(const QString& data)
|
||||
|
||||
m_timeSteps.resize(m_timeSteps.size() + 1);
|
||||
|
||||
double scaleFactor = 1.0;
|
||||
|
||||
QString unitText = QString::fromStdString(ci.unitName);
|
||||
if (unitText.compare("DAYS", Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
scaleFactor = 60.0 * 60.0 * 24.0;
|
||||
}
|
||||
else if (unitText.compare("YEARS", Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
scaleFactor = 60.0 * 60.0 * 24.0 * 365.0;
|
||||
}
|
||||
|
||||
std::vector<time_t>& timeSteps = m_timeSteps.back();
|
||||
{
|
||||
for (auto v : ci.values)
|
||||
{
|
||||
timeSteps.push_back(v);
|
||||
timeSteps.push_back(v * scaleFactor);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user