mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1732 Update path to StimPlan xml if required
This commit is contained in:
@@ -126,3 +126,18 @@ void RimFractureTemplateCollection::loadAndUpdateData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimFractureTemplateCollection::updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath)
|
||||||
|
{
|
||||||
|
for (RimFractureTemplate* f : fractureDefinitions())
|
||||||
|
{
|
||||||
|
RimStimPlanFractureTemplate* stimPlanFracture = dynamic_cast<RimStimPlanFractureTemplate*>(f);
|
||||||
|
if (stimPlanFracture)
|
||||||
|
{
|
||||||
|
stimPlanFracture->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,4 +48,5 @@ public:
|
|||||||
void deleteFractureDefinitions();
|
void deleteFractureDefinitions();
|
||||||
void loadAndUpdateData();
|
void loadAndUpdateData();
|
||||||
|
|
||||||
|
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,16 +21,19 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
|
#include "RifStimPlanXmlReader.h"
|
||||||
|
|
||||||
#include "RigStimPlanFractureDefinition.h"
|
#include "RigStimPlanFractureDefinition.h"
|
||||||
#include "RigFractureGrid.h"
|
#include "RigFractureGrid.h"
|
||||||
|
|
||||||
|
#include "RigFractureCell.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimFracture.h"
|
#include "RimFracture.h"
|
||||||
|
#include "RimFractureContainment.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RigFractureCell.h"
|
|
||||||
#include "RimStimPlanColors.h"
|
#include "RimStimPlanColors.h"
|
||||||
#include "RimStimPlanLegendConfig.h"
|
#include "RimStimPlanLegendConfig.h"
|
||||||
#include "RimFractureContainment.h"
|
#include "RimTools.h"
|
||||||
|
|
||||||
#include "RivWellFracturePartMgr.h"
|
#include "RivWellFracturePartMgr.h"
|
||||||
|
|
||||||
@@ -46,7 +49,6 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "RifStimPlanXmlReader.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -178,6 +180,13 @@ QString RimStimPlanFractureTemplate::fileNameWithOutPath()
|
|||||||
return stimplanfileFileInfo.fileName();
|
return stimplanfileFileInfo.fileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimStimPlanFractureTemplate::updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath)
|
||||||
|
{
|
||||||
|
m_stimPlanFileName = RimTools::relocateFile(m_stimPlanFileName(), newProjectPath, oldProjectPath, nullptr, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ public:
|
|||||||
const QString& fileName();
|
const QString& fileName();
|
||||||
QString fileNameWithOutPath();
|
QString fileNameWithOutPath();
|
||||||
|
|
||||||
|
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
|
||||||
|
|
||||||
|
|
||||||
// Fracture geometry
|
// Fracture geometry
|
||||||
|
|
||||||
const RigFractureGrid* fractureGrid() const;
|
const RigFractureGrid* fractureGrid() const;
|
||||||
|
|||||||
@@ -438,6 +438,9 @@ void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName
|
|||||||
if (oilField->summaryCaseCollection() != NULL) {
|
if (oilField->summaryCaseCollection() != NULL) {
|
||||||
oilField->summaryCaseCollection()->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
oilField->summaryCaseCollection()->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CVF_ASSERT(oilField->fractureDefinitionCollection());
|
||||||
|
oilField->fractureDefinitionCollection()->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user