mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added customized mock model to user interface
This commit is contained in:
@@ -657,12 +657,21 @@ void RiaApplication::createLargeResultsMockModel()
|
|||||||
openEclipseCase(RimDefines::mockModelLargeWithResults(), RimDefines::mockModelLargeWithResults());
|
openEclipseCase(RimDefines::mockModelLargeWithResults(), RimDefines::mockModelLargeWithResults());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiaApplication::createMockModelCustomized()
|
||||||
|
{
|
||||||
|
openEclipseCase(RimDefines::mockModelCustomized(), RimDefines::mockModelCustomized());
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiaApplication::createInputMockModel()
|
void RiaApplication::createInputMockModel()
|
||||||
{
|
{
|
||||||
openInputEclipseCaseFromFileNames(QStringList("Input Mock Debug Model Simple"));
|
openInputEclipseCaseFromFileNames(QStringList(RimDefines::mockModelBasicInputCase()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public:
|
|||||||
void createMockModel();
|
void createMockModel();
|
||||||
void createResultsMockModel();
|
void createResultsMockModel();
|
||||||
void createLargeResultsMockModel();
|
void createLargeResultsMockModel();
|
||||||
|
void createMockModelCustomized();
|
||||||
void createInputMockModel();
|
void createInputMockModel();
|
||||||
|
|
||||||
QString defaultFileDialogDirectory(const QString& dialogName);
|
QString defaultFileDialogDirectory(const QString& dialogName);
|
||||||
|
|||||||
@@ -175,3 +175,11 @@ void RifReaderMockModel::populateReservoir(RigCaseData* eclipseCase)
|
|||||||
m_reservoirBuilder.populateReservoir(eclipseCase);
|
m_reservoirBuilder.populateReservoir(eclipseCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RifReaderMockModel::enableWellData(bool enableWellData)
|
||||||
|
{
|
||||||
|
m_reservoirBuilder.enableWellData(enableWellData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public:
|
|||||||
void setWorldCoordinates(cvf::Vec3d minWorldCoordinate, cvf::Vec3d maxWorldCoordinate);
|
void setWorldCoordinates(cvf::Vec3d minWorldCoordinate, cvf::Vec3d maxWorldCoordinate);
|
||||||
void setGridPointDimensions(const cvf::Vec3st& gridPointDimensions);
|
void setGridPointDimensions(const cvf::Vec3st& gridPointDimensions);
|
||||||
void setResultInfo(size_t resultCount, size_t timeStepCount);
|
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);
|
void addLocalGridRefinement(const cvf::Vec3st& minCellPosition, const cvf::Vec3st& maxCellPosition, const cvf::Vec3st& singleCellRefinementFactors);
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public:
|
|||||||
static QString mockModelBasic() { return "Result Mock Debug Model Simple"; }
|
static QString mockModelBasic() { return "Result Mock Debug Model Simple"; }
|
||||||
static QString mockModelBasicWithResults() { return "Result Mock Debug Model With Results"; }
|
static QString mockModelBasicWithResults() { return "Result Mock Debug Model With Results"; }
|
||||||
static QString mockModelLargeWithResults() { return "Result Mock Debug Model Large 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"; }
|
static QString mockModelBasicInputCase() { return "Input Mock Debug Model Simple"; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ RimInputCase::~RimInputCase()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimInputCase::openDataFileSet(const QStringList& fileNames)
|
void RimInputCase::openDataFileSet(const QStringList& fileNames)
|
||||||
{
|
{
|
||||||
if (fileNames.contains("Input Mock Debug Model Simple"))
|
if (fileNames.contains(RimDefines::mockModelBasicInputCase()))
|
||||||
{
|
{
|
||||||
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());
|
||||||
@@ -182,7 +182,7 @@ bool RimInputCase::openEclipseGridFile()
|
|||||||
{
|
{
|
||||||
cvf::ref<RifReaderInterface> readerInterface;
|
cvf::ref<RifReaderInterface> readerInterface;
|
||||||
|
|
||||||
if (m_gridFileName().contains("Input Mock Debug Model Simple"))
|
if (m_gridFileName().contains(RimDefines::mockModelBasicInputCase()))
|
||||||
{
|
{
|
||||||
readerInterface = this->createMockModel(this->m_gridFileName());
|
readerInterface = this->createMockModel(this->m_gridFileName());
|
||||||
}
|
}
|
||||||
@@ -370,7 +370,7 @@ cvf::ref<RifReaderInterface> RimInputCase::createMockModel(QString modelName)
|
|||||||
cvf::ref<RigCaseData> reservoir = new RigCaseData;
|
cvf::ref<RigCaseData> reservoir = new RigCaseData;
|
||||||
cvf::ref<RifReaderMockModel> mockFileInterface = new RifReaderMockModel;
|
cvf::ref<RifReaderMockModel> mockFileInterface = new RifReaderMockModel;
|
||||||
|
|
||||||
if (modelName == "Input Mock Debug Model Simple")
|
if (modelName == RimDefines::mockModelBasicInputCase())
|
||||||
{
|
{
|
||||||
m_gridFileName = modelName;
|
m_gridFileName = modelName;
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "Rim3dOverlayInfoConfig.h"
|
#include "Rim3dOverlayInfoConfig.h"
|
||||||
#include "RimOilField.h"
|
#include "RimOilField.h"
|
||||||
#include "RimAnalysisModels.h"
|
#include "RimAnalysisModels.h"
|
||||||
|
#include "RimMockModelSettings.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimResultCase, "EclipseCase");
|
CAF_PDM_SOURCE_INIT(RimResultCase, "EclipseCase");
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -255,6 +256,32 @@ cvf::ref<RifReaderInterface> RimResultCase::createMockModel(QString modelName)
|
|||||||
mockFileInterface->open("", reservoir.p());
|
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() );
|
this->setReservoirData( reservoir.p() );
|
||||||
|
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ void RiuMainWindow::createActions()
|
|||||||
m_mockModelAction = new QAction("&Mock Model", this);
|
m_mockModelAction = new QAction("&Mock Model", this);
|
||||||
m_mockResultsModelAction = new QAction("Mock Model With &Results", this);
|
m_mockResultsModelAction = new QAction("Mock Model With &Results", this);
|
||||||
m_mockLargeResultsModelAction = new QAction("Large Mock Model", 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_mockInputModelAction = new QAction("Input Mock Model", this);
|
||||||
|
|
||||||
m_snapshotToFile = new QAction(QIcon(":/SnapShotSave.png"), "Snapshot To File", 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_mockModelAction, SIGNAL(triggered()), SLOT(slotMockModel()));
|
||||||
connect(m_mockResultsModelAction, SIGNAL(triggered()), SLOT(slotMockResultsModel()));
|
connect(m_mockResultsModelAction, SIGNAL(triggered()), SLOT(slotMockResultsModel()));
|
||||||
connect(m_mockLargeResultsModelAction, SIGNAL(triggered()), SLOT(slotMockLargeResultsModel()));
|
connect(m_mockLargeResultsModelAction, SIGNAL(triggered()), SLOT(slotMockLargeResultsModel()));
|
||||||
|
connect(m_mockModelCustomizedAction, SIGNAL(triggered()), SLOT(slotMockModelCustomized()));
|
||||||
connect(m_mockInputModelAction, SIGNAL(triggered()), SLOT(slotInputMockModel()));
|
connect(m_mockInputModelAction, SIGNAL(triggered()), SLOT(slotInputMockModel()));
|
||||||
|
|
||||||
connect(m_snapshotToFile, SIGNAL(triggered()), SLOT(slotSnapshotToFile()));
|
connect(m_snapshotToFile, SIGNAL(triggered()), SLOT(slotSnapshotToFile()));
|
||||||
@@ -379,6 +381,7 @@ void RiuMainWindow::createMenus()
|
|||||||
testMenu->addAction(m_mockModelAction);
|
testMenu->addAction(m_mockModelAction);
|
||||||
testMenu->addAction(m_mockResultsModelAction);
|
testMenu->addAction(m_mockResultsModelAction);
|
||||||
testMenu->addAction(m_mockLargeResultsModelAction);
|
testMenu->addAction(m_mockLargeResultsModelAction);
|
||||||
|
testMenu->addAction(m_mockModelCustomizedAction);
|
||||||
testMenu->addAction(m_mockInputModelAction);
|
testMenu->addAction(m_mockInputModelAction);
|
||||||
testMenu->addSeparator();
|
testMenu->addSeparator();
|
||||||
testMenu->addAction(m_createCommandObject);
|
testMenu->addAction(m_createCommandObject);
|
||||||
@@ -836,8 +839,6 @@ void RiuMainWindow::slotMockModel()
|
|||||||
{
|
{
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
app->createMockModel();
|
app->createMockModel();
|
||||||
|
|
||||||
//m_mainViewer->setDefaultView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -847,8 +848,6 @@ void RiuMainWindow::slotMockResultsModel()
|
|||||||
{
|
{
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
app->createResultsMockModel();
|
app->createResultsMockModel();
|
||||||
|
|
||||||
//m_mainViewer->setDefaultView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -861,6 +860,14 @@ void RiuMainWindow::slotMockLargeResultsModel()
|
|||||||
app->createLargeResultsMockModel();
|
app->createLargeResultsMockModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMainWindow::slotMockModelCustomized()
|
||||||
|
{
|
||||||
|
RiaApplication* app = RiaApplication::instance();
|
||||||
|
app->createMockModelCustomized();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ private:
|
|||||||
QAction* m_mockModelAction;
|
QAction* m_mockModelAction;
|
||||||
QAction* m_mockResultsModelAction;
|
QAction* m_mockResultsModelAction;
|
||||||
QAction* m_mockLargeResultsModelAction;
|
QAction* m_mockLargeResultsModelAction;
|
||||||
|
QAction* m_mockModelCustomizedAction;
|
||||||
QAction* m_mockInputModelAction;
|
QAction* m_mockInputModelAction;
|
||||||
|
|
||||||
QAction* m_snapshotToFile;
|
QAction* m_snapshotToFile;
|
||||||
@@ -240,6 +241,7 @@ private slots:
|
|||||||
void slotMockModel();
|
void slotMockModel();
|
||||||
void slotMockResultsModel();
|
void slotMockResultsModel();
|
||||||
void slotMockLargeResultsModel();
|
void slotMockLargeResultsModel();
|
||||||
|
void slotMockModelCustomized();
|
||||||
void slotInputMockModel();
|
void slotInputMockModel();
|
||||||
|
|
||||||
// Windows slots
|
// Windows slots
|
||||||
|
|||||||
Reference in New Issue
Block a user