From 48f9769eb75b205c0573c879502afff1bf570833 Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Thu, 7 Dec 2017 08:34:12 +0100 Subject: [PATCH] #2221 Well Path Formation names: Improve user feedback on import --- .../FileInterface/RifWellPathFormationReader.cpp | 6 +++++- .../ProjectDataModel/RimWellPathCollection.cpp | 16 +++++++++++++++- .../ReservoirDataModel/RigWellPathFormations.cpp | 8 ++++++++ .../ReservoirDataModel/RigWellPathFormations.h | 2 ++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/FileInterface/RifWellPathFormationReader.cpp b/ApplicationCode/FileInterface/RifWellPathFormationReader.cpp index 445f180149..fdad0c55a6 100644 --- a/ApplicationCode/FileInterface/RifWellPathFormationReader.cpp +++ b/ApplicationCode/FileInterface/RifWellPathFormationReader.cpp @@ -19,8 +19,10 @@ #include "RifWellPathFormationReader.h" #include "RiaLogging.h" +#include "RiuMainWindow.h" #include +#include #include #include @@ -40,7 +42,9 @@ std::map> readFileIntoMap(filePath, &formations); if (formations.empty()) { - RiaLogging::error(QString("Failed to parse %1 as well picks").arg(filePath)); + QMessageBox::warning(RiuMainWindow::instance(), "Import failure", + QString("Failed to parse %1 as well picks file").arg(filePath)); + RiaLogging::error(QString("Failed to parse %1 as well picks file").arg(filePath)); } std::map>>::iterator it; diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp index d28d979b9b..964b425707 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp @@ -333,6 +333,10 @@ RimWellLogFile* RimWellPathCollection::addWellLogs(const QStringList& filePaths) //-------------------------------------------------------------------------------------------------- void RimWellPathCollection::addWellPathFormations(const QStringList& filePaths) { + QString outputMessage = "Well Picks Import\n"; + outputMessage += "-----------------------------------------------\n"; + outputMessage += "Well Name \tDetected Well Path \tCount\n"; + for (QString filePath : filePaths) { std::map> newFormations = @@ -346,12 +350,22 @@ void RimWellPathCollection::addWellPathFormations(const QStringList& filePaths) wellPath = new RimWellPath(); wellPath->setName(it->first); wellPaths.push_back(wellPath); + RiaLogging::info(QString("Created new well: %1").arg(wellPath->name())); } wellPath->setFormationsGeometry(it->second); + + QString wellFormationsCount = QString("%1").arg(it->second->formationNamesCount()); + m_newestAddedWellPath = wellPath; - RiaLogging::info(QString("Well picks set for well %1").arg(wellPath->name())); + + outputMessage += it->first + "\t\t"; + outputMessage += wellPath->name() + " \t\t\t"; + outputMessage += wellFormationsCount + "\n"; } } + outputMessage += "-----------------------------------------------"; + QMessageBox::information(RiuMainWindow::instance(), "Well Picks Import", outputMessage); + RiaLogging::info(outputMessage); this->sortWellsByName(); } diff --git a/ApplicationCode/ReservoirDataModel/RigWellPathFormations.cpp b/ApplicationCode/ReservoirDataModel/RigWellPathFormations.cpp index f99849bf44..7121c8ba9c 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPathFormations.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellPathFormations.cpp @@ -64,3 +64,11 @@ QString RigWellPathFormations::keyInFile() const { return m_keyInFile; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +size_t RigWellPathFormations::formationNamesCount() const +{ + return m_measuredDepthAndFormationNames.size(); +} diff --git a/ApplicationCode/ReservoirDataModel/RigWellPathFormations.h b/ApplicationCode/ReservoirDataModel/RigWellPathFormations.h index e3a65cb0e6..5d8f912cfc 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPathFormations.h +++ b/ApplicationCode/ReservoirDataModel/RigWellPathFormations.h @@ -37,6 +37,8 @@ public: QString filePath() const; QString keyInFile() const; + size_t formationNamesCount() const; + private: QString m_filePath; QString m_keyInFile;