Skip to content

Commit

Permalink
Merge pull request #108 from OPM/dev
Browse files Browse the repository at this point in the history
Update to 1.0.0
  • Loading branch information
magnesj committed Oct 25, 2013
2 parents f12b04d + 04b54d8 commit b3a8d59
Show file tree
Hide file tree
Showing 105 changed files with 5,000 additions and 255 deletions.
7 changes: 3 additions & 4 deletions ApplicationCode/Application/RiaApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#include "RimCellPropertyFilterCollection.h"
#include "Rim3dOverlayInfoConfig.h"
#include "RimWellCollection.h"
#include "cafCeetronPlusNavigation.h"

namespace caf
{
Expand Down Expand Up @@ -1132,7 +1133,7 @@ void RiaApplication::applyPreferences()
}
else
{
m_activeReservoirView->viewer()->setNavigationPolicy(new caf::CeetronNavigation);
m_activeReservoirView->viewer()->setNavigationPolicy(new caf::CeetronPlusNavigation);
}

m_activeReservoirView->viewer()->enablePerfInfoHud(m_preferences->showHud());
Expand Down Expand Up @@ -1631,10 +1632,8 @@ QString RiaApplication::commandLineParameterHelp() const
"\n"
"-project <filename> Open project file <filename>\n"
"\n"
"-case <casename> Open Eclipse case <casename>\n"
"-case <casename> Import Eclipse case <casename>\n"
" (do not include .GRID/.EGRID)\n"
"\n"
"-startdir The default directory for open/save commands\n"
"\n"
"-savesnapshots Save snapshot of all views to 'snapshots' folder in project file folder\n"
" Application closes after snapshots are written to file\n"
Expand Down
2 changes: 1 addition & 1 deletion ApplicationCode/Application/RiaRegressionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CAF_PDM_SOURCE_INIT(RiaRegressionTest, "RiaRegressionTest");
//--------------------------------------------------------------------------------------------------
RiaRegressionTest::RiaRegressionTest(void)
{
CAF_PDM_InitFieldNoDefault(&applicationWorkingFolder, "workingFolder", "Application Working Folder", "", "", "");
CAF_PDM_InitFieldNoDefault(&applicationWorkingFolder, "workingFolder", "Folder containing <b>compare</b>", "", "Location of compare tool from Image Magic suite", "");
applicationWorkingFolder.setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());

CAF_PDM_InitFieldNoDefault(&regressionTestFolder, "regressionTestFolder", "Regression Test Folder", "", "", "");
Expand Down
12 changes: 12 additions & 0 deletions ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,9 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL

if (activeCellInfo->globalActiveCellCount() > 0)
{
size_t timeStepsAllCells = keywordDataItemCounts[i] / activeCellInfo->globalCellCount();
size_t timeStepsAllCellsRest = keywordDataItemCounts[i] % activeCellInfo->globalCellCount();

size_t timeStepsMatrix = keywordDataItemCounts[i] / activeCellInfo->globalActiveCellCount();
size_t timeStepsMatrixRest = keywordDataItemCounts[i] % activeCellInfo->globalActiveCellCount();

Expand All @@ -1479,13 +1482,22 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
}
}
else if (timeStepsAllCellsRest == 0)
{
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
}

}
else
{
if (timeStepsMatrixAndFractureRest == 0 && timeStepCount == timeStepsMatrixAndFracture)
{
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
}
else if (timeStepsAllCellsRest == 0)
{
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
}
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ void RivWellPathCollectionPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBa
{
setScaleTransform(scaleTransform);

if (!m_wellPathCollection->isActive()) return;
if (m_wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return;

for (size_t wIdx = 0; wIdx < m_wellPathCollection->wellPaths.size(); wIdx++)
Expand Down
2 changes: 2 additions & 0 deletions ApplicationCode/ProjectDataModel/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ${CEE_CURRENT_LIST_DIR}RimReservoirCellResultsCacher.h
${CEE_CURRENT_LIST_DIR}RimStatisticsCaseEvaluator.h
${CEE_CURRENT_LIST_DIR}RimMimeData.h
${CEE_CURRENT_LIST_DIR}RimCommandObject.h
${CEE_CURRENT_LIST_DIR}RimTools.h
)

set (SOURCE_GROUP_SOURCE_FILES
Expand Down Expand Up @@ -84,6 +85,7 @@ ${CEE_CURRENT_LIST_DIR}RimReservoirCellResultsCacher.cpp
${CEE_CURRENT_LIST_DIR}RimStatisticsCaseEvaluator.cpp
${CEE_CURRENT_LIST_DIR}RimMimeData.cpp
${CEE_CURRENT_LIST_DIR}RimCommandObject.cpp
${CEE_CURRENT_LIST_DIR}RimTools.cpp
)

list(APPEND CODE_HEADER_FILES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CAF_PDM_SOURCE_INIT(Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig");
//--------------------------------------------------------------------------------------------------
Rim3dOverlayInfoConfig::Rim3dOverlayInfoConfig()
{
CAF_PDM_InitObject("Overlay 3D info", ":/Legend.png", "", "");
CAF_PDM_InitObject("Overlay 3D info", ":/InfoBox16x16.png", "", "");

CAF_PDM_InitField(&active, "Active", true, "Active", "", "", "");
active.setUiHidden(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RimIdenticalGridCaseGroup::RimIdenticalGridCaseGroup()
groupId.setUiReadOnly(true);

CAF_PDM_InitFieldNoDefault(&statisticsCaseCollection, "StatisticsCaseCollection", "Derived Statistics", ":/Histograms16x16.png", "", "");
CAF_PDM_InitFieldNoDefault(&caseCollection, "CaseCollection", "Cases", ":/Cases16x16.png", "", "");
CAF_PDM_InitFieldNoDefault(&caseCollection, "CaseCollection", "Source Cases", ":/Cases16x16.png", "", "");

caseCollection = new RimCaseCollection;
statisticsCaseCollection = new RimCaseCollection;
Expand Down
12 changes: 11 additions & 1 deletion ApplicationCode/ProjectDataModel/RimProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void RimProject::close()
casesObsolete.deleteAllChildObjects();
caseGroupsObsolete.deleteAllChildObjects();

wellPathImport = new RimWellPathImport();
wellPathImport->regions().deleteAllChildObjects();

commandObjects.deleteAllChildObjects();

Expand Down Expand Up @@ -344,6 +344,16 @@ void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName
{
cases[i]->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
}

// Update path to well path file cache
for (size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++)
{
RimOilField* oilField = oilFields[oilFieldIdx];
if (oilField == NULL || oilField->wellPathCollection == NULL) continue;
oilField->wellPathCollection->updateFilePathsFromProjectPath();
}

wellPathImport->updateFilePaths();
}

//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "RimWellPathCollection.h"
#include "RimOilField.h"
#include "RimAnalysisModels.h"
#include "RimTools.h"

CAF_PDM_SOURCE_INIT(RimReservoirCellResultsStorage, "ReservoirCellResultStorage");

Expand Down Expand Up @@ -211,11 +212,8 @@ QString RimReservoirCellResultsStorage::getValidCacheFileName()
//--------------------------------------------------------------------------------------------------
QString RimReservoirCellResultsStorage::getCacheDirectoryPath()
{
QString cacheDirPath;
QString projectFileName = RiaApplication::instance()->project()->fileName();
QFileInfo fileInfo(projectFileName);
cacheDirPath = fileInfo.canonicalPath();
cacheDirPath += "/" + fileInfo.completeBaseName() + "_cache";
QString cacheDirPath = RimTools::getCacheRootDirectoryPathFromProject();
cacheDirPath += "_cache";
return cacheDirPath;
}

Expand Down
29 changes: 25 additions & 4 deletions ApplicationCode/ProjectDataModel/RimReservoirView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#include "cvfOverlayScalarMapperLegend.h"

#include <limits.h>
#include "cafCeetronPlusNavigation.h"

namespace caf {

Expand Down Expand Up @@ -122,7 +123,7 @@ RimReservoirView::RimReservoirView()
CAF_PDM_InitFieldNoDefault(&cellEdgeResult, "GridCellEdgeResult", "Cell Edge Result", ":/EdgeResult_1.png", "", "");
cellEdgeResult = new RimCellEdgeResultSlot();

CAF_PDM_InitFieldNoDefault(&overlayInfoConfig, "OverlayInfoConfig", "Overlay Info", "", "", "");
CAF_PDM_InitFieldNoDefault(&overlayInfoConfig, "OverlayInfoConfig", "Info Box", "", "", "");
overlayInfoConfig = new Rim3dOverlayInfoConfig();
overlayInfoConfig->setReservoirView(this);

Expand All @@ -141,7 +142,7 @@ RimReservoirView::RimReservoirView()
CAF_PDM_InitField(&animationMode, "AnimationMode", false, "Animation Mode","", "", "");
animationMode.setUiHidden(true);

CAF_PDM_InitFieldNoDefault(&wellCollection, "WellCollection","Wells", "", "", "");
CAF_PDM_InitFieldNoDefault(&wellCollection, "WellCollection", "Simulation Wells", "", "", "");
wellCollection = new RimWellCollection;

CAF_PDM_InitFieldNoDefault(&rangeFilterCollection, "RangeFilters", "Range Filters", "", "", "");
Expand All @@ -165,7 +166,7 @@ RimReservoirView::RimReservoirView()
CAF_PDM_InitField(&showInactiveCells, "ShowInactiveCells", false, "Show Inactive Cells", "", "", "");
CAF_PDM_InitField(&showInvalidCells, "ShowInvalidCells", false, "Show Invalid Cells", "", "", "");
cvf::Color3f defBackgColor = preferences->defaultViewerBackgroundColor();
CAF_PDM_InitField(&backgroundColor, "ViewBackgroundColor", defBackgColor, "Viewer Background", "", "", "");
CAF_PDM_InitField(&backgroundColor, "ViewBackgroundColor", defBackgColor, "Background", "", "", "");


CAF_PDM_InitField(&cameraPosition, "CameraPosition", cvf::Mat4d::IDENTITY, "", "", "", "");
Expand Down Expand Up @@ -234,7 +235,7 @@ void RimReservoirView::updateViewerWidget()

if (RiaApplication::instance()->navigationPolicy() == RiaApplication::NAVIGATION_POLICY_CEETRON)
{
m_viewer->setNavigationPolicy(new caf::CeetronNavigation);
m_viewer->setNavigationPolicy(new caf::CeetronPlusNavigation);
}
else
{
Expand Down Expand Up @@ -1610,3 +1611,23 @@ caf::PdmFieldHandle* RimReservoirView::objectToggleField()
return &showWindow;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimReservoirView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* viewGroup = uiOrdering.addNewGroup("Viewer");
viewGroup->add(&name);
viewGroup->add(&backgroundColor);

caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup("Grid Appearance");
gridGroup->add(&scaleZ);
gridGroup->add(&meshMode);
gridGroup->add(&surfaceMode);

caf::PdmUiGroup* cellGroup = uiOrdering.addNewGroup("Cell Visibility");
cellGroup->add(&showMainGrid);
cellGroup->add(&showInactiveCells);
cellGroup->add(&showInvalidCells);
}

2 changes: 2 additions & 0 deletions ApplicationCode/ProjectDataModel/RimReservoirView.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,14 @@ class RimReservoirView : public caf::PdmObject
protected:
virtual void initAfterRead();
virtual void setupBeforeSave();
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );

// Really private
private:
void syncronizeWellsWithResults();
void clampCurrentTimestep();


private:
caf::PdmField<int> m_currentTimeStep;
QPointer<RiuViewer> m_viewer;
Expand Down
62 changes: 62 additions & 0 deletions ApplicationCode/ProjectDataModel/RimTools.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

#include "RiaStdInclude.h"

#include "RimTools.h"

#include "RivWellPathCollectionPartMgr.h"
#include "RimProject.h"
#include "RimCase.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimScriptCollection.h"
#include "RimReservoirView.h"
#include "RimReservoirCellResultsCacher.h"
#include "RimCaseCollection.h"
#include "RimResultSlot.h"
#include "RimCellEdgeResultSlot.h"
#include "RimCellPropertyFilterCollection.h"
#include "RimWellCollection.h"
#include "Rim3dOverlayInfoConfig.h"
#include "RimWellPathCollection.h"
#include "RivWellPathPartMgr.h"
#include "RimWellPathCollection.h"
#include "RimCellRangeFilterCollection.h"
#include "RimOilField.h"
#include "RimAnalysisModels.h"
#include "RiaApplication.h"

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimTools::getCacheRootDirectoryPathFromProject()
{
if (!RiaApplication::instance()->project())
{
return QString();
}

QString projectFileName = RiaApplication::instance()->project()->fileName();

QString cacheRootFolderPath;
QFileInfo fileInfo(projectFileName);
cacheRootFolderPath = fileInfo.canonicalPath();
cacheRootFolderPath += "/" + fileInfo.completeBaseName();

return cacheRootFolderPath;
}
27 changes: 27 additions & 0 deletions ApplicationCode/ProjectDataModel/RimTools.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

#pragma once

class RimProject;

class RimTools
{
public:
static QString getCacheRootDirectoryPathFromProject();
};
20 changes: 19 additions & 1 deletion ApplicationCode/ProjectDataModel/RimUiTreeView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
else if (dynamic_cast<RimWellPathCollection*>(uiItem->dataObject().p()))
{
menu.addAction(QString("Delete All Well Paths"), this, SLOT(slotDeleteAllWellPaths()));

RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
ruiMainWindow->appendActionsContextMenuForPdmObject(uiItem->dataObject().p(), &menu);
}
else if (dynamic_cast<RimAnalysisModels*>(uiItem->dataObject().p()))
{
RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
ruiMainWindow->appendActionsContextMenuForPdmObject(uiItem->dataObject().p(), &menu);
menu.addAction(QString("New Grid Case Group"), this, SLOT(slotAddCaseGroup()));
}

// Execute script on selection of cases
Expand Down Expand Up @@ -1586,7 +1595,16 @@ void RimUiTreeView::slotDeleteAllWellPaths()
if (myModel)
{
myModel->deleteAllWellPaths(currentIndex());

caf::PdmUiTreeItem* uiItem = myModel->getTreeItemFromIndex(currentIndex());
if (uiItem && uiItem->dataObject())
{
RimWellPathCollection* wellPathCollection = dynamic_cast<RimWellPathCollection*>(uiItem->dataObject().p());
if (wellPathCollection)
{
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
}
}
}

}

6 changes: 3 additions & 3 deletions ApplicationCode/ProjectDataModel/RimWell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ bool RimWell::calculateWellPipeVisibility(size_t frameIndex)
//--------------------------------------------------------------------------------------------------
void RimWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Well pipe");
caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Appearance");
pipeGroup->add(&showWellPipes);
pipeGroup->add(&pipeRadiusScaleFactor);
pipeGroup->add(&wellPipeColor);
pipeGroup->add(&showWellLabel);
pipeGroup->add(&wellPipeColor);
pipeGroup->add(&pipeRadiusScaleFactor);

caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Range filter");
filterGroup->add(&showWellCells);
Expand Down
Loading

0 comments on commit b3a8d59

Please sign in to comment.