mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Roff support with submodule
* Roff: Add initial roff support (with roffcpp as submodule). * Roff: Create viewer when importing roff files. * Roff: add timing for roff import. * Roff: precompute active cell indexes. * Roff: parallelize using OpenMP. * Roff: Handle exceptions when importing. * Roff: improvements from review. * Invert ordering Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com>
This commit is contained in:
committed by
GitHub
parent
38bfa9ef1f
commit
8b51160ac4
@@ -47,6 +47,7 @@
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRoffCase.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
@@ -508,3 +509,51 @@ bool RiaImportEclipseCaseTools::addEclipseCases( const QStringList& fil
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiaImportEclipseCaseTools::openRoffCaseFromFileNames( const QStringList& fileNames, bool createDefaultView )
|
||||
{
|
||||
CAF_ASSERT( !fileNames.empty() );
|
||||
|
||||
auto* roffCase = new RimRoffCase();
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* project = app->project();
|
||||
project->assignCaseIdToCase( roffCase );
|
||||
roffCase->setGridFileName( fileNames[0] );
|
||||
|
||||
bool gridImportSuccess = roffCase->openEclipseGridFile();
|
||||
if ( !gridImportSuccess )
|
||||
{
|
||||
RiaLogging::error( "Failed to import grid" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels()
|
||||
: nullptr;
|
||||
if ( !analysisModels ) return -1;
|
||||
|
||||
analysisModels->cases.push_back( roffCase );
|
||||
|
||||
RimEclipseView* eclipseView = nullptr;
|
||||
if ( createDefaultView )
|
||||
{
|
||||
eclipseView = roffCase->createAndAddReservoirView();
|
||||
|
||||
eclipseView->cellResult()->setResultType( RiaDefines::ResultCatType::INPUT_PROPERTY );
|
||||
|
||||
if ( RiaGuiApplication::isRunning() )
|
||||
{
|
||||
if ( RiuMainWindow::instance() )
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( eclipseView->cellResult() );
|
||||
}
|
||||
|
||||
eclipseView->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
analysisModels->updateConnectedEditors();
|
||||
|
||||
return roffCase->caseId();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user