mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#1768 Move RifReaderSettings to private member of RiaPreferences
This commit is contained in:
parent
a9381b862f
commit
609bf4037b
@ -83,8 +83,8 @@ RiaPreferences::RiaPreferences(void)
|
||||
CAF_PDM_InitField(&loadAndShowSoil, "loadAndShowSoil", true, "Load and Show SOIL", "", "", "");
|
||||
loadAndShowSoil.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&readerSettings, "readerSettings", "Reader Settings", "", "", "");
|
||||
readerSettings = new RifReaderSettings;
|
||||
CAF_PDM_InitFieldNoDefault(&m_readerSettings, "readerSettings", "Reader Settings", "", "", "");
|
||||
m_readerSettings = new RifReaderSettings;
|
||||
|
||||
CAF_PDM_InitField(&autoCreatePlotsOnImport, "AutoCreatePlotsOnImport", true, "Automatically Create Summary Plots On Import", "", "", "");
|
||||
autoCreatePlotsOnImport.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
@ -102,7 +102,7 @@ RiaPreferences::RiaPreferences(void)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferences::~RiaPreferences(void)
|
||||
{
|
||||
delete readerSettings;
|
||||
delete m_readerSettings;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -110,7 +110,7 @@ RiaPreferences::~RiaPreferences(void)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute)
|
||||
{
|
||||
readerSettings->defineEditorAttribute(field, uiConfigName, attribute);
|
||||
m_readerSettings->defineEditorAttribute(field, uiConfigName, attribute);
|
||||
|
||||
if (field == &scriptDirectories)
|
||||
{
|
||||
@ -172,7 +172,7 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
newCaseBehaviourGroup->add(&autocomputeDepthRelatedProperties);
|
||||
newCaseBehaviourGroup->add(&loadAndShowSoil);
|
||||
|
||||
readerSettings->defineUiOrdering(uiConfigName, *newCaseBehaviourGroup);
|
||||
m_readerSettings->defineUiOrdering(uiConfigName, *newCaseBehaviourGroup);
|
||||
}
|
||||
else if (uiConfigName == m_tabNames[2])
|
||||
{
|
||||
@ -227,3 +227,11 @@ QStringList RiaPreferences::tabNames()
|
||||
return m_tabNames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RifReaderSettings* RiaPreferences::readerSettings() const
|
||||
{
|
||||
return m_readerSettings;
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,8 @@ public:
|
||||
|
||||
QStringList tabNames();
|
||||
|
||||
const RifReaderSettings* readerSettings() const;
|
||||
|
||||
public: // Pdm Fields
|
||||
caf::PdmField<caf::AppEnum< RiaApplication::RINavigationPolicy > > navigationPolicy;
|
||||
|
||||
@ -71,7 +73,6 @@ public: // Pdm Fields
|
||||
caf::PdmField<bool> autocomputeDepthRelatedProperties;
|
||||
caf::PdmField<bool> loadAndShowSoil;
|
||||
|
||||
caf::PdmChildField<RifReaderSettings*> readerSettings;
|
||||
|
||||
// Summary
|
||||
|
||||
@ -85,5 +86,7 @@ protected:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||
|
||||
private:
|
||||
caf::PdmChildField<RifReaderSettings*> m_readerSettings;
|
||||
|
||||
QStringList m_tabNames;
|
||||
};
|
||||
|
@ -19,27 +19,17 @@
|
||||
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderInterface::setReaderSetting(RifReaderSettings* settings)
|
||||
{
|
||||
m_settings = settings;
|
||||
}
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isFaultImportEnabled()
|
||||
{
|
||||
if (m_settings.notNull())
|
||||
{
|
||||
return m_settings->importFaults;
|
||||
}
|
||||
|
||||
return false;
|
||||
return readerSettings()->importFaults;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -47,12 +37,7 @@ bool RifReaderInterface::isFaultImportEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isImportOfCompleteMswDataEnabled()
|
||||
{
|
||||
if (m_settings.notNull())
|
||||
{
|
||||
return m_settings->importAdvancedMswData;
|
||||
}
|
||||
|
||||
return false;
|
||||
return readerSettings()->importAdvancedMswData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -60,12 +45,7 @@ bool RifReaderInterface::isImportOfCompleteMswDataEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isNNCsEnabled()
|
||||
{
|
||||
if (m_settings.notNull())
|
||||
{
|
||||
return m_settings->importNNCs;
|
||||
}
|
||||
|
||||
return false;
|
||||
return readerSettings()->importNNCs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -73,12 +53,7 @@ bool RifReaderInterface::isNNCsEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString RifReaderInterface::faultIncludeFileAbsolutePathPrefix()
|
||||
{
|
||||
if (m_settings.notNull())
|
||||
{
|
||||
return m_settings->faultIncludeFileAbsolutePathPrefix;
|
||||
}
|
||||
|
||||
return QString();
|
||||
return readerSettings()->faultIncludeFileAbsolutePathPrefix;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -120,3 +95,15 @@ size_t RifReaderInterface::timeStepIndexOnFile(size_t timeStepIndex) const
|
||||
return timeStepIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RifReaderSettings* RifReaderInterface::readerSettings() const
|
||||
{
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
|
||||
CVF_ASSERT(prefs->readerSettings());
|
||||
|
||||
return prefs->readerSettings();
|
||||
}
|
||||
|
||||
|
@ -49,8 +49,6 @@ public:
|
||||
RifReaderInterface() { }
|
||||
virtual ~RifReaderInterface() { }
|
||||
|
||||
void setReaderSetting(RifReaderSettings* settings);
|
||||
|
||||
bool isFaultImportEnabled();
|
||||
bool isImportOfCompleteMswDataEnabled();
|
||||
bool isNNCsEnabled();
|
||||
@ -72,8 +70,10 @@ protected:
|
||||
size_t timeStepIndexOnFile(size_t timeStepIndex) const;
|
||||
|
||||
private:
|
||||
std::vector<QString> m_filenamesWithFaults;
|
||||
caf::PdmPointer<RifReaderSettings> m_settings;
|
||||
const RifReaderSettings* readerSettings() const;
|
||||
|
||||
private:
|
||||
std::vector<QString> m_filenamesWithFaults;
|
||||
|
||||
std::vector<size_t> m_fileTimeStepIndices;
|
||||
std::vector<size_t> m_fileTimeStepIndices;
|
||||
};
|
||||
|
@ -115,7 +115,7 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames)
|
||||
|
||||
for (int i = 0; i < fileNames.size(); i++)
|
||||
{
|
||||
if (RifEclipseInputFileTools::openGridFile(fileNames[i], this->eclipseCaseData(), prefs->readerSettings->importFaults()))
|
||||
if (RifEclipseInputFileTools::openGridFile(fileNames[i], this->eclipseCaseData(), prefs->readerSettings()->importFaults()))
|
||||
{
|
||||
m_gridFileName = fileNames[i];
|
||||
|
||||
@ -192,7 +192,6 @@ bool RimEclipseInputCase::openEclipseGridFile()
|
||||
{
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
readerInterface = new RifReaderEclipseInput;
|
||||
readerInterface->setReaderSetting(prefs->readerSettings());
|
||||
|
||||
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData;
|
||||
if (!readerInterface->open(m_gridFileName, eclipseCase.p()))
|
||||
|
@ -124,7 +124,6 @@ bool RimEclipseResultCase::importGridAndResultMetaData(bool showTimeStepFilter)
|
||||
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
cvf::ref<RifReaderEclipseOutput> readerEclipseOutput = new RifReaderEclipseOutput;
|
||||
readerEclipseOutput->setReaderSetting(prefs->readerSettings());
|
||||
readerEclipseOutput->setFilenamesWithFaults(this->filesContainingFaults());
|
||||
|
||||
if (showTimeStepFilter)
|
||||
|
Loading…
Reference in New Issue
Block a user