mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Observed Data : Rename to RifEclipseUserDataParserTools
This commit is contained in:
parent
62c8219a27
commit
2d50a68286
@ -17,7 +17,7 @@ ${CEE_CURRENT_LIST_DIR}RifReaderEclipseInput.h
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderEclipseOutput.h
|
||||
${CEE_CURRENT_LIST_DIR}RifSummaryReaderInterface.h
|
||||
${CEE_CURRENT_LIST_DIR}RifColumnBasedAsciiParser.h
|
||||
${CEE_CURRENT_LIST_DIR}RifRsmspecParserTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RifEclipseUserDataParserTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RifColumnBasedUserDataParser.h
|
||||
${CEE_CURRENT_LIST_DIR}RifKeywordVectorParser.h
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderObservedData.h
|
||||
@ -56,7 +56,7 @@ ${CEE_CURRENT_LIST_DIR}RifReaderEclipseInput.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderEclipseOutput.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifSummaryReaderInterface.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifColumnBasedAsciiParser.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifRsmspecParserTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifEclipseUserDataParserTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifColumnBasedUserDataParser.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifKeywordVectorParser.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderObservedData.cpp
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RifColumnBasedUserDataParser.h"
|
||||
#include "RifRsmspecParserTools.h"
|
||||
#include "RifEclipseUserDataParserTools.h"
|
||||
|
||||
#include "cafUtils.h"
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include "RifColumnBasedUserDataParser.h"
|
||||
|
||||
#include "RifRsmspecParserTools.h"
|
||||
#include "RifEclipseUserDataParserTools.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
@ -57,7 +57,7 @@ void RifColumnBasedUserDataParser::parseData(const QString& data)
|
||||
|
||||
do
|
||||
{
|
||||
std::vector<ColumnInfo> table = RifRsmspecParserTools::columnInfoForTable(streamData, line);
|
||||
std::vector<ColumnInfo> table = RifEclipseUserDataParserTools::columnInfoForTable(streamData, line);
|
||||
size_t columnCount = table.size();
|
||||
if (columnCount == 0) break;
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RifRsmspecParserTools.h"
|
||||
#include "RifEclipseUserDataParserTools.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifRsmspecParserTools::isLineSkippable(const std::string& line)
|
||||
bool RifEclipseUserDataParserTools::isLineSkippable(const std::string& line)
|
||||
{
|
||||
if (std::all_of(line.begin(), line.end(), isspace))
|
||||
{
|
||||
@ -69,7 +69,7 @@ bool RifRsmspecParserTools::isLineSkippable(const std::string& line)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifRsmspecParserTools::isAComment(const std::string& word)
|
||||
bool RifEclipseUserDataParserTools::isAComment(const std::string& word)
|
||||
{
|
||||
if (word.size() > 1 && word.substr(0, 2) == "--")
|
||||
{
|
||||
@ -81,7 +81,7 @@ bool RifRsmspecParserTools::isAComment(const std::string& word)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::string> RifRsmspecParserTools::splitLineAndRemoveComments(std::string line)
|
||||
std::vector<std::string> RifEclipseUserDataParserTools::splitLineAndRemoveComments(std::string line)
|
||||
{
|
||||
std::istringstream iss(line);
|
||||
std::vector<std::string> words{ std::istream_iterator<std::string>{iss},
|
||||
@ -102,7 +102,7 @@ std::vector<std::string> RifRsmspecParserTools::splitLineAndRemoveComments(std::
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress::SummaryVarCategory RifRsmspecParserTools::identifyCategory(const std::string& word)
|
||||
RifEclipseSummaryAddress::SummaryVarCategory RifEclipseUserDataParserTools::identifyCategory(const std::string& word)
|
||||
{
|
||||
if (word.size() == 0) return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
|
||||
@ -140,7 +140,7 @@ RifEclipseSummaryAddress::SummaryVarCategory RifRsmspecParserTools::identifyCate
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RifRsmspecParserTools::findFirstNonEmptyEntryIndex(std::vector<std::string>& list)
|
||||
size_t RifEclipseUserDataParserTools::findFirstNonEmptyEntryIndex(std::vector<std::string>& list)
|
||||
{
|
||||
for (size_t i = 0; i < list.size(); i++)
|
||||
{
|
||||
@ -155,7 +155,7 @@ size_t RifRsmspecParserTools::findFirstNonEmptyEntryIndex(std::vector<std::strin
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifRsmspecParserTools::makeAndFillAddress(std::string quantityName, std::vector< std::string > headerColumn)
|
||||
RifEclipseSummaryAddress RifEclipseUserDataParserTools::makeAndFillAddress(std::string quantityName, std::vector< std::string > headerColumn)
|
||||
{
|
||||
int regionNumber = -1;
|
||||
int regionNumber2 = -1;
|
||||
@ -223,7 +223,7 @@ RifEclipseSummaryAddress RifRsmspecParserTools::makeAndFillAddress(std::string q
|
||||
cellK);
|
||||
}
|
||||
|
||||
bool RifRsmspecParserTools::keywordParser(std::string line, std::string& origin, std::string& dateFormat, std::string& startDate)
|
||||
bool RifEclipseUserDataParserTools::keywordParser(std::string line, std::string& origin, std::string& dateFormat, std::string& startDate)
|
||||
{
|
||||
std::vector<std::string> words = splitLineAndRemoveComments(line);
|
||||
if (words.size() < 2) return false;
|
||||
@ -250,7 +250,7 @@ bool RifRsmspecParserTools::keywordParser(std::string line, std::string& origin,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<ColumnInfo> RifRsmspecParserTools::columnInfoForTable(std::stringstream& streamData, std::string& line)
|
||||
std::vector<ColumnInfo> RifEclipseUserDataParserTools::columnInfoForTable(std::stringstream& streamData, std::string& line)
|
||||
{
|
||||
std::vector<ColumnInfo> table;
|
||||
|
||||
@ -360,7 +360,7 @@ std::vector<ColumnInfo> RifRsmspecParserTools::columnInfoForTable(std::stringstr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifRsmspecParserTools::splitLineToDoubles(const std::string& line, std::vector<double>& values)
|
||||
void RifEclipseUserDataParserTools::splitLineToDoubles(const std::string& line, std::vector<double>& values)
|
||||
{
|
||||
std::istringstream iss(line);
|
||||
values.clear();
|
||||
@ -375,7 +375,7 @@ void RifRsmspecParserTools::splitLineToDoubles(const std::string& line, std::vec
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifRsmspecParserTools::isANumber(const std::string& line)
|
||||
bool RifEclipseUserDataParserTools::isANumber(const std::string& line)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -391,7 +391,7 @@ bool RifRsmspecParserTools::isANumber(const std::string& line)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::string> RifRsmspecParserTools::headerReader(std::stringstream& streamData, std::string& line)
|
||||
std::vector<std::string> RifEclipseUserDataParserTools::headerReader(std::stringstream& streamData, std::string& line)
|
||||
{
|
||||
std::vector<std::string> header;
|
||||
|
@ -43,7 +43,7 @@ struct ColumnInfo
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RifRsmspecParserTools
|
||||
class RifEclipseUserDataParserTools
|
||||
{
|
||||
public:
|
||||
static bool isLineSkippable(const std::string& line);
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include "RifKeywordVectorParser.h"
|
||||
|
||||
#include "RifRsmspecParserTools.h"
|
||||
#include "RifEclipseUserDataParserTools.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
@ -51,7 +51,7 @@ bool RifKeywordVectorParser::canBeParsed(const QString& data)
|
||||
|
||||
while (streamData.good())
|
||||
{
|
||||
if (RifRsmspecParserTools::isAComment(line))
|
||||
if (RifEclipseUserDataParserTools::isAComment(line))
|
||||
{
|
||||
std::getline(streamData, line);
|
||||
}
|
||||
@ -79,16 +79,16 @@ void RifKeywordVectorParser::parseData(const QString& data)
|
||||
|
||||
do
|
||||
{
|
||||
while (RifRsmspecParserTools::isLineSkippable(line) && !streamData.eof())
|
||||
while (RifEclipseUserDataParserTools::isLineSkippable(line) && !streamData.eof())
|
||||
{
|
||||
std::getline(streamData, line);
|
||||
}
|
||||
|
||||
KeywordBasedVector keywordBasedVector;
|
||||
keywordBasedVector.header = RifRsmspecParserTools::headerReader(streamData, line);
|
||||
keywordBasedVector.header = RifEclipseUserDataParserTools::headerReader(streamData, line);
|
||||
if (keywordBasedVector.header.empty()) break;
|
||||
|
||||
while (RifRsmspecParserTools::isANumber(line))
|
||||
while (RifEclipseUserDataParserTools::isANumber(line))
|
||||
{
|
||||
keywordBasedVector.values.push_back(std::stod(line));
|
||||
std::getline(streamData, line);
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifKeywordVectorParser.h"
|
||||
#include "RifRsmspecParserTools.h"
|
||||
#include "RifEclipseUserDataParserTools.h"
|
||||
|
||||
#include "cafUtils.h"
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "RifColumnBasedUserData.h"
|
||||
#include "RifColumnBasedUserDataParser.h"
|
||||
#include "RifKeywordVectorParser.h"
|
||||
#include "RifRsmspecParserTools.h"
|
||||
#include "RifEclipseUserDataParserTools.h"
|
||||
|
||||
#include <vector>
|
||||
#include <QTextStream>
|
||||
@ -230,7 +230,7 @@ TEST(RifRsmspecParserToolsTest, TestSplitLineToDoubles)
|
||||
while (std::getline(streamData, line))
|
||||
{
|
||||
std::vector<double> values;
|
||||
RifRsmspecParserTools::splitLineToDoubles(line, values);
|
||||
RifEclipseUserDataParserTools::splitLineToDoubles(line, values);
|
||||
table.push_back(values);
|
||||
}
|
||||
|
||||
@ -588,7 +588,7 @@ TEST(RifKeywordBasedRsmspecParserTest, TestTimeSteps)
|
||||
std::vector< std::string > headerColumn;
|
||||
headerColumn.push_back("OP-1");
|
||||
|
||||
RifEclipseSummaryAddress address = RifRsmspecParserTools::makeAndFillAddress(quantityName, headerColumn);
|
||||
RifEclipseSummaryAddress address = RifEclipseUserDataParserTools::makeAndFillAddress(quantityName, headerColumn);
|
||||
|
||||
RifColumnBasedUserData columnBasedUserdata;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user