#2221 Well Path Formation names: Improve user feedback on import

This commit is contained in:
Rebecca Cox
2017-12-07 08:34:12 +01:00
parent 9a4eab2569
commit 48f9769eb7
4 changed files with 30 additions and 2 deletions

View File

@@ -19,8 +19,10 @@
#include "RifWellPathFormationReader.h" #include "RifWellPathFormationReader.h"
#include "RiaLogging.h" #include "RiaLogging.h"
#include "RiuMainWindow.h"
#include <QFile> #include <QFile>
#include <QMessageBox>
#include <QStringList> #include <QStringList>
#include <algorithm> #include <algorithm>
@@ -40,7 +42,9 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
readFileIntoMap(filePath, &formations); readFileIntoMap(filePath, &formations);
if (formations.empty()) 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<QString, std::vector<std::pair<double, QString>>>::iterator it; std::map<QString, std::vector<std::pair<double, QString>>>::iterator it;

View File

@@ -333,6 +333,10 @@ RimWellLogFile* RimWellPathCollection::addWellLogs(const QStringList& filePaths)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellPathCollection::addWellPathFormations(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) for (QString filePath : filePaths)
{ {
std::map<QString, cvf::ref<RigWellPathFormations>> newFormations = std::map<QString, cvf::ref<RigWellPathFormations>> newFormations =
@@ -346,12 +350,22 @@ void RimWellPathCollection::addWellPathFormations(const QStringList& filePaths)
wellPath = new RimWellPath(); wellPath = new RimWellPath();
wellPath->setName(it->first); wellPath->setName(it->first);
wellPaths.push_back(wellPath); wellPaths.push_back(wellPath);
RiaLogging::info(QString("Created new well: %1").arg(wellPath->name()));
} }
wellPath->setFormationsGeometry(it->second); wellPath->setFormationsGeometry(it->second);
QString wellFormationsCount = QString("%1").arg(it->second->formationNamesCount());
m_newestAddedWellPath = wellPath; 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(); this->sortWellsByName();
} }

View File

@@ -64,3 +64,11 @@ QString RigWellPathFormations::keyInFile() const
{ {
return m_keyInFile; return m_keyInFile;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigWellPathFormations::formationNamesCount() const
{
return m_measuredDepthAndFormationNames.size();
}

View File

@@ -37,6 +37,8 @@ public:
QString filePath() const; QString filePath() const;
QString keyInFile() const; QString keyInFile() const;
size_t formationNamesCount() const;
private: private:
QString m_filePath; QString m_filePath;
QString m_keyInFile; QString m_keyInFile;