mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Grid preferences update (#11547)
* Refactor RifReaderSettings and grid preferences tab
This commit is contained in:
@@ -8,6 +8,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferences.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesSummary.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesGeoMech.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesGrid.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesSystem.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesOsdu.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPorosityModel.h
|
||||
@@ -50,6 +51,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferences.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesSummary.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesGeoMech.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesGrid.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesSystem.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesOsdu.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPorosityModel.cpp
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "RiaArgumentParser.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
#include "RiaProjectModifier.h"
|
||||
#include "RiaSocketServer.h"
|
||||
#include "RiaVersionInfo.h"
|
||||
@@ -165,7 +166,7 @@ RiaApplication::ApplicationStatus RiaConsoleApplication::handleArguments( gsl::n
|
||||
{
|
||||
CVF_ASSERT( o.valueCount() == 1 );
|
||||
std::string readerName = o.value( 0 ).toLower().toStdString();
|
||||
m_preferences->setGridModelReaderOverride( readerName );
|
||||
m_preferences->gridPreferences()->setGridModelReaderOverride( readerName );
|
||||
}
|
||||
|
||||
QString projectFileName;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPlotWindowRedrawScheduler.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
#include "RiaPreferencesSystem.h"
|
||||
#include "RiaProjectModifier.h"
|
||||
#include "RiaRegressionTestRunner.h"
|
||||
@@ -525,7 +526,7 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
|
||||
{
|
||||
CVF_ASSERT( o.valueCount() == 1 );
|
||||
std::string readerName = o.value( 0 ).toLower().toStdString();
|
||||
m_preferences->setGridModelReaderOverride( readerName );
|
||||
m_preferences->gridPreferences()->setGridModelReaderOverride( readerName );
|
||||
}
|
||||
|
||||
if ( cvf::Option o = progOpt->option( "size" ) )
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesGeoMech.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "RiaPreferencesSystem.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaValidRegExpValidator.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
#include "RiuGuiTheme.h"
|
||||
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
@@ -82,7 +82,6 @@ CAF_PDM_SOURCE_INIT( RiaPreferences, "RiaPreferences" );
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferences::RiaPreferences()
|
||||
: m_gridModelReaderOverride( RiaDefines::GridModelReader::NOT_SET )
|
||||
{
|
||||
CAF_PDM_InitField( &m_navigationPolicy,
|
||||
"navigationPolicy",
|
||||
@@ -194,18 +193,6 @@ RiaPreferences::RiaPreferences()
|
||||
CAF_PDM_InitFieldNoDefault( &lastUsedProjectFileName, "lastUsedProjectFileName", "Last Used Project File" );
|
||||
lastUsedProjectFileName.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &autocomputeDepthRelatedProperties,
|
||||
"autocomputeDepth",
|
||||
true,
|
||||
"Compute DEPTH Related Properties",
|
||||
"",
|
||||
"DEPTH, DX, DY, DZ, TOP, BOTTOM",
|
||||
"" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &autocomputeDepthRelatedProperties );
|
||||
|
||||
CAF_PDM_InitField( &loadAndShowSoil, "loadAndShowSoil", true, "Load and Show SOIL" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &loadAndShowSoil );
|
||||
|
||||
CAF_PDM_InitField( &holoLensDisableCertificateVerification,
|
||||
"holoLensDisableCertificateVerification",
|
||||
false,
|
||||
@@ -214,10 +201,6 @@ RiaPreferences::RiaPreferences()
|
||||
|
||||
CAF_PDM_InitField( &csvTextExportFieldSeparator, "csvTextExportFieldSeparator", QString( "," ), "CSV Text Export Field Separator" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_gridModelReader, "gridModelReader", "Grid Model Reader" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_readerSettings, "readerSettings", "Reader Settings" );
|
||||
m_readerSettings = new RifReaderSettings;
|
||||
CAF_PDM_InitFieldNoDefault( &m_dateFormat, "dateFormat", "Date Format" );
|
||||
m_dateFormat.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() );
|
||||
m_dateFormat = RiaQDateTimeTools::supportedDateFormats().front();
|
||||
@@ -279,6 +262,9 @@ RiaPreferences::RiaPreferences()
|
||||
CAF_PDM_InitFieldNoDefault( &m_summaryPreferences, "summaryPreferences", "summaryPreferences" );
|
||||
m_summaryPreferences = new RiaPreferencesSummary;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_gridPreferences, "gridPreferences", "gridPreferences" );
|
||||
m_gridPreferences = new RiaPreferencesGrid();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_geoMechPreferences, "geoMechPreferences", "geoMechPreferences" );
|
||||
m_geoMechPreferences = new RiaPreferencesGeoMech;
|
||||
|
||||
@@ -294,7 +280,6 @@ RiaPreferences::RiaPreferences()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferences::~RiaPreferences()
|
||||
{
|
||||
delete m_readerSettings;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -310,7 +295,6 @@ RiaPreferences* RiaPreferences::current()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
m_readerSettings->defineEditorAttribute( field, uiConfigName, attribute );
|
||||
m_summaryPreferences->defineEditorAttribute( field, uiConfigName, attribute );
|
||||
|
||||
{
|
||||
@@ -393,13 +377,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
}
|
||||
else if ( uiConfigName == RiaPreferences::tabNameGrid() )
|
||||
{
|
||||
if ( m_gridModelReaderOverride == RiaDefines::GridModelReader::NOT_SET ) uiOrdering.add( &m_gridModelReader );
|
||||
|
||||
caf::PdmUiGroup* newCaseBehaviourGroup = uiOrdering.addNewGroup( "Behavior When Loading Data" );
|
||||
newCaseBehaviourGroup->add( &autocomputeDepthRelatedProperties );
|
||||
newCaseBehaviourGroup->add( &loadAndShowSoil );
|
||||
|
||||
m_readerSettings->uiOrdering( uiConfigName, *newCaseBehaviourGroup );
|
||||
m_gridPreferences()->appendItems( uiOrdering );
|
||||
}
|
||||
else if ( uiConfigName == RiaPreferences::tabNameSummary() )
|
||||
{
|
||||
@@ -685,55 +663,6 @@ QStringList RiaPreferences::tabNames()
|
||||
return names;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RifReaderSettings* RiaPreferences::readerSettings() const
|
||||
{
|
||||
return m_readerSettings;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::GridModelReader RiaPreferences::gridModelReader() const
|
||||
{
|
||||
if ( m_gridModelReaderOverride != RiaDefines::GridModelReader::NOT_SET )
|
||||
{
|
||||
return m_gridModelReaderOverride;
|
||||
}
|
||||
|
||||
return m_gridModelReader();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferences::setGridModelReaderOverride( const std::string& readerName )
|
||||
{
|
||||
RiaDefines::GridModelReader readerType = RiaDefines::GridModelReader::NOT_SET;
|
||||
if ( readerName == "opm_common" )
|
||||
{
|
||||
readerType = RiaDefines::GridModelReader::OPM_COMMON;
|
||||
}
|
||||
else if ( readerName == "resdata" )
|
||||
{
|
||||
readerType = RiaDefines::GridModelReader::RESDATA;
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::warning( QString::fromStdString( "Unknown EGRID reader type specified on command line: " + readerName ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( readerType != RiaDefines::GridModelReader::NOT_SET )
|
||||
{
|
||||
RiaLogging::info( QString::fromStdString( "Using EGRID reader: " + readerName ) );
|
||||
}
|
||||
|
||||
m_gridModelReaderOverride = readerType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1106,3 +1035,11 @@ bool RiaPreferences::enableFaultsByDefault() const
|
||||
{
|
||||
return m_enableFaultsByDefault;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferencesGrid* RiaPreferences::gridPreferences() const
|
||||
{
|
||||
return m_gridPreferences();
|
||||
}
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
class RifReaderSettings;
|
||||
class RiaPreferencesSummary;
|
||||
class RiaPreferencesGeoMech;
|
||||
class RiaPreferencesSystem;
|
||||
class RiaPreferencesOsdu;
|
||||
class RiaPreferencesGrid;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -58,7 +58,6 @@ public:
|
||||
using FontSizeEnum = RiaFontCache::FontSizeEnum;
|
||||
using PageSizeEnum = caf::AppEnum<QPageSize::PageSizeId>;
|
||||
using PageOrientationEnum = caf::AppEnum<QPageLayout::Orientation>;
|
||||
using GridModelEnum = caf::AppEnum<RiaDefines::GridModelReader>;
|
||||
|
||||
bool enableFaultsByDefault() const;
|
||||
|
||||
@@ -70,10 +69,6 @@ public:
|
||||
|
||||
QStringList tabNames();
|
||||
|
||||
const RifReaderSettings* readerSettings() const;
|
||||
RiaDefines::GridModelReader gridModelReader() const;
|
||||
void setGridModelReaderOverride( const std::string& readerName );
|
||||
|
||||
bool useUndoRedo() const;
|
||||
|
||||
const QString& dateFormat() const;
|
||||
@@ -134,6 +129,7 @@ public:
|
||||
RiaPreferencesSummary* summaryPreferences() const;
|
||||
RiaPreferencesSystem* systemPreferences() const;
|
||||
RiaPreferencesOsdu* osduPreferences() const;
|
||||
RiaPreferencesGrid* gridPreferences() const;
|
||||
|
||||
public:
|
||||
caf::PdmField<bool> enableGrpcServer;
|
||||
@@ -157,9 +153,6 @@ public:
|
||||
|
||||
caf::PdmField<QString> lastUsedProjectFileName;
|
||||
|
||||
caf::PdmField<bool> autocomputeDepthRelatedProperties;
|
||||
caf::PdmField<bool> loadAndShowSoil;
|
||||
|
||||
caf::PdmField<bool> holoLensDisableCertificateVerification;
|
||||
caf::PdmField<QString> csvTextExportFieldSeparator;
|
||||
|
||||
@@ -184,10 +177,6 @@ private:
|
||||
static double defaultMarginSize( QPageSize::PageSizeId pageSizeId );
|
||||
|
||||
private:
|
||||
caf::PdmField<GridModelEnum> m_gridModelReader;
|
||||
RiaDefines::GridModelReader m_gridModelReaderOverride;
|
||||
caf::PdmChildField<RifReaderSettings*> m_readerSettings;
|
||||
|
||||
caf::PdmField<QString> m_dateFormat;
|
||||
caf::PdmField<QString> m_timeFormat;
|
||||
|
||||
@@ -235,6 +224,9 @@ private:
|
||||
// Well Path Import
|
||||
caf::PdmField<QString> m_multiLateralWellPattern;
|
||||
|
||||
// Grid import
|
||||
caf::PdmChildField<RiaPreferencesGrid*> m_gridPreferences;
|
||||
|
||||
// GeoMech things
|
||||
caf::PdmChildField<RiaPreferencesGeoMech*> m_geoMechPreferences;
|
||||
|
||||
|
||||
300
ApplicationLibCode/Application/RiaPreferencesGrid.cpp
Normal file
300
ApplicationLibCode/Application/RiaPreferencesGrid.cpp
Normal file
@@ -0,0 +1,300 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2024 - Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RiaPreferencesGrid, "RifReaderSettings" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferencesGrid::RiaPreferencesGrid()
|
||||
: m_gridModelReaderOverride( RiaDefines::GridModelReader::NOT_SET )
|
||||
{
|
||||
CAF_PDM_InitObject( "RiaPreferencesGrid" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_gridModelReader, "gridModelReader", "Model Reader" );
|
||||
m_gridModelReader = RiaDefines::GridModelReader::RESDATA;
|
||||
|
||||
CAF_PDM_InitField( &m_importFaults, "importFaults", true, "Import Faults" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_importFaults );
|
||||
|
||||
CAF_PDM_InitField( &m_importNNCs, "importSimulationNNCs", true, "Import NNCs" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_importNNCs );
|
||||
|
||||
CAF_PDM_InitField( &m_includeInactiveCellsInFaultGeometry,
|
||||
"includeInactiveCellsInFaultGeometry",
|
||||
false,
|
||||
"Include Inactive Cells in Fault Geometry" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_includeInactiveCellsInFaultGeometry );
|
||||
|
||||
CAF_PDM_InitField( &m_importAdvancedMswData, "importAdvancedMswData", true, "Import Advanced MSW Data" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_importAdvancedMswData );
|
||||
|
||||
CAF_PDM_InitField( &m_useResultIndexFile,
|
||||
"useResultIndexFile",
|
||||
false,
|
||||
"Use Result Index File",
|
||||
"",
|
||||
"After import of a result file, store index data in an index file in the same folder as the "
|
||||
"result file.\n"
|
||||
"Import of result data if a result index file is present, will reduce file parsing "
|
||||
"significantly.",
|
||||
"" );
|
||||
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_useResultIndexFile );
|
||||
|
||||
CAF_PDM_InitField( &m_skipWellData, "skipWellData", false, "Skip Import of Simulation Well Data" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_skipWellData );
|
||||
|
||||
CAF_PDM_InitField( &m_includeFileAbsolutePathPrefix,
|
||||
"includeFileAbsolutePathPrefix",
|
||||
QString(),
|
||||
"Include File Absolute Path Prefix",
|
||||
"",
|
||||
"Path used to prefix absolute UNIX paths in include statements on Windows, used when searching "
|
||||
"for FAULTS and EQUIL",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitField( &m_autoComputeDepthRelatedProperties,
|
||||
"autocomputeDepth",
|
||||
true,
|
||||
"Compute DEPTH Related Properties",
|
||||
"",
|
||||
"DEPTH, DX, DY, DZ, TOP, BOTTOM",
|
||||
"" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_autoComputeDepthRelatedProperties );
|
||||
|
||||
CAF_PDM_InitField( &m_loadAndShowSoil, "loadAndShowSoil", true, "Load and Show SOIL" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_loadAndShowSoil );
|
||||
|
||||
CAF_PDM_InitField( &m_onlyLoadActiveCells, "onlyLoadActiveCells", false, "Only Load Active Cell Geometry" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_onlyLoadActiveCells );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferencesGrid* RiaPreferencesGrid::current()
|
||||
{
|
||||
return RiaApplication::instance()->preferences()->gridPreferences();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferencesGrid::appendItems( caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
auto newCBGroup = uiOrdering.addNewGroup( "Behavior When Loading Data" );
|
||||
newCBGroup->add( &m_autoComputeDepthRelatedProperties );
|
||||
newCBGroup->add( &m_loadAndShowSoil );
|
||||
|
||||
auto faultGrp = uiOrdering.addNewGroup( "Fault Import" );
|
||||
|
||||
faultGrp->add( &m_importFaults );
|
||||
faultGrp->add( &m_includeInactiveCellsInFaultGeometry );
|
||||
#ifdef WIN32
|
||||
faultGrp->add( &m_includeFileAbsolutePathPrefix );
|
||||
#endif
|
||||
faultGrp->add( &m_importNNCs );
|
||||
|
||||
auto wellGrp = uiOrdering.addNewGroup( "Well Import" );
|
||||
|
||||
wellGrp->add( &m_skipWellData );
|
||||
wellGrp->add( &m_importAdvancedMswData );
|
||||
|
||||
if ( m_gridModelReaderOverride == RiaDefines::GridModelReader::NOT_SET )
|
||||
{
|
||||
auto egridGrp = uiOrdering.addNewGroup( "EGRID Settings" );
|
||||
egridGrp->add( &m_gridModelReader );
|
||||
}
|
||||
|
||||
auto resdataGrp = uiOrdering.addNewGroup( "ResData Reader Settings" );
|
||||
resdataGrp->add( &m_useResultIndexFile );
|
||||
|
||||
auto opmcGrp = uiOrdering.addNewGroup( "OPM Common Reader Settings" );
|
||||
opmcGrp->add( &m_onlyLoadActiveCells );
|
||||
|
||||
const bool setFaultImportSettingsReadOnly = !importFaults();
|
||||
|
||||
m_includeInactiveCellsInFaultGeometry.uiCapability()->setUiReadOnly( setFaultImportSettingsReadOnly );
|
||||
m_includeFileAbsolutePathPrefix.uiCapability()->setUiReadOnly( setFaultImportSettingsReadOnly );
|
||||
m_importNNCs.uiCapability()->setUiReadOnly( setFaultImportSettingsReadOnly );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifReaderSettings RiaPreferencesGrid::gridOnlyReaderSettings()
|
||||
{
|
||||
RifReaderSettings rs{
|
||||
// Disable as much as possible
|
||||
false, // import faults
|
||||
false, // import NNCs
|
||||
false, // includeInactiveCellsInFaultGeometry
|
||||
false, // importAdvancedMswData
|
||||
false, // useResultIndexFile
|
||||
true, // skipWellData
|
||||
false, // import summary data
|
||||
"" // include prefix
|
||||
};
|
||||
return rs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifReaderSettings RiaPreferencesGrid::readerSettings()
|
||||
{
|
||||
RifReaderSettings rs{ m_importFaults,
|
||||
m_importNNCs,
|
||||
m_includeInactiveCellsInFaultGeometry,
|
||||
m_importAdvancedMswData,
|
||||
m_useResultIndexFile,
|
||||
m_skipWellData,
|
||||
true, // import summary data
|
||||
m_includeFileAbsolutePathPrefix };
|
||||
return rs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGrid::importFaults() const
|
||||
{
|
||||
return m_importFaults;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGrid::importNNCs() const
|
||||
{
|
||||
return m_importNNCs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGrid::includeInactiveCellsInFaultGeometry() const
|
||||
{
|
||||
return m_includeInactiveCellsInFaultGeometry;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGrid::importAdvancedMswData() const
|
||||
{
|
||||
return m_importAdvancedMswData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferencesGrid::includeFileAbsolutePathPrefix() const
|
||||
{
|
||||
return m_includeFileAbsolutePathPrefix;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGrid::useResultIndexFile() const
|
||||
{
|
||||
return m_useResultIndexFile;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGrid::skipWellData() const
|
||||
{
|
||||
return m_skipWellData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGrid::loadAndShowSoil() const
|
||||
{
|
||||
return m_loadAndShowSoil;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGrid::autoComputeDepthRelatedProperties() const
|
||||
{
|
||||
return m_autoComputeDepthRelatedProperties;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGrid::onlyLoadActiveCells() const
|
||||
{
|
||||
return m_onlyLoadActiveCells;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::GridModelReader RiaPreferencesGrid::gridModelReader() const
|
||||
{
|
||||
if ( m_gridModelReaderOverride != RiaDefines::GridModelReader::NOT_SET )
|
||||
{
|
||||
return m_gridModelReaderOverride;
|
||||
}
|
||||
|
||||
return m_gridModelReader();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferencesGrid::setGridModelReaderOverride( const std::string& readerName )
|
||||
{
|
||||
RiaDefines::GridModelReader readerType = RiaDefines::GridModelReader::NOT_SET;
|
||||
if ( readerName == "opm_common" )
|
||||
{
|
||||
readerType = RiaDefines::GridModelReader::OPM_COMMON;
|
||||
}
|
||||
else if ( readerName == "resdata" )
|
||||
{
|
||||
readerType = RiaDefines::GridModelReader::RESDATA;
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::warning( QString::fromStdString( "Unknown EGRID reader type specified on command line: " + readerName ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( readerType != RiaDefines::GridModelReader::NOT_SET )
|
||||
{
|
||||
RiaLogging::info( QString::fromStdString( "Using EGRID reader: " + readerName ) );
|
||||
}
|
||||
|
||||
m_gridModelReaderOverride = readerType;
|
||||
}
|
||||
78
ApplicationLibCode/Application/RiaPreferencesGrid.h
Normal file
78
ApplicationLibCode/Application/RiaPreferencesGrid.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA
|
||||
// Copyright (C) Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RiaPreferencesGrid : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
using GridModelEnum = caf::AppEnum<RiaDefines::GridModelReader>;
|
||||
|
||||
public:
|
||||
RiaPreferencesGrid();
|
||||
|
||||
static RiaPreferencesGrid* current();
|
||||
static RifReaderSettings gridOnlyReaderSettings();
|
||||
RifReaderSettings readerSettings();
|
||||
|
||||
bool importFaults() const;
|
||||
bool importNNCs() const;
|
||||
bool includeInactiveCellsInFaultGeometry() const;
|
||||
bool importAdvancedMswData() const;
|
||||
QString includeFileAbsolutePathPrefix() const;
|
||||
bool useResultIndexFile() const;
|
||||
bool skipWellData() const;
|
||||
bool loadAndShowSoil() const;
|
||||
bool autoComputeDepthRelatedProperties() const;
|
||||
bool onlyLoadActiveCells() const;
|
||||
|
||||
RiaDefines::GridModelReader gridModelReader() const;
|
||||
void setGridModelReaderOverride( const std::string& readerName );
|
||||
|
||||
void appendItems( caf::PdmUiOrdering& uiOrdering );
|
||||
|
||||
private:
|
||||
caf::PdmField<GridModelEnum> m_gridModelReader;
|
||||
RiaDefines::GridModelReader m_gridModelReaderOverride;
|
||||
|
||||
caf::PdmField<bool> m_importFaults;
|
||||
caf::PdmField<bool> m_importNNCs;
|
||||
caf::PdmField<bool> m_includeInactiveCellsInFaultGeometry;
|
||||
caf::PdmField<bool> m_importAdvancedMswData;
|
||||
caf::PdmField<QString> m_includeFileAbsolutePathPrefix;
|
||||
caf::PdmField<bool> m_useResultIndexFile;
|
||||
caf::PdmField<bool> m_skipWellData;
|
||||
caf::PdmField<bool> m_autoComputeDepthRelatedProperties;
|
||||
caf::PdmField<bool> m_loadAndShowSoil;
|
||||
caf::PdmField<bool> m_onlyLoadActiveCells;
|
||||
};
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
#include "RifReaderSettings.h"
|
||||
@@ -68,11 +69,20 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fileNames,
|
||||
bool createView,
|
||||
FileCaseIdMap* openedFilesOut,
|
||||
bool noDialog,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fileNames, bool createView, FileCaseIdMap* openedFilesOut, bool noDialog )
|
||||
{
|
||||
RifReaderSettings rs = RiaPreferencesGrid::current()->readerSettings();
|
||||
return openEclipseCasesFromFile( fileNames, createView, openedFilesOut, noDialog, rs );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fileNames,
|
||||
bool createView,
|
||||
FileCaseIdMap* openedFilesOut,
|
||||
bool noDialog,
|
||||
RifReaderSettings& readerSettings )
|
||||
{
|
||||
RimProject* project = RimProject::current();
|
||||
if ( !project ) return false;
|
||||
@@ -100,16 +110,7 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList&
|
||||
RimMainPlotCollection::current()->ensureDefaultFlowPlotsAreCreated();
|
||||
}
|
||||
|
||||
// The default value for summary case import is true, but we use the state from RifReaderSettings if defined
|
||||
//
|
||||
// TODO:
|
||||
// Refactor RifReaderSettings, separate the data structure sent to reader from the data structure in
|
||||
// preferences. See RifReaderSettings::createGridOnlyReaderSettings() for the only use of importSummaryData flag
|
||||
//
|
||||
bool importSummaryCases = true;
|
||||
if ( readerSettings ) importSummaryCases = readerSettings->importSummaryData;
|
||||
|
||||
if ( importSummaryCases && !summaryFileInfos.empty() )
|
||||
if ( readerSettings.importSummaryData && !summaryFileInfos.empty() )
|
||||
{
|
||||
RimSummaryCaseMainCollection* sumCaseColl = project->activeOilField() ? project->activeOilField()->summaryCaseMainCollection()
|
||||
: nullptr;
|
||||
@@ -228,7 +229,7 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiaImportEclipseCaseTools::openEclipseCaseFromFile( const QString& fileName, bool createView, std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
int RiaImportEclipseCaseTools::openEclipseCaseFromFile( const QString& fileName, bool createView, RifReaderSettings& readerSettings )
|
||||
{
|
||||
if ( !caf::Utils::fileExists( fileName ) ) return -1;
|
||||
|
||||
@@ -243,9 +244,10 @@ bool RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilter( const QString
|
||||
{
|
||||
if ( !caf::Utils::fileExists( fileName ) ) return false;
|
||||
|
||||
bool showTimeStepFilter = true;
|
||||
bool createView = true;
|
||||
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, showTimeStepFilter, createView, nullptr ) >= 0;
|
||||
bool showTimeStepFilter = true;
|
||||
bool createView = true;
|
||||
RifReaderSettings rs = RiaPreferencesGrid::current()->readerSettings();
|
||||
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, showTimeStepFilter, createView, rs ) >= 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -318,18 +320,19 @@ std::vector<int> RiaImportEclipseCaseTools::openEclipseInputCasesFromFileNames(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaImportEclipseCaseTools::openMockModel( const QString& name )
|
||||
{
|
||||
bool showTimeStepFilter = false;
|
||||
bool createView = true;
|
||||
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( name, showTimeStepFilter, createView, nullptr );
|
||||
bool showTimeStepFilter = false;
|
||||
bool createView = true;
|
||||
RifReaderSettings rs = RiaPreferencesGrid::current()->readerSettings();
|
||||
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( name, showTimeStepFilter, createView, rs );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QString& fileName,
|
||||
bool showTimeStepFilter,
|
||||
bool createView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QString& fileName,
|
||||
bool showTimeStepFilter,
|
||||
bool createView,
|
||||
RifReaderSettings& readerSettings )
|
||||
{
|
||||
RimProject* project = RimProject::current();
|
||||
if ( !project ) return -1;
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
@@ -29,7 +31,6 @@ class QString;
|
||||
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimRoffCase;
|
||||
class RifReaderSettings;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -40,11 +41,13 @@ public:
|
||||
using CaseFileNameAndId = std::pair<QString, int>;
|
||||
using FileCaseIdMap = std::map<QString, int>;
|
||||
|
||||
static bool openEclipseCasesFromFile( const QStringList& fileNames,
|
||||
bool createView,
|
||||
FileCaseIdMap* openedFilesOut,
|
||||
bool noDialog,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings = nullptr );
|
||||
static bool openEclipseCasesFromFile( const QStringList& fileNames, bool createView, FileCaseIdMap* openedFilesOut, bool noDialog );
|
||||
|
||||
static bool openEclipseCasesFromFile( const QStringList& fileNames,
|
||||
bool createView,
|
||||
FileCaseIdMap* openedFilesOut,
|
||||
bool noDialog,
|
||||
RifReaderSettings& readerSettings );
|
||||
|
||||
static bool openEclipseCaseShowTimeStepFilter( const QString& fileName );
|
||||
|
||||
@@ -55,7 +58,7 @@ public:
|
||||
|
||||
static bool addEclipseCases( const QStringList& fileNames, RimIdenticalGridCaseGroup** resultingCaseGroup = nullptr );
|
||||
|
||||
static int openEclipseCaseFromFile( const QString& fileName, bool createView, std::shared_ptr<RifReaderSettings> readerSettings = nullptr );
|
||||
static int openEclipseCaseFromFile( const QString& fileName, bool createView, RifReaderSettings& readerSettings );
|
||||
|
||||
static std::vector<int> openRoffCasesFromFileNames( const QStringList& fileNames, bool createDefaultView );
|
||||
static RimRoffCase* openRoffCaseFromFileName( const QString& fileName, bool createDefaultView );
|
||||
@@ -63,8 +66,8 @@ public:
|
||||
static bool openEmFilesFromFileNames( const QStringList& fileNames, bool createDefaultView, std::vector<int>& createdCaseIds );
|
||||
|
||||
private:
|
||||
static int openEclipseCaseShowTimeStepFilterImpl( const QString& fileName,
|
||||
bool showTimeStepFilter,
|
||||
bool createView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings );
|
||||
static int openEclipseCaseShowTimeStepFilterImpl( const QString& fileName,
|
||||
bool showTimeStepFilter,
|
||||
bool createView,
|
||||
RifReaderSettings& readerSettings );
|
||||
};
|
||||
|
||||
@@ -21,9 +21,12 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
|
||||
#include <QDir>
|
||||
@@ -65,8 +68,8 @@ caf::PdmScriptResponse RicfLoadCase::execute()
|
||||
absolutePath = startDir.absoluteFilePath( m_path );
|
||||
}
|
||||
|
||||
std::shared_ptr<RifReaderSettings> readerSettings;
|
||||
if ( m_gridOnly ) readerSettings = RifReaderSettings::createGridOnlyReaderSettings();
|
||||
RifReaderSettings readerSettings = m_gridOnly ? RiaPreferencesGrid::current()->gridOnlyReaderSettings()
|
||||
: RiaPreferencesGrid::current()->readerSettings();
|
||||
|
||||
bool createPlot = false;
|
||||
bool createView = false;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "RicImportEclipseCaseFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
|
||||
@@ -51,9 +52,9 @@ void RicImportEclipseCaseFeature::onActionTriggered( bool isChecked )
|
||||
defaultDir = QFileInfo( fileNames.last() ).absolutePath();
|
||||
app->setLastUsedDialogDirectory( "BINARY_GRID", defaultDir );
|
||||
|
||||
bool createDefaultView = true;
|
||||
std::vector<int> caseIds;
|
||||
std::shared_ptr<RifReaderSettings> readerSettings;
|
||||
bool createDefaultView = true;
|
||||
std::vector<int> caseIds;
|
||||
RifReaderSettings readerSettings = RiaPreferencesGrid::current()->readerSettings();
|
||||
openEclipseCaseFromFileNames( fileNames, createDefaultView, caseIds, readerSettings );
|
||||
|
||||
for ( const auto& f : fileNames )
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "ExportCommands/RicExportToLasFileFeature.h"
|
||||
#include "RicCloseCaseFeature.h"
|
||||
@@ -280,8 +281,8 @@ RimEclipseCase* RicCreateEnsembleWellLogFeature::loadEclipseCase( const QString&
|
||||
bool createView = false;
|
||||
bool createPlot = false;
|
||||
|
||||
std::shared_ptr<RifReaderSettings> readerSettings = RifReaderSettings::createGridOnlyReaderSettings();
|
||||
auto openResult =
|
||||
RifReaderSettings readerSettings = RiaPreferencesGrid::current()->gridOnlyReaderSettings();
|
||||
auto openResult =
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames( QStringList( { absolutePath } ), createPlot, createView, readerSettings );
|
||||
|
||||
if ( !openResult.createdCaseIds.empty() )
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "RiaEclipseFileNameTools.h"
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "RicImportSummaryCasesFeature.h"
|
||||
|
||||
@@ -47,10 +48,19 @@ CAF_CMD_SOURCE_INIT( RicImportGeneralDataFeature, "RicImportGeneralDataFeature"
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicImportGeneralDataFeature::OpenCaseResults
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames( const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot,
|
||||
bool createDefaultView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames( const QStringList& fileNames, bool doCreateDefaultPlot, bool createDefaultView )
|
||||
{
|
||||
RifReaderSettings rs = RiaPreferencesGrid::current()->readerSettings();
|
||||
return openEclipseFilesFromFileNames( fileNames, doCreateDefaultPlot, createDefaultView, rs );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicImportGeneralDataFeature::OpenCaseResults RicImportGeneralDataFeature::openEclipseFilesFromFileNames( const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot,
|
||||
bool createDefaultView,
|
||||
RifReaderSettings& readerSettings )
|
||||
{
|
||||
CVF_ASSERT( !fileNames.empty() );
|
||||
|
||||
@@ -303,7 +313,7 @@ void RicImportGeneralDataFeature::openFileDialog( ImportFileType fileTypes )
|
||||
RiaApplication::instance()->setLastUsedDialogDirectory( defaultDirectoryLabel( ImportFileType::ANY_ECLIPSE_FILE ), fileNames.front() );
|
||||
}
|
||||
|
||||
if ( !openEclipseFilesFromFileNames( fileNames, true, true, nullptr ) )
|
||||
if ( !openEclipseFilesFromFileNames( fileNames, true, true ) )
|
||||
{
|
||||
RiaLogging::error( QString( "Failed to open file names: %1" ).arg( fileNames.join( ", " ) ) );
|
||||
}
|
||||
@@ -319,10 +329,10 @@ void RicImportGeneralDataFeature::openFileDialog( ImportFileType fileTypes )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicImportGeneralDataFeature::openEclipseCaseFromFileNames( const QStringList& fileNames,
|
||||
bool createDefaultView,
|
||||
std::vector<int>& createdCaseIds,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
bool RicImportGeneralDataFeature::openEclipseCaseFromFileNames( const QStringList& fileNames,
|
||||
bool createDefaultView,
|
||||
std::vector<int>& createdCaseIds,
|
||||
RifReaderSettings& readerSettings )
|
||||
{
|
||||
bool noDialog = false;
|
||||
RiaImportEclipseCaseTools::FileCaseIdMap newCaseFiles;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class RifReaderSettings;
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -52,10 +52,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static OpenCaseResults openEclipseFilesFromFileNames( const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot,
|
||||
bool createDefaultView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings = nullptr );
|
||||
static OpenCaseResults openEclipseFilesFromFileNames( const QStringList& fileNames, bool doCreateDefaultPlot, bool createDefaultView );
|
||||
static OpenCaseResults openEclipseFilesFromFileNames( const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot,
|
||||
bool createDefaultView,
|
||||
RifReaderSettings& readerSettings );
|
||||
static QStringList fileNamesFromCaseNames( const QStringList& caseNames );
|
||||
static QStringList getEclipseFileNamesWithDialog( RiaDefines::ImportFileType fileTypes );
|
||||
|
||||
@@ -69,10 +70,10 @@ protected:
|
||||
|
||||
static void openFileDialog( RiaDefines::ImportFileType fileTypes );
|
||||
|
||||
static bool openEclipseCaseFromFileNames( const QStringList& fileNames,
|
||||
bool createDefaultView,
|
||||
std::vector<int>& createdCaseIds,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings );
|
||||
static bool openEclipseCaseFromFileNames( const QStringList& fileNames,
|
||||
bool createDefaultView,
|
||||
std::vector<int>& createdCaseIds,
|
||||
RifReaderSettings& readerSettings );
|
||||
|
||||
static bool openSummaryCaseFromFileNames( const QStringList& fileNames, bool doCreateDefaultPlot = true );
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
#include "RiaColorTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "cafPdmDocument.h"
|
||||
#include "cafSelectionManager.h"
|
||||
@@ -438,7 +438,7 @@ void RicNewContourMapViewFeature::assignDefaultResultAndLegend( RimEclipseContou
|
||||
{
|
||||
contourMap->cellResult()->setResultType( RiaDefines::ResultCatType::DYNAMIC_NATIVE );
|
||||
|
||||
if ( RiaPreferences::current()->loadAndShowSoil )
|
||||
if ( RiaPreferencesGrid::current()->loadAndShowSoil() )
|
||||
{
|
||||
contourMap->cellResult()->setResultVariable( "SOIL" );
|
||||
}
|
||||
|
||||
@@ -128,7 +128,6 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifJsonEncodeDecode.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifReaderInterface.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifReaderMockModel.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifReaderSettings.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddress.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifEclipseRftAddress.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifWellPathImporter.cpp
|
||||
|
||||
@@ -21,11 +21,10 @@
|
||||
#include "RifEclipseUnifiedRestartFileAccess.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "RiaStringEncodingTools.h"
|
||||
#include "RifEclipseOutputFileTools.h"
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "ert/ecl/ecl_file.h"
|
||||
#include "ert/ecl/ecl_kw_magic.h"
|
||||
@@ -135,10 +134,8 @@ bool RifEclipseUnifiedRestartFileAccess::openFile()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifEclipseUnifiedRestartFileAccess::useResultIndexFile() const
|
||||
{
|
||||
RiaPreferences* prefs = RiaPreferences::current();
|
||||
const RifReaderSettings* readerSettings = prefs->readerSettings();
|
||||
|
||||
return readerSettings->useResultIndexFile();
|
||||
RiaPreferencesGrid* prefs = RiaPreferencesGrid::current();
|
||||
return prefs->useResultIndexFile();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "RifHdf5ReaderInterface.h"
|
||||
#include "RifOpmRadialGridTools.h"
|
||||
#include "RifReaderEclipseWell.h"
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#ifdef USE_HDF5
|
||||
#include "RifHdf5Reader.h"
|
||||
|
||||
@@ -19,57 +19,65 @@
|
||||
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "RifEclipseInputFileTools.h"
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isFaultImportEnabled()
|
||||
RifReaderInterface::RifReaderInterface()
|
||||
{
|
||||
return readerSettings()->importFaults;
|
||||
RiaPreferencesGrid* prefs = RiaPreferencesGrid::current();
|
||||
m_readerSettings = prefs->readerSettings();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isImportOfCompleteMswDataEnabled()
|
||||
bool RifReaderInterface::isFaultImportEnabled() const
|
||||
{
|
||||
return readerSettings()->importAdvancedMswData;
|
||||
return m_readerSettings.importFaults;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isNNCsEnabled()
|
||||
bool RifReaderInterface::isImportOfCompleteMswDataEnabled() const
|
||||
{
|
||||
return readerSettings()->importNNCs;
|
||||
return m_readerSettings.importAdvancedMswData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::loadWellDataEnabled()
|
||||
bool RifReaderInterface::isNNCsEnabled() const
|
||||
{
|
||||
return !readerSettings()->skipWellData;
|
||||
return m_readerSettings.importNNCs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::includeInactiveCellsInFaultGeometry()
|
||||
bool RifReaderInterface::loadWellDataEnabled() const
|
||||
{
|
||||
return readerSettings()->includeInactiveCellsInFaultGeometry();
|
||||
return !m_readerSettings.skipWellData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString RifReaderInterface::faultIncludeFileAbsolutePathPrefix()
|
||||
bool RifReaderInterface::includeInactiveCellsInFaultGeometry() const
|
||||
{
|
||||
return readerSettings()->includeFileAbsolutePathPrefix;
|
||||
return m_readerSettings.includeInactiveCellsInFaultGeometry;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString RifReaderInterface::faultIncludeFileAbsolutePathPrefix() const
|
||||
{
|
||||
return m_readerSettings.includeFileAbsolutePathPrefix;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -122,26 +130,7 @@ size_t RifReaderInterface::timeStepIndexOnFile( size_t timeStepIndex ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RifReaderSettings* RifReaderInterface::readerSettings() const
|
||||
{
|
||||
if ( m_readerSettings )
|
||||
{
|
||||
return m_readerSettings.get();
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaPreferences* prefs = RiaPreferences::current();
|
||||
|
||||
CVF_ASSERT( prefs->readerSettings() );
|
||||
|
||||
return prefs->readerSettings();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderInterface::setReaderSettings( std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
void RifReaderInterface::setReaderSettings( RifReaderSettings readerSettings )
|
||||
{
|
||||
m_readerSettings = readerSettings;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaPorosityModel.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "cvfCollection.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
@@ -36,7 +38,6 @@
|
||||
#include <vector>
|
||||
|
||||
class RigEclipseCaseData;
|
||||
class RifReaderSettings;
|
||||
class RigFault;
|
||||
|
||||
//==================================================================================================
|
||||
@@ -47,17 +48,17 @@ class RigFault;
|
||||
class RifReaderInterface : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RifReaderInterface() {}
|
||||
RifReaderInterface();
|
||||
~RifReaderInterface() override {}
|
||||
|
||||
void setReaderSettings( std::shared_ptr<RifReaderSettings> readerSettings );
|
||||
bool isFaultImportEnabled() const;
|
||||
bool isImportOfCompleteMswDataEnabled() const;
|
||||
bool isNNCsEnabled() const;
|
||||
bool includeInactiveCellsInFaultGeometry() const;
|
||||
bool loadWellDataEnabled() const;
|
||||
const QString faultIncludeFileAbsolutePathPrefix() const;
|
||||
|
||||
bool isFaultImportEnabled();
|
||||
bool isImportOfCompleteMswDataEnabled();
|
||||
bool isNNCsEnabled();
|
||||
bool includeInactiveCellsInFaultGeometry();
|
||||
bool loadWellDataEnabled();
|
||||
const QString faultIncludeFileAbsolutePathPrefix();
|
||||
void setReaderSettings( RifReaderSettings readerSettings );
|
||||
|
||||
virtual bool open( const QString& fileName, RigEclipseCaseData* eclipseCase ) = 0;
|
||||
|
||||
@@ -81,13 +82,10 @@ protected:
|
||||
size_t timeStepIndexOnFile( size_t timeStepIndex ) const;
|
||||
void importFaults( const QStringList& fileSet, cvf::Collection<RigFault>* faults );
|
||||
|
||||
private:
|
||||
const RifReaderSettings* readerSettings() const;
|
||||
|
||||
private:
|
||||
std::vector<QString> m_filenamesWithFaults;
|
||||
|
||||
std::vector<size_t> m_fileTimeStepIndices;
|
||||
|
||||
std::shared_ptr<RifReaderSettings> m_readerSettings;
|
||||
RifReaderSettings m_readerSettings;
|
||||
};
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA
|
||||
// Copyright (C) Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RifReaderSettings, "RifReaderSettings" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifReaderSettings::RifReaderSettings()
|
||||
{
|
||||
CAF_PDM_InitObject( "RifReaderSettings" );
|
||||
|
||||
CAF_PDM_InitField( &importFaults, "importFaults", true, "Import Faults" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &importFaults );
|
||||
|
||||
CAF_PDM_InitField( &importNNCs, "importSimulationNNCs", true, "Import NNCs" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &importNNCs );
|
||||
|
||||
CAF_PDM_InitField( &includeInactiveCellsInFaultGeometry, "includeInactiveCellsInFaultGeometry", false, "Include Inactive Cells" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &includeInactiveCellsInFaultGeometry );
|
||||
|
||||
CAF_PDM_InitField( &importAdvancedMswData, "importAdvancedMswData", true, "Import Advanced MSW Data" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &importAdvancedMswData );
|
||||
|
||||
CAF_PDM_InitField( &useResultIndexFile,
|
||||
"useResultIndexFile",
|
||||
false,
|
||||
"Use Result Index File",
|
||||
"",
|
||||
"After import of a result file, store index data in an index file in the same folder as the "
|
||||
"result file.\n"
|
||||
"Import of result data if a result index file is present, will reduce file parsing "
|
||||
"significantly.",
|
||||
"" );
|
||||
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &useResultIndexFile );
|
||||
|
||||
CAF_PDM_InitField( &skipWellData, "skipWellData", false, "Skip Import of Simulation Well Data" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &skipWellData );
|
||||
|
||||
CAF_PDM_InitField( &includeFileAbsolutePathPrefix,
|
||||
"includeFileAbsolutePathPrefix",
|
||||
QString(),
|
||||
"Include File Absolute Path Prefix",
|
||||
"",
|
||||
"Path used to prefix absolute UNIX paths in include statements on Windows, used when searching "
|
||||
"for FAULTS and EQUIL",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitField( &importSummaryData, "importSummaryData", true, "Import summary data" );
|
||||
importSummaryData.uiCapability()->setUiHidden( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderSettings::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &importFaults );
|
||||
uiOrdering.add( &includeInactiveCellsInFaultGeometry );
|
||||
#ifdef WIN32
|
||||
uiOrdering.add( &includeFileAbsolutePathPrefix );
|
||||
#endif
|
||||
uiOrdering.add( &importNNCs );
|
||||
uiOrdering.add( &importAdvancedMswData );
|
||||
uiOrdering.add( &useResultIndexFile );
|
||||
uiOrdering.add( &skipWellData );
|
||||
|
||||
bool setFaultImportSettingsReadOnly = !importFaults();
|
||||
|
||||
includeInactiveCellsInFaultGeometry.uiCapability()->setUiReadOnly( setFaultImportSettingsReadOnly );
|
||||
includeFileAbsolutePathPrefix.uiCapability()->setUiReadOnly( setFaultImportSettingsReadOnly );
|
||||
importNNCs.uiCapability()->setUiReadOnly( setFaultImportSettingsReadOnly );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::shared_ptr<RifReaderSettings> RifReaderSettings::createGridOnlyReaderSettings()
|
||||
{
|
||||
std::shared_ptr<RifReaderSettings> readerSettings = std::make_shared<RifReaderSettings>();
|
||||
// Disable as much as possible
|
||||
readerSettings->importNNCs = false;
|
||||
readerSettings->importFaults = false;
|
||||
readerSettings->skipWellData = true;
|
||||
readerSettings->includeInactiveCellsInFaultGeometry = false;
|
||||
readerSettings->importAdvancedMswData = false;
|
||||
readerSettings->importSummaryData = false;
|
||||
return readerSettings;
|
||||
}
|
||||
@@ -19,33 +19,20 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include <QString>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RifReaderSettings : public caf::PdmObject
|
||||
struct RifReaderSettings
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
friend class RiaPreferences;
|
||||
|
||||
public:
|
||||
RifReaderSettings();
|
||||
|
||||
caf::PdmField<bool> importFaults;
|
||||
caf::PdmField<bool> importNNCs;
|
||||
caf::PdmField<bool> includeInactiveCellsInFaultGeometry;
|
||||
caf::PdmField<bool> importAdvancedMswData;
|
||||
caf::PdmField<QString> includeFileAbsolutePathPrefix;
|
||||
caf::PdmField<bool> useResultIndexFile;
|
||||
caf::PdmField<bool> skipWellData;
|
||||
caf::PdmField<bool> importSummaryData;
|
||||
|
||||
static std::shared_ptr<RifReaderSettings> createGridOnlyReaderSettings();
|
||||
|
||||
private:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
bool importFaults;
|
||||
bool importNNCs;
|
||||
bool includeInactiveCellsInFaultGeometry;
|
||||
bool importAdvancedMswData;
|
||||
bool useResultIndexFile;
|
||||
bool skipWellData;
|
||||
bool importSummaryData;
|
||||
QString includeFileAbsolutePathPrefix;
|
||||
};
|
||||
|
||||
@@ -25,14 +25,13 @@
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaFieldHandleTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h"
|
||||
|
||||
#include "RicfCommandObject.h"
|
||||
#include "RifInputPropertyLoader.h"
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
@@ -129,6 +128,8 @@ RimEclipseCase::RimEclipseCase()
|
||||
m_fractureModelResults.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
|
||||
setReservoirData( nullptr );
|
||||
|
||||
m_readerSettings = RiaPreferencesGrid::current()->readerSettings();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -184,15 +185,6 @@ void RimEclipseCase::ensureDeckIsParsedForEquilData()
|
||||
{
|
||||
if ( m_rigEclipseCase.notNull() )
|
||||
{
|
||||
QString includeFileAbsolutePathPrefix;
|
||||
{
|
||||
RiaPreferences* prefs = RiaPreferences::current();
|
||||
if ( prefs->readerSettings() )
|
||||
{
|
||||
includeFileAbsolutePathPrefix = prefs->readerSettings()->includeFileAbsolutePathPrefix();
|
||||
}
|
||||
}
|
||||
|
||||
QString dataDeckFile;
|
||||
{
|
||||
QFileInfo fi( gridFileName() );
|
||||
@@ -200,7 +192,7 @@ void RimEclipseCase::ensureDeckIsParsedForEquilData()
|
||||
dataDeckFile = caf::Utils::constructFullFileName( fi.absolutePath(), fi.baseName(), ".DATA" );
|
||||
}
|
||||
|
||||
m_rigEclipseCase->ensureDeckIsParsedForEquilData( dataDeckFile, includeFileAbsolutePathPrefix );
|
||||
m_rigEclipseCase->ensureDeckIsParsedForEquilData( dataDeckFile, m_readerSettings.includeFileAbsolutePathPrefix );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -730,9 +722,7 @@ void RimEclipseCase::ensureFaultDataIsComputed()
|
||||
RigEclipseCaseData* rigEclipseCase = eclipseCaseData();
|
||||
if ( rigEclipseCase )
|
||||
{
|
||||
bool computeFaults = ( m_readerSettings && m_readerSettings->importFaults() ) ||
|
||||
( !m_readerSettings && RiaPreferences::current()->readerSettings()->importFaults() );
|
||||
if ( computeFaults )
|
||||
if ( m_readerSettings.importFaults )
|
||||
{
|
||||
RigActiveCellInfo* actCellInfo = rigEclipseCase->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
rigEclipseCase->mainGrid()->calculateFaults( actCellInfo );
|
||||
@@ -1179,7 +1169,7 @@ bool RimEclipseCase::importAsciiInputProperties( const QStringList& fileNames )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCase::setReaderSettings( std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
void RimEclipseCase::setReaderSettings( RifReaderSettings& readerSettings )
|
||||
{
|
||||
m_readerSettings = readerSettings;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include "RiaDefines.h"
|
||||
#include "RimCase.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
@@ -51,7 +53,6 @@ class RimEclipseView;
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimReservoirCellResultsStorage;
|
||||
class RimEclipseResultAddressCollection;
|
||||
class RifReaderSettings;
|
||||
class RimEclipseViewCollection;
|
||||
|
||||
//==================================================================================================
|
||||
@@ -126,7 +127,7 @@ public:
|
||||
void createDisplayModelAndUpdateAllViews();
|
||||
void computeActiveCellsBoundingBox();
|
||||
|
||||
void setReaderSettings( std::shared_ptr<RifReaderSettings> readerSettings );
|
||||
void setReaderSettings( RifReaderSettings& readerSettings );
|
||||
|
||||
void updateResultAddressCollection();
|
||||
|
||||
@@ -139,11 +140,10 @@ protected:
|
||||
|
||||
// Internal methods
|
||||
protected:
|
||||
void computeCachedData();
|
||||
void setReservoirData( RigEclipseCaseData* eclipseCase );
|
||||
std::vector<QString> additionalFiles() const;
|
||||
RimEclipseViewCollection* globalViewCollection() const;
|
||||
RimEclipseContourMapViewCollection* contourMapViewCollection() const;
|
||||
void computeCachedData();
|
||||
void setReservoirData( RigEclipseCaseData* eclipseCase );
|
||||
std::vector<QString> additionalFiles() const;
|
||||
RimEclipseViewCollection* globalViewCollection() const;
|
||||
void addViewsFromViewCollection( std::vector<RimEclipseView*>& views, const RimEclipseViewCollection* viewColl ) const;
|
||||
|
||||
private:
|
||||
@@ -158,7 +158,7 @@ protected:
|
||||
caf::PdmField<bool> m_flipYAxis;
|
||||
caf::PdmChildField<RimEclipseInputPropertyCollection*> m_inputPropertyCollection;
|
||||
|
||||
std::shared_ptr<RifReaderSettings> m_readerSettings;
|
||||
RifReaderSettings m_readerSettings;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_releaseResultMemory;
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigGridManager.h"
|
||||
|
||||
@@ -23,14 +23,13 @@
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaFieldHandleTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "RifEclipseInputFileTools.h"
|
||||
#include "RifInputPropertyLoader.h"
|
||||
#include "RifReaderEclipseInput.h"
|
||||
#include "RifReaderInterface.h"
|
||||
#include "RifReaderMockModel.h"
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
@@ -107,7 +106,7 @@ bool RimEclipseInputCase::openDataFileSet( const QStringList& fileNames )
|
||||
setReservoirData( new RigEclipseCaseData( this ) );
|
||||
}
|
||||
|
||||
bool importFaults = RiaPreferences::current()->readerSettings()->importFaults();
|
||||
bool importFaults = RiaPreferencesGrid::current()->importFaults();
|
||||
|
||||
std::vector<QString> allErrorMessages;
|
||||
|
||||
@@ -225,7 +224,7 @@ bool RimEclipseInputCase::openEclipseGridFile()
|
||||
computeCachedData();
|
||||
}
|
||||
|
||||
if ( RiaPreferences::current()->autocomputeDepthRelatedProperties )
|
||||
if ( RiaPreferencesGrid::current()->autoComputeDepthRelatedProperties() )
|
||||
{
|
||||
results( RiaDefines::PorosityModelType::MATRIX_MODEL )->computeDepthRelatedResults();
|
||||
results( RiaDefines::PorosityModelType::FRACTURE_MODEL )->computeDepthRelatedResults();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaFieldHandleTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
#include "RiaRegressionTestRunner.h"
|
||||
#include "RiaResultNames.h"
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "RifReaderMockModel.h"
|
||||
#include "RifReaderOpmCommon.h"
|
||||
#include "RifReaderOpmRft.h"
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
@@ -160,7 +159,7 @@ bool RimEclipseResultCase::importGridAndResultMetaData( bool showTimeStepFilter
|
||||
return false;
|
||||
}
|
||||
|
||||
auto readerType = RiaPreferences::current()->gridModelReader();
|
||||
auto readerType = RiaPreferencesGrid::current()->gridModelReader();
|
||||
|
||||
// opmcommon reader only reads EGRID
|
||||
if ( !gridFileName().toLower().endsWith( ".egrid" ) )
|
||||
@@ -248,7 +247,7 @@ bool RimEclipseResultCase::importGridAndResultMetaData( bool showTimeStepFilter
|
||||
outReader->setHdf5FileName( m_sourSimFileName().path() );
|
||||
}
|
||||
|
||||
if ( RiaPreferences::current()->autocomputeDepthRelatedProperties )
|
||||
if ( RiaPreferencesGrid::current()->autoComputeDepthRelatedProperties() )
|
||||
{
|
||||
results( RiaDefines::PorosityModelType::MATRIX_MODEL )->computeDepthRelatedResults();
|
||||
results( RiaDefines::PorosityModelType::FRACTURE_MODEL )->computeDepthRelatedResults();
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
@@ -95,7 +95,7 @@ bool RimEmCase::openEclipseGridFile()
|
||||
|
||||
results( RiaDefines::PorosityModelType::MATRIX_MODEL )->createPlaceholderResultEntries();
|
||||
|
||||
if ( RiaPreferences::current()->autocomputeDepthRelatedProperties )
|
||||
if ( RiaPreferencesGrid::current()->autoComputeDepthRelatedProperties() )
|
||||
{
|
||||
results( RiaDefines::PorosityModelType::MATRIX_MODEL )->computeDepthRelatedResults();
|
||||
results( RiaDefines::PorosityModelType::FRACTURE_MODEL )->computeDepthRelatedResults();
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "RiaFractureDefines.h"
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
|
||||
#include "ApplicationCommands/RicShowMainWindowFeature.h"
|
||||
@@ -213,8 +214,9 @@ bool RimReloadCaseTools::openOrImportGridModelFromSummaryCase( const RimSummaryC
|
||||
|
||||
if ( QFileInfo::exists( candidateGridFileName ) )
|
||||
{
|
||||
bool createView = true;
|
||||
auto id = RiaImportEclipseCaseTools::openEclipseCaseFromFile( candidateGridFileName, createView );
|
||||
bool createView = true;
|
||||
RifReaderSettings rs = RiaPreferencesGrid::current()->readerSettings();
|
||||
auto id = RiaImportEclipseCaseTools::openEclipseCaseFromFile( candidateGridFileName, createView, rs );
|
||||
if ( id > -1 )
|
||||
{
|
||||
RiaLogging::info( QString( "Imported %1" ).arg( candidateGridFileName ) );
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
|
||||
#include "RifInputPropertyLoader.h"
|
||||
#include "RifRoffFileTools.h"
|
||||
@@ -94,7 +94,7 @@ bool RimRoffCase::openEclipseGridFile()
|
||||
|
||||
results( RiaDefines::PorosityModelType::MATRIX_MODEL )->createPlaceholderResultEntries();
|
||||
|
||||
if ( RiaPreferences::current()->autocomputeDepthRelatedProperties )
|
||||
if ( RiaPreferencesGrid::current()->autoComputeDepthRelatedProperties() )
|
||||
{
|
||||
results( RiaDefines::PorosityModelType::MATRIX_MODEL )->computeDepthRelatedResults();
|
||||
results( RiaDefines::PorosityModelType::FRACTURE_MODEL )->computeDepthRelatedResults();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
#include "RiaResultNames.h"
|
||||
|
||||
#include "RifReaderEclipseOutput.h"
|
||||
@@ -795,8 +795,8 @@ RigEclipseResultAddress RigCaseCellResultsData::defaultResult() const
|
||||
|
||||
if ( maxTimeStepCount() > 0 )
|
||||
{
|
||||
auto prefs = RiaPreferences::current();
|
||||
if ( prefs->loadAndShowSoil ) return RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() );
|
||||
auto prefs = RiaPreferencesGrid::current();
|
||||
if ( prefs->loadAndShowSoil() ) return RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() );
|
||||
|
||||
auto dynamicResult = std::find_if( allResults.begin(),
|
||||
allResults.end(),
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "RifEclipseOutputFileTools.h"
|
||||
#include "RifEclipseUnifiedRestartFileAccess.h"
|
||||
#include "RifReaderEclipseOutput.h"
|
||||
#include "RifReaderSettings.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
|
||||
Reference in New Issue
Block a user