mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2003 Observed Data : If YEARX is present, use this as basis for the time step
This commit is contained in:
@@ -142,6 +142,7 @@ void RifColumnBasedUserData::buildTimeStepsFromTables()
|
||||
// Find time index
|
||||
size_t dateColumnIndex = tableData.columnInfos().size();
|
||||
size_t dayOrYearColumnIndex = tableData.columnInfos().size();
|
||||
size_t yearXColumnIndex = tableData.columnInfos().size();
|
||||
|
||||
for (size_t columIndex = 0; columIndex < tableData.columnInfos().size(); columIndex++)
|
||||
{
|
||||
@@ -151,11 +152,18 @@ void RifColumnBasedUserData::buildTimeStepsFromTables()
|
||||
{
|
||||
dateColumnIndex = columIndex;
|
||||
}
|
||||
else if (dayOrYearColumnIndex == tableData.columnInfos().size() &&
|
||||
|
||||
if (dayOrYearColumnIndex == tableData.columnInfos().size() &&
|
||||
RifEclipseUserDataParserTools::hasTimeUnit(ci.unitName))
|
||||
{
|
||||
dayOrYearColumnIndex = columIndex;
|
||||
}
|
||||
|
||||
if (yearXColumnIndex == tableData.columnInfos().size() &&
|
||||
ci.summaryAddress.quantityName() == "YEARX")
|
||||
{
|
||||
yearXColumnIndex = columIndex;
|
||||
}
|
||||
}
|
||||
|
||||
if (dateColumnIndex == tableData.columnInfos().size() &&
|
||||
@@ -181,6 +189,16 @@ void RifColumnBasedUserData::buildTimeStepsFromTables()
|
||||
timeSteps.push_back(dt.toTime_t());
|
||||
}
|
||||
}
|
||||
else if (yearXColumnIndex != tableData.columnInfos().size())
|
||||
{
|
||||
const ColumnInfo& ci = tableData.columnInfos()[yearXColumnIndex];
|
||||
|
||||
for (const auto& timeStepValue : ci.values)
|
||||
{
|
||||
QDateTime dateTime = RiaQDateTimeTools::fromYears(timeStepValue);
|
||||
timeSteps.push_back(dateTime.toTime_t());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QDateTime startDate = RiaQDateTimeTools::epoch();
|
||||
@@ -216,7 +234,6 @@ void RifColumnBasedUserData::buildTimeStepsFromTables()
|
||||
timeSteps.push_back(dateTime.toTime_t());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user