mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#2329 Add relocate of RimWellLogFile
This commit is contained in:
parent
a40a3578f2
commit
561e20a37e
@ -52,6 +52,8 @@
|
||||
#include "RimMultiSnapshotDefinition.h"
|
||||
#include "RimObservedDataCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimPltPlotCollection.h"
|
||||
#include "RimRftPlotCollection.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
@ -59,12 +61,11 @@
|
||||
#include "RimView.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimViewLinkerCollection.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimRftPlotCollection.h"
|
||||
#include "RimPltPlotCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathImport.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuMainPlotWindow.h"
|
||||
@ -470,6 +471,15 @@ void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName
|
||||
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<RimWellLogFile*> rimWellLogFiles;
|
||||
this->descendantsIncludingThisOfType(rimWellLogFiles);
|
||||
|
||||
for (auto rimWellLogFile : rimWellLogFiles)
|
||||
{
|
||||
rimWellLogFile->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
||||
}
|
||||
}
|
||||
|
||||
wellPathImport->updateFilePaths();
|
||||
}
|
||||
|
@ -243,6 +243,21 @@ bool RimWellLogFile::hasFlowData() const
|
||||
return RimWellPlotTools::hasFlowData(this);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogFile::updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath)
|
||||
{
|
||||
bool foundFile = false;
|
||||
std::vector<QString> searchedPaths;
|
||||
|
||||
QString fileNameCandidate = RimTools::relocateFile(m_fileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths);
|
||||
if (foundFile)
|
||||
{
|
||||
m_fileName = fileNameCandidate;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -72,6 +72,8 @@ public:
|
||||
|
||||
RimWellLogFile::WellFlowCondition wellFlowRateCondition() const { return m_wellFlowCondition(); }
|
||||
|
||||
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
|
||||
|
||||
private:
|
||||
virtual void setupBeforeSave() override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
Loading…
Reference in New Issue
Block a user