mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2122 Formation/Well Path: Use reader in WellPath classes
This commit is contained in:
@@ -21,36 +21,39 @@
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaWellNameComparer.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "RifWellPathFormationsImporter.h"
|
||||
#include "RifWellPathImporter.h"
|
||||
|
||||
#include "RivWellPathPartMgr.h"
|
||||
|
||||
#include "cafPdmUiEditorHandle.h"
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
#include <QString>
|
||||
|
||||
#include <fstream>
|
||||
#include <cmath>
|
||||
#include "RivWellPathPartMgr.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include <fstream>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@@ -97,6 +100,7 @@ RimWellPathCollection::RimWellPathCollection()
|
||||
|
||||
m_wellPathImporter = new RifWellPathImporter;
|
||||
m_newestAddedWellName = QString();
|
||||
m_wellPathFormationsImporter = new RifWellPathFormationsImporter;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,6 +111,7 @@ RimWellPathCollection::~RimWellPathCollection()
|
||||
{
|
||||
wellPaths.deleteAllChildObjects();
|
||||
delete m_wellPathImporter;
|
||||
delete m_wellPathFormationsImporter;
|
||||
}
|
||||
|
||||
|
||||
@@ -322,6 +327,34 @@ RimWellLogFile* RimWellPathCollection::addWellLogs(const QStringList& filePaths)
|
||||
return logFileInfo;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathFormations* RimWellPathCollection::addWellFormations(const QStringList& filePaths)
|
||||
{
|
||||
RimWellPathFormations* wellFormationFile = nullptr;
|
||||
/*
|
||||
foreach(QString filePath, filePaths)
|
||||
{
|
||||
wellFormationFile = RimWellPathFormations::readWellLogFile(filePath);
|
||||
if (wellFormationFile)
|
||||
{
|
||||
RimWellPath* wellPath = tryFindMatchingWellPath(wellFormationFile->wellName());
|
||||
if (!wellPath)
|
||||
{
|
||||
wellPath = new RimWellPath();
|
||||
wellPaths.push_back(wellPath);
|
||||
}
|
||||
|
||||
wellPath->setWellFormationFile(wellFormationFile);
|
||||
}
|
||||
}
|
||||
|
||||
this->sortWellsByName();*/
|
||||
|
||||
return wellFormationFile;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -461,6 +494,31 @@ void RimWellPathCollection::deleteAllWellPaths()
|
||||
m_wellPathImporter->clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCollection::readWellPathFormationFiles()
|
||||
{
|
||||
caf::ProgressInfo progress(wellPaths.size(), "Reading well path formations from file");
|
||||
|
||||
for (size_t wpIdx = 0; wpIdx < wellPaths.size(); wpIdx++)
|
||||
{
|
||||
if (!wellPaths[wpIdx]->filepath().isEmpty())
|
||||
{
|
||||
QString errorMessage;
|
||||
if (!wellPaths[wpIdx]->readWellPathFormationsFile(&errorMessage, m_wellPathFormationsImporter))
|
||||
{
|
||||
QMessageBox::warning(RiuMainWindow::instance(),
|
||||
"File open error",
|
||||
errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
progress.setProgressDescription(QString("Reading formation file %1").arg(wpIdx));
|
||||
progress.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user