mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1957 Observed Data : Add handling of custom well name
This commit is contained in:
@@ -49,7 +49,7 @@ RifColumnBasedUserData::~RifColumnBasedUserData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifColumnBasedUserData::parse(const QString& data)
|
||||
bool RifColumnBasedUserData::parse(const QString& data, const QString& customWellName, const QString& customWellGroupName)
|
||||
{
|
||||
m_allResultAddresses.clear();
|
||||
m_timeSteps.clear();
|
||||
@@ -129,6 +129,17 @@ bool RifColumnBasedUserData::parse(const QString& data)
|
||||
if (ci.isAVector)
|
||||
{
|
||||
RifEclipseSummaryAddress sumAddress = ci.summaryAddress;
|
||||
|
||||
if (customWellName.size() > 0)
|
||||
{
|
||||
sumAddress.setWellName(customWellName.toStdString());
|
||||
}
|
||||
|
||||
if (customWellGroupName.size() > 0)
|
||||
{
|
||||
sumAddress.setWellGroupName(customWellGroupName.toStdString());
|
||||
}
|
||||
|
||||
m_allResultAddresses.push_back(sumAddress);
|
||||
|
||||
m_mapFromAddressToTimeStepIndex[sumAddress] = m_timeSteps.size() - 1;
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
RifColumnBasedUserData();
|
||||
~RifColumnBasedUserData();
|
||||
|
||||
bool parse(const QString& data);
|
||||
bool parse(const QString& data, const QString& customWellName, const QString& customWellGroupName);
|
||||
|
||||
virtual const std::vector<time_t>& timeSteps(const RifEclipseSummaryAddress& resultAddress) const override;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ RifKeywordVectorUserData::~RifKeywordVectorUserData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifKeywordVectorUserData::parse(const QString& data)
|
||||
bool RifKeywordVectorUserData::parse(const QString& data, const QString& customWellName)
|
||||
{
|
||||
m_allResultAddresses.clear();
|
||||
m_timeSteps.clear();
|
||||
@@ -87,6 +87,9 @@ bool RifKeywordVectorUserData::parse(const QString& data)
|
||||
|
||||
// Find all time vectors
|
||||
|
||||
std::map<QString, size_t> mapFromOriginToTimeStepIndex;
|
||||
|
||||
|
||||
for (size_t i = 0; i < keyValuePairVector.size(); i++)
|
||||
{
|
||||
const std::map<QString, QString>& keyValuePairs = keyValuePairVector[i];
|
||||
@@ -136,7 +139,7 @@ bool RifKeywordVectorUserData::parse(const QString& data)
|
||||
|
||||
QString originText = valueForKey(keyValuePairs, "ORIGIN");
|
||||
|
||||
m_mapFromOriginToTimeStepIndex[originText] = m_timeSteps.size() - 1;
|
||||
mapFromOriginToTimeStepIndex[originText] = m_timeSteps.size() - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,17 +154,23 @@ bool RifKeywordVectorUserData::parse(const QString& data)
|
||||
if (isVectorHeader(keyValuePairs))
|
||||
{
|
||||
QString originText = valueForKey(keyValuePairs, "ORIGIN");
|
||||
auto timeStepIndexIterator = m_mapFromOriginToTimeStepIndex.find(originText);
|
||||
if (timeStepIndexIterator != m_mapFromOriginToTimeStepIndex.end())
|
||||
auto timeStepIndexIterator = mapFromOriginToTimeStepIndex.find(originText);
|
||||
if (timeStepIndexIterator != mapFromOriginToTimeStepIndex.end())
|
||||
{
|
||||
QString vectorText = valueForKey(keyValuePairs, "VECTOR");
|
||||
|
||||
QString wellName = originText;
|
||||
if (customWellName.size() > 0)
|
||||
{
|
||||
wellName = customWellName;
|
||||
}
|
||||
|
||||
RifEclipseSummaryAddress addr(RifEclipseSummaryAddress::SUMMARY_WELL,
|
||||
vectorText.toStdString(),
|
||||
-1,
|
||||
-1,
|
||||
"",
|
||||
originText.toStdString(),
|
||||
wellName.toStdString(),
|
||||
-1,
|
||||
"",
|
||||
-1,
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
RifKeywordVectorUserData();
|
||||
~RifKeywordVectorUserData();
|
||||
|
||||
bool parse(const QString& data);
|
||||
bool parse(const QString& data, const QString& customWellName);
|
||||
|
||||
virtual const std::vector<time_t>& timeSteps(const RifEclipseSummaryAddress& resultAddress) const override;
|
||||
|
||||
@@ -61,7 +61,6 @@ private:
|
||||
|
||||
std::vector< std::vector<time_t> > m_timeSteps;
|
||||
|
||||
std::map<QString, size_t> m_mapFromOriginToTimeStepIndex;
|
||||
std::map<RifEclipseSummaryAddress, size_t> m_mapFromAddressToVectorIndex;
|
||||
std::map<RifEclipseSummaryAddress, size_t> m_mapFromAddressToTimeIndex;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user