mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2776 Error bars. Moved eclipse address parsing to RifEclipseSummaryAddress class
This commit is contained in:
parent
312d302848
commit
10b3d0f6db
@ -71,7 +71,7 @@ void RiaSummaryTools::notifyCalculatedCurveNameHasChanged(const QString& previou
|
||||
{
|
||||
if (adr.quantityName() == previousCurveName.toStdString())
|
||||
{
|
||||
RifEclipseSummaryAddress updatedAdr = RifEclipseSummaryAddress::calculatedCurveAddress(currentCurveName.toStdString());
|
||||
RifEclipseSummaryAddress updatedAdr = RifEclipseSummaryAddress::calculatedAddress(currentCurveName.toStdString());
|
||||
curve->setSummaryAddressY(updatedAdr);
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ void RicNewSummaryCurveFeature::onActionTriggered(bool isChecked)
|
||||
defaultCase = project->activeOilField()->summaryCaseMainCollection()->summaryCase(0);
|
||||
newCurve->setSummaryCaseY(defaultCase);
|
||||
|
||||
newCurve->setSummaryAddressY(RifEclipseSummaryAddress::fieldVarAddress("FOPT"));
|
||||
newCurve->setSummaryAddressY(RifEclipseSummaryAddress::fieldAddress("FOPT"));
|
||||
|
||||
newCurve->loadDataAndUpdate(true);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ bool RifCsvUserDataParser::parseColumnInfo(QTextStream* dataStream, const AsciiD
|
||||
for (int iCol = 0; iCol < colCount; iCol++)
|
||||
{
|
||||
QString colName = RiaTextStringTools::trimAndRemoveDoubleSpaces(lineColumns[iCol]);
|
||||
RifEclipseSummaryAddress addr = RifEclipseUserDataKeywordTools::makeAndFillAddressFromObservedData(colName.toStdString());
|
||||
RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddress(colName.toStdString());
|
||||
Column col = Column::createColumnInfoFromCsvData(addr, "");
|
||||
|
||||
columnInfoList->push_back(col);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "RiaStdStringTools.h"
|
||||
|
||||
#include <QTextStream>
|
||||
#include <QStringList>
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
@ -102,27 +103,364 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress(SummaryVarCategory category,
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// Column header text format: [<ER|ERR|ERROR>:]<VECTOR>:<CATEGORY_PARAM_NAME1>[:<CATEGORY_PARAM_NAME2>][....]
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::fieldVarAddress(const std::string& fieldVarName)
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::fromEclipseTextAddress(const std::string& textAddress)
|
||||
{
|
||||
RifEclipseSummaryAddress fieldAddr;
|
||||
fieldAddr.m_variableCategory = SUMMARY_FIELD;
|
||||
fieldAddr.m_quantityName = fieldVarName;
|
||||
QStringList names = QString().fromStdString(textAddress).split(QRegExp("[:,]"));
|
||||
|
||||
return fieldAddr;
|
||||
bool isErrorResult = false;
|
||||
|
||||
if (names.size() > 1 && names[0].trimmed().startsWith("ER", Qt::CaseInsensitive))
|
||||
{
|
||||
isErrorResult = true;
|
||||
names.pop_front();
|
||||
}
|
||||
else if (names.empty())
|
||||
{
|
||||
return RifEclipseSummaryAddress();
|
||||
}
|
||||
|
||||
std::string quantityName = names[0].trimmed().toStdString();
|
||||
names.pop_front();
|
||||
|
||||
SummaryVarCategory category = identifyCategory(quantityName);
|
||||
|
||||
RifEclipseSummaryAddress address;
|
||||
switch (category)
|
||||
{
|
||||
case SUMMARY_FIELD:
|
||||
address = fieldAddress(quantityName);
|
||||
break;
|
||||
|
||||
case SUMMARY_AQUIFER:
|
||||
if (names.size() > 0) address = aquiferAddress(quantityName,
|
||||
RiaStdStringTools::toInt(names[0].toStdString()));
|
||||
break;
|
||||
|
||||
case SUMMARY_NETWORK:
|
||||
address = networkAddress(quantityName);
|
||||
break;
|
||||
|
||||
case SUMMARY_MISC:
|
||||
address = miscAddress(quantityName);
|
||||
break;
|
||||
|
||||
case SUMMARY_REGION:
|
||||
if (names.size() > 0) address = regionAddress(quantityName,
|
||||
RiaStdStringTools::toInt(names[0].toStdString()));
|
||||
break;
|
||||
|
||||
case SUMMARY_REGION_2_REGION:
|
||||
if (names.size() > 0)
|
||||
{
|
||||
QStringList regions = names[0].trimmed().split("-");
|
||||
if (regions.size() == 2)
|
||||
{
|
||||
address = regionToRegionAddress(quantityName,
|
||||
RiaStdStringTools::toInt(regions[0].toStdString()),
|
||||
RiaStdStringTools::toInt(regions[1].toStdString()));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SUMMARY_WELL_GROUP:
|
||||
if (names.size() > 0) address = wellGroupAddress(quantityName,
|
||||
names[0].toStdString());
|
||||
break;
|
||||
|
||||
case SUMMARY_WELL:
|
||||
if (names.size() > 0) address = wellAddress(quantityName,
|
||||
names[0].toStdString());
|
||||
break;
|
||||
|
||||
case SUMMARY_WELL_COMPLETION:
|
||||
if (names.size() > 3) address = wellCompletionAddress(quantityName,
|
||||
names[0].toStdString(),
|
||||
RiaStdStringTools::toInt(names[1].toStdString()),
|
||||
RiaStdStringTools::toInt(names[2].toStdString()),
|
||||
RiaStdStringTools::toInt(names[3].toStdString()));
|
||||
break;
|
||||
|
||||
case SUMMARY_WELL_LGR:
|
||||
if (names.size() > 1) address = wellLgrAddress(quantityName,
|
||||
names[0].toStdString(),
|
||||
names[1].toStdString());
|
||||
break;
|
||||
|
||||
case SUMMARY_WELL_COMPLETION_LGR:
|
||||
if (names.size() > 4) address = wellCompletionLgrAddress(quantityName,
|
||||
names[0].toStdString(),
|
||||
names[1].toStdString(),
|
||||
RiaStdStringTools::toInt(names[2].toStdString()),
|
||||
RiaStdStringTools::toInt(names[3].toStdString()),
|
||||
RiaStdStringTools::toInt(names[4].toStdString()));
|
||||
break;
|
||||
|
||||
case SUMMARY_WELL_SEGMENT:
|
||||
if (names.size() > 1) address = wellSegmentAddress(quantityName,
|
||||
names[0].toStdString(),
|
||||
RiaStdStringTools::toInt(names[1].toStdString()));
|
||||
break;
|
||||
|
||||
case SUMMARY_BLOCK:
|
||||
if (names.size() > 2) address = blockAddress(quantityName,
|
||||
RiaStdStringTools::toInt(names[0].toStdString()),
|
||||
RiaStdStringTools::toInt(names[1].toStdString()),
|
||||
RiaStdStringTools::toInt(names[2].toStdString()));
|
||||
break;
|
||||
|
||||
case SUMMARY_BLOCK_LGR:
|
||||
if (names.size() > 3) address = blockLgrAddress(quantityName,
|
||||
names[0].toStdString(),
|
||||
RiaStdStringTools::toInt(names[1].toStdString()),
|
||||
RiaStdStringTools::toInt(names[2].toStdString()),
|
||||
RiaStdStringTools::toInt(names[3].toStdString()));
|
||||
break;
|
||||
|
||||
case SUMMARY_CALCULATED:
|
||||
address = calculatedAddress(quantityName);
|
||||
break;
|
||||
|
||||
case SUMMARY_IMPORTED:
|
||||
case SUMMARY_INVALID:
|
||||
address = importedAddress(quantityName);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (isErrorResult) address.setAsErrorResult();
|
||||
return address;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::calculatedCurveAddress(const std::string& curveName)
|
||||
RifEclipseSummaryAddress::SummaryVarCategory RifEclipseSummaryAddress::identifyCategory(const std::string& quantityName)
|
||||
{
|
||||
RifEclipseSummaryAddress fieldAddr;
|
||||
fieldAddr.m_variableCategory = SUMMARY_CALCULATED;
|
||||
fieldAddr.m_quantityName = curveName;
|
||||
if (quantityName.size() == 0) return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
|
||||
return fieldAddr;
|
||||
if (!RiaStdStringTools::containsOnlyLettersAndDigits(quantityName)) return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
|
||||
if (quantityName.size() > 2 && quantityName[0] == 'R' && quantityName[2] == 'F')
|
||||
{
|
||||
return RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION;
|
||||
}
|
||||
|
||||
char firstLetter = quantityName.at(0);
|
||||
|
||||
if (firstLetter == 'A') return RifEclipseSummaryAddress::SUMMARY_AQUIFER;
|
||||
if (firstLetter == 'B') return RifEclipseSummaryAddress::SUMMARY_BLOCK;
|
||||
if (firstLetter == 'C') return RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION;
|
||||
if (firstLetter == 'F') return RifEclipseSummaryAddress::SUMMARY_FIELD;
|
||||
if (firstLetter == 'G') return RifEclipseSummaryAddress::SUMMARY_WELL_GROUP;
|
||||
if (firstLetter == 'N') return RifEclipseSummaryAddress::SUMMARY_NETWORK;
|
||||
if (firstLetter == 'R') return RifEclipseSummaryAddress::SUMMARY_REGION;
|
||||
if (firstLetter == 'S') return RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT;
|
||||
if (firstLetter == 'W') return RifEclipseSummaryAddress::SUMMARY_WELL;
|
||||
|
||||
if (quantityName.size() < 2) return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
|
||||
std::string firstTwoLetters = quantityName.substr(0, 2);
|
||||
|
||||
if (firstTwoLetters == "LB") return RifEclipseSummaryAddress::SUMMARY_BLOCK_LGR;
|
||||
if (firstTwoLetters == "LC") return RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION_LGR;
|
||||
if (firstTwoLetters == "LW") return RifEclipseSummaryAddress::SUMMARY_WELL_LGR;
|
||||
|
||||
return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::fieldAddress(const std::string& quantityName)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_FIELD;
|
||||
addr.m_quantityName = quantityName;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::aquiferAddress(const std::string& quantityName, int aquiferNumber)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_AQUIFER;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_aquiferNumber = aquiferNumber;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::networkAddress(const std::string& quantityName)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_NETWORK;
|
||||
addr.m_quantityName = quantityName;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::miscAddress(const std::string& quantityName)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_MISC;
|
||||
addr.m_quantityName = quantityName;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::regionAddress(const std::string& quantityName, int regionNumber)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_REGION;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_regionNumber = regionNumber;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::regionToRegionAddress(const std::string& quantityName, int regionNumber, int region2Number)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_REGION_2_REGION;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_regionNumber = regionNumber;
|
||||
addr.m_regionNumber2 = region2Number;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::wellGroupAddress(const std::string& quantityName, const std::string& wellGroupName)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_WELL_GROUP;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_wellGroupName = wellGroupName;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::wellAddress(const std::string& quantityName, const std::string& wellName)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_WELL;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_wellName = wellName;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::wellCompletionAddress(const std::string& quantityName, const std::string& wellName, int i, int j, int k)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_WELL_COMPLETION;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_wellName = wellName;
|
||||
addr.m_cellI = i;
|
||||
addr.m_cellJ = j;
|
||||
addr.m_cellK = k;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::wellLgrAddress(const std::string& quantityName, const std::string& lgrName, const std::string& wellName)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_WELL_LGR;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_lgrName = lgrName;
|
||||
addr.m_wellName = wellName;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::wellCompletionLgrAddress(const std::string& quantityName, const std::string& lgrName, const std::string& wellName, int i, int j, int k)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_WELL_COMPLETION_LGR;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_lgrName = lgrName;
|
||||
addr.m_wellName = wellName;
|
||||
addr.m_cellI = i;
|
||||
addr.m_cellJ = j;
|
||||
addr.m_cellK = k;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::wellSegmentAddress(const std::string& quantityName, const std::string& wellName, int segmentNumber)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_WELL_SEGMENT;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_wellName = wellName;
|
||||
addr.m_wellSegmentNumber = segmentNumber;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::blockAddress(const std::string& quantityName, int i, int j, int k)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_BLOCK;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_cellI = i;
|
||||
addr.m_cellJ = j;
|
||||
addr.m_cellK = k;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::blockLgrAddress(const std::string& quantityName, const std::string& lgrName, int i, int j, int k)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_BLOCK_LGR;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_lgrName = lgrName;
|
||||
addr.m_cellI = i;
|
||||
addr.m_cellJ = j;
|
||||
addr.m_cellK = k;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::calculatedAddress(const std::string& quantityName)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_CALCULATED;
|
||||
addr.m_quantityName = quantityName;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -130,11 +468,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::calculatedCurveAddress(const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::importedAddress(const std::string& quantityName)
|
||||
{
|
||||
RifEclipseSummaryAddress fieldAddr;
|
||||
fieldAddr.m_variableCategory = SUMMARY_IMPORTED;
|
||||
fieldAddr.m_quantityName = quantityName;
|
||||
|
||||
return fieldAddr;
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_IMPORTED;
|
||||
addr.m_quantityName = quantityName;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -323,14 +660,13 @@ std::string RifEclipseSummaryAddress::formatUiTextIJK() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::tuple<int, int, int> RifEclipseSummaryAddress::ijkTupleFromUiText(const std::string &s)
|
||||
{
|
||||
auto firstSep = s.find(',');
|
||||
auto lastSep = s.find(',', firstSep + 1);
|
||||
CVF_ASSERT(firstSep != std::string::npos && lastSep != std::string::npos);
|
||||
auto textI = s.substr(0, firstSep);
|
||||
auto textJ = s.substr(firstSep + 1, lastSep - firstSep - 1);
|
||||
auto textK = s.substr(lastSep + 1);
|
||||
QStringList ijk = QString().fromStdString(s).trimmed().split(QRegExp("[ ,.:;]"));
|
||||
|
||||
if (ijk.size() != 3) return std::make_tuple(-1, -1, -1);
|
||||
|
||||
return std::make_tuple(RiaStdStringTools::toInt(textI), RiaStdStringTools::toInt(textJ), RiaStdStringTools::toInt(textK));
|
||||
return std::make_tuple(RiaStdStringTools::toInt(ijk[0].trimmed().toStdString()),
|
||||
RiaStdStringTools::toInt(ijk[1].trimmed().toStdString()),
|
||||
RiaStdStringTools::toInt(ijk[2].trimmed().toStdString()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class QTextStream;
|
||||
|
||||
@ -114,8 +115,24 @@ public:
|
||||
|
||||
// Static specialized creation methods
|
||||
|
||||
static RifEclipseSummaryAddress fieldVarAddress(const std::string& fieldVarName);
|
||||
static RifEclipseSummaryAddress calculatedCurveAddress(const std::string& curveName);
|
||||
static RifEclipseSummaryAddress fromEclipseTextAddress(const std::string& textAddress);
|
||||
static SummaryVarCategory identifyCategory(const std::string& quantityName);
|
||||
|
||||
static RifEclipseSummaryAddress fieldAddress(const std::string& quantityName);
|
||||
static RifEclipseSummaryAddress aquiferAddress(const std::string& quantityName, int aquiferNumber);
|
||||
static RifEclipseSummaryAddress networkAddress(const std::string& quantityName);
|
||||
static RifEclipseSummaryAddress miscAddress(const std::string& quantityName);
|
||||
static RifEclipseSummaryAddress regionAddress(const std::string& quantityName, int regionNumber);
|
||||
static RifEclipseSummaryAddress regionToRegionAddress(const std::string& quantityName, int regionNumber, int region2Number);
|
||||
static RifEclipseSummaryAddress wellGroupAddress(const std::string& quantityName, const std::string& wellGroupName);
|
||||
static RifEclipseSummaryAddress wellAddress(const std::string& quantityName, const std::string& wellName);
|
||||
static RifEclipseSummaryAddress wellCompletionAddress(const std::string& quantityName, const std::string& wellName, int i, int j, int k);
|
||||
static RifEclipseSummaryAddress wellLgrAddress(const std::string& quantityName, const std::string& lgrName, const std::string& wellName);
|
||||
static RifEclipseSummaryAddress wellCompletionLgrAddress(const std::string& quantityName, const std::string& lgrName, const std::string& wellName, int i, int j, int k);
|
||||
static RifEclipseSummaryAddress wellSegmentAddress(const std::string& quantityName, const std::string& wellName, int segmentNumber);
|
||||
static RifEclipseSummaryAddress blockAddress(const std::string& quantityName, int i, int j, int k);
|
||||
static RifEclipseSummaryAddress blockLgrAddress(const std::string& quantityName, const std::string& lgrName, int i, int j, int k);
|
||||
static RifEclipseSummaryAddress calculatedAddress(const std::string& quantityName);
|
||||
static RifEclipseSummaryAddress importedAddress(const std::string& quantityName);
|
||||
|
||||
// Access methods
|
||||
@ -152,10 +169,10 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
std::string formatUiTextIJK() const;
|
||||
std::tuple<int, int, int> ijkTupleFromUiText(const std::string &s);
|
||||
std::string formatUiTextRegionToRegion() const;
|
||||
std::pair<int, int> regionToRegionPairFromUiText(const std::string &s);
|
||||
std::string formatUiTextIJK() const;
|
||||
static std::tuple<int, int, int> ijkTupleFromUiText(const std::string &s);
|
||||
std::string formatUiTextRegionToRegion() const;
|
||||
std::pair<int, int> regionToRegionPairFromUiText(const std::string &s);
|
||||
|
||||
SummaryVarCategory m_variableCategory;
|
||||
std::string m_quantityName;
|
||||
|
@ -153,7 +153,7 @@ bool RifEclipseUserDataKeywordTools::isYearX(const std::string& identifier)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress(const std::string quantityName, const std::vector<std::string>& columnHeaderText)
|
||||
{
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseUserDataParserTools::identifyCategory(quantityName);
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::identifyCategory(quantityName);
|
||||
|
||||
if (category == RifEclipseSummaryAddress::SUMMARY_INVALID)
|
||||
{
|
||||
@ -284,30 +284,6 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress(cons
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Column header text format: [<ER|ERR|ERROR>:]<VECTOR>:<CATEGORY_VALUE_NAME1>[:<CATEGORY_VALUE_NAME2>][....]
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddressFromObservedData(const std::string& columnHeaderText)
|
||||
{
|
||||
QStringList names = QString().fromStdString(columnHeaderText).split(":");
|
||||
|
||||
int vectorNameIndex = 0;
|
||||
bool isErrorResult = false;
|
||||
|
||||
if (names.size() > 1 && names[0].trimmed().startsWith("ER", Qt::CaseInsensitive))
|
||||
{
|
||||
vectorNameIndex = 1;
|
||||
isErrorResult = true;
|
||||
}
|
||||
|
||||
std::vector<std::string> columnHeaderTexts;
|
||||
for (int i = vectorNameIndex + 1; i < names.size(); i++) columnHeaderTexts.push_back(names[i].trimmed().toStdString());
|
||||
|
||||
RifEclipseSummaryAddress address = makeAndFillAddress(names[vectorNameIndex].trimmed().toStdString(), columnHeaderTexts);
|
||||
if (isErrorResult) address.setAsErrorResult();
|
||||
return address;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -42,7 +42,6 @@ public:
|
||||
static bool isYearX(const std::string& identifier);
|
||||
|
||||
static RifEclipseSummaryAddress makeAndFillAddress(const std::string quantityName, const std::vector<std::string>& columnHeaderText);
|
||||
static RifEclipseSummaryAddress makeAndFillAddressFromObservedData(const std::string& columnHeaderText);
|
||||
|
||||
static bool isStepType(const std::string& identifier);
|
||||
static size_t computeRequiredHeaderLineCount(const std::vector<std::string>& words);
|
||||
|
@ -116,42 +116,42 @@ std::vector<std::string> RifEclipseUserDataParserTools::splitLineAndRemoveCommen
|
||||
return words;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress::SummaryVarCategory RifEclipseUserDataParserTools::identifyCategory(const std::string& word)
|
||||
{
|
||||
if (word.size() == 0) return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
|
||||
if (!RiaStdStringTools::containsOnlyLettersAndDigits(word)) return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
|
||||
if (word.size() > 2 && word[0] == 'R' && word[2] == 'F')
|
||||
{
|
||||
return RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION;
|
||||
}
|
||||
|
||||
char firstLetter = word.at(0);
|
||||
|
||||
if (firstLetter == 'A') return RifEclipseSummaryAddress::SUMMARY_AQUIFER;
|
||||
if (firstLetter == 'B') return RifEclipseSummaryAddress::SUMMARY_BLOCK;
|
||||
if (firstLetter == 'C') return RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION;
|
||||
if (firstLetter == 'F') return RifEclipseSummaryAddress::SUMMARY_FIELD;
|
||||
if (firstLetter == 'G') return RifEclipseSummaryAddress::SUMMARY_WELL_GROUP;
|
||||
if (firstLetter == 'N') return RifEclipseSummaryAddress::SUMMARY_NETWORK;
|
||||
if (firstLetter == 'R') return RifEclipseSummaryAddress::SUMMARY_REGION;
|
||||
if (firstLetter == 'S') return RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT;
|
||||
if (firstLetter == 'W') return RifEclipseSummaryAddress::SUMMARY_WELL;
|
||||
|
||||
if (word.size() < 2) return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
|
||||
std::string firstTwoLetters = word.substr(0, 2);
|
||||
|
||||
if (firstTwoLetters == "LB") return RifEclipseSummaryAddress::SUMMARY_BLOCK_LGR;
|
||||
if (firstTwoLetters == "LC") return RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION_LGR;
|
||||
if (firstTwoLetters == "LW") return RifEclipseSummaryAddress::SUMMARY_WELL_LGR;
|
||||
|
||||
return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
}
|
||||
////--------------------------------------------------------------------------------------------------
|
||||
/////
|
||||
////--------------------------------------------------------------------------------------------------
|
||||
//RifEclipseSummaryAddress::SummaryVarCategory RifEclipseUserDataParserTools::identifyCategory(const std::string& word)
|
||||
//{
|
||||
// if (word.size() == 0) return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
//
|
||||
// if (!RiaStdStringTools::containsOnlyLettersAndDigits(word)) return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
//
|
||||
// if (word.size() > 2 && word[0] == 'R' && word[2] == 'F')
|
||||
// {
|
||||
// return RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION;
|
||||
// }
|
||||
//
|
||||
// char firstLetter = word.at(0);
|
||||
//
|
||||
// if (firstLetter == 'A') return RifEclipseSummaryAddress::SUMMARY_AQUIFER;
|
||||
// if (firstLetter == 'B') return RifEclipseSummaryAddress::SUMMARY_BLOCK;
|
||||
// if (firstLetter == 'C') return RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION;
|
||||
// if (firstLetter == 'F') return RifEclipseSummaryAddress::SUMMARY_FIELD;
|
||||
// if (firstLetter == 'G') return RifEclipseSummaryAddress::SUMMARY_WELL_GROUP;
|
||||
// if (firstLetter == 'N') return RifEclipseSummaryAddress::SUMMARY_NETWORK;
|
||||
// if (firstLetter == 'R') return RifEclipseSummaryAddress::SUMMARY_REGION;
|
||||
// if (firstLetter == 'S') return RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT;
|
||||
// if (firstLetter == 'W') return RifEclipseSummaryAddress::SUMMARY_WELL;
|
||||
//
|
||||
// if (word.size() < 2) return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
//
|
||||
// std::string firstTwoLetters = word.substr(0, 2);
|
||||
//
|
||||
// if (firstTwoLetters == "LB") return RifEclipseSummaryAddress::SUMMARY_BLOCK_LGR;
|
||||
// if (firstTwoLetters == "LC") return RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION_LGR;
|
||||
// if (firstTwoLetters == "LW") return RifEclipseSummaryAddress::SUMMARY_WELL_LGR;
|
||||
//
|
||||
// return RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
//}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -86,7 +86,7 @@ void RifCalculatedSummaryCurveReader::buildMetaData()
|
||||
|
||||
for (RimSummaryCalculation* calc : m_calculationCollection->calculations())
|
||||
{
|
||||
m_allResultAddresses.push_back(RifEclipseSummaryAddress::calculatedCurveAddress(calc->description().toStdString()));
|
||||
m_allResultAddresses.push_back(RifEclipseSummaryAddress::calculatedAddress(calc->description().toStdString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -383,7 +383,7 @@ void RiuSummaryCurveDefSelection::setDefaultSelection(const std::vector<RimSumma
|
||||
auto allSumCases = proj->allSummaryCases();
|
||||
if (allSumCases.size() > 0)
|
||||
{
|
||||
RifEclipseSummaryAddress defaultAddress = RifEclipseSummaryAddress::fieldVarAddress("FOPT");
|
||||
RifEclipseSummaryAddress defaultAddress = RifEclipseSummaryAddress::fieldAddress("FOPT");
|
||||
|
||||
std::vector<RimSummaryCase*> selectTheseCases = defaultCases;
|
||||
if (selectTheseCases.empty()) selectTheseCases.push_back(allSumCases[0]);
|
||||
@ -416,7 +416,7 @@ void RiuSummaryCurveDefSelection::setSelectedCurveDefinitions(const std::vector<
|
||||
if (summaryAddress.category() == RifEclipseSummaryAddress::SUMMARY_INVALID)
|
||||
{
|
||||
// If we have an invalid address, set the default address to Field
|
||||
summaryAddress = RifEclipseSummaryAddress::fieldVarAddress(summaryAddress.quantityName());
|
||||
summaryAddress = RifEclipseSummaryAddress::fieldAddress(summaryAddress.quantityName());
|
||||
}
|
||||
|
||||
// Select summary category if not already selected
|
||||
|
Loading…
Reference in New Issue
Block a user