mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#1933 Observed data: Add scaleFactor to ColumnInfo
This commit is contained in:
@@ -50,6 +50,12 @@ bool RifRsmspecParserTools::isLineSkippable(const std::string& line)
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (str.find("PAGE") < str.size())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +197,7 @@ size_t RifRsmspecParserTools::findFirstNonEmptyEntryIndex(std::vector<std::strin
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RifEclipseSummaryAddress RifRsmspecParserTools::makeAndFillAddress(std::string scaleFactor, std::string quantityName, std::vector< std::string > headerColumn)
|
RifEclipseSummaryAddress RifRsmspecParserTools::makeAndFillAddress(std::string quantityName, std::vector< std::string > headerColumn)
|
||||||
{
|
{
|
||||||
int regionNumber = -1;
|
int regionNumber = -1;
|
||||||
int regionNumber2 = -1;
|
int regionNumber2 = -1;
|
||||||
@@ -290,15 +296,19 @@ std::vector<ColumnInfo> RifRsmspecParserTools::columnInfoForTable(std::stringstr
|
|||||||
table.push_back(columnInfo);
|
table.push_back(columnInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scaleFactors.size() < columnCount)
|
if (scaleFactors.empty())
|
||||||
{
|
{
|
||||||
int diff = columnCount - scaleFactors.size();
|
for (size_t i = 0; i < table.size(); i++)
|
||||||
for (int i = 0; i < diff; i++)
|
|
||||||
{
|
{
|
||||||
scaleFactors.push_back("1.0");
|
scaleFactors.push_back("1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < table.size(); i++)
|
||||||
|
{
|
||||||
|
table[i].scaleFactor = scaleFactors[i];
|
||||||
|
}
|
||||||
|
|
||||||
std::vector< std::vector< std::string > > restOfHeader;
|
std::vector< std::vector< std::string > > restOfHeader;
|
||||||
|
|
||||||
bool header = true;
|
bool header = true;
|
||||||
@@ -338,7 +348,7 @@ std::vector<ColumnInfo> RifRsmspecParserTools::columnInfoForTable(std::stringstr
|
|||||||
{
|
{
|
||||||
restOfHeaderColumn.push_back(restOfHeaderRow.at(i));
|
restOfHeaderColumn.push_back(restOfHeaderRow.at(i));
|
||||||
}
|
}
|
||||||
table[i].summaryAddress = makeAndFillAddress(scaleFactors.at(i), quantityNames.at(i), restOfHeaderColumn);
|
table[i].summaryAddress = makeAndFillAddress(quantityNames.at(i), restOfHeaderColumn);
|
||||||
}
|
}
|
||||||
|
|
||||||
return table;
|
return table;
|
||||||
|
|||||||
@@ -33,7 +33,10 @@ struct ColumnInfo
|
|||||||
bool isAVector = false;
|
bool isAVector = false;
|
||||||
RifEclipseSummaryAddress summaryAddress;
|
RifEclipseSummaryAddress summaryAddress;
|
||||||
std::string unitName;
|
std::string unitName;
|
||||||
|
std::string scaleFactor;
|
||||||
std::vector<double> values;
|
std::vector<double> values;
|
||||||
|
std::string dateFormat;
|
||||||
|
std::string origin;
|
||||||
};
|
};
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@@ -50,7 +53,7 @@ public:
|
|||||||
static RifEclipseSummaryAddress::SummaryVarCategory identifyCategory(const std::string& word);
|
static RifEclipseSummaryAddress::SummaryVarCategory identifyCategory(const std::string& word);
|
||||||
static void splitLineToDoubles(const std::string& line, std::vector<double>& values);
|
static void splitLineToDoubles(const std::string& line, std::vector<double>& values);
|
||||||
static size_t findFirstNonEmptyEntryIndex(std::vector<std::string>& list);
|
static size_t findFirstNonEmptyEntryIndex(std::vector<std::string>& list);
|
||||||
static RifEclipseSummaryAddress makeAndFillAddress(std::string scaleFactor, std::string quantityName, std::vector< std::string > headerColumn);
|
static RifEclipseSummaryAddress makeAndFillAddress(std::string quantityName, std::vector< std::string > headerColumn);
|
||||||
static std::vector<ColumnInfo> columnInfoForTable(std::stringstream& data, std::string& line);
|
static std::vector<ColumnInfo> columnInfoForTable(std::stringstream& data, std::string& line);
|
||||||
static bool isANumber(const std::string& line);
|
static bool isANumber(const std::string& line);
|
||||||
static std::vector<std::string> headerReader(std::stringstream& streamData, std::string& line);
|
static std::vector<std::string> headerReader(std::stringstream& streamData, std::string& line);
|
||||||
|
|||||||
Reference in New Issue
Block a user