Renamed class RimInputProperty to RimEclipseInputProperty

This commit is contained in:
Pål Hagen 2015-06-25 11:51:59 +02:00
parent dec6791027
commit 33684d32c3
10 changed files with 48 additions and 48 deletions

View File

@ -150,11 +150,11 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames)
std::map<QString, QString>::iterator it;
for (it = readProperties.begin(); it != readProperties.end(); ++it)
{
RimInputProperty* inputProperty = new RimInputProperty;
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = it->first;
inputProperty->eclipseKeyword = it->second;
inputProperty->fileName = propertyFileName;
inputProperty->resolvedState = RimInputProperty::RESOLVED;
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED;
m_inputPropertyCollection->inputProperties.push_back(inputProperty);
}
@ -267,7 +267,7 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
// Find the input property objects referring to the file
std::vector<RimInputProperty*> ipsUsingThisFile = this->m_inputPropertyCollection()->findInputProperties(filenames[i]);
std::vector<RimEclipseInputProperty*> ipsUsingThisFile = this->m_inputPropertyCollection()->findInputProperties(filenames[i]);
// Read property data for each inputProperty
@ -275,17 +275,17 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
{
if (!isExistingFile)
{
ipsUsingThisFile[ipIdx]->resolvedState = RimInputProperty::FILE_MISSING;
ipsUsingThisFile[ipIdx]->resolvedState = RimEclipseInputProperty::FILE_MISSING;
}
else
{
QString kw = ipsUsingThisFile[ipIdx]->eclipseKeyword();
ipsUsingThisFile[ipIdx]->resolvedState = RimInputProperty::KEYWORD_NOT_IN_FILE;
ipsUsingThisFile[ipIdx]->resolvedState = RimEclipseInputProperty::KEYWORD_NOT_IN_FILE;
if (fileKeywordSet.count(kw))
{
if (RifEclipseInputFileTools::readProperty(filenames[i], this->reservoirData(), kw, ipsUsingThisFile[ipIdx]->resultName ))
{
ipsUsingThisFile[ipIdx]->resolvedState = RimInputProperty::RESOLVED;
ipsUsingThisFile[ipIdx]->resolvedState = RimEclipseInputProperty::RESOLVED;
}
}
fileKeywordSet.erase(kw);
@ -309,11 +309,11 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
QString resultName = this->reservoirData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(knownKeywords[fkIt]);
if (RifEclipseInputFileTools::readProperty(filenames[i], this->reservoirData(), knownKeywords[fkIt], resultName))
{
RimInputProperty* inputProperty = new RimInputProperty;
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = resultName;
inputProperty->eclipseKeyword = knownKeywords[fkIt];
inputProperty->fileName = filenames[i];
inputProperty->resolvedState = RimInputProperty::RESOLVED;
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED;
m_inputPropertyCollection->inputProperties.push_back(inputProperty);
}
}
@ -324,9 +324,9 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
for_all(m_inputPropertyCollection->inputProperties, i)
{
if (m_inputPropertyCollection->inputProperties[i]->resolvedState() == RimInputProperty::UNKNOWN)
if (m_inputPropertyCollection->inputProperties[i]->resolvedState() == RimEclipseInputProperty::UNKNOWN)
{
m_inputPropertyCollection->inputProperties[i]->resolvedState = RimInputProperty::FILE_MISSING;
m_inputPropertyCollection->inputProperties[i]->resolvedState = RimEclipseInputProperty::FILE_MISSING;
}
}
}
@ -334,7 +334,7 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseInputCase::removeProperty(RimInputProperty* inputProperty)
void RimEclipseInputCase::removeProperty(RimEclipseInputProperty* inputProperty)
{
bool isPropertyFileReferencedByOthers = false;
@ -395,7 +395,7 @@ cvf::ref<RifReaderInterface> RimEclipseInputCase::createMockModel(QString modelN
}
// Add a property
RimInputProperty* inputProperty = new RimInputProperty;
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = "PORO";
inputProperty->eclipseKeyword = "PORO";
inputProperty->fileName = "PORO.prop";

View File

@ -27,7 +27,7 @@
class RifReaderInterface;
class RimInputPropertyCollection;
class RimInputProperty;
class RimEclipseInputProperty;
//==================================================================================================
//
@ -49,7 +49,7 @@ public:
void openDataFileSet(const QStringList& fileNames);
void loadAndSyncronizeInputProperties();
void removeProperty(RimInputProperty* inputProperty);
void removeProperty(RimEclipseInputProperty* inputProperty);
// RimCase overrides
virtual bool openEclipseGridFile(); // Find grid file among file set. Read, Find read and validate property date. Syncronize child property sets.

View File

@ -27,24 +27,24 @@
namespace caf {
template<>
void RimInputProperty::ResolveStateEnum::setUp()
void RimEclipseInputProperty::ResolveStateEnum::setUp()
{
addItem(RimInputProperty::UNKNOWN, "UNKNOWN", "Unknown");
addItem(RimInputProperty::FILE_MISSING, "FILE_MISSING", "No data loaded, can't find the file");
addItem(RimInputProperty::KEYWORD_NOT_IN_FILE, "KEYWORD_NOT_IN_FILE", "No data loaded, can't find the keyword");
addItem(RimInputProperty::RESOLVED_NOT_SAVED, "RESOLVED_NOT_SAVED", "Ok, but not saved");
addItem(RimInputProperty::RESOLVED, "RESOLVED", "Loaded, Ok");
setDefault(RimInputProperty::UNKNOWN);
addItem(RimEclipseInputProperty::UNKNOWN, "UNKNOWN", "Unknown");
addItem(RimEclipseInputProperty::FILE_MISSING, "FILE_MISSING", "No data loaded, can't find the file");
addItem(RimEclipseInputProperty::KEYWORD_NOT_IN_FILE, "KEYWORD_NOT_IN_FILE", "No data loaded, can't find the keyword");
addItem(RimEclipseInputProperty::RESOLVED_NOT_SAVED, "RESOLVED_NOT_SAVED", "Ok, but not saved");
addItem(RimEclipseInputProperty::RESOLVED, "RESOLVED", "Loaded, Ok");
setDefault(RimEclipseInputProperty::UNKNOWN);
}
}
CAF_PDM_SOURCE_INIT(RimInputProperty, "RimInputProperty");
CAF_PDM_SOURCE_INIT(RimEclipseInputProperty, "RimInputProperty");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimInputProperty::RimInputProperty()
RimEclipseInputProperty::RimEclipseInputProperty()
{
CAF_PDM_InitObject("Input Property", ":/EclipseInput48x48.png", "", "");
@ -64,7 +64,7 @@ RimInputProperty::RimInputProperty()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimInputProperty::~RimInputProperty()
RimEclipseInputProperty::~RimEclipseInputProperty()
{
}

View File

@ -31,13 +31,13 @@ class QString;
//
//
//==================================================================================================
class RimInputProperty : public caf::PdmObject
class RimEclipseInputProperty : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimInputProperty();
virtual ~RimInputProperty();
RimEclipseInputProperty();
virtual ~RimEclipseInputProperty();
enum ResolveState
{

View File

@ -47,10 +47,10 @@ RimInputPropertyCollection::~RimInputPropertyCollection()
//--------------------------------------------------------------------------------------------------
/// Returns the InputProperties pointing to the same file as \a fileName
//--------------------------------------------------------------------------------------------------
std::vector<RimInputProperty*> RimInputPropertyCollection::findInputProperties(QString fileName)
std::vector<RimEclipseInputProperty*> RimInputPropertyCollection::findInputProperties(QString fileName)
{
QFileInfo fileInfo(fileName);
std::vector<RimInputProperty*> result;
std::vector<RimEclipseInputProperty*> result;
for (size_t i = 0; i < this->inputProperties.size(); ++i)
{
if (!inputProperties[i]) continue;
@ -66,7 +66,7 @@ std::vector<RimInputProperty*> RimInputPropertyCollection::findInputProperties(Q
/// Remove given input property from collection and checks if the associated file is referenced by other input
/// properties
//--------------------------------------------------------------------------------------------------
void RimInputPropertyCollection::removeInputProperty(RimInputProperty* inputProperty, bool& isPropertyFileReferencedByOthers)
void RimInputPropertyCollection::removeInputProperty(RimEclipseInputProperty* inputProperty, bool& isPropertyFileReferencedByOthers)
{
CVF_ASSERT(inputProperty);
@ -85,7 +85,7 @@ void RimInputPropertyCollection::removeInputProperty(RimInputProperty* inputProp
//--------------------------------------------------------------------------------------------------
/// Returns the InputProperty with resultName \a resultName
//--------------------------------------------------------------------------------------------------
RimInputProperty * RimInputPropertyCollection::findInputProperty(QString resultName)
RimEclipseInputProperty * RimInputPropertyCollection::findInputProperty(QString resultName)
{
for (size_t i = 0; i < this->inputProperties.size(); i++)
{

View File

@ -25,7 +25,7 @@
#include "cafPdmField.h"
#include "cafPdmObject.h"
class RimInputProperty;
class RimEclipseInputProperty;
//==================================================================================================
@ -40,13 +40,13 @@ class RimInputPropertyCollection : public caf::PdmObject
public:
RimInputPropertyCollection();
virtual ~RimInputPropertyCollection();
std::vector<RimInputProperty*> findInputProperties(QString fileName);
RimInputProperty* findInputProperty(QString resultName);
std::vector<RimEclipseInputProperty*> findInputProperties(QString fileName);
RimEclipseInputProperty* findInputProperty(QString resultName);
void removeInputProperty(RimInputProperty* inputProperty, bool& isPropertyFileReferencedByOthers);
void removeInputProperty(RimEclipseInputProperty* inputProperty, bool& isPropertyFileReferencedByOthers);
// Fields:
caf::PdmPointersField<RimInputProperty*> inputProperties;
caf::PdmPointersField<RimEclipseInputProperty*> inputProperties;
};

View File

@ -518,7 +518,7 @@ void RimUiTreeModelPdm::deleteInputProperty(const QModelIndex& itemIndex)
if (!uiItem) return;
caf::PdmObject* object = uiItem->dataObject().p();
RimInputProperty* inputProperty = dynamic_cast<RimInputProperty*>(object);
RimEclipseInputProperty* inputProperty = dynamic_cast<RimEclipseInputProperty*>(object);
if (!inputProperty) return;
// Remove item from UI tree model before delete of project data structure

View File

@ -32,7 +32,7 @@ class RimCellRangeFilter;
class RimGeoMechPropertyFilter;
class RimEclipseCase;
class RimEclipseView;
class RimInputProperty;
class RimEclipseInputProperty;
class RimStatisticsCase;
class RimIdenticalGridCaseGroup;

View File

@ -195,7 +195,7 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
{
menu.addAction(QString("Add Input Property"), this, SLOT(slotAddInputProperty()));
}
else if (dynamic_cast<RimInputProperty*>(uiItem->dataObject().p()))
else if (dynamic_cast<RimEclipseInputProperty*>(uiItem->dataObject().p()))
{
menu.addAction(QString("Delete"), this, SLOT(slotDeleteObjectFromContainer()));
menu.addAction(QString("Save Property To File"), this, SLOT(slotWriteInputProperty()));
@ -803,12 +803,12 @@ void RimUiTreeView::slotWriteInputProperty()
RimUiTreeModelPdm* myModel = dynamic_cast<RimUiTreeModelPdm*>(model());
caf::PdmUiTreeItem* uiItem = myModel->getTreeItemFromIndex(currentIndex());
RimInputProperty* inputProperty = dynamic_cast<RimInputProperty*>(uiItem->dataObject().p());
RimEclipseInputProperty* inputProperty = dynamic_cast<RimEclipseInputProperty*>(uiItem->dataObject().p());
if (!inputProperty) return;
{
bool isResolved = false;
if (inputProperty->resolvedState == RimInputProperty::RESOLVED || inputProperty->resolvedState == RimInputProperty::RESOLVED_NOT_SAVED)
if (inputProperty->resolvedState == RimEclipseInputProperty::RESOLVED || inputProperty->resolvedState == RimEclipseInputProperty::RESOLVED_NOT_SAVED)
{
isResolved = true;
}
@ -871,7 +871,7 @@ void RimUiTreeView::slotWriteInputProperty()
{
inputProperty->fileName = exportSettings.fileName;
inputProperty->eclipseKeyword = exportSettings.eclipseKeyword;
inputProperty->resolvedState = RimInputProperty::RESOLVED;
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED;
inputProperty->updateConnectedEditors();
}

View File

@ -616,11 +616,11 @@ public:
RimEclipseInputCase* inputRes = dynamic_cast<RimEclipseInputCase*>(m_currentReservoir);
if (inputRes)
{
RimInputProperty* inputProperty = NULL;
RimEclipseInputProperty* inputProperty = NULL;
inputProperty = inputRes->m_inputPropertyCollection->findInputProperty(m_currentPropertyName);
if (!inputProperty)
{
inputProperty = new RimInputProperty;
inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = m_currentPropertyName;
inputProperty->eclipseKeyword = "";
inputProperty->fileName = "";
@ -628,7 +628,7 @@ public:
RimUiTreeModelPdm* treeModel = RiuMainWindow::instance()->uiPdmModel();
treeModel->updateUiSubTree(inputRes->m_inputPropertyCollection());
}
inputProperty->resolvedState = RimInputProperty::RESOLVED_NOT_SAVED;
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED_NOT_SAVED;
}
if( m_currentScalarIndex != cvf::UNDEFINED_SIZE_T &&
@ -962,11 +962,11 @@ public:
RimEclipseInputCase* inputRes = dynamic_cast<RimEclipseInputCase*>(m_currentReservoir);
if (inputRes)
{
RimInputProperty* inputProperty = NULL;
RimEclipseInputProperty* inputProperty = NULL;
inputProperty = inputRes->m_inputPropertyCollection->findInputProperty(m_currentPropertyName);
if (!inputProperty)
{
inputProperty = new RimInputProperty;
inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = m_currentPropertyName;
inputProperty->eclipseKeyword = "";
inputProperty->fileName = "";
@ -974,7 +974,7 @@ public:
RimUiTreeModelPdm* treeModel = RiuMainWindow::instance()->uiPdmModel();
treeModel->updateUiSubTree(inputRes->m_inputPropertyCollection());
}
inputProperty->resolvedState = RimInputProperty::RESOLVED_NOT_SAVED;
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED_NOT_SAVED;
}
if( m_currentScalarIndex != cvf::UNDEFINED_SIZE_T &&