mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5147 RimEclipseCase::m_filesContainingFaults -> vector<FilePath>
This commit is contained in:
parent
d19c87c23a
commit
723caaaf79
@ -89,8 +89,8 @@ RimEclipseCase::RimEclipseCase()
|
||||
CAF_PDM_InitField( &m_flipXAxis, "FlipXAxis", false, "Flip X Axis", "", "", "" );
|
||||
CAF_PDM_InitField( &m_flipYAxis, "FlipYAxis", false, "Flip Y Axis", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_filesContainingFaultsSemColSeparated, "CachedFileNamesContainingFaults", "", "", "", "" );
|
||||
m_filesContainingFaultsSemColSeparated.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &m_filesContainingFaults, "CachedFileNamesContainingFaults", "", "", "", "" );
|
||||
m_filesContainingFaults.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_contourMapCollection, "ContourMaps", "2d Contour Maps", "", "", "" );
|
||||
m_contourMapCollection = new RimEclipseContourMapViewCollection;
|
||||
@ -746,12 +746,12 @@ const RimReservoirCellResultsStorage* RimEclipseCase::resultsStorage( RiaDefines
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RimEclipseCase::filesContainingFaults() const
|
||||
{
|
||||
QString separatedPaths = m_filesContainingFaultsSemColSeparated;
|
||||
QStringList pathList = separatedPaths.split( ";", QString::SkipEmptyParts );
|
||||
std::vector<QString> stdPathList;
|
||||
|
||||
for ( auto& path : pathList )
|
||||
stdPathList.push_back( path );
|
||||
for ( auto& filePath : m_filesContainingFaults() )
|
||||
{
|
||||
stdPathList.push_back( filePath.path() );
|
||||
}
|
||||
|
||||
return stdPathList;
|
||||
}
|
||||
@ -759,20 +759,15 @@ std::vector<QString> RimEclipseCase::filesContainingFaults() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCase::setFilesContainingFaults( const std::vector<QString>& val )
|
||||
void RimEclipseCase::setFilesContainingFaults( const std::vector<QString>& pathStrings )
|
||||
{
|
||||
QString separatedPaths;
|
||||
|
||||
for ( size_t i = 0; i < val.size(); ++i )
|
||||
std::vector<caf::FilePath> filePaths;
|
||||
for ( const auto& pathString : pathStrings )
|
||||
{
|
||||
const auto& path = val[i];
|
||||
separatedPaths += path;
|
||||
if ( !( i + 1 >= val.size() ) )
|
||||
{
|
||||
separatedPaths += ";";
|
||||
}
|
||||
filePaths.push_back( pathString );
|
||||
}
|
||||
m_filesContainingFaultsSemColSeparated = separatedPaths;
|
||||
|
||||
m_filesContainingFaults = filePaths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -145,8 +145,8 @@ protected:
|
||||
caf::PdmChildField<RimEclipseInputPropertyCollection*> m_inputPropertyCollection;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_filesContainingFaultsSemColSeparated;
|
||||
caf::PdmField<bool> m_releaseResultMemory;
|
||||
caf::PdmField<std::vector<caf::FilePath>> m_filesContainingFaults;
|
||||
caf::PdmField<bool> m_releaseResultMemory;
|
||||
|
||||
caf::PdmChildField<RimEclipseContourMapViewCollection*> m_contourMapCollection;
|
||||
|
||||
|
@ -486,22 +486,22 @@ void RimEclipseResultCase::readGridDimensions( std::vector<std::vector<int>>& gr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseResultCase::updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath )
|
||||
{
|
||||
bool foundFile = false;
|
||||
std::vector<QString> searchedPaths;
|
||||
// bool foundFile = false;
|
||||
// std::vector<QString> searchedPaths;
|
||||
|
||||
// Update filename and folder paths when opening project from a different file location
|
||||
// caseFileName = RimTools::relocateFile( caseFileName().path(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
||||
|
||||
std::vector<QString> relocatedFaultFiles;
|
||||
const std::vector<QString>& orgFilesContainingFaults = filesContainingFaults();
|
||||
for ( auto faultFileName : orgFilesContainingFaults )
|
||||
{
|
||||
QString relocatedFaultFile =
|
||||
RimTools::relocateFile( faultFileName, newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
||||
relocatedFaultFiles.push_back( relocatedFaultFile );
|
||||
}
|
||||
|
||||
setFilesContainingFaults( relocatedFaultFiles );
|
||||
// std::vector<QString> relocatedFaultFiles;
|
||||
// const std::vector<QString>& orgFilesContainingFaults = filesContainingFaults();
|
||||
// for ( auto faultFileName : orgFilesContainingFaults )
|
||||
// {
|
||||
// QString relocatedFaultFile =
|
||||
// RimTools::relocateFile( faultFileName, newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
||||
// relocatedFaultFiles.push_back( relocatedFaultFile );
|
||||
// }
|
||||
//
|
||||
// setFilesContainingFaults( relocatedFaultFiles );
|
||||
|
||||
#if 0 // Output the search path for debugging
|
||||
for (size_t i = 0; i < searchedPaths.size(); ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user