#3479 Input Case : Missing entry in tree view for imported properties

This commit is contained in:
Magne Sjaastad
2018-10-10 09:35:01 +02:00
parent c7f6c74869
commit e1b1e3e898
4 changed files with 39 additions and 18 deletions

View File

@@ -39,6 +39,7 @@
#include "RimReservoirCellResultsStorage.h"
#include "RimTools.h"
#include "cafPdmUiTreeOrdering.h"
#include "cafProgressInfo.h"
#include <QFileInfo>
@@ -311,7 +312,7 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
progInfo.setProgress(static_cast<int>(progress + inputPropCount));
// Check if there are more known property keywords left on file. If it is, read them and create inputProperty objects
for (const QString fileKeyword : fileKeywordSet)
for (const QString& fileKeyword : fileKeywordSet)
{
{
QString resultName = this->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->makeResultNameUnique(fileKeyword);
@@ -339,6 +340,14 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseInputPropertyCollection* RimEclipseInputCase::inputPropertyCollection()
{
return m_inputPropertyCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -402,6 +411,16 @@ void RimEclipseInputCase::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseInputCase::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
{
uiTreeOrdering.add(&m_inputPropertyCollection);
RimEclipseCase::defineUiTreeOrdering(uiTreeOrdering, uiConfigName);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -45,22 +45,21 @@ public:
RimEclipseInputCase();
virtual ~RimEclipseInputCase();
// Fields
caf::PdmChildField<RimEclipseInputPropertyCollection*> m_inputPropertyCollection;
// File open methods
bool openDataFileSet(const QStringList& fileNames);
void loadAndSyncronizeInputProperties();
RimEclipseInputPropertyCollection* inputPropertyCollection();
// RimCase overrides
virtual bool openEclipseGridFile(); // Find grid file among file set. Read, Find read and validate property date. Syncronize child property sets.
virtual void reloadEclipseGridFile();
bool openEclipseGridFile() override;
void reloadEclipseGridFile() override;
// Overrides from RimCase
virtual QString locationOnDisc() const;
virtual QString gridFileName() const { return m_gridFileName();}
QString locationOnDisc() const override;
QString gridFileName() const override { return m_gridFileName();}
virtual void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath);
void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath) override;
void updateAdditionalFileFolder(const QString& newFolder);
@@ -69,11 +68,14 @@ private:
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
private:
cvf::ref<RifReaderInterface> createMockModel(QString modelName);
private:
// Fields
caf::PdmChildField<RimEclipseInputPropertyCollection*> m_inputPropertyCollection;
caf::PdmField<QString> m_gridFileName;
caf::PdmProxyValueField< std::vector<QString> > m_additionalFiles;

View File

@@ -521,15 +521,15 @@ public:
RimEclipseInputCase* inputRes = dynamic_cast<RimEclipseInputCase*>(m_currentReservoir);
if (inputRes)
{
RimEclipseInputProperty* inputProperty = inputRes->m_inputPropertyCollection->findInputProperty(m_currentPropertyName);
RimEclipseInputProperty* inputProperty = inputRes->inputPropertyCollection()->findInputProperty(m_currentPropertyName);
if (!inputProperty)
{
inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = m_currentPropertyName;
inputProperty->eclipseKeyword = "";
inputProperty->fileName = "";
inputRes->m_inputPropertyCollection->inputProperties.push_back(inputProperty);
inputRes->m_inputPropertyCollection()->updateConnectedEditors();
inputRes->inputPropertyCollection()->inputProperties.push_back(inputProperty);
inputRes->inputPropertyCollection()->updateConnectedEditors();
}
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED_NOT_SAVED;
}

View File

@@ -641,15 +641,15 @@ public:
RimEclipseInputCase* inputRes = dynamic_cast<RimEclipseInputCase*>(m_currentReservoir);
if (inputRes)
{
RimEclipseInputProperty* inputProperty = inputRes->m_inputPropertyCollection->findInputProperty(m_currentPropertyName);
RimEclipseInputProperty* inputProperty = inputRes->inputPropertyCollection()->findInputProperty(m_currentPropertyName);
if (!inputProperty)
{
inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = m_currentPropertyName;
inputProperty->eclipseKeyword = "";
inputProperty->fileName = "";
inputRes->m_inputPropertyCollection->inputProperties.push_back(inputProperty);
inputRes->m_inputPropertyCollection()->updateConnectedEditors();
inputRes->inputPropertyCollection()->inputProperties.push_back(inputProperty);
inputRes->inputPropertyCollection()->updateConnectedEditors();
}
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED_NOT_SAVED;
}
@@ -1005,15 +1005,15 @@ public:
RimEclipseInputCase* inputRes = dynamic_cast<RimEclipseInputCase*>(m_currentReservoir);
if (inputRes)
{
RimEclipseInputProperty* inputProperty = inputRes->m_inputPropertyCollection->findInputProperty(m_currentPropertyName);
RimEclipseInputProperty* inputProperty = inputRes->inputPropertyCollection()->findInputProperty(m_currentPropertyName);
if (!inputProperty)
{
inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = m_currentPropertyName;
inputProperty->eclipseKeyword = "";
inputProperty->fileName = "";
inputRes->m_inputPropertyCollection->inputProperties.push_back(inputProperty);
inputRes->m_inputPropertyCollection()->updateConnectedEditors();
inputRes->inputPropertyCollection()->inputProperties.push_back(inputProperty);
inputRes->inputPropertyCollection()->updateConnectedEditors();
}
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED_NOT_SAVED;
}