Cleanup after merge

This commit is contained in:
Magne Sjaastad 2014-04-22 14:39:09 +02:00
commit e5712e9809
13 changed files with 110 additions and 27 deletions

View File

@ -699,7 +699,7 @@ bool RiaApplication::openInputEclipseCaseFromFileNames(const QStringList& fileNa
//--------------------------------------------------------------------------------------------------
void RiaApplication::createMockModel()
{
openEclipseCase("Result Mock Debug Model Simple", "Result Mock Debug Model Simple");
openEclipseCase(RimDefines::mockModelBasic(), RimDefines::mockModelBasic());
}
//--------------------------------------------------------------------------------------------------
@ -707,7 +707,7 @@ void RiaApplication::createMockModel()
//--------------------------------------------------------------------------------------------------
void RiaApplication::createResultsMockModel()
{
openEclipseCase("Result Mock Debug Model With Results", "Result Mock Debug Model With Results");
openEclipseCase(RimDefines::mockModelBasicWithResults(), RimDefines::mockModelBasicWithResults());
}
@ -716,7 +716,16 @@ void RiaApplication::createResultsMockModel()
//--------------------------------------------------------------------------------------------------
void RiaApplication::createLargeResultsMockModel()
{
openEclipseCase("Result Mock Debug Model Large With Results", "Result Mock Debug Model Large With Results");
openEclipseCase(RimDefines::mockModelLargeWithResults(), RimDefines::mockModelLargeWithResults());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaApplication::createMockModelCustomized()
{
openEclipseCase(RimDefines::mockModelCustomized(), RimDefines::mockModelCustomized());
}
//--------------------------------------------------------------------------------------------------
@ -724,7 +733,7 @@ void RiaApplication::createLargeResultsMockModel()
//--------------------------------------------------------------------------------------------------
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

@ -60,8 +60,6 @@ RiaPreferences::RiaPreferences(void)
CAF_PDM_InitField(&autocomputeDepthRelatedProperties,"autocomputeDepth", true, "DEPTH related properties", "", "DEPTH, DX, DY, DZ, TOP, BOTTOM", "");
CAF_PDM_InitField(&readFaultData, "readFaultData", true, "Read fault data", "", "", "");
CAF_PDM_InitField(&useStreamTransfer, "useStreamTransfer", true, "Use stream transfer to Octave", "", "", "");
CAF_PDM_InitField(&blockSize, "blockSize", 10000, "blockSize", "", "", "");
}
//--------------------------------------------------------------------------------------------------

View File

@ -60,9 +60,6 @@ public: // Pdm Fields
caf::PdmField<bool> readFaultData;
caf::PdmField<bool> useStreamTransfer;
caf::PdmField<int> blockSize;
protected:
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);

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

@ -41,8 +41,16 @@ public:
static QString undefinedResultName() { return "None"; }
static QString undefinedGridFaultName() { return "Undefined grid faults"; }
static QString combinedTransmissibilityResultName() { return "TRANSXYZ"; }
static QString ternarySaturationResultName() { return "TERNARY"; }
// Mock model text identifiers
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

@ -35,7 +35,7 @@ RimMockModelSettings::RimMockModelSettings()
CAF_PDM_InitField(&cellCountX, "CellCountX", quint64(100), "Cell Count X", "", "", "");
CAF_PDM_InitField(&cellCountY, "CellCountY", quint64(100), "Cell Count Y", "", "", "");
CAF_PDM_InitField(&cellCountZ, "CellCountZ", quint64(100), "Cell Count Z", "", "", "");
CAF_PDM_InitField(&cellCountZ, "CellCountZ", quint64(10), "Cell Count Z", "", "", "");
CAF_PDM_InitFieldNoDefault(&totalCellCount, "TotalCellCount", "Total Cell Count", "", "", "");
totalCellCount.setUiReadOnly(true);
@ -70,4 +70,8 @@ void RimMockModelSettings::defineUiOrdering(QString uiConfigName, caf::PdmUiOrde
gridSizeGroup->add(&cellCountY);
gridSizeGroup->add(&cellCountZ);
gridSizeGroup->add(&totalCellCount);
caf::PdmUiGroup* resultGroup = uiOrdering.addNewGroup("Results");
resultGroup->add(&resultCount);
resultGroup->add(&timeStepCount);
}

View File

@ -17,6 +17,13 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RiaStdInclude.h"
#include "cafProgressInfo.h"
#include "cafPdmSettings.h"
#include "cafPdmFieldCvfMat4d.h"
#include "cafPdmFieldCvfColor.h"
#include "cafPdmUiPropertyDialog.h"
#include "RimResultCase.h"
#include "RigCaseData.h"
#include "RifReaderEclipseOutput.h"
@ -24,7 +31,7 @@
#include "RimReservoirView.h"
#include "RifReaderMockModel.h"
#include "RifReaderEclipseInput.h"
#include "cafProgressInfo.h"
#include "RimProject.h"
#include "RifEclipseOutputFileTools.h"
#include "RiaApplication.h"
@ -34,8 +41,6 @@
#include "RimReservoirCellResultsCacher.h"
#include "RimWellPathCollection.h"
#include "cafPdmFieldCvfMat4d.h"
#include "cafPdmFieldCvfColor.h"
#include "RimResultSlot.h"
#include "RimCellEdgeResultSlot.h"
#include "RimCellRangeFilterCollection.h"
@ -45,6 +50,7 @@
#include "RimOilField.h"
#include "RimAnalysisModels.h"
#include "RiaPreferences.h"
#include "RimMockModelSettings.h"
CAF_PDM_SOURCE_INIT(RimResultCase, "EclipseCase");
//--------------------------------------------------------------------------------------------------
@ -199,7 +205,7 @@ cvf::ref<RifReaderInterface> RimResultCase::createMockModel(QString modelName)
cvf::ref<RifReaderMockModel> mockFileInterface = new RifReaderMockModel;
cvf::ref<RigCaseData> reservoir = new RigCaseData;
if (modelName == "Result Mock Debug Model Simple")
if (modelName == RimDefines::mockModelBasic())
{
// Create the mock file interface and and RigSerervoir and set them up.
mockFileInterface->setWorldCoordinates(cvf::Vec3d(10, 10, 10), cvf::Vec3d(20, 20, 20));
@ -221,7 +227,7 @@ cvf::ref<RifReaderInterface> RimResultCase::createMockModel(QString modelName)
//reservoir->mainGrid()->cell(idx).setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T);
}
}
else if (modelName == "Result Mock Debug Model With Results")
else if (modelName == RimDefines::mockModelBasicWithResults())
{
mockFileInterface->setWorldCoordinates(cvf::Vec3d(10, 10, 10), cvf::Vec3d(-20, -20, -20));
mockFileInterface->setGridPointDimensions(cvf::Vec3st(5, 10, 20));
@ -234,7 +240,7 @@ cvf::ref<RifReaderInterface> RimResultCase::createMockModel(QString modelName)
cvf::Vec3d& tmp = reservoir->mainGrid()->nodes()[1];
tmp += cvf::Vec3d(1, 0, 0);
}
else if (modelName =="Result Mock Debug Model Large With Results")
else if (modelName == RimDefines::mockModelLargeWithResults())
{
double startX = 0;
double startY = 0;
@ -262,6 +268,45 @@ cvf::ref<RifReaderInterface> RimResultCase::createMockModel(QString modelName)
mockFileInterface->open("", reservoir.p());
}
else if (modelName == RimDefines::mockModelCustomized())
{
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
RimMockModelSettings rimMockModelSettings;
caf::Settings::readFieldsFromApplicationStore(&rimMockModelSettings);
caf::PdmUiPropertyDialog propertyDialog(NULL, &rimMockModelSettings, "Customize Mock Model");
if (propertyDialog.exec() == QDialog::Accepted)
{
QApplication::restoreOverrideCursor();
caf::Settings::writeFieldsToApplicationStore(&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 + 1, rimMockModelSettings.cellCountY + 1, rimMockModelSettings.cellCountZ + 1));
mockFileInterface->setResultInfo(rimMockModelSettings.resultCount, rimMockModelSettings.timeStepCount);
mockFileInterface->enableWellData(false);
mockFileInterface->open("", reservoir.p());
}
else
{
QApplication::restoreOverrideCursor();
}
}
this->setReservoirData( reservoir.p() );

View File

@ -529,6 +529,9 @@ void RigReservoirBuilderMock::addFaults(RigCaseData* eclipseCase)
grid->setFaults(faults);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigReservoirBuilderMock::enableWellData(bool enableWellData)
{
m_enableWellData = false;

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);
@ -846,8 +849,6 @@ void RiuMainWindow::slotMockModel()
{
RiaApplication* app = RiaApplication::instance();
app->createMockModel();
//m_mainViewer->setDefaultView();
}
//--------------------------------------------------------------------------------------------------
@ -857,8 +858,6 @@ void RiuMainWindow::slotMockResultsModel()
{
RiaApplication* app = RiaApplication::instance();
app->createResultsMockModel();
//m_mainViewer->setDefaultView();
}
@ -871,6 +870,14 @@ void RiuMainWindow::slotMockLargeResultsModel()
app->createLargeResultsMockModel();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotMockModelCustomized()
{
RiaApplication* app = RiaApplication::instance();
app->createMockModelCustomized();
}
//--------------------------------------------------------------------------------------------------
///
@ -1447,9 +1454,9 @@ void RiuMainWindow::slotOpenMultipleCases()
if (1)
{
gridFileNames += "Result Mock Debug Model With Results";
gridFileNames += "Result Mock Debug Model With Results";
gridFileNames += "Result Mock Debug Model With Results";
gridFileNames += RimDefines::mockModelBasicWithResults();
gridFileNames += RimDefines::mockModelBasicWithResults();
gridFileNames += RimDefines::mockModelBasicWithResults();
}
else
{

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