mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
SSIHUB: Update file paths for and well path cache
Consolidated cache creation in RimTools
This commit is contained in:
@@ -17,8 +17,14 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimWellPathImport.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "cafPdmUiTreeViewEditor.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
namespace caf {
|
||||
|
||||
template<>
|
||||
@@ -209,5 +215,37 @@ RimWellPathImport::~RimWellPathImport()
|
||||
regions.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathImport::updateFilePaths()
|
||||
{
|
||||
QString wellPathsFolderPath = RimTools::getCacheRootDirectoryPathFromProject();
|
||||
wellPathsFolderPath += "_wellpaths";
|
||||
|
||||
for (size_t regionIdx = 0; regionIdx < this->regions.size(); regionIdx++)
|
||||
{
|
||||
for (size_t fIdx = 0; fIdx < this->regions[regionIdx]->fields.size(); fIdx++)
|
||||
{
|
||||
RimOilFieldEntry* oilField = this->regions[regionIdx]->fields[fIdx];
|
||||
|
||||
QFileInfo fi(oilField->wellsFilePath);
|
||||
|
||||
QString newWellsFilePath = wellPathsFolderPath + "/" + fi.fileName();
|
||||
oilField->wellsFilePath = newWellsFilePath;
|
||||
|
||||
for (size_t wIdx = 0; wIdx < oilField->wells.size(); wIdx++)
|
||||
{
|
||||
RimWellPathEntry* rimWellPathEntry = oilField->wells[wIdx];
|
||||
|
||||
QFileInfo fiWell(rimWellPathEntry->wellPathFilePath);
|
||||
|
||||
QString newFilePath = wellPathsFolderPath + "/" + fiWell.fileName();
|
||||
rimWellPathEntry->wellPathFilePath = newFilePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
void updateFieldVisibility();
|
||||
|
||||
|
||||
void updateFilePaths();
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user