Added customized mock model to user interface

This commit is contained in:
Magne Sjaastad 2013-10-28 10:32:24 +01:00
parent 7ffe48bff9
commit ae9f72912e
9 changed files with 64 additions and 8 deletions

View File

@ -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()));
}
//--------------------------------------------------------------------------------------------------

View File

@ -81,6 +81,7 @@ public:
void createMockModel();
void createResultsMockModel();
void createLargeResultsMockModel();
void createMockModelCustomized();
void createInputMockModel();
QString defaultFileDialogDirectory(const QString& dialogName);

View File

@ -175,3 +175,11 @@ void RifReaderMockModel::populateReservoir(RigCaseData* eclipseCase)
m_reservoirBuilder.populateReservoir(eclipseCase);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifReaderMockModel::enableWellData(bool enableWellData)
{
m_reservoirBuilder.enableWellData(enableWellData);
}

View File

@ -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);

View File

@ -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"; }
};

View File

@ -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<RifReaderInterface> readerInterface = this->createMockModel(fileNames[0]);
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
@ -184,7 +184,7 @@ bool RimInputCase::openEclipseGridFile()
{
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());
}
@ -377,7 +377,7 @@ cvf::ref<RifReaderInterface> RimInputCase::createMockModel(QString modelName)
cvf::ref<RigCaseData> reservoir = new RigCaseData;
cvf::ref<RifReaderMockModel> mockFileInterface = new RifReaderMockModel;
if (modelName == "Input Mock Debug Model Simple")
if (modelName == RimDefines::mockModelBasicInputCase())
{
m_gridFileName = modelName;

View File

@ -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<RifReaderInterface> 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() );

View File

@ -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();
}
//--------------------------------------------------------------------------------------------------
///

View File

@ -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