mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2003 Observed Data : Handle STEPTYPE with potentially missing text for first row
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RifColumnBasedUserDataParser.h"
|
||||
|
||||
#include "RifEclipseUserDataKeywordTools.h"
|
||||
#include "RifEclipseUserDataParserTools.h"
|
||||
|
||||
#include "RiaDateStringParser.h"
|
||||
@@ -103,6 +104,15 @@ void RifColumnBasedUserDataParser::parseTableData(const QString& data)
|
||||
int columnCount = static_cast<int>(columnInfos.size());
|
||||
if (columnCount == 0) break;
|
||||
|
||||
int stepTypeIndex = -1;
|
||||
for (size_t i = 0; i < columnInfos.size(); i++)
|
||||
{
|
||||
if (RifEclipseUserDataKeywordTools::isStepType(columnInfos[i].summaryAddress.quantityName()))
|
||||
{
|
||||
stepTypeIndex = static_cast<int>(i);
|
||||
}
|
||||
}
|
||||
|
||||
std::string line;
|
||||
std::getline(streamData, line);
|
||||
|
||||
@@ -111,6 +121,12 @@ void RifColumnBasedUserDataParser::parseTableData(const QString& data)
|
||||
QString qLine = QString::fromStdString(line);
|
||||
QStringList entries = qLine.split(" ", QString::SkipEmptyParts);
|
||||
|
||||
if (stepTypeIndex > -1 &&
|
||||
entries.size() < columnInfos.size())
|
||||
{
|
||||
entries.insert(stepTypeIndex, " ");
|
||||
}
|
||||
|
||||
if (entries.size() < columnCount) break;
|
||||
|
||||
for (int i = 0; i < columnCount; i++)
|
||||
|
||||
Reference in New Issue
Block a user