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:
@@ -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;
|
||||||
|
@@ -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();
|
||||||
}
|
}
|
||||||
|
@@ -64,3 +64,11 @@ QString RigWellPathFormations::keyInFile() const
|
|||||||
{
|
{
|
||||||
return m_keyInFile;
|
return m_keyInFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
size_t RigWellPathFormations::formationNamesCount() const
|
||||||
|
{
|
||||||
|
return m_measuredDepthAndFormationNames.size();
|
||||||
|
}
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user