From 19ce35432ce8a6387892456245b91fd3117ceb13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Mon, 9 Jul 2018 10:43:53 +0200 Subject: [PATCH] #3152 Observed data import. Fix accumulated data determination --- .../RifEclipseSummaryAddress.cpp | 35 +++++++++++++++++-- .../FileInterface/RifEclipseSummaryAddress.h | 2 +- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/ApplicationCode/FileInterface/RifEclipseSummaryAddress.cpp b/ApplicationCode/FileInterface/RifEclipseSummaryAddress.cpp index c64249feff..44ffacb046 100644 --- a/ApplicationCode/FileInterface/RifEclipseSummaryAddress.cpp +++ b/ApplicationCode/FileInterface/RifEclipseSummaryAddress.cpp @@ -717,8 +717,39 @@ bool RifEclipseSummaryAddress::isValid() const //-------------------------------------------------------------------------------------------------- bool RifEclipseSummaryAddress::hasAccumulatedData() const { - return QString::fromStdString(m_quantityName).endsWith("T") || - QString::fromStdString(m_quantityName).endsWith("TH"); + if (!isValidEclipseCategory()) return false; + + QString qBaseName = QString::fromStdString(quantityName()); + if (qBaseName.size() == 8) qBaseName.chop(3); + while (qBaseName.endsWith("_")) qBaseName.chop(1); + + return qBaseName.endsWith("T") || qBaseName.endsWith("TH"); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RifEclipseSummaryAddress::isValidEclipseCategory() const +{ + switch (category()) + { + case SUMMARY_FIELD: + case SUMMARY_AQUIFER: + case SUMMARY_NETWORK: + case SUMMARY_MISC: + case SUMMARY_REGION: + case SUMMARY_REGION_2_REGION: + case SUMMARY_WELL_GROUP: + case SUMMARY_WELL: + case SUMMARY_WELL_COMPLETION: + case SUMMARY_WELL_LGR: + case SUMMARY_WELL_COMPLETION_LGR: + case SUMMARY_WELL_SEGMENT: + case SUMMARY_BLOCK: + case SUMMARY_BLOCK_LGR: + return true; + } + return false; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/FileInterface/RifEclipseSummaryAddress.h b/ApplicationCode/FileInterface/RifEclipseSummaryAddress.h index 74f44ae1c0..c6d7790c5a 100644 --- a/ApplicationCode/FileInterface/RifEclipseSummaryAddress.h +++ b/ApplicationCode/FileInterface/RifEclipseSummaryAddress.h @@ -177,7 +177,7 @@ public: void setAsErrorResult() { m_isErrorResult = true; } bool isErrorResult() const { return m_isErrorResult; } bool hasAccumulatedData() const; - + bool isValidEclipseCategory() const; private: std::string formatUiTextIJK() const;