mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1769 Add time step filtering when importing model
Move import code from RiaApplication to command feature Show time step selection UI when importing Eclipse data Support time step reading of HDF data
This commit is contained in:
@@ -20,6 +20,9 @@
|
||||
|
||||
#include "RifEclipseOutputFileTools.h"
|
||||
|
||||
#include "RifEclipseRestartFilesetAccess.h"
|
||||
#include "RifEclipseUnifiedRestartFileAccess.h"
|
||||
|
||||
#include "ert/ecl/ecl_file.h"
|
||||
#include "ert/ecl/ecl_grid.h"
|
||||
#include "ert/ecl/ecl_kw_magic.h"
|
||||
@@ -337,6 +340,37 @@ int RifEclipseOutputFileTools::readUnitsType(ecl_file_type* ecl_file)
|
||||
return unitsType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RifEclipseRestartDataAccess> RifEclipseOutputFileTools::createDynamicResultAccess(const QString& fileName)
|
||||
{
|
||||
QStringList filesWithSameBaseName;
|
||||
RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(fileName, &filesWithSameBaseName);
|
||||
|
||||
cvf::ref<RifEclipseRestartDataAccess> resultsAccess;
|
||||
|
||||
// Look for unified restart file
|
||||
QString unrstFileName = RifEclipseOutputFileTools::firstFileNameOfType(filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE);
|
||||
if (unrstFileName.size() > 0)
|
||||
{
|
||||
resultsAccess = new RifEclipseUnifiedRestartFileAccess();
|
||||
resultsAccess->setRestartFiles(QStringList(unrstFileName));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Look for set of restart files (one file per time step)
|
||||
QStringList restartFiles = RifEclipseOutputFileTools::filterFileNamesOfType(filesWithSameBaseName, ECL_RESTART_FILE);
|
||||
if (restartFiles.size() > 0)
|
||||
{
|
||||
resultsAccess = new RifEclipseRestartFilesetAccess();
|
||||
resultsAccess->setRestartFiles(restartFiles);
|
||||
}
|
||||
}
|
||||
|
||||
return resultsAccess;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user