mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
Preferences: Read faults on import and fault default visibility
This commit is contained in:
parent
d165d6ce38
commit
b7141dde50
@ -48,7 +48,6 @@ RiaPreferences::RiaPreferences(void)
|
||||
|
||||
CAF_PDM_InitField(&defaultViewerBackgroundColor, "defaultViewerBackgroundColor", cvf::Color3f(0.69f, 0.77f, 0.87f), "Viewer background", "", "The viewer background color for new views", "");
|
||||
|
||||
|
||||
CAF_PDM_InitField(&defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Z scale factor", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&useShaders, "useShaders", true, "Use Shaders", "", "", "");
|
||||
@ -59,6 +58,9 @@ RiaPreferences::RiaPreferences(void)
|
||||
|
||||
CAF_PDM_InitField(&autocomputeSOIL, "autocomputeSOIL", true, "SOIL", "", "SOIL = 1.0 - SGAS - SWAT", "");
|
||||
CAF_PDM_InitField(&autocomputeDepthRelatedProperties,"autocomputeDepth", true, "DEPTH related properties", "", "DEPTH, DX, DY, DZ, TOP, BOTTOM", "");
|
||||
|
||||
CAF_PDM_InitField(&enableFaultsImport, "enableFaultsImport", true, "Read faults in case import", "", "", "");
|
||||
CAF_PDM_InitField(&defaultShowFaults, "defaultShowFaults", false, "Show faults by default in view", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -108,10 +110,15 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
caf::PdmUiGroup* autoComputeGroup = uiOrdering.addNewGroup("Compute when loading new case");
|
||||
autoComputeGroup->add(&autocomputeSOIL);
|
||||
autoComputeGroup->add(&autocomputeDepthRelatedProperties);
|
||||
|
||||
caf::PdmUiGroup* faultsGroup = uiOrdering.addNewGroup("Faults");
|
||||
faultsGroup->add(&enableFaultsImport);
|
||||
faultsGroup->add(&defaultShowFaults);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// This function is called as part of the regression test system to make sure the configuration
|
||||
/// for regression tests is consistent
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferences::resetToDefaults()
|
||||
{
|
||||
@ -120,5 +127,7 @@ void RiaPreferences::resetToDefaults()
|
||||
|
||||
autocomputeSOIL = true;
|
||||
autocomputeDepthRelatedProperties = true;
|
||||
|
||||
enableFaultsImport = true;
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,8 @@ public: // Pdm Fields
|
||||
caf::PdmField<bool> autocomputeSOIL;
|
||||
caf::PdmField<bool> autocomputeDepthRelatedProperties;
|
||||
|
||||
caf::PdmField<bool> enableFaultsImport;
|
||||
caf::PdmField<bool> defaultShowFaults;
|
||||
|
||||
protected:
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||
|
@ -196,6 +196,8 @@ RifReaderEclipseOutput::RifReaderEclipseOutput()
|
||||
|
||||
m_ecl_init_file = NULL;
|
||||
m_dynamicResultsAccess = NULL;
|
||||
|
||||
m_enableFaultsImport = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -377,37 +379,40 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigCaseData* eclipseC
|
||||
progInfo.setProgressDescription("Reading faults");
|
||||
progInfo.setNextProgressIncrement(10);
|
||||
|
||||
if (this->filenamesWithFaults().size() > 0)
|
||||
if (m_enableFaultsImport)
|
||||
{
|
||||
cvf::Collection<RigFault> faults;
|
||||
std::vector< RifKeywordAndFilePos > fileKeywords;
|
||||
if (this->filenamesWithFaults().size() > 0)
|
||||
{
|
||||
cvf::Collection<RigFault> faults;
|
||||
std::vector< RifKeywordAndFilePos > fileKeywords;
|
||||
|
||||
std::vector<QString> filenamesWithFaults;
|
||||
std::vector<QString> filenamesWithFaults;
|
||||
|
||||
for (size_t i = 0; i < this->filenamesWithFaults().size(); i++)
|
||||
{
|
||||
QString faultFilename = this->filenamesWithFaults()[i];
|
||||
|
||||
RifEclipseInputFileTools::readFaults(faultFilename, faults, fileKeywords);
|
||||
|
||||
RigMainGrid* mainGrid = eclipseCase->mainGrid();
|
||||
mainGrid->setFaults(faults);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (QString fname, fileSet)
|
||||
{
|
||||
if (fname.endsWith(".DATA"))
|
||||
for (size_t i = 0; i < this->filenamesWithFaults().size(); i++)
|
||||
{
|
||||
cvf::Collection<RigFault> faults;
|
||||
std::vector<QString> filenamesWithFaults;
|
||||
RifEclipseInputFileTools::readFaultsInGridSection(fname, faults, filenamesWithFaults);
|
||||
QString faultFilename = this->filenamesWithFaults()[i];
|
||||
|
||||
RifEclipseInputFileTools::readFaults(faultFilename, faults, fileKeywords);
|
||||
|
||||
RigMainGrid* mainGrid = eclipseCase->mainGrid();
|
||||
mainGrid->setFaults(faults);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (QString fname, fileSet)
|
||||
{
|
||||
if (fname.endsWith(".DATA"))
|
||||
{
|
||||
cvf::Collection<RigFault> faults;
|
||||
std::vector<QString> filenamesWithFaults;
|
||||
RifEclipseInputFileTools::readFaultsInGridSection(fname, faults, filenamesWithFaults);
|
||||
|
||||
this->setFilenamesWithFaults(filenamesWithFaults);
|
||||
RigMainGrid* mainGrid = eclipseCase->mainGrid();
|
||||
mainGrid->setFaults(faults);
|
||||
|
||||
this->setFilenamesWithFaults(filenamesWithFaults);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1705,3 +1710,11 @@ std::string RifReaderEclipseOutput::ertGridName(size_t gridNr)
|
||||
return gridName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderEclipseOutput::enableFaultsImport(bool enableFaultsImport)
|
||||
{
|
||||
m_enableFaultsImport = enableFaultsImport;
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
RifReaderEclipseOutput();
|
||||
virtual ~RifReaderEclipseOutput();
|
||||
|
||||
void enableFaultsImport(bool enableFaultsImport);
|
||||
bool open(const QString& fileName, RigCaseData* eclipseCase);
|
||||
virtual bool openAndReadActiveCellData(const QString& fileName, const std::vector<QDateTime>& mainCaseTimeSteps, RigCaseData* eclipseCase);
|
||||
void close();
|
||||
@ -88,4 +89,6 @@ private:
|
||||
|
||||
ecl_file_type* m_ecl_init_file; // File access to static results
|
||||
cvf::ref<RifEclipseRestartDataAccess> m_dynamicResultsAccess; // File access to dynamic results
|
||||
|
||||
bool m_enableFaultsImport;
|
||||
};
|
||||
|
@ -62,7 +62,8 @@ RimFaultCollection::RimFaultCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("Faults", ":/draw_style_faults_24x24.png", "", "");
|
||||
|
||||
CAF_PDM_InitField(&showFaultCollection, "Active", true, "Active", "", "", "");
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
CAF_PDM_InitField(&showFaultCollection, "Active", prefs->defaultShowFaults(), "Active", "", "", "");
|
||||
showFaultCollection.setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&showGeometryDetectedFaults, "ShowGeometryDetectedFaults", false, "Show geometry detected faults", "", "", "");
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimAnalysisModels.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimResultCase, "EclipseCase");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -97,10 +98,15 @@ bool RimResultCase::openEclipseGridFile()
|
||||
return false;
|
||||
}
|
||||
|
||||
cvf::ref<RigCaseData> eclipseCase = new RigCaseData;
|
||||
readerInterface = new RifReaderEclipseOutput;
|
||||
cvf::ref<RifReaderEclipseOutput> outputInterface = new RifReaderEclipseOutput;
|
||||
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
outputInterface->enableFaultsImport(prefs->enableFaultsImport());
|
||||
readerInterface = outputInterface;
|
||||
|
||||
readerInterface->setFilenamesWithFaults(this->filesContainingFaults());
|
||||
|
||||
cvf::ref<RigCaseData> eclipseCase = new RigCaseData;
|
||||
if (!readerInterface->open(caseFileName(), eclipseCase.p()))
|
||||
{
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user