#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 "RimReservoirCellResultsStorage.h"
#include "RimTools.h" #include "RimTools.h"
#include "cafPdmUiTreeOrdering.h"
#include "cafProgressInfo.h" #include "cafProgressInfo.h"
#include <QFileInfo> #include <QFileInfo>
@@ -311,7 +312,7 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
progInfo.setProgress(static_cast<int>(progress + inputPropCount)); 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 // 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); 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(); RimEclipseInputCase();
virtual ~RimEclipseInputCase(); virtual ~RimEclipseInputCase();
// Fields
caf::PdmChildField<RimEclipseInputPropertyCollection*> m_inputPropertyCollection;
// File open methods // File open methods
bool openDataFileSet(const QStringList& fileNames); bool openDataFileSet(const QStringList& fileNames);
void loadAndSyncronizeInputProperties(); void loadAndSyncronizeInputProperties();
RimEclipseInputPropertyCollection* inputPropertyCollection();
// RimCase overrides // RimCase overrides
virtual bool openEclipseGridFile(); // Find grid file among file set. Read, Find read and validate property date. Syncronize child property sets. bool openEclipseGridFile() override;
virtual void reloadEclipseGridFile(); void reloadEclipseGridFile() override;
// Overrides from RimCase // Overrides from RimCase
virtual QString locationOnDisc() const; QString locationOnDisc() const override;
virtual QString gridFileName() const { return m_gridFileName();} 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); void updateAdditionalFileFolder(const QString& newFolder);
@@ -69,11 +68,14 @@ private:
protected: protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
private: private:
cvf::ref<RifReaderInterface> createMockModel(QString modelName); cvf::ref<RifReaderInterface> createMockModel(QString modelName);
private:
// Fields // Fields
caf::PdmChildField<RimEclipseInputPropertyCollection*> m_inputPropertyCollection;
caf::PdmField<QString> m_gridFileName; caf::PdmField<QString> m_gridFileName;
caf::PdmProxyValueField< std::vector<QString> > m_additionalFiles; caf::PdmProxyValueField< std::vector<QString> > m_additionalFiles;

View File

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

View File

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