mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor issues
* Remove obsolete code * Fix path modification of a relative folder Replace start token '.' with file path to the project file to make sure that the path './wells/a-1h.dev' can be imported correctly. * Add more logging when keywords are missing from import
This commit is contained in:
parent
9099919bbc
commit
48469f33f6
@ -199,6 +199,13 @@ bool RifEclipseInputFileTools::openGridFile( const QString& fileName,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString txt = "Missing required keywords :";
|
||||||
|
if ( !specGridKw ) txt += " SPECGRID";
|
||||||
|
if ( !zCornKw ) txt += " ZCORN";
|
||||||
|
if ( !coordKw ) txt += " COORD";
|
||||||
|
|
||||||
|
RiaLogging::error( txt );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,17 +277,7 @@ void RimFractureTemplateCollection::loadAndUpdateData()
|
|||||||
{
|
{
|
||||||
stimPlanFracture->loadDataAndUpdate();
|
stimPlanFracture->loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimFractureTemplateCollection::updateFilePathsFromProjectPath( const QString& newProjectPath,
|
|
||||||
const QString& oldProjectPath )
|
|
||||||
{
|
|
||||||
for ( RimFractureTemplate* f : m_fractureDefinitions() )
|
|
||||||
{
|
|
||||||
RimEllipseFractureTemplate* ellipseFracture = dynamic_cast<RimEllipseFractureTemplate*>( f );
|
RimEllipseFractureTemplate* ellipseFracture = dynamic_cast<RimEllipseFractureTemplate*>( f );
|
||||||
if ( ellipseFracture )
|
if ( ellipseFracture )
|
||||||
{
|
{
|
||||||
|
@ -60,8 +60,6 @@ public:
|
|||||||
void createAndAssignTemplateCopyForNonMatchingUnit();
|
void createAndAssignTemplateCopyForNonMatchingUnit();
|
||||||
void loadAndUpdateData();
|
void loadAndUpdateData();
|
||||||
|
|
||||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
|
||||||
|
|
||||||
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
||||||
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
||||||
|
|
||||||
|
@ -150,15 +150,6 @@ void RimFormationNames::readFormationNamesFile( QString* errorMessage )
|
|||||||
m_formationNamesData = RifColorLegendData::readFormationNamesFile( m_formationNamesFileName().path(), errorMessage );
|
m_formationNamesData = RifColorLegendData::readFormationNamesFile( m_formationNamesFileName().path(), errorMessage );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimFormationNames::updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath )
|
|
||||||
{
|
|
||||||
// m_formationNamesFileName =
|
|
||||||
// RimTools::relocateFile( m_formationNamesFileName(), newProjectPath, oldProjectPath, nullptr, nullptr );
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -44,7 +44,6 @@ public:
|
|||||||
void updateConnectedViews();
|
void updateConnectedViews();
|
||||||
|
|
||||||
void readFormationNamesFile( QString* errorMessage );
|
void readFormationNamesFile( QString* errorMessage );
|
||||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
|
||||||
|
|
||||||
static QString layerZoneTableFileName();
|
static QString layerZoneTableFileName();
|
||||||
|
|
||||||
|
@ -112,18 +112,6 @@ std::vector<RimFormationNames*> RimFormationNamesCollection::importFiles( const
|
|||||||
return m_formationNamesList.children();
|
return m_formationNamesList.children();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimFormationNamesCollection::updateFilePathsFromProjectPath( const QString& newProjectPath,
|
|
||||||
const QString& oldProjectPath )
|
|
||||||
{
|
|
||||||
for ( RimFormationNames* fmNames : m_formationNamesList )
|
|
||||||
{
|
|
||||||
fmNames->updateFilePathsFromProjectPath( newProjectPath, oldProjectPath );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -39,8 +39,6 @@ public:
|
|||||||
|
|
||||||
std::vector<RimFormationNames*> importFiles( const QStringList& fileNames );
|
std::vector<RimFormationNames*> importFiles( const QStringList& fileNames );
|
||||||
|
|
||||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
|
||||||
|
|
||||||
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
||||||
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
||||||
|
|
||||||
|
@ -473,38 +473,18 @@ void RimProject::setProjectFileNameAndUpdateDependencies( const QString& project
|
|||||||
bool foundFile = false;
|
bool foundFile = false;
|
||||||
std::vector<QString> searchedPaths;
|
std::vector<QString> searchedPaths;
|
||||||
|
|
||||||
|
QString filePathCandidate = filePath->path();
|
||||||
|
if ( filePathCandidate.startsWith( '.' ) )
|
||||||
|
{
|
||||||
|
filePathCandidate = filePathCandidate.right( filePathCandidate.size() - 1 );
|
||||||
|
filePathCandidate = newProjectPath + filePathCandidate;
|
||||||
|
}
|
||||||
|
|
||||||
QString newFilePath =
|
QString newFilePath =
|
||||||
RimTools::relocateFile( filePath->path(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
RimTools::relocateFile( filePathCandidate, newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
||||||
filePath->setPath( newFilePath );
|
filePath->setPath( newFilePath );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update path to well path file cache
|
|
||||||
for ( RimOilField* oilField : oilFields )
|
|
||||||
{
|
|
||||||
if ( oilField == nullptr ) continue;
|
|
||||||
if ( oilField->wellPathCollection() != nullptr )
|
|
||||||
{
|
|
||||||
oilField->wellPathCollection()->updateFilePathsFromProjectPath( newProjectPath, oldProjectPath );
|
|
||||||
}
|
|
||||||
if ( oilField->formationNamesCollection() != nullptr )
|
|
||||||
{
|
|
||||||
oilField->formationNamesCollection()->updateFilePathsFromProjectPath( newProjectPath, oldProjectPath );
|
|
||||||
}
|
|
||||||
|
|
||||||
CVF_ASSERT( oilField->fractureDefinitionCollection() );
|
|
||||||
oilField->fractureDefinitionCollection()->updateFilePathsFromProjectPath( newProjectPath, oldProjectPath );
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
std::vector<RimWellLogFile*> rimWellLogFiles;
|
|
||||||
this->descendantsIncludingThisOfType( rimWellLogFiles );
|
|
||||||
|
|
||||||
for ( auto rimWellLogFile : rimWellLogFiles )
|
|
||||||
{
|
|
||||||
rimWellLogFile->updateFilePathsFromProjectPath( newProjectPath, oldProjectPath );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wellPathImport->updateFilePaths();
|
wellPathImport->updateFilePaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,22 +232,6 @@ bool RimWellLogFile::hasFlowData() const
|
|||||||
return RimWellPlotTools::hasFlowData( this );
|
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;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -70,8 +70,6 @@ public:
|
|||||||
|
|
||||||
RimWellLogFile::WellFlowCondition wellFlowRateCondition() const { return m_wellFlowCondition(); }
|
RimWellLogFile::WellFlowCondition wellFlowRateCondition() const { return m_wellFlowCondition(); }
|
||||||
|
|
||||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
|
||||||
|
|
||||||
static std::vector<std::pair<double, double>> findMdAndChannelValuesForWellPath( const RimWellPath* wellPath,
|
static std::vector<std::pair<double, double>> findMdAndChannelValuesForWellPath( const RimWellPath* wellPath,
|
||||||
const QString& channelName,
|
const QString& channelName,
|
||||||
QString* unitString = nullptr );
|
QString* unitString = nullptr );
|
||||||
|
@ -279,19 +279,6 @@ bool RimFileWellPath::isStoredInCache() const
|
|||||||
return !id().isEmpty();
|
return !id().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimFileWellPath::updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath )
|
|
||||||
{
|
|
||||||
QString newCacheFileName = getCacheFileName();
|
|
||||||
|
|
||||||
if ( caf::Utils::fileExists( newCacheFileName ) )
|
|
||||||
{
|
|
||||||
m_filePathInCache = newCacheFileName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -349,3 +336,16 @@ void RimFileWellPath::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimFileWellPath::initAfterRead()
|
||||||
|
{
|
||||||
|
QString newCacheFileName = getCacheFileName();
|
||||||
|
|
||||||
|
if ( caf::Utils::fileExists( newCacheFileName ) )
|
||||||
|
{
|
||||||
|
m_filePathInCache = newCacheFileName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -31,7 +31,6 @@ public:
|
|||||||
bool readWellPathFile( QString* errorMessage, RifWellPathImporter* wellPathImporter, bool setWellNameForExport );
|
bool readWellPathFile( QString* errorMessage, RifWellPathImporter* wellPathImporter, bool setWellNameForExport );
|
||||||
int wellPathIndexInFile() const; // -1 means none.
|
int wellPathIndexInFile() const; // -1 means none.
|
||||||
void setWellPathIndexInFile( int index );
|
void setWellPathIndexInFile( int index );
|
||||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath ) override;
|
|
||||||
static QString getCacheDirectoryPath();
|
static QString getCacheDirectoryPath();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -43,6 +42,7 @@ private:
|
|||||||
bool isStoredInCache() const;
|
bool isStoredInCache() const;
|
||||||
QString getCacheFileName();
|
QString getCacheFileName();
|
||||||
|
|
||||||
|
void initAfterRead() override;
|
||||||
void setupBeforeSave() override;
|
void setupBeforeSave() override;
|
||||||
|
|
||||||
void ensureWellPathStartAtSeaLevel( RigWellPath* wellPath );
|
void ensureWellPathStartAtSeaLevel( RigWellPath* wellPath );
|
||||||
|
@ -813,13 +813,6 @@ size_t RimWellPath::simulationWellBranchCount( const QString& simWellName )
|
|||||||
return branches.size();
|
return branches.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimWellPath::updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -87,8 +87,6 @@ public:
|
|||||||
bool tryAssociateWithSimulationWell();
|
bool tryAssociateWithSimulationWell();
|
||||||
bool isAssociatedWithSimulationWell() const;
|
bool isAssociatedWithSimulationWell() const;
|
||||||
|
|
||||||
virtual void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
|
||||||
|
|
||||||
void setUnitSystem( RiaDefines::EclipseUnitSystem unitSystem );
|
void setUnitSystem( RiaDefines::EclipseUnitSystem unitSystem );
|
||||||
RiaDefines::EclipseUnitSystem unitSystem() const;
|
RiaDefines::EclipseUnitSystem unitSystem() const;
|
||||||
|
|
||||||
|
@ -504,17 +504,6 @@ void RimWellPathCollection::scheduleRedrawAffectedViews()
|
|||||||
if ( proj ) proj->reloadCompletionTypeResultsInAllViews();
|
if ( proj ) proj->reloadCompletionTypeResultsInAllViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimWellPathCollection::updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath )
|
|
||||||
{
|
|
||||||
for ( auto wellPath : m_wellPaths )
|
|
||||||
{
|
|
||||||
wellPath->updateFilePathsFromProjectPath( newProjectPath, oldProjectPath );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -120,7 +120,6 @@ public:
|
|||||||
|
|
||||||
void scheduleRedrawAffectedViews();
|
void scheduleRedrawAffectedViews();
|
||||||
|
|
||||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
|
||||||
bool anyWellsContainingPerforationIntervals() const;
|
bool anyWellsContainingPerforationIntervals() const;
|
||||||
size_t modelledWellPathCount() const;
|
size_t modelledWellPathCount() const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user