mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2609 Make modeled well path visible when loading project file
This commit is contained in:
@@ -467,7 +467,7 @@ bool RiaApplication::loadProject(const QString& projectFileName, ProjectLoadActi
|
|||||||
|
|
||||||
if (oilField->wellPathCollection)
|
if (oilField->wellPathCollection)
|
||||||
{
|
{
|
||||||
oilField->wellPathCollection->readWellPathFiles();
|
oilField->wellPathCollection->loadDataAndUpdate();
|
||||||
oilField->wellPathCollection->readWellPathFormationFiles();
|
oilField->wellPathCollection->readWellPathFormationFiles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,14 @@ RimModeledWellPath::~RimModeledWellPath()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimModeledWellPath::createWellPathGeometry()
|
||||||
|
{
|
||||||
|
this->setWellPathGeometry(m_geometryDefinition->createWellPathGeometry().p());
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public:
|
|||||||
RimModeledWellPath();
|
RimModeledWellPath();
|
||||||
~RimModeledWellPath();
|
~RimModeledWellPath();
|
||||||
|
|
||||||
|
void createWellPathGeometry();
|
||||||
void updateWellPathVisualization();
|
void updateWellPathVisualization();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include "RimFileWellPath.h"
|
#include "RimFileWellPath.h"
|
||||||
|
#include "RimModeledWellPath.h"
|
||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
@@ -126,21 +127,22 @@ void RimWellPathCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|
|||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Read JSON files containing well path data
|
/// Read files containing well path data, or create geometry based on the targets
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellPathCollection::readWellPathFiles()
|
void RimWellPathCollection::loadDataAndUpdate()
|
||||||
{
|
{
|
||||||
caf::ProgressInfo progress(wellPaths.size(), "Reading well paths from file");
|
caf::ProgressInfo progress(wellPaths.size(), "Reading well paths from file");
|
||||||
|
|
||||||
for (size_t wpIdx = 0; wpIdx < wellPaths.size(); wpIdx++)
|
for (size_t wpIdx = 0; wpIdx < wellPaths.size(); wpIdx++)
|
||||||
{
|
{
|
||||||
RimFileWellPath* fWPath = dynamic_cast<RimFileWellPath*>(wellPaths[wpIdx]);
|
RimFileWellPath* fWPath = dynamic_cast<RimFileWellPath*>(wellPaths[wpIdx]);
|
||||||
|
RimModeledWellPath* mWPath = dynamic_cast<RimModeledWellPath*>(wellPaths[wpIdx]);
|
||||||
if (fWPath)
|
if (fWPath)
|
||||||
{
|
{
|
||||||
if (!fWPath->filepath().isEmpty())
|
if ( !fWPath->filepath().isEmpty() )
|
||||||
{
|
{
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!fWPath->readWellPathFile(&errorMessage, m_wellPathImporter))
|
if ( !fWPath->readWellPathFile(&errorMessage, m_wellPathImporter) )
|
||||||
{
|
{
|
||||||
QMessageBox::warning(Riu3DMainWindowTools::mainWindowWidget(),
|
QMessageBox::warning(Riu3DMainWindowTools::mainWindowWidget(),
|
||||||
"File open error",
|
"File open error",
|
||||||
@@ -148,16 +150,16 @@ void RimWellPathCollection::readWellPathFiles()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RimWellLogFile* const wellLogFile : fWPath->wellLogFiles())
|
for ( RimWellLogFile* const wellLogFile : fWPath->wellLogFiles() )
|
||||||
{
|
{
|
||||||
if (wellLogFile)
|
if ( wellLogFile )
|
||||||
{
|
{
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!wellLogFile->readFile(&errorMessage))
|
if ( !wellLogFile->readFile(&errorMessage) )
|
||||||
{
|
{
|
||||||
QString displayMessage = "Could not open the well log file: \n" + wellLogFile->fileName();
|
QString displayMessage = "Could not open the well log file: \n" + wellLogFile->fileName();
|
||||||
|
|
||||||
if (!errorMessage.isEmpty())
|
if ( !errorMessage.isEmpty() )
|
||||||
{
|
{
|
||||||
displayMessage += "\n\n";
|
displayMessage += "\n\n";
|
||||||
displayMessage += errorMessage;
|
displayMessage += errorMessage;
|
||||||
@@ -170,6 +172,11 @@ void RimWellPathCollection::readWellPathFiles()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (mWPath)
|
||||||
|
{
|
||||||
|
mWPath->createWellPathGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
progress.setProgressDescription(QString("Reading file %1").arg(wellPaths[wpIdx]->name()));
|
progress.setProgressDescription(QString("Reading file %1").arg(wellPaths[wpIdx]->name()));
|
||||||
progress.incrementProgress();
|
progress.incrementProgress();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public:
|
|||||||
|
|
||||||
caf::PdmChildArrayField<RimWellPath*> wellPaths;
|
caf::PdmChildArrayField<RimWellPath*> wellPaths;
|
||||||
|
|
||||||
void readWellPathFiles();
|
void loadDataAndUpdate();
|
||||||
void addWellPaths(QStringList filePaths);
|
void addWellPaths(QStringList filePaths);
|
||||||
|
|
||||||
void removeWellPath(RimWellPath* wellPath);
|
void removeWellPath(RimWellPath* wellPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user