mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use filename from file containing the grid as InputCase case description. Fixed Input Case Mock model.
This commit is contained in:
parent
606a14f9f7
commit
3f7bdbb5ec
File diff suppressed because it is too large
Load Diff
@ -88,7 +88,7 @@ public:
|
|||||||
bool openEclipseCaseFromFile(const QString& fileName);
|
bool openEclipseCaseFromFile(const QString& fileName);
|
||||||
bool openEclipseCase(const QString& caseName, const QString& caseFileName);
|
bool openEclipseCase(const QString& caseName, const QString& caseFileName);
|
||||||
bool addEclipseCases(const QStringList& fileNames);
|
bool addEclipseCases(const QStringList& fileNames);
|
||||||
bool openInputEclipseCase(const QString& caseName, const QStringList& caseFileNames);
|
bool openInputEclipseCaseFromFileNames(const QStringList& fileNames);
|
||||||
|
|
||||||
bool loadLastUsedProject();
|
bool loadLastUsedProject();
|
||||||
QString currentProjectFileName() const;
|
QString currentProjectFileName() const;
|
||||||
|
@ -75,16 +75,22 @@ RimInputCase::~RimInputCase()
|
|||||||
/// Open the supplied file set. If no grid data has been read, it will first find the possible
|
/// Open the supplied file set. If no grid data has been read, it will first find the possible
|
||||||
/// grid data among the files then read all supported properties from the files matching the grid
|
/// grid data among the files then read all supported properties from the files matching the grid
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimInputCase::openDataFileSet(const QStringList& filenames)
|
void RimInputCase::openDataFileSet(const QStringList& fileNames)
|
||||||
{
|
{
|
||||||
if (filenames.contains("Input Mock Debug Model"))
|
if (fileNames.contains("Input Mock Debug Model Simple"))
|
||||||
{
|
{
|
||||||
cvf::ref<RifReaderInterface> readerInterface = this->createMockModel(filenames[0]);
|
cvf::ref<RifReaderInterface> readerInterface = this->createMockModel(fileNames[0]);
|
||||||
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
|
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
|
||||||
results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p());
|
results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p());
|
||||||
|
|
||||||
reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->computeDerivedData();
|
reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->computeDerivedData();
|
||||||
reservoirData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->computeDerivedData();
|
reservoirData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->computeDerivedData();
|
||||||
|
|
||||||
|
QFileInfo gridFileName(fileNames[0]);
|
||||||
|
QString caseName = gridFileName.completeBaseName();
|
||||||
|
this->caseUserDescription = caseName;
|
||||||
|
|
||||||
|
computeCachedData();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -97,11 +103,16 @@ void RimInputCase::openDataFileSet(const QStringList& filenames)
|
|||||||
// First find and read the grid data
|
// First find and read the grid data
|
||||||
if (this->reservoirData()->mainGrid()->gridPointDimensions() == cvf::Vec3st(0,0,0))
|
if (this->reservoirData()->mainGrid()->gridPointDimensions() == cvf::Vec3st(0,0,0))
|
||||||
{
|
{
|
||||||
for (int i = 0; i < filenames.size(); i++)
|
for (int i = 0; i < fileNames.size(); i++)
|
||||||
{
|
{
|
||||||
if (RifEclipseInputFileTools::openGridFile(filenames[i], this->reservoirData()))
|
if (RifEclipseInputFileTools::openGridFile(fileNames[i], this->reservoirData()))
|
||||||
{
|
{
|
||||||
m_gridFileName = filenames[i];
|
m_gridFileName = fileNames[i];
|
||||||
|
|
||||||
|
QFileInfo gridFileName(fileNames[i]);
|
||||||
|
QString caseName = gridFileName.completeBaseName();
|
||||||
|
|
||||||
|
this->caseUserDescription = caseName;
|
||||||
|
|
||||||
this->reservoirData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
|
this->reservoirData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
|
||||||
|
|
||||||
@ -119,13 +130,13 @@ void RimInputCase::openDataFileSet(const QStringList& filenames)
|
|||||||
|
|
||||||
// Then read the properties possibly in the grid file
|
// Then read the properties possibly in the grid file
|
||||||
QStringList filesToRead;
|
QStringList filesToRead;
|
||||||
for (int i = 0; i < filenames.size(); i++)
|
for (int i = 0; i < fileNames.size(); i++)
|
||||||
{
|
{
|
||||||
size_t j;
|
size_t j;
|
||||||
bool exist = false;
|
bool exist = false;
|
||||||
for (j = 0; j < m_additionalFileNames().size(); j++)
|
for (j = 0; j < m_additionalFileNames().size(); j++)
|
||||||
{
|
{
|
||||||
if (m_additionalFileNames()[j] == filenames[i])
|
if (m_additionalFileNames()[j] == fileNames[i])
|
||||||
{
|
{
|
||||||
exist = true;
|
exist = true;
|
||||||
}
|
}
|
||||||
@ -133,7 +144,7 @@ void RimInputCase::openDataFileSet(const QStringList& filenames)
|
|||||||
|
|
||||||
if (!exist)
|
if (!exist)
|
||||||
{
|
{
|
||||||
filesToRead.push_back(filenames[i]);
|
filesToRead.push_back(fileNames[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +182,7 @@ bool RimInputCase::openEclipseGridFile()
|
|||||||
{
|
{
|
||||||
cvf::ref<RifReaderInterface> readerInterface;
|
cvf::ref<RifReaderInterface> readerInterface;
|
||||||
|
|
||||||
if (m_gridFileName().contains("Input Mock Debug Model"))
|
if (m_gridFileName().contains("Input Mock Debug Model Simple"))
|
||||||
{
|
{
|
||||||
readerInterface = this->createMockModel(this->m_gridFileName());
|
readerInterface = this->createMockModel(this->m_gridFileName());
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
caf::PdmField<RimInputPropertyCollection*> m_inputPropertyCollection;
|
caf::PdmField<RimInputPropertyCollection*> m_inputPropertyCollection;
|
||||||
|
|
||||||
// File open methods
|
// File open methods
|
||||||
void openDataFileSet(const QStringList& filenames);
|
void openDataFileSet(const QStringList& fileNames);
|
||||||
void loadAndSyncronizeInputProperties();
|
void loadAndSyncronizeInputProperties();
|
||||||
|
|
||||||
void removeProperty(RimInputProperty* inputProperty);
|
void removeProperty(RimInputProperty* inputProperty);
|
||||||
|
@ -761,7 +761,7 @@ void RiuMainWindow::slotOpenInputFiles()
|
|||||||
// Remember the path to next time
|
// Remember the path to next time
|
||||||
app->setDefaultFileDialogDirectory("INPUT_FILES", QFileInfo(fileNames.last()).absolutePath());
|
app->setDefaultFileDialogDirectory("INPUT_FILES", QFileInfo(fileNames.last()).absolutePath());
|
||||||
|
|
||||||
app->openInputEclipseCase("Eclipse Input Files", fileNames);
|
app->openInputEclipseCaseFromFileNames(fileNames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user