diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index 9ff31cc740..d029af322f 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -719,12 +719,21 @@ void RiaApplication::createLargeResultsMockModel() openEclipseCase(RimDefines::mockModelLargeWithResults(), RimDefines::mockModelLargeWithResults()); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaApplication::createMockModelCustomized() +{ + openEclipseCase(RimDefines::mockModelCustomized(), RimDefines::mockModelCustomized()); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RiaApplication::createInputMockModel() { - openInputEclipseCaseFromFileNames(QStringList("Input Mock Debug Model Simple")); + openInputEclipseCaseFromFileNames(QStringList(RimDefines::mockModelBasicInputCase())); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Application/RiaApplication.h b/ApplicationCode/Application/RiaApplication.h index 5688087195..f026d613b6 100644 --- a/ApplicationCode/Application/RiaApplication.h +++ b/ApplicationCode/Application/RiaApplication.h @@ -81,6 +81,7 @@ public: void createMockModel(); void createResultsMockModel(); void createLargeResultsMockModel(); + void createMockModelCustomized(); void createInputMockModel(); QString defaultFileDialogDirectory(const QString& dialogName); diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.cpp b/ApplicationCode/FileInterface/RifReaderMockModel.cpp index f03a79e40f..64507ebc8d 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.cpp +++ b/ApplicationCode/FileInterface/RifReaderMockModel.cpp @@ -175,3 +175,11 @@ void RifReaderMockModel::populateReservoir(RigCaseData* eclipseCase) m_reservoirBuilder.populateReservoir(eclipseCase); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RifReaderMockModel::enableWellData(bool enableWellData) +{ + m_reservoirBuilder.enableWellData(enableWellData); +} + diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.h b/ApplicationCode/FileInterface/RifReaderMockModel.h index 0237381bbe..3acd5a7c7b 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.h +++ b/ApplicationCode/FileInterface/RifReaderMockModel.h @@ -30,6 +30,7 @@ public: void setWorldCoordinates(cvf::Vec3d minWorldCoordinate, cvf::Vec3d maxWorldCoordinate); void setGridPointDimensions(const cvf::Vec3st& gridPointDimensions); void setResultInfo(size_t resultCount, size_t timeStepCount); + void enableWellData(bool enableWellData); void addLocalGridRefinement(const cvf::Vec3st& minCellPosition, const cvf::Vec3st& maxCellPosition, const cvf::Vec3st& singleCellRefinementFactors); diff --git a/ApplicationCode/ProjectDataModel/RimDefines.h b/ApplicationCode/ProjectDataModel/RimDefines.h index cfb31f48ad..0dd82175f1 100644 --- a/ApplicationCode/ProjectDataModel/RimDefines.h +++ b/ApplicationCode/ProjectDataModel/RimDefines.h @@ -48,6 +48,7 @@ public: static QString mockModelBasic() { return "Result Mock Debug Model Simple"; } static QString mockModelBasicWithResults() { return "Result Mock Debug Model With Results"; } static QString mockModelLargeWithResults() { return "Result Mock Debug Model Large With Results"; } + static QString mockModelCustomized() { return "Result Mock Debug Model Customized"; } static QString mockModelBasicInputCase() { return "Input Mock Debug Model Simple"; } }; diff --git a/ApplicationCode/ProjectDataModel/RimInputCase.cpp b/ApplicationCode/ProjectDataModel/RimInputCase.cpp index ddfa4876fe..e9ab1a607f 100644 --- a/ApplicationCode/ProjectDataModel/RimInputCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimInputCase.cpp @@ -77,7 +77,7 @@ RimInputCase::~RimInputCase() //-------------------------------------------------------------------------------------------------- void RimInputCase::openDataFileSet(const QStringList& fileNames) { - if (fileNames.contains("Input Mock Debug Model Simple")) + if (fileNames.contains(RimDefines::mockModelBasicInputCase())) { cvf::ref readerInterface = this->createMockModel(fileNames[0]); results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p()); @@ -184,7 +184,7 @@ bool RimInputCase::openEclipseGridFile() { cvf::ref readerInterface; - if (m_gridFileName().contains("Input Mock Debug Model Simple")) + if (m_gridFileName().contains(RimDefines::mockModelBasicInputCase())) { readerInterface = this->createMockModel(this->m_gridFileName()); } @@ -377,7 +377,7 @@ cvf::ref RimInputCase::createMockModel(QString modelName) cvf::ref reservoir = new RigCaseData; cvf::ref mockFileInterface = new RifReaderMockModel; - if (modelName == "Input Mock Debug Model Simple") + if (modelName == RimDefines::mockModelBasicInputCase()) { m_gridFileName = modelName; diff --git a/ApplicationCode/ProjectDataModel/RimResultCase.cpp b/ApplicationCode/ProjectDataModel/RimResultCase.cpp index 558245c5f6..d13fddbc2f 100644 --- a/ApplicationCode/ProjectDataModel/RimResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimResultCase.cpp @@ -45,6 +45,7 @@ #include "RimOilField.h" #include "RimAnalysisModels.h" #include "RiaPreferences.h" +#include "RimMockModelSettings.h" CAF_PDM_SOURCE_INIT(RimResultCase, "EclipseCase"); //-------------------------------------------------------------------------------------------------- @@ -262,6 +263,32 @@ cvf::ref RimResultCase::createMockModel(QString modelName) mockFileInterface->open("", reservoir.p()); } + else if (modelName == RimDefines::mockModelCustomized()) + { + RimMockModelSettings rimMockModelSettings; + + //caf::Settings::readFieldsFromApplicationStore(&rimMockModelSettings); + + double startX = 0; + double startY = 0; + double startZ = 0; + + double widthX = 6000; + double widthY = 12000; + double widthZ = 500; + + // Test code to simulate UTM coordinates + double offsetX = 400000; + double offsetY = 6000000; + double offsetZ = 0; + + mockFileInterface->setWorldCoordinates(cvf::Vec3d(startX + offsetX, startY + offsetY, startZ + offsetZ), cvf::Vec3d(startX + widthX + offsetX, startY + widthY + offsetY, startZ + widthZ + offsetZ)); + mockFileInterface->setGridPointDimensions(cvf::Vec3st(rimMockModelSettings.cellCountX, rimMockModelSettings.cellCountX, rimMockModelSettings.cellCountX)); + mockFileInterface->setResultInfo(rimMockModelSettings.resultCount, rimMockModelSettings.timeStepCount); + mockFileInterface->enableWellData(false); + + mockFileInterface->open("", reservoir.p()); + } this->setReservoirData( reservoir.p() ); diff --git a/ApplicationCode/UserInterface/RiuMainWindow.cpp b/ApplicationCode/UserInterface/RiuMainWindow.cpp index dd1e7090c2..2e39767fc2 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationCode/UserInterface/RiuMainWindow.cpp @@ -199,6 +199,7 @@ void RiuMainWindow::createActions() m_mockModelAction = new QAction("&Mock Model", this); m_mockResultsModelAction = new QAction("Mock Model With &Results", this); m_mockLargeResultsModelAction = new QAction("Large Mock Model", this); + m_mockModelCustomizedAction = new QAction("Customized Mock Model", this); m_mockInputModelAction = new QAction("Input Mock Model", this); m_snapshotToFile = new QAction(QIcon(":/SnapShotSave.png"), "Snapshot To File", this); @@ -226,6 +227,7 @@ void RiuMainWindow::createActions() connect(m_mockModelAction, SIGNAL(triggered()), SLOT(slotMockModel())); connect(m_mockResultsModelAction, SIGNAL(triggered()), SLOT(slotMockResultsModel())); connect(m_mockLargeResultsModelAction, SIGNAL(triggered()), SLOT(slotMockLargeResultsModel())); + connect(m_mockModelCustomizedAction, SIGNAL(triggered()), SLOT(slotMockModelCustomized())); connect(m_mockInputModelAction, SIGNAL(triggered()), SLOT(slotInputMockModel())); connect(m_snapshotToFile, SIGNAL(triggered()), SLOT(slotSnapshotToFile())); @@ -386,6 +388,7 @@ void RiuMainWindow::createMenus() testMenu->addAction(m_mockModelAction); testMenu->addAction(m_mockResultsModelAction); testMenu->addAction(m_mockLargeResultsModelAction); + testMenu->addAction(m_mockModelCustomizedAction); testMenu->addAction(m_mockInputModelAction); testMenu->addSeparator(); testMenu->addAction(m_createCommandObject); @@ -845,8 +848,6 @@ void RiuMainWindow::slotMockModel() { RiaApplication* app = RiaApplication::instance(); app->createMockModel(); - - //m_mainViewer->setDefaultView(); } //-------------------------------------------------------------------------------------------------- @@ -856,8 +857,6 @@ void RiuMainWindow::slotMockResultsModel() { RiaApplication* app = RiaApplication::instance(); app->createResultsMockModel(); - - //m_mainViewer->setDefaultView(); } @@ -870,6 +869,14 @@ void RiuMainWindow::slotMockLargeResultsModel() app->createLargeResultsMockModel(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuMainWindow::slotMockModelCustomized() +{ + RiaApplication* app = RiaApplication::instance(); + app->createMockModelCustomized(); +} //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationCode/UserInterface/RiuMainWindow.h b/ApplicationCode/UserInterface/RiuMainWindow.h index 2b92f9a7b4..ae3f922af3 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.h +++ b/ApplicationCode/UserInterface/RiuMainWindow.h @@ -154,6 +154,7 @@ private: QAction* m_mockModelAction; QAction* m_mockResultsModelAction; QAction* m_mockLargeResultsModelAction; + QAction* m_mockModelCustomizedAction; QAction* m_mockInputModelAction; QAction* m_snapshotToFile; @@ -243,6 +244,7 @@ private slots: void slotMockModel(); void slotMockResultsModel(); void slotMockLargeResultsModel(); + void slotMockModelCustomized(); void slotInputMockModel(); // Windows slots