Skip to content

Commit b3a8d59

Browse files
committed
Merge pull request #108 from OPM/dev
Update to 1.0.0
2 parents f12b04d + 04b54d8 commit b3a8d59

File tree

105 files changed

+5000
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+5000
-255
lines changed

ApplicationCode/Application/RiaApplication.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
#include "RimCellPropertyFilterCollection.h"
7373
#include "Rim3dOverlayInfoConfig.h"
7474
#include "RimWellCollection.h"
75+
#include "cafCeetronPlusNavigation.h"
7576

7677
namespace caf
7778
{
@@ -1132,7 +1133,7 @@ void RiaApplication::applyPreferences()
11321133
}
11331134
else
11341135
{
1135-
m_activeReservoirView->viewer()->setNavigationPolicy(new caf::CeetronNavigation);
1136+
m_activeReservoirView->viewer()->setNavigationPolicy(new caf::CeetronPlusNavigation);
11361137
}
11371138

11381139
m_activeReservoirView->viewer()->enablePerfInfoHud(m_preferences->showHud());
@@ -1631,10 +1632,8 @@ QString RiaApplication::commandLineParameterHelp() const
16311632
"\n"
16321633
"-project <filename> Open project file <filename>\n"
16331634
"\n"
1634-
"-case <casename> Open Eclipse case <casename>\n"
1635+
"-case <casename> Import Eclipse case <casename>\n"
16351636
" (do not include .GRID/.EGRID)\n"
1636-
"\n"
1637-
"-startdir The default directory for open/save commands\n"
16381637
"\n"
16391638
"-savesnapshots Save snapshot of all views to 'snapshots' folder in project file folder\n"
16401639
" Application closes after snapshots are written to file\n"

ApplicationCode/Application/RiaRegressionTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CAF_PDM_SOURCE_INIT(RiaRegressionTest, "RiaRegressionTest");
2727
//--------------------------------------------------------------------------------------------------
2828
RiaRegressionTest::RiaRegressionTest(void)
2929
{
30-
CAF_PDM_InitFieldNoDefault(&applicationWorkingFolder, "workingFolder", "Application Working Folder", "", "", "");
30+
CAF_PDM_InitFieldNoDefault(&applicationWorkingFolder, "workingFolder", "Folder containing <b>compare</b>", "", "Location of compare tool from Image Magic suite", "");
3131
applicationWorkingFolder.setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
3232

3333
CAF_PDM_InitFieldNoDefault(&regressionTestFolder, "regressionTestFolder", "Regression Test Folder", "", "", "");

ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,9 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
14641464

14651465
if (activeCellInfo->globalActiveCellCount() > 0)
14661466
{
1467+
size_t timeStepsAllCells = keywordDataItemCounts[i] / activeCellInfo->globalCellCount();
1468+
size_t timeStepsAllCellsRest = keywordDataItemCounts[i] % activeCellInfo->globalCellCount();
1469+
14671470
size_t timeStepsMatrix = keywordDataItemCounts[i] / activeCellInfo->globalActiveCellCount();
14681471
size_t timeStepsMatrixRest = keywordDataItemCounts[i] % activeCellInfo->globalActiveCellCount();
14691472

@@ -1479,13 +1482,22 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
14791482
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
14801483
}
14811484
}
1485+
else if (timeStepsAllCellsRest == 0)
1486+
{
1487+
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
1488+
}
1489+
14821490
}
14831491
else
14841492
{
14851493
if (timeStepsMatrixAndFractureRest == 0 && timeStepCount == timeStepsMatrixAndFracture)
14861494
{
14871495
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
14881496
}
1497+
else if (timeStepsAllCellsRest == 0)
1498+
{
1499+
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
1500+
}
14891501
}
14901502
}
14911503
else

ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ void RivWellPathCollectionPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBa
8484
{
8585
setScaleTransform(scaleTransform);
8686

87+
if (!m_wellPathCollection->isActive()) return;
8788
if (m_wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return;
8889

8990
for (size_t wIdx = 0; wIdx < m_wellPathCollection->wellPaths.size(); wIdx++)

ApplicationCode/ProjectDataModel/CMakeLists_files.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ ${CEE_CURRENT_LIST_DIR}RimReservoirCellResultsCacher.h
4343
${CEE_CURRENT_LIST_DIR}RimStatisticsCaseEvaluator.h
4444
${CEE_CURRENT_LIST_DIR}RimMimeData.h
4545
${CEE_CURRENT_LIST_DIR}RimCommandObject.h
46+
${CEE_CURRENT_LIST_DIR}RimTools.h
4647
)
4748

4849
set (SOURCE_GROUP_SOURCE_FILES
@@ -84,6 +85,7 @@ ${CEE_CURRENT_LIST_DIR}RimReservoirCellResultsCacher.cpp
8485
${CEE_CURRENT_LIST_DIR}RimStatisticsCaseEvaluator.cpp
8586
${CEE_CURRENT_LIST_DIR}RimMimeData.cpp
8687
${CEE_CURRENT_LIST_DIR}RimCommandObject.cpp
88+
${CEE_CURRENT_LIST_DIR}RimTools.cpp
8789
)
8890

8991
list(APPEND CODE_HEADER_FILES

ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ CAF_PDM_SOURCE_INIT(Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig");
4040
//--------------------------------------------------------------------------------------------------
4141
Rim3dOverlayInfoConfig::Rim3dOverlayInfoConfig()
4242
{
43-
CAF_PDM_InitObject("Overlay 3D info", ":/Legend.png", "", "");
43+
CAF_PDM_InitObject("Overlay 3D info", ":/InfoBox16x16.png", "", "");
4444

4545
CAF_PDM_InitField(&active, "Active", true, "Active", "", "", "");
4646
active.setUiHidden(true);

ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ RimIdenticalGridCaseGroup::RimIdenticalGridCaseGroup()
6161
groupId.setUiReadOnly(true);
6262

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

6666
caseCollection = new RimCaseCollection;
6767
statisticsCaseCollection = new RimCaseCollection;

ApplicationCode/ProjectDataModel/RimProject.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void RimProject::close()
123123
casesObsolete.deleteAllChildObjects();
124124
caseGroupsObsolete.deleteAllChildObjects();
125125

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

128128
commandObjects.deleteAllChildObjects();
129129

@@ -344,6 +344,16 @@ void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName
344344
{
345345
cases[i]->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
346346
}
347+
348+
// Update path to well path file cache
349+
for (size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++)
350+
{
351+
RimOilField* oilField = oilFields[oilFieldIdx];
352+
if (oilField == NULL || oilField->wellPathCollection == NULL) continue;
353+
oilField->wellPathCollection->updateFilePathsFromProjectPath();
354+
}
355+
356+
wellPathImport->updateFilePaths();
347357
}
348358

349359
//--------------------------------------------------------------------------------------------------

ApplicationCode/ProjectDataModel/RimReservoirCellResultsCacher.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "RimWellPathCollection.h"
4848
#include "RimOilField.h"
4949
#include "RimAnalysisModels.h"
50+
#include "RimTools.h"
5051

5152
CAF_PDM_SOURCE_INIT(RimReservoirCellResultsStorage, "ReservoirCellResultStorage");
5253

@@ -211,11 +212,8 @@ QString RimReservoirCellResultsStorage::getValidCacheFileName()
211212
//--------------------------------------------------------------------------------------------------
212213
QString RimReservoirCellResultsStorage::getCacheDirectoryPath()
213214
{
214-
QString cacheDirPath;
215-
QString projectFileName = RiaApplication::instance()->project()->fileName();
216-
QFileInfo fileInfo(projectFileName);
217-
cacheDirPath = fileInfo.canonicalPath();
218-
cacheDirPath += "/" + fileInfo.completeBaseName() + "_cache";
215+
QString cacheDirPath = RimTools::getCacheRootDirectoryPathFromProject();
216+
cacheDirPath += "_cache";
219217
return cacheDirPath;
220218
}
221219

ApplicationCode/ProjectDataModel/RimReservoirView.cpp

+25-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
#include "cvfOverlayScalarMapperLegend.h"
7373

7474
#include <limits.h>
75+
#include "cafCeetronPlusNavigation.h"
7576

7677
namespace caf {
7778

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

125-
CAF_PDM_InitFieldNoDefault(&overlayInfoConfig, "OverlayInfoConfig", "Overlay Info", "", "", "");
126+
CAF_PDM_InitFieldNoDefault(&overlayInfoConfig, "OverlayInfoConfig", "Info Box", "", "", "");
126127
overlayInfoConfig = new Rim3dOverlayInfoConfig();
127128
overlayInfoConfig->setReservoirView(this);
128129

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

144-
CAF_PDM_InitFieldNoDefault(&wellCollection, "WellCollection","Wells", "", "", "");
145+
CAF_PDM_InitFieldNoDefault(&wellCollection, "WellCollection", "Simulation Wells", "", "", "");
145146
wellCollection = new RimWellCollection;
146147

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

170171

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

235236
if (RiaApplication::instance()->navigationPolicy() == RiaApplication::NAVIGATION_POLICY_CEETRON)
236237
{
237-
m_viewer->setNavigationPolicy(new caf::CeetronNavigation);
238+
m_viewer->setNavigationPolicy(new caf::CeetronPlusNavigation);
238239
}
239240
else
240241
{
@@ -1610,3 +1611,23 @@ caf::PdmFieldHandle* RimReservoirView::objectToggleField()
16101611
return &showWindow;
16111612
}
16121613

1614+
//--------------------------------------------------------------------------------------------------
1615+
///
1616+
//--------------------------------------------------------------------------------------------------
1617+
void RimReservoirView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
1618+
{
1619+
caf::PdmUiGroup* viewGroup = uiOrdering.addNewGroup("Viewer");
1620+
viewGroup->add(&name);
1621+
viewGroup->add(&backgroundColor);
1622+
1623+
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup("Grid Appearance");
1624+
gridGroup->add(&scaleZ);
1625+
gridGroup->add(&meshMode);
1626+
gridGroup->add(&surfaceMode);
1627+
1628+
caf::PdmUiGroup* cellGroup = uiOrdering.addNewGroup("Cell Visibility");
1629+
cellGroup->add(&showMainGrid);
1630+
cellGroup->add(&showInactiveCells);
1631+
cellGroup->add(&showInvalidCells);
1632+
}
1633+

ApplicationCode/ProjectDataModel/RimReservoirView.h

+2
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,14 @@ class RimReservoirView : public caf::PdmObject
191191
protected:
192192
virtual void initAfterRead();
193193
virtual void setupBeforeSave();
194+
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
194195

195196
// Really private
196197
private:
197198
void syncronizeWellsWithResults();
198199
void clampCurrentTimestep();
199200

201+
200202
private:
201203
caf::PdmField<int> m_currentTimeStep;
202204
QPointer<RiuViewer> m_viewer;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/////////////////////////////////////////////////////////////////////////////////
2+
//
3+
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
4+
//
5+
// ResInsight is free software: you can redistribute it and/or modify
6+
// it under the terms of the GNU General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
11+
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
// FITNESS FOR A PARTICULAR PURPOSE.
13+
//
14+
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
15+
// for more details.
16+
//
17+
/////////////////////////////////////////////////////////////////////////////////
18+
19+
#include "RiaStdInclude.h"
20+
21+
#include "RimTools.h"
22+
23+
#include "RivWellPathCollectionPartMgr.h"
24+
#include "RimProject.h"
25+
#include "RimCase.h"
26+
#include "RimIdenticalGridCaseGroup.h"
27+
#include "RimScriptCollection.h"
28+
#include "RimReservoirView.h"
29+
#include "RimReservoirCellResultsCacher.h"
30+
#include "RimCaseCollection.h"
31+
#include "RimResultSlot.h"
32+
#include "RimCellEdgeResultSlot.h"
33+
#include "RimCellPropertyFilterCollection.h"
34+
#include "RimWellCollection.h"
35+
#include "Rim3dOverlayInfoConfig.h"
36+
#include "RimWellPathCollection.h"
37+
#include "RivWellPathPartMgr.h"
38+
#include "RimWellPathCollection.h"
39+
#include "RimCellRangeFilterCollection.h"
40+
#include "RimOilField.h"
41+
#include "RimAnalysisModels.h"
42+
#include "RiaApplication.h"
43+
44+
//--------------------------------------------------------------------------------------------------
45+
///
46+
//--------------------------------------------------------------------------------------------------
47+
QString RimTools::getCacheRootDirectoryPathFromProject()
48+
{
49+
if (!RiaApplication::instance()->project())
50+
{
51+
return QString();
52+
}
53+
54+
QString projectFileName = RiaApplication::instance()->project()->fileName();
55+
56+
QString cacheRootFolderPath;
57+
QFileInfo fileInfo(projectFileName);
58+
cacheRootFolderPath = fileInfo.canonicalPath();
59+
cacheRootFolderPath += "/" + fileInfo.completeBaseName();
60+
61+
return cacheRootFolderPath;
62+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/////////////////////////////////////////////////////////////////////////////////
2+
//
3+
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
4+
//
5+
// ResInsight is free software: you can redistribute it and/or modify
6+
// it under the terms of the GNU General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
11+
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
// FITNESS FOR A PARTICULAR PURPOSE.
13+
//
14+
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
15+
// for more details.
16+
//
17+
/////////////////////////////////////////////////////////////////////////////////
18+
19+
#pragma once
20+
21+
class RimProject;
22+
23+
class RimTools
24+
{
25+
public:
26+
static QString getCacheRootDirectoryPathFromProject();
27+
};

ApplicationCode/ProjectDataModel/RimUiTreeView.cpp

+19-1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,15 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
223223
else if (dynamic_cast<RimWellPathCollection*>(uiItem->dataObject().p()))
224224
{
225225
menu.addAction(QString("Delete All Well Paths"), this, SLOT(slotDeleteAllWellPaths()));
226+
227+
RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
228+
ruiMainWindow->appendActionsContextMenuForPdmObject(uiItem->dataObject().p(), &menu);
229+
}
230+
else if (dynamic_cast<RimAnalysisModels*>(uiItem->dataObject().p()))
231+
{
232+
RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
233+
ruiMainWindow->appendActionsContextMenuForPdmObject(uiItem->dataObject().p(), &menu);
234+
menu.addAction(QString("New Grid Case Group"), this, SLOT(slotAddCaseGroup()));
226235
}
227236

228237
// Execute script on selection of cases
@@ -1586,7 +1595,16 @@ void RimUiTreeView::slotDeleteAllWellPaths()
15861595
if (myModel)
15871596
{
15881597
myModel->deleteAllWellPaths(currentIndex());
1598+
1599+
caf::PdmUiTreeItem* uiItem = myModel->getTreeItemFromIndex(currentIndex());
1600+
if (uiItem && uiItem->dataObject())
1601+
{
1602+
RimWellPathCollection* wellPathCollection = dynamic_cast<RimWellPathCollection*>(uiItem->dataObject().p());
1603+
if (wellPathCollection)
1604+
{
1605+
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
1606+
}
1607+
}
15891608
}
1590-
15911609
}
15921610

ApplicationCode/ProjectDataModel/RimWell.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,11 @@ bool RimWell::calculateWellPipeVisibility(size_t frameIndex)
246246
//--------------------------------------------------------------------------------------------------
247247
void RimWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
248248
{
249-
caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Well pipe");
249+
caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Appearance");
250250
pipeGroup->add(&showWellPipes);
251-
pipeGroup->add(&pipeRadiusScaleFactor);
252-
pipeGroup->add(&wellPipeColor);
253251
pipeGroup->add(&showWellLabel);
252+
pipeGroup->add(&wellPipeColor);
253+
pipeGroup->add(&pipeRadiusScaleFactor);
254254

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

0 commit comments

Comments
 (0)