mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-03 04:00:57 -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
af7fe8f00e
commit
70bb221162
@ -199,6 +199,13 @@ bool RifEclipseInputFileTools::openGridFile( const QString& fileName,
|
||||
return true;
|
||||
}
|
||||
|
||||
QString txt = "Missing required keywords :";
|
||||
if ( !specGridKw ) txt += " SPECGRID";
|
||||
if ( !zCornKw ) txt += " ZCORN";
|
||||
if ( !coordKw ) txt += " COORD";
|
||||
|
||||
RiaLogging::error( txt );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -277,17 +277,7 @@ void RimFractureTemplateCollection::loadAndUpdateData()
|
||||
{
|
||||
stimPlanFracture->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureTemplateCollection::updateFilePathsFromProjectPath( const QString& newProjectPath,
|
||||
const QString& oldProjectPath )
|
||||
{
|
||||
for ( RimFractureTemplate* f : m_fractureDefinitions() )
|
||||
{
|
||||
RimEllipseFractureTemplate* ellipseFracture = dynamic_cast<RimEllipseFractureTemplate*>( f );
|
||||
if ( ellipseFracture )
|
||||
{
|
||||
|
@ -60,8 +60,6 @@ public:
|
||||
void createAndAssignTemplateCopyForNonMatchingUnit();
|
||||
void loadAndUpdateData();
|
||||
|
||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
||||
|
||||
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
||||
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
||||
|
||||
|
@ -150,15 +150,6 @@ void RimFormationNames::readFormationNamesFile( QString* 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 readFormationNamesFile( QString* errorMessage );
|
||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
||||
|
||||
static QString layerZoneTableFileName();
|
||||
|
||||
|
@ -112,18 +112,6 @@ std::vector<RimFormationNames*> RimFormationNamesCollection::importFiles( const
|
||||
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 );
|
||||
|
||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
||||
|
||||
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
||||
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
||||
|
||||
|
@ -473,38 +473,18 @@ void RimProject::setProjectFileNameAndUpdateDependencies( const QString& project
|
||||
bool foundFile = false;
|
||||
std::vector<QString> searchedPaths;
|
||||
|
||||
QString filePathCandidate = filePath->path();
|
||||
if ( filePathCandidate.startsWith( '.' ) )
|
||||
{
|
||||
filePathCandidate = filePathCandidate.right( filePathCandidate.size() - 1 );
|
||||
filePathCandidate = newProjectPath + filePathCandidate;
|
||||
}
|
||||
|
||||
QString newFilePath =
|
||||
RimTools::relocateFile( filePath->path(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
||||
RimTools::relocateFile( filePathCandidate, newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -232,22 +232,6 @@ 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;
|
||||
// }
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -70,8 +70,6 @@ public:
|
||||
|
||||
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,
|
||||
const QString& channelName,
|
||||
QString* unitString = nullptr );
|
||||
|
@ -279,19 +279,6 @@ bool RimFileWellPath::isStoredInCache() const
|
||||
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 );
|
||||
int wellPathIndexInFile() const; // -1 means none.
|
||||
void setWellPathIndexInFile( int index );
|
||||
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath ) override;
|
||||
static QString getCacheDirectoryPath();
|
||||
|
||||
protected:
|
||||
@ -43,6 +42,7 @@ private:
|
||||
bool isStoredInCache() const;
|
||||
QString getCacheFileName();
|
||||
|
||||
void initAfterRead() override;
|
||||
void setupBeforeSave() override;
|
||||
|
||||
void ensureWellPathStartAtSeaLevel( RigWellPath* wellPath );
|
||||
|
@ -813,13 +813,6 @@ size_t RimWellPath::simulationWellBranchCount( const QString& simWellName )
|
||||
return branches.size();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPath::updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -87,8 +87,6 @@ public:
|
||||
bool tryAssociateWithSimulationWell();
|
||||
bool isAssociatedWithSimulationWell() const;
|
||||
|
||||
virtual void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
||||
|
||||
void setUnitSystem( RiaDefines::EclipseUnitSystem unitSystem );
|
||||
RiaDefines::EclipseUnitSystem unitSystem() const;
|
||||
|
||||
|
@ -504,17 +504,6 @@ void RimWellPathCollection::scheduleRedrawAffectedViews()
|
||||
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 updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
||||
bool anyWellsContainingPerforationIntervals() const;
|
||||
size_t modelledWellPathCount() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user