diff --git a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp index eaf45f5b4c..8cb009ac35 100644 --- a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp +++ b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp @@ -18,6 +18,7 @@ #include "RifEclipseRestartFilesetAccess.h" #include "RifEclipseOutputFileTools.h" +#include "cafProgressInfo.h" //-------------------------------------------------------------------------------------------------- @@ -44,13 +45,20 @@ bool RifEclipseRestartFilesetAccess::open(const QStringList& fileSet) close(); int numFiles = fileSet.size(); + + caf::ProgressInfo progInfo(numFiles,""); + int i; for (i = 0; i < numFiles; i++) { + progInfo.setProgressDescription(fileSet[i]); + ecl_file_type* ecl_file = ecl_file_open(fileSet[i].toAscii().data()); if (!ecl_file) return false; m_ecl_files.push_back(ecl_file); + + progInfo.incrementProgress(); } return true; diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index 5ce586ee02..b84d2ab7f9 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -326,7 +326,7 @@ bool RifReaderEclipseOutput::transferGeometry(const ecl_grid_type* mainEclGrid, bool RifReaderEclipseOutput::open(const QString& fileName, RigReservoir* reservoir) { CVF_ASSERT(reservoir); - caf::ProgressInfo progInfo(10, ""); + caf::ProgressInfo progInfo(100, ""); progInfo.setProgressDescription("Reading Grid"); @@ -336,25 +336,30 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigReservoir* reservo // Get set of files QStringList fileSet; if (!RifEclipseOutputFileTools::fileSet(fileName, &fileSet)) return false; + + progInfo.incrementProgress(); - + progInfo.setNextProgressIncrement(20); // Keep the set of files of interest m_fileSet = fileSet; // Read geometry ecl_grid_type * mainEclGrid = ecl_grid_alloc( fileName.toAscii().data() ); - progInfo.setProgress(1); - progInfo.setNextProgressIncrement(6); + progInfo.incrementProgress(); + + progInfo.setNextProgressIncrement(10); progInfo.setProgressDescription("Transferring grid geometry"); if (!transferGeometry(mainEclGrid, reservoir)) return false; - progInfo.setProgress(7); + progInfo.incrementProgress(); + progInfo.setProgressDescription("Releasing reader memory"); ecl_grid_free( mainEclGrid ); + progInfo.incrementProgress(); - progInfo.setProgress(8); progInfo.setProgressDescription("Reading Result index"); + progInfo.setNextProgressIncrement(60); m_mainGrid = reservoir->mainGrid(); @@ -363,8 +368,9 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigReservoir* reservo // Build results meta data if (!buildMetaData(reservoir)) return false; + progInfo.incrementProgress(); - progInfo.setProgress(9); + progInfo.setNextProgressIncrement(8); progInfo.setProgressDescription("Reading Well information"); readWellCells(reservoir); @@ -381,7 +387,9 @@ bool RifReaderEclipseOutput::buildMetaData(RigReservoir* reservoir) CVF_ASSERT(reservoir); CVF_ASSERT(m_fileSet.size() > 0); - caf::ProgressInfo progInfo(2,""); + caf::ProgressInfo progInfo(m_fileSet.size() + 3,""); + + progInfo.setNextProgressIncrement(m_fileSet.size()); // Create access object for dynamic results m_dynamicResultsAccess = dynamicResultsAccess(m_fileSet); @@ -390,6 +398,8 @@ bool RifReaderEclipseOutput::buildMetaData(RigReservoir* reservoir) return false; } + progInfo.incrementProgress(); + RigReservoirCellResults* matrixModelResults = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS); RigReservoirCellResults* fractureModelResults = reservoir->mainGrid()->results(RifReaderInterface::FRACTURE_RESULTS); @@ -424,7 +434,7 @@ bool RifReaderEclipseOutput::buildMetaData(RigReservoir* reservoir) } - progInfo.setProgress(1); + progInfo.incrementProgress(); QString initFileName = RifEclipseOutputFileTools::fileNameByType(m_fileSet, ECL_INIT_FILE); if (initFileName.size() > 0) @@ -432,6 +442,8 @@ bool RifReaderEclipseOutput::buildMetaData(RigReservoir* reservoir) ecl_file_type* ecl_file = ecl_file_open(initFileName.toAscii().data()); if (!ecl_file) return false; + progInfo.incrementProgress(); + QStringList resultNames; std::vector resultNamesDataItemCounts; RifEclipseOutputFileTools::findKeywordsAndDataItemCounts(ecl_file, &resultNames, &resultNamesDataItemCounts); @@ -574,6 +586,7 @@ void RifReaderEclipseOutput::readWellCells(RigReservoir* reservoir) reservoir->allGrids(&grids); cvf::Collection wells; + caf::ProgressInfo progress(well_info_get_num_wells(ert_well_info), ""); int wellIdx; for (wellIdx = 0; wellIdx < well_info_get_num_wells(ert_well_info); wellIdx++) @@ -738,6 +751,8 @@ void RifReaderEclipseOutput::readWellCells(RigReservoir* reservoir) wellResults->computeMappingFromResultTimeIndicesToWellTimeIndices(m_timeSteps); wells.push_back(wellResults.p()); + + progress.incrementProgress(); } well_info_free(ert_well_info); diff --git a/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp b/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp index 0e3d9464f2..58486fde62 100644 --- a/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp +++ b/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp @@ -44,10 +44,10 @@ RimResultReservoir::RimResultReservoir() //-------------------------------------------------------------------------------------------------- bool RimResultReservoir::openEclipseGridFile() { - caf::ProgressInfo progInfo(20, "Reading Eclipse Grid File"); + caf::ProgressInfo progInfo(50, "Reading Eclipse Grid File"); progInfo.setProgressDescription("Open Grid File"); - progInfo.setNextProgressIncrement(19); + progInfo.setNextProgressIncrement(48); // Early exit if reservoir data is created if (m_rigReservoir.notNull()) return true; @@ -107,13 +107,15 @@ bool RimResultReservoir::openEclipseGridFile() m_rigReservoir = reservoir; } - progInfo.setProgress(19); + progInfo.incrementProgress(); CVF_ASSERT(m_rigReservoir.notNull()); CVF_ASSERT(readerInterface.notNull()); progInfo.setProgressDescription("Computing Faults"); m_rigReservoir->computeFaults(); + + progInfo.incrementProgress(); progInfo.setProgressDescription("Computing Cache"); m_rigReservoir->mainGrid()->computeCachedData();