mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
parent
704f4fa42b
commit
ee11d4fde7
@ -351,7 +351,6 @@ bool RiaApplication::loadProject(const QString& projectFileName, ProjectLoadActi
|
||||
{
|
||||
//printf("Create well path collection for oil field %i in loadProject.\n", oilFieldIdx);
|
||||
oilField->wellPathCollection = new RimWellPathCollection();
|
||||
oilField->wellPathCollection->setProject(m_project);
|
||||
}
|
||||
|
||||
if (oilField->wellPathCollection) oilField->wellPathCollection->readWellPathFiles();
|
||||
@ -474,7 +473,6 @@ void RiaApplication::addWellPathsToModel(QList<QString> wellPathFilePaths)
|
||||
{
|
||||
//printf("Create well path collection.\n");
|
||||
oilField->wellPathCollection = new RimWellPathCollection();
|
||||
oilField->wellPathCollection->setProject(m_project);
|
||||
|
||||
m_project->updateConnectedEditors();
|
||||
}
|
||||
@ -497,7 +495,6 @@ void RiaApplication::addWellLogsToModel(const QList<QString>& wellLogFilePaths)
|
||||
if (oilField->wellPathCollection == NULL)
|
||||
{
|
||||
oilField->wellPathCollection = new RimWellPathCollection();
|
||||
oilField->wellPathCollection->setProject(m_project);
|
||||
|
||||
m_project->updateConnectedEditors();
|
||||
}
|
||||
|
@ -306,7 +306,6 @@ void RimProject::initAfterRead()
|
||||
{
|
||||
RimOilField* oilField = oilFields[oilFieldIdx];
|
||||
if (oilField == NULL || oilField->wellPathCollection == NULL) continue;
|
||||
oilField->wellPathCollection->setProject(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,6 @@ RimWellPath::RimWellPath()
|
||||
m_wellLogFile.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_wellPath = NULL;
|
||||
m_project = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -148,7 +147,9 @@ RivWellPathPartMgr* RimWellPath::partMgr()
|
||||
{
|
||||
if (m_wellPathPartMgr.isNull())
|
||||
{
|
||||
m_wellPathPartMgr = new RivWellPathPartMgr(m_wellPathCollection, this);
|
||||
RimWellPathCollection* wpColl;
|
||||
this->firstAnchestorOrThisOfType(wpColl);
|
||||
if (wpColl) m_wellPathPartMgr = new RivWellPathPartMgr(wpColl, this);
|
||||
}
|
||||
|
||||
return m_wellPathPartMgr.p();
|
||||
@ -161,7 +162,10 @@ RivWellPathPartMgr* RimWellPath::partMgr()
|
||||
void RimWellPath::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
partMgr()->scheduleGeometryRegen();
|
||||
if (m_project) m_project->createDisplayModelAndRedrawAllViews();
|
||||
|
||||
RimProject* proj;
|
||||
this->firstAnchestorOrThisOfType(proj);
|
||||
if (proj) proj->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
|
||||
|
||||
@ -177,7 +181,7 @@ caf::PdmFieldHandle* RimWellPath::objectToggleField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Read JSON or ascii file containing well path data
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPath::readWellPathFile(QString* errorMessage)
|
||||
bool RimWellPath::readWellPathFile(QString* errorMessage, RifWellPathAsciiFileReader* asciiReader)
|
||||
{
|
||||
QFileInfo fileInf(filepath());
|
||||
|
||||
@ -189,7 +193,7 @@ bool RimWellPath::readWellPathFile(QString* errorMessage)
|
||||
}
|
||||
else
|
||||
{
|
||||
this->readAsciiWellPathFile();
|
||||
this->readAsciiWellPathFile(asciiReader);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -254,9 +258,11 @@ void RimWellPath::readJsonWellPathFile()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPath::readAsciiWellPathFile()
|
||||
void RimWellPath::readAsciiWellPathFile(RifWellPathAsciiFileReader* asciiReader)
|
||||
{
|
||||
RifWellPathAsciiFileReader::WellData wpData = m_wellPathCollection->asciiFileReader()->readWellData(filepath(), wellPathIndexInFile());
|
||||
CVF_ASSERT(asciiReader);
|
||||
|
||||
RifWellPathAsciiFileReader::WellData wpData = asciiReader->readWellData(filepath(), wellPathIndexInFile());
|
||||
this->name = wpData.m_name;
|
||||
|
||||
setWellPathGeometry(wpData.m_wellPathGeometry.p());
|
||||
|
@ -49,8 +49,6 @@ public:
|
||||
RimWellPath();
|
||||
virtual ~RimWellPath();
|
||||
|
||||
void setProject(RimProject* project) { m_project = project; }
|
||||
void setCollection(RimWellPathCollection* collection) { m_wellPathCollection = collection; }
|
||||
void setLogFileInfo(RimWellLogFile* logFileInfo);
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
@ -74,7 +72,7 @@ public:
|
||||
RigWellPath* wellPathGeometry() { return m_wellPath.p(); }
|
||||
RivWellPathPartMgr* partMgr();
|
||||
|
||||
bool readWellPathFile(QString * errorMessage);
|
||||
bool readWellPathFile(QString * errorMessage, RifWellPathAsciiFileReader* asciiReader);
|
||||
void updateFilePathsFromProjectPath();
|
||||
|
||||
|
||||
@ -83,7 +81,7 @@ private:
|
||||
|
||||
void setWellPathGeometry(RigWellPath* wellPathModel) { m_wellPath = wellPathModel; }
|
||||
void readJsonWellPathFile();
|
||||
void readAsciiWellPathFile();
|
||||
void readAsciiWellPathFile(RifWellPathAsciiFileReader* asciiReader);
|
||||
QString surveyType() { return m_surveyType; }
|
||||
void setSurveyType(QString surveyType);
|
||||
|
||||
@ -104,6 +102,4 @@ private:
|
||||
|
||||
cvf::ref<RigWellPath> m_wellPath;
|
||||
cvf::ref<RivWellPathPartMgr> m_wellPathPartMgr;
|
||||
caf::PdmPointer<RimWellPathCollection> m_wellPathCollection;
|
||||
RimProject* m_project;
|
||||
};
|
||||
|
@ -82,7 +82,6 @@ RimWellPathCollection::RimWellPathCollection()
|
||||
wellPaths.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_wellPathCollectionPartManager = new RivWellPathCollectionPartMgr(this);
|
||||
m_project = NULL;
|
||||
|
||||
m_asciiFileReader = new RifWellPathAsciiFileReader;
|
||||
}
|
||||
@ -107,20 +106,6 @@ void RimWellPathCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCollection::setProject( RimProject* project )
|
||||
{
|
||||
m_project = project;
|
||||
for (size_t wellPathIdx = 0; wellPathIdx < wellPaths.size(); wellPathIdx++)
|
||||
{
|
||||
wellPaths[wellPathIdx]->setProject(m_project);
|
||||
wellPaths[wellPathIdx]->setCollection(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Read JSON files containing well path data
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -133,7 +118,7 @@ void RimWellPathCollection::readWellPathFiles()
|
||||
if (!wellPaths[wpIdx]->filepath().isEmpty())
|
||||
{
|
||||
QString errorMessage;
|
||||
if (!wellPaths[wpIdx]->readWellPathFile(&errorMessage))
|
||||
if (!wellPaths[wpIdx]->readWellPathFile(&errorMessage, this->asciiFileReader()))
|
||||
{
|
||||
QMessageBox::warning(RiuMainWindow::instance(),
|
||||
"File open error",
|
||||
@ -203,8 +188,6 @@ void RimWellPathCollection::addWellPaths( QStringList filePaths )
|
||||
if (fi.suffix().compare("json") == 0)
|
||||
{
|
||||
RimWellPath* wellPath = new RimWellPath();
|
||||
wellPath->setProject(m_project);
|
||||
wellPath->setCollection(this);
|
||||
wellPath->filepath = filePath;
|
||||
wellPathArray.push_back(wellPath);
|
||||
}
|
||||
@ -215,8 +198,6 @@ void RimWellPathCollection::addWellPaths( QStringList filePaths )
|
||||
for (size_t i = 0; i < wellPathCount; ++i)
|
||||
{
|
||||
RimWellPath* wellPath = new RimWellPath();
|
||||
wellPath->setProject(m_project);
|
||||
wellPath->setCollection(this);
|
||||
wellPath->filepath = filePath;
|
||||
wellPath->wellPathIndexInFile = static_cast<int>(i);
|
||||
wellPathArray.push_back(wellPath);
|
||||
@ -239,7 +220,7 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector<RimWellPath*>& wellP
|
||||
for (size_t wpIdx = 0; wpIdx < wellPathArray.size(); wpIdx++)
|
||||
{
|
||||
RimWellPath* wellPath = wellPathArray[wpIdx];
|
||||
wellPath->readWellPathFile(NULL);
|
||||
wellPath->readWellPathFile(NULL, this->asciiFileReader());
|
||||
|
||||
progress.setProgressDescription(QString("Reading file %1").arg(wellPath->name));
|
||||
|
||||
@ -249,7 +230,7 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector<RimWellPath*>& wellP
|
||||
{
|
||||
existingWellPath->filepath = wellPath->filepath;
|
||||
existingWellPath->wellPathIndexInFile = wellPath->wellPathIndexInFile;
|
||||
existingWellPath->readWellPathFile(NULL);
|
||||
existingWellPath->readWellPathFile(NULL, this->asciiFileReader());
|
||||
|
||||
delete wellPath;
|
||||
}
|
||||
@ -279,7 +260,6 @@ void RimWellPathCollection::addWellLogs(const QStringList& filePaths)
|
||||
if (!wellPath)
|
||||
{
|
||||
wellPath = new RimWellPath();
|
||||
wellPath->setCollection(this);
|
||||
wellPaths.push_back(wellPath);
|
||||
}
|
||||
|
||||
@ -322,7 +302,9 @@ caf::PdmFieldHandle* RimWellPathCollection::objectToggleField()
|
||||
void RimWellPathCollection::scheduleGeometryRegenAndRedrawViews()
|
||||
{
|
||||
m_wellPathCollectionPartManager->scheduleGeometryRegen();
|
||||
if (m_project) m_project->createDisplayModelAndRedrawAllViews();
|
||||
RimProject* proj;
|
||||
this->firstAnchestorOrThisOfType(proj);
|
||||
if (proj) proj->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -102,7 +102,6 @@ private:
|
||||
void readAndAddWellPaths(std::vector<RimWellPath*>& wellPathArray);
|
||||
void sortWellsByName();
|
||||
|
||||
caf::PdmPointer<RimProject> m_project;
|
||||
cvf::ref<RivWellPathCollectionPartMgr> m_wellPathCollectionPartManager;
|
||||
|
||||
RifWellPathAsciiFileReader* m_asciiFileReader;
|
||||
|
Loading…
Reference in New Issue
Block a user