mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2221 Well Path Formation names: Improve user feedback on import
This commit is contained in:
parent
9a4eab2569
commit
48f9769eb7
@ -19,8 +19,10 @@
|
||||
#include "RifWellPathFormationReader.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
#include <QStringList>
|
||||
|
||||
#include <algorithm>
|
||||
@ -40,7 +42,9 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
|
||||
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<QString, std::vector<std::pair<double, QString>>>::iterator it;
|
||||
|
@ -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<QString, cvf::ref<RigWellPathFormations>> 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();
|
||||
}
|
||||
|
@ -64,3 +64,11 @@ QString RigWellPathFormations::keyInFile() const
|
||||
{
|
||||
return m_keyInFile;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigWellPathFormations::formationNamesCount() const
|
||||
{
|
||||
return m_measuredDepthAndFormationNames.size();
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ public:
|
||||
QString filePath() const;
|
||||
QString keyInFile() const;
|
||||
|
||||
size_t formationNamesCount() const;
|
||||
|
||||
private:
|
||||
QString m_filePath;
|
||||
QString m_keyInFile;
|
||||
|
Loading…
Reference in New Issue
Block a user