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:
parent
dc95b217c5
commit
95c396ce77
@ -467,7 +467,7 @@ bool RiaApplication::loadProject(const QString& projectFileName, ProjectLoadActi
|
||||
|
||||
if (oilField->wellPathCollection)
|
||||
{
|
||||
oilField->wellPathCollection->readWellPathFiles();
|
||||
oilField->wellPathCollection->loadDataAndUpdate();
|
||||
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();
|
||||
|
||||
void createWellPathGeometry();
|
||||
void updateWellPathVisualization();
|
||||
|
||||
private:
|
||||
|
@ -55,6 +55,7 @@
|
||||
#include <cmath>
|
||||
#include <fstream>
|
||||
#include "RimFileWellPath.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@ -126,50 +127,56 @@ 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");
|
||||
|
||||
for (size_t wpIdx = 0; wpIdx < wellPaths.size(); wpIdx++)
|
||||
{
|
||||
RimFileWellPath* fWPath = dynamic_cast<RimFileWellPath*>(wellPaths[wpIdx]);
|
||||
RimModeledWellPath* mWPath = dynamic_cast<RimModeledWellPath*>(wellPaths[wpIdx]);
|
||||
if (fWPath)
|
||||
{
|
||||
if (!fWPath->filepath().isEmpty())
|
||||
{
|
||||
QString errorMessage;
|
||||
if (!fWPath->readWellPathFile(&errorMessage, m_wellPathImporter))
|
||||
{
|
||||
QMessageBox::warning(Riu3DMainWindowTools::mainWindowWidget(),
|
||||
"File open error",
|
||||
errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
for (RimWellLogFile* const wellLogFile : fWPath->wellLogFiles())
|
||||
{
|
||||
if (wellLogFile)
|
||||
if ( !fWPath->filepath().isEmpty() )
|
||||
{
|
||||
QString errorMessage;
|
||||
if (!wellLogFile->readFile(&errorMessage))
|
||||
if ( !fWPath->readWellPathFile(&errorMessage, m_wellPathImporter) )
|
||||
{
|
||||
QString displayMessage = "Could not open the well log file: \n" + wellLogFile->fileName();
|
||||
|
||||
if (!errorMessage.isEmpty())
|
||||
{
|
||||
displayMessage += "\n\n";
|
||||
displayMessage += errorMessage;
|
||||
}
|
||||
|
||||
QMessageBox::warning(Riu3DMainWindowTools::mainWindowWidget(),
|
||||
"File open error",
|
||||
displayMessage);
|
||||
errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
for ( RimWellLogFile* const wellLogFile : fWPath->wellLogFiles() )
|
||||
{
|
||||
if ( wellLogFile )
|
||||
{
|
||||
QString errorMessage;
|
||||
if ( !wellLogFile->readFile(&errorMessage) )
|
||||
{
|
||||
QString displayMessage = "Could not open the well log file: \n" + wellLogFile->fileName();
|
||||
|
||||
if ( !errorMessage.isEmpty() )
|
||||
{
|
||||
displayMessage += "\n\n";
|
||||
displayMessage += errorMessage;
|
||||
}
|
||||
|
||||
QMessageBox::warning(Riu3DMainWindowTools::mainWindowWidget(),
|
||||
"File open error",
|
||||
displayMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mWPath)
|
||||
{
|
||||
mWPath->createWellPathGeometry();
|
||||
}
|
||||
|
||||
progress.setProgressDescription(QString("Reading file %1").arg(wellPaths[wpIdx]->name()));
|
||||
progress.incrementProgress();
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public:
|
||||
|
||||
caf::PdmChildArrayField<RimWellPath*> wellPaths;
|
||||
|
||||
void readWellPathFiles();
|
||||
void loadDataAndUpdate();
|
||||
void addWellPaths(QStringList filePaths);
|
||||
|
||||
void removeWellPath(RimWellPath* wellPath);
|
||||
|
Loading…
Reference in New Issue
Block a user