mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
commit
10411b9358
16
.github/workflows/AppFwkUnitTest.yml
vendored
16
.github/workflows/AppFwkUnitTest.yml
vendored
@ -10,33 +10,25 @@ jobs:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache Qt
|
||||
id: cache-qt
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ github.workspace }}/Qt/
|
||||
key: ${{ runner.os }}-QtCache-5-12-12
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2
|
||||
uses: jurplel/install-qt-action@v3
|
||||
with:
|
||||
version: 5.12.12
|
||||
modules: qtscript
|
||||
dir: "${{ github.workspace }}/Qt/"
|
||||
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||
cache: true
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: "contains( matrix.os, 'ubuntu')"
|
||||
run: sudo apt-get install libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev
|
||||
|
||||
- name: Build AppFwk with Unit Tests
|
||||
uses: lukka/run-cmake@v1
|
||||
uses: lukka/run-cmake@v3
|
||||
with:
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
cmakeListsTxtPath: "${{ github.workspace }}/Fwk/AppFwk/CMakeLists.txt"
|
||||
cmakeAppendedArgs:
|
||||
buildDirectory: ${{ github.workspace }}/cmakebuild
|
||||
buildWithCMakeArgs: "--config Release"
|
||||
useVcpkgToolchainFile: false
|
||||
|
43
.github/workflows/ResInsightWithCache.yml
vendored
43
.github/workflows/ResInsightWithCache.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
||||
config:
|
||||
- {
|
||||
name: "Windows Latest MSVC",
|
||||
os: windows-latest,
|
||||
os: windows-2022,
|
||||
cc: "cl",
|
||||
cxx: "cl",
|
||||
vcpkg-response-file: vcpkg_x64-windows.txt,
|
||||
@ -32,7 +32,7 @@ jobs:
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Latest gcc",
|
||||
os: ubuntu-latest,
|
||||
os: ubuntu-20.04,
|
||||
cc: "gcc",
|
||||
cxx: "g++",
|
||||
vcpkg-response-file: vcpkg_x64-linux.txt,
|
||||
@ -42,7 +42,7 @@ jobs:
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Latest clang",
|
||||
os: ubuntu-latest,
|
||||
os: ubuntu-20.04,
|
||||
cc: "clang",
|
||||
cxx: "clang++",
|
||||
vcpkg-response-file: vcpkg_x64-linux.txt,
|
||||
@ -52,7 +52,7 @@ jobs:
|
||||
}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
@ -64,11 +64,12 @@ jobs:
|
||||
run: python -c "import sys; print(sys.version)"
|
||||
|
||||
- name: Get Python executable path
|
||||
shell: bash
|
||||
id: python-path
|
||||
run: echo "::set-output name=PYTHON_EXECUTABLE::$(python -c 'import sys; import pathlib; print (pathlib.PurePath(sys.executable).as_posix())')"
|
||||
run: echo "PYTHON_EXECUTABLE=$(python -c 'import sys; import pathlib; print (pathlib.PurePath(sys.executable).as_posix())')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Print Python path
|
||||
run: echo ${{ steps.python-path.outputs.PYTHON_EXECUTABLE }}
|
||||
run: echo "${{ steps.python-path.outputs.PYTHON_EXECUTABLE }}"
|
||||
|
||||
- name: Install dependencies
|
||||
# Make sure protobuf version is compatible with grpc - https://github.com/OPM/ResInsight/issues/9304
|
||||
@ -105,18 +106,21 @@ jobs:
|
||||
)
|
||||
endif()
|
||||
|
||||
- name: Prepare cache timestamp
|
||||
id: cache_timestamp_string
|
||||
shell: cmake -P {0}
|
||||
run: |
|
||||
string(TIMESTAMP current_date "%Y-%m-%d" UTC)
|
||||
message("::set-output name=timestamp::${current_date}")
|
||||
- name: Get current time
|
||||
uses: josStorer/get-current-time@v2.0.2
|
||||
id: current-time
|
||||
with:
|
||||
format: YYYY-MM-DD
|
||||
|
||||
- name: Print time stamp
|
||||
run: echo "timestamp ${{ steps.current-time.outputs.formattedTime }}"
|
||||
|
||||
- name: Cache Buildcache
|
||||
id: cache-buildcache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ env.BUILDCACHE_DIR }}
|
||||
key: ${{ matrix.config.os }}-${{ matrix.config.cc }}-cache-v02-${{ steps.cache_timestamp_string.outputs.timestamp }}
|
||||
key: ${{ matrix.config.os }}-${{ matrix.config.cc }}-cache-v02-${{ steps.current-time.outputs.formattedTime }}
|
||||
- name: Create Folder for buildcache
|
||||
run: New-Item ${{ env.BUILDCACHE_DIR }} -ItemType "directory" -Force
|
||||
shell: pwsh
|
||||
@ -124,20 +128,13 @@ jobs:
|
||||
run: echo "${{github.workspace}}/buildcache/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||
shell: pwsh
|
||||
|
||||
- name: Cache Qt
|
||||
id: cache-qt
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ github.workspace }}/Qt/
|
||||
key: ${{ matrix.config.os }}-QtCache-5-12-12
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2
|
||||
uses: jurplel/install-qt-action@v3
|
||||
with:
|
||||
setup-python: false
|
||||
version: 5.12.12
|
||||
modules: qtscript qtcharts
|
||||
modules: qtscript
|
||||
dir: "${{ github.workspace }}/Qt/"
|
||||
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||
cache: true
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: "contains( matrix.config.os, 'ubuntu')"
|
||||
|
56
.github/workflows/clang-format.yml
vendored
56
.github/workflows/clang-format.yml
vendored
@ -6,32 +6,30 @@ jobs:
|
||||
clang-format-job:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Install clang-format 10.0
|
||||
run: |
|
||||
sudo apt install clang-format
|
||||
clang-format --version
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check format - ApplicationLibCode
|
||||
run: |
|
||||
cd ApplicationLibCode
|
||||
find -name *.h -o -name *.cpp -o -name *.inl | xargs clang-format -i
|
||||
git diff
|
||||
- name: Check format - ApplicationExeCode
|
||||
run: |
|
||||
cd ApplicationExeCode
|
||||
find -name *.h -o -name *.cpp -o -name *.inl | xargs clang-format -i
|
||||
git diff
|
||||
- name: Check format - AppFwk
|
||||
run: |
|
||||
cd Fwk/AppFwk
|
||||
find -name *.h -o -name *.cpp -o -name *.inl | grep -v gtest | xargs clang-format -i
|
||||
git diff
|
||||
- uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: 'Fixes by clang-format'
|
||||
title: 'Fixes by clang-format'
|
||||
branch: clang-format-patches
|
||||
branch-suffix: random
|
||||
|
||||
|
||||
- name: Install clang-format 10.0
|
||||
run: |
|
||||
sudo apt install clang-format
|
||||
clang-format --version
|
||||
- uses: actions/checkout@v3
|
||||
- name: Check format - ApplicationLibCode
|
||||
run: |
|
||||
cd ApplicationLibCode
|
||||
find -name *.h -o -name *.cpp -o -name *.inl | xargs clang-format -i
|
||||
git diff
|
||||
- name: Check format - ApplicationExeCode
|
||||
run: |
|
||||
cd ApplicationExeCode
|
||||
find -name *.h -o -name *.cpp -o -name *.inl | xargs clang-format -i
|
||||
git diff
|
||||
- name: Check format - AppFwk
|
||||
run: |
|
||||
cd Fwk/AppFwk
|
||||
find -name *.h -o -name *.cpp -o -name *.inl | grep -v gtest | xargs clang-format -i
|
||||
git diff
|
||||
- uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: "Fixes by clang-format"
|
||||
title: "Fixes by clang-format"
|
||||
branch: clang-format-patches
|
||||
branch-suffix: random
|
||||
|
50
.github/workflows/clang-tidy.yml
vendored
50
.github/workflows/clang-tidy.yml
vendored
@ -4,7 +4,7 @@ on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Once every night
|
||||
- cron: '0 1 * * * '
|
||||
- cron: "0 1 * * * "
|
||||
|
||||
jobs:
|
||||
ResInsight-x64-buildcache:
|
||||
@ -13,32 +13,29 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "Ubuntu 20.04",
|
||||
os: ubuntu-20.04,
|
||||
cc: "gcc", cxx: "g++",
|
||||
vcpkg-response-file: vcpkg_x64-linux.txt,
|
||||
vcpkg-triplet: x64-linux,
|
||||
cmake-toolchain: 'ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake'
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu 20.04",
|
||||
os: ubuntu-20.04,
|
||||
cc: "gcc",
|
||||
cxx: "g++",
|
||||
vcpkg-response-file: vcpkg_x64-linux.txt,
|
||||
vcpkg-triplet: x64-linux,
|
||||
cmake-toolchain: "ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake",
|
||||
}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: Cache Qt
|
||||
id: cache-qt
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ github.workspace }}/Qt/
|
||||
key: ${{ matrix.config.os }}-QtCache-5-12-12
|
||||
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2
|
||||
uses: jurplel/install-qt-action@v3
|
||||
with:
|
||||
version: 5.12.12
|
||||
modules: qtscript qtcharts
|
||||
dir: '${{ github.workspace }}/Qt/'
|
||||
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||
modules: qtscript
|
||||
dir: "${{ github.workspace }}/Qt/"
|
||||
cache: true
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: "contains( matrix.config.os, 'ubuntu')"
|
||||
run: sudo apt-get install libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev libhdf5-dev
|
||||
@ -50,9 +47,10 @@ jobs:
|
||||
uses: lukka/run-vcpkg@v7
|
||||
id: runvcpkg
|
||||
with:
|
||||
vcpkgArguments: '@${{ github.workspace }}/${{ matrix.config.vcpkg-response-file }}'
|
||||
vcpkgDirectory: '${{ github.workspace }}/ThirdParty/vcpkg'
|
||||
# Ensure the cache key changes any time the content of the response file changes.
|
||||
vcpkgArguments: "@${{ github.workspace }}/${{ matrix.config.vcpkg-response-file }}"
|
||||
vcpkgDirectory:
|
||||
"${{ github.workspace }}/ThirdParty/vcpkg"
|
||||
# Ensure the cache key changes any time the content of the response file changes.
|
||||
appendedCacheKey: ${{ hashFiles(env.VCPKGRESPONSEFILE) }}-clang-tidy-v01
|
||||
- name: Create compile commands and run clang-tidy
|
||||
# https://clang.llvm.org/extra/doxygen/run-clang-tidy_8py_source.html
|
||||
@ -89,10 +87,10 @@ jobs:
|
||||
cd ThirdParty/vcpkg
|
||||
git reset --hard HEAD
|
||||
git clean -fxd
|
||||
- uses: peter-evans/create-pull-request@v3
|
||||
- uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: 'Fixes by clang-tidy'
|
||||
title: 'Fixes by clang-tidy'
|
||||
commit-message: "Fixes by clang-tidy"
|
||||
title: "Fixes by clang-tidy"
|
||||
branch: clang-tidy-patches
|
||||
branch-suffix: random
|
||||
|
52
.github/workflows/cmake-format.yml
vendored
52
.github/workflows/cmake-format.yml
vendored
@ -4,34 +4,34 @@ on: [push]
|
||||
|
||||
jobs:
|
||||
cmake-format-job:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Install cmakelang for cmake-format
|
||||
run: |
|
||||
python3 -m pip install --user cmakelang
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check format - ApplicationLibCode
|
||||
run: |
|
||||
~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i CMakeLists.txt
|
||||
- name: Install cmakelang for cmake-format
|
||||
run: |
|
||||
python3 -m pip install --user cmakelang
|
||||
- uses: actions/checkout@v3
|
||||
- name: Check format - ApplicationLibCode
|
||||
run: |
|
||||
~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i CMakeLists.txt
|
||||
|
||||
cd ApplicationLibCode
|
||||
find -name CMake*.txt | xargs ~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i
|
||||
find -name CMake*.cmake | xargs ~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i
|
||||
cd ..
|
||||
cd ApplicationLibCode
|
||||
find -name CMake*.txt | xargs ~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i
|
||||
find -name CMake*.cmake | xargs ~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i
|
||||
cd ..
|
||||
|
||||
cd ApplicationExeCode
|
||||
find -name CMake*.txt | xargs ~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i
|
||||
cd ..
|
||||
cd ApplicationExeCode
|
||||
find -name CMake*.txt | xargs ~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i
|
||||
cd ..
|
||||
|
||||
cd Fwk/AppFwk
|
||||
find -name CMake*.txt | xargs ~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i
|
||||
cd ..
|
||||
cd Fwk/AppFwk
|
||||
find -name CMake*.txt | xargs ~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i
|
||||
cd ..
|
||||
|
||||
git diff
|
||||
- uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: 'Fixes by cmake-format'
|
||||
title: 'Fixes by cmake-format'
|
||||
branch: cmake-format-patches
|
||||
branch-suffix: random
|
||||
git diff
|
||||
- uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: "Fixes by cmake-format"
|
||||
title: "Fixes by cmake-format"
|
||||
branch: cmake-format-patches
|
||||
branch-suffix: random
|
||||
|
6
.github/workflows/delete_artifacts.yml
vendored
6
.github/workflows/delete_artifacts.yml
vendored
@ -3,7 +3,7 @@ name: Remove old artifacts
|
||||
on:
|
||||
schedule:
|
||||
# Every day at 1am
|
||||
- cron: '0 1 * * *'
|
||||
- cron: "0 1 * * *"
|
||||
|
||||
jobs:
|
||||
remove-old-artifacts:
|
||||
@ -12,9 +12,9 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: setup python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Remove old artifacts
|
||||
|
12
.github/workflows/python-linting.yml
vendored
12
.github/workflows/python-linting.yml
vendored
@ -4,20 +4,20 @@ on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
- name: (Python) Use black to do linting
|
||||
run: |
|
||||
pip install black
|
||||
cd GrpcInterface
|
||||
black .
|
||||
- uses: peter-evans/create-pull-request@v3
|
||||
- uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: 'Python code linting changes detected by black'
|
||||
title: 'Fixes by black (Python)'
|
||||
commit-message: "Python code linting changes detected by black"
|
||||
title: "Fixes by black (Python)"
|
||||
branch: python-black-patches
|
||||
branch-suffix: random
|
||||
base: ${{ github.head_ref }}
|
||||
|
28
.github/workflows/spell-check.yml
vendored
28
.github/workflows/spell-check.yml
vendored
@ -5,20 +5,16 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: sobolevn/misspell-fixer-action@master
|
||||
with:
|
||||
options: '-rsvnuR ApplicationLibCode/'
|
||||
- uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: 'Fixes by misspell-fixer'
|
||||
title: 'Typos fix by misspell-fixer'
|
||||
branch: spell-check-patches
|
||||
branch-suffix: random
|
||||
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: sobolevn/misspell-fixer-action@master
|
||||
with:
|
||||
options: "-rsvnuR ApplicationLibCode/"
|
||||
- uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: "Fixes by misspell-fixer"
|
||||
title: "Typos fix by misspell-fixer"
|
||||
branch: spell-check-patches
|
||||
branch-suffix: random
|
||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -13,3 +13,6 @@
|
||||
[submodule "ThirdParty/custom-opm-common/opm-common"]
|
||||
path = ThirdParty/custom-opm-common/opm-common
|
||||
url = https://github.com/CeetronSolutions/opm-common
|
||||
[submodule "ThirdParty/roffcpp"]
|
||||
path = ThirdParty/roffcpp
|
||||
url = https://github.com/CeetronSolutions/roffcpp
|
||||
|
@ -30,7 +30,6 @@ if(Qt5Core_FOUND)
|
||||
Gui
|
||||
OpenGL
|
||||
Network
|
||||
Script
|
||||
Widgets
|
||||
Xml
|
||||
Concurrent
|
||||
@ -43,7 +42,6 @@ if(Qt5Core_FOUND)
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt5::OpenGL
|
||||
Qt5::Script
|
||||
Qt5::Widgets
|
||||
Qt5::Xml
|
||||
Qt5::Concurrent
|
||||
|
@ -559,3 +559,60 @@ https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/blob/master/LICEN
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
===============================================================================
|
||||
Notice for the fmtlib library
|
||||
===============================================================================
|
||||
|
||||
https://github.com/fmtlib/fmt
|
||||
|
||||
|
||||
Copyright (c) 2012 - present, Victor Zverovich
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
--- Optional exception to the license ---
|
||||
|
||||
As an exception, if, as a result of your compiling your source code, portions
|
||||
of this Software are embedded into a machine-executable object form of such
|
||||
source code, you may redistribute such embedded portions in such object form
|
||||
without including the above copyright and permission notices.
|
||||
|
||||
===============================================================================
|
||||
Notice for the roffcpp library
|
||||
===============================================================================
|
||||
|
||||
https://github.com/CeetronSolutions/roffcpp
|
||||
|
||||
|
||||
Copyright (C) 2023- Equinor ASA
|
||||
|
||||
roffcpp 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.
|
||||
|
||||
roffcpp 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.
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,438 @@
|
||||
// ResInsight version string : 2023.01.0
|
||||
// Report generated : Tue Jan 10 12:36:28 2023
|
||||
//
|
||||
//
|
||||
|
||||
AnalysisPlot
|
||||
AnalysisPlotCollection
|
||||
AnalysisPlotDataEntry
|
||||
Annotations
|
||||
AsciiDataCurve
|
||||
CalcScript
|
||||
CalculatedSummaryCase
|
||||
CellEdgeResultSlot
|
||||
CellFilterCollection
|
||||
CellPropertyFilter
|
||||
CellPropertyFilters
|
||||
CellRangeFilter
|
||||
CellRangeFilterCollection
|
||||
ChangeDataSourceFeatureUi
|
||||
CmdSelectionChangeExecData
|
||||
ColorLegend
|
||||
ColorLegendCollection
|
||||
ColorLegendItem
|
||||
CompletionTemplateCollection
|
||||
CorrelationMatrixPlot
|
||||
CorrelationPlot
|
||||
CorrelationPlotCollection
|
||||
CorrelationReportPlot
|
||||
CrossSection
|
||||
CrossSectionCollection
|
||||
CurveIntersection
|
||||
DataContainerFloat
|
||||
DataContainerString
|
||||
DataContainerTime
|
||||
DepthTrackPlot
|
||||
DoubleParameter
|
||||
Eclipse2dViewCollection
|
||||
EclipseCase
|
||||
EclipseGeometrySelectionItem
|
||||
EclipseResultAddress
|
||||
ElasticProperties
|
||||
ElasticPropertyScaling
|
||||
ElasticPropertyScalingCollection
|
||||
EnsembleFractureStatistics
|
||||
EnsembleFractureStatisticsPlot
|
||||
EnsembleFractureStatisticsPlotCollection
|
||||
EnsembleStatisticsSurface
|
||||
EnsembleSurface
|
||||
EnsembleWellLogStatisticsCurve
|
||||
EnsembleWellLogs
|
||||
EnsembleWellLogsCollection
|
||||
FaciesInitialPressureConfig
|
||||
FaciesProperties
|
||||
Fault
|
||||
Faults
|
||||
FileSummaryCase
|
||||
FileSurface
|
||||
FishbonesCollection
|
||||
FishbonesMultipleSubs
|
||||
FishbonesPipeProperties
|
||||
FlowCharacteristicsPlot
|
||||
FlowDiagSolution
|
||||
FlowPlotCollection
|
||||
FormationNames
|
||||
FormationNamesCollectionObject
|
||||
FractureContainment
|
||||
FractureDefinitionCollection
|
||||
FractureGroupStatisticsCollection
|
||||
FractureTemplateCollection
|
||||
GeoMech2dViewCollection
|
||||
GeoMechGeometrySelectionItem
|
||||
GeoMechPart
|
||||
GeoMechPartCollection
|
||||
GeoMechPropertyFilter
|
||||
GeoMechPropertyFilters
|
||||
GeoMechResultDefinition
|
||||
GeoMechResultSlot
|
||||
GeoMechView
|
||||
GridCaseSurface
|
||||
GridCollection
|
||||
GridCrossPlotCurve
|
||||
GridCrossPlotCurveSet
|
||||
GridInfo
|
||||
GridInfoCollection
|
||||
GridStatisticsPlot
|
||||
GridStatisticsPlotCollection
|
||||
GridSummaryCase
|
||||
GridTimeHistoryCurve
|
||||
IntegerParameter
|
||||
Intersection2dView
|
||||
Intersection2dViewCollection
|
||||
IntersectionBox
|
||||
IntersectionCollection
|
||||
IntersectionResultDefinition
|
||||
Legend
|
||||
ListParameter
|
||||
MainPlotCollection
|
||||
MdiWindowController
|
||||
MockModelSettings
|
||||
ModeledWellPath
|
||||
MultiPlot
|
||||
MultiSnapshotDefinition
|
||||
MultiSummaryPlot
|
||||
NonNetLayers
|
||||
ObservedDataCollection
|
||||
ObservedFmuRftData
|
||||
ParameterGroup
|
||||
ParameterList
|
||||
ParameterResultCrossPlot
|
||||
PdmDocument
|
||||
PdmObjectCollection
|
||||
PdmObjectGroup
|
||||
Perforation
|
||||
PerforationCollection
|
||||
PlotDataFilterCollection
|
||||
PlotDataFilterItem
|
||||
PlotTemplateCollection
|
||||
PlotTemplateFileItem
|
||||
PolyLineFilter
|
||||
PolygonFilter
|
||||
PolylineTarget
|
||||
PolylinesFromFileAnnotation
|
||||
PressureTable
|
||||
PressureTableItem
|
||||
PropertyFilter
|
||||
ResInsightAnalysisModels
|
||||
ResInsightGeoMechCase
|
||||
ResInsightGeoMechModels
|
||||
ResInsightOilField
|
||||
ResInsightProject
|
||||
ResampleData
|
||||
ReservoirCellResultStorage
|
||||
ReservoirView
|
||||
ResultDefinition
|
||||
ResultSlot
|
||||
ResultStorageEntryInfo
|
||||
RftAddress
|
||||
RiaMemoryCleanup
|
||||
RiaPreferences
|
||||
RiaPreferencesGeoMech
|
||||
RiaPreferencesSummary
|
||||
RiaPreferencesSystem
|
||||
RiaRegressionTest
|
||||
RicCaseAndFileExportSettingsUi
|
||||
RicCellRangeUi
|
||||
RicCreateEnsembleSurfaceUi
|
||||
RicCreateEnsembleWellLogUi
|
||||
RicCreateMultipleWellPathLateralsUi
|
||||
RicDeleteItemExecData
|
||||
RicExportCarfinUi
|
||||
RicExportCompletionDataSettingsUi
|
||||
RicExportContourMapToTextUi
|
||||
RicExportEclipseInputGridUi
|
||||
RicExportLgrUi
|
||||
RicExportToLasFileObj
|
||||
RicExportToLasFileResampleUi
|
||||
RicExportWellPathsUi
|
||||
RicGridCalculator
|
||||
RicHoloLensCreateSessionUi
|
||||
RicHoloLensExportToFolderUi
|
||||
RicHoloLensServerSettings
|
||||
RicLinkVisibleViewsFeatureUi
|
||||
RicPasteAsciiDataToSummaryPlotFeatureUi
|
||||
RicSaturationPressureUi
|
||||
RicSaveEclipseInputVisibleCellsUi
|
||||
RicSaveMultiPlotTemplateFeatureSettings
|
||||
RicSelectCaseOrEnsembleUi
|
||||
RicSelectPlotTemplateUi
|
||||
RicSelectSummaryPlotUI
|
||||
RicSelectViewUI
|
||||
RicSummaryAddressSelection
|
||||
RicSummaryCurveCalculator
|
||||
RicSummaryCurveCreator
|
||||
RicWellPathsUnitSystemSettingsUi
|
||||
RifReaderSettings
|
||||
Rim3dWellLogCurveCollection
|
||||
Rim3dWellLogExtractionCurve
|
||||
Rim3dWellLogFileCurve
|
||||
Rim3dWellLogRftCurve
|
||||
RimAnnotationCollection
|
||||
RimAnnotationCollectionBase
|
||||
RimAnnotationGroupCollection
|
||||
RimAnnotationLineAppearance
|
||||
RimAnnotationTextAppearance
|
||||
RimBinaryExportSettings
|
||||
RimCaseCollection
|
||||
RimCellFilterCollection
|
||||
RimCommandExecuteScript
|
||||
RimCommandIssueFieldChanged
|
||||
RimCommandObject
|
||||
RimCommandRouter
|
||||
RimContourMapView
|
||||
RimCsvUserData
|
||||
RimCustomObjectiveFunction
|
||||
RimCustomObjectiveFunctionCollection
|
||||
RimCustomObjectiveFunctionWeight
|
||||
RimDerivedEnsembleCase
|
||||
RimDerivedEnsembleCaseCollection
|
||||
RimDialogData
|
||||
RimEclipseContourMapProjection
|
||||
RimEclipseResultAddressCollection
|
||||
RimElementVectorResult
|
||||
RimEllipseFractureTemplate
|
||||
RimEnsembleCurveFilter
|
||||
RimEnsembleCurveFilterCollection
|
||||
RimEnsembleCurveSet
|
||||
RimEnsembleCurveSetCollection
|
||||
RimEnsembleStatistics
|
||||
RimEnsembleWellLogCurveSet
|
||||
RimEquilibriumAxisAnnotation
|
||||
RimExportInputSettings
|
||||
RimFaultResultSlot
|
||||
RimFractureExportSettings
|
||||
RimGeoMechContourMapProjection
|
||||
RimGeoMechContourMapView
|
||||
RimGridCalculation
|
||||
RimGridCalculationCollection
|
||||
RimGridCalculationVariable
|
||||
RimGridCrossPlot
|
||||
RimGridCrossPlotCollection
|
||||
RimGridCrossPlotCurveSetNameConfig
|
||||
RimGridCrossPlotNameConfig
|
||||
RimIdenticalGridCaseGroup
|
||||
RimInputProperty
|
||||
RimInputPropertyCollection
|
||||
RimInputReservoir
|
||||
RimIntersectionResultsDefinitionCollection
|
||||
RimMeasurement
|
||||
RimMswCompletionParameters
|
||||
RimMudWeightWindowParameters
|
||||
RimMultiPlotCollection
|
||||
RimMultipleEclipseResults
|
||||
RimMultipleLocations
|
||||
RimMultipleValveLocations
|
||||
RimNonDarcyPerforationParameters
|
||||
RimObjectiveFunction
|
||||
RimObservedEclipseUserData
|
||||
RimOilFieldEntry
|
||||
RimOilRegionEntry
|
||||
RimPlotAxisAnnotation
|
||||
RimPlotCellFilterCollection
|
||||
RimPlotCellPropertyFilter
|
||||
RimPolylineAppearance
|
||||
RimPolylinesAnnotationInView
|
||||
RimPolylinesFromFileAnnotationInView
|
||||
RimProcess
|
||||
RimReachCircleAnnotation
|
||||
RimReachCircleAnnotationInView
|
||||
RimRftCase
|
||||
RimRftTopologyCurve
|
||||
RimRoffCase
|
||||
RimSaturationPressurePlot
|
||||
RimSaturationPressurePlotCollection
|
||||
RimStatisticalCalculation
|
||||
RimStatisticalCollection
|
||||
RimStimPlanColors
|
||||
RimStimPlanFractureTemplate
|
||||
RimStimPlanLegendConfig
|
||||
RimSummaryAddressCollection
|
||||
RimSummaryCalculation
|
||||
RimSummaryCalculationCollection
|
||||
RimSummaryCalculationVariable
|
||||
RimSummaryCurveCollection
|
||||
RimSummaryCurveCollectionModifier
|
||||
RimSummaryMultiPlotCollection
|
||||
RimSummaryPlotManager
|
||||
RimSurfaceIntersectionBand
|
||||
RimSurfaceIntersectionCollection
|
||||
RimSurfaceIntersectionCurve
|
||||
RimTensorResults
|
||||
RimTernaryLegendConfig
|
||||
RimTextAnnotation
|
||||
RimTextAnnotationInView
|
||||
RimThermalFractureTemplate
|
||||
RimTimeAxisAnnotation
|
||||
RimTimeStepFilter
|
||||
RimUserDefinedPolylinesAnnotationInView
|
||||
RimVfpPlotCollection
|
||||
RimViewLinkerCollection
|
||||
RimViewNameConfig
|
||||
RimVirtualPerforationResults
|
||||
RimWellIASettings
|
||||
RimWellIASettingsCollection
|
||||
RimWellLogExtractionCurve
|
||||
RimWellLogExtractionCurveNameConfig
|
||||
RimWellLogFileCurveNameConfig
|
||||
RimWellLogPlotNameConfig
|
||||
RimWellLogRftCurveNameConfig
|
||||
RimWellLogWbsCurve
|
||||
RimWellPathEntry
|
||||
RimWellPathImport
|
||||
RimWellPathTieIn
|
||||
RiuCreateMultipleFractionsUi
|
||||
RiuMultipleFractionsOptions
|
||||
ScriptLocation
|
||||
SimWellFracture
|
||||
SimWellFractureCollection
|
||||
StimPlanFractureTemplate
|
||||
StimPlanModel
|
||||
StimPlanModelCollection
|
||||
StimPlanModelCurve
|
||||
StimPlanModelPlot
|
||||
StimPlanModelPlotCollection
|
||||
StimPlanModelTemplate
|
||||
StimPlanModelTemplateCollection
|
||||
StreamlineInViewCollection
|
||||
StringParameter
|
||||
SummaryAddress
|
||||
SummaryCaseCollection
|
||||
SummaryCaseSubCollection
|
||||
SummaryCrossPlot
|
||||
SummaryCrossPlotCollection
|
||||
SummaryCurve
|
||||
SummaryCurveAutoName
|
||||
SummaryObservedDataFile
|
||||
SummaryPageDownloadEntity
|
||||
SummaryPlot
|
||||
SummaryPlotCollection
|
||||
SummaryPlotFilterTextCurveSetEditor
|
||||
SummaryTimeAxisProperties
|
||||
SummaryYAxisProperties
|
||||
Surface
|
||||
SurfaceCollection
|
||||
SurfaceInView
|
||||
SurfaceInViewCollection
|
||||
SurfaceResultDefinition
|
||||
TC2
|
||||
TestCommand1
|
||||
ThermalFractureTemplate
|
||||
TofAccumulatedPhaseFractionsPlot
|
||||
TotalWellAllocationPlot
|
||||
TriangleGeometry
|
||||
UserDefinedFilter
|
||||
UserDefinedPolylinesAnnotation
|
||||
ValveTemplate
|
||||
ValveTemplateCollection
|
||||
VfpPlot
|
||||
View3dOverlayInfoConfig
|
||||
ViewController
|
||||
ViewLinker
|
||||
WbsParameters
|
||||
Well
|
||||
WellAllocationPlot
|
||||
WellAllocationPlotLegend
|
||||
WellBoreStabilityPlot
|
||||
WellDistributionPlot
|
||||
WellDistributionPlotCollection
|
||||
WellFlowRateCurve
|
||||
WellLogExtractionCurve
|
||||
WellLogFile
|
||||
WellLogFileChannel
|
||||
WellLogFileCurve
|
||||
WellLogPlot
|
||||
WellLogPlotCollection
|
||||
WellLogPlotTrack
|
||||
WellLogRftCurve
|
||||
WellMeasurement
|
||||
WellMeasurementCurve
|
||||
WellMeasurementFilePath
|
||||
WellMeasurementInView
|
||||
WellMeasurements
|
||||
WellMeasurementsInView
|
||||
WellPath
|
||||
WellPathAicdParameters
|
||||
WellPathAttribute
|
||||
WellPathAttributes
|
||||
WellPathBase
|
||||
WellPathCompletionSettings
|
||||
WellPathCompletions
|
||||
WellPathFracture
|
||||
WellPathFractureCollection
|
||||
WellPathGeometry
|
||||
WellPathGeometryDef
|
||||
WellPathGroup
|
||||
WellPathTarget
|
||||
WellPathValve
|
||||
WellPaths
|
||||
WellPltPlot
|
||||
WellPltPlotCollection
|
||||
WellRftEnsembleCurveSet
|
||||
WellRftPlot
|
||||
WellRftPlotCollection
|
||||
Wells
|
||||
cafNamedTreeNode
|
||||
cafObjectReferenceTreeNode
|
||||
cafTreeNode
|
||||
cloneView
|
||||
closeProject
|
||||
computeCaseGroupStatistics
|
||||
createGridCaseGroup
|
||||
createGridCaseGroupResult
|
||||
createLgrForCompletions
|
||||
createMultiPlot
|
||||
createMultipleFractures
|
||||
createSaturationPressurePlots
|
||||
createStatisticsCase
|
||||
createStatisticsCaseResult
|
||||
createView
|
||||
createViewResult
|
||||
createWbsPlotResult
|
||||
createWellBoreStabilityPlot
|
||||
exportContourMapToText
|
||||
exportFlowCharacteristics
|
||||
exportLgrForCompletions
|
||||
exportMsw
|
||||
exportMultiCaseSnapshots
|
||||
exportProperty
|
||||
exportPropertyInViews
|
||||
exportSimWellFractureCompletions
|
||||
exportSnapshots
|
||||
exportVisibleCells
|
||||
exportWellLogPlotData
|
||||
exportWellLogPlotDataResult
|
||||
exportWellPathCompletions
|
||||
exportWellPaths
|
||||
importFormationNames
|
||||
importWellLogFiles
|
||||
importWellLogFilesResult
|
||||
importWellPaths
|
||||
importWellPathsResult
|
||||
loadCase
|
||||
loadCaseResult
|
||||
openProject
|
||||
replaceCase
|
||||
replaceMultipleCases
|
||||
replaceSourceCases
|
||||
runOctaveScript
|
||||
saveProject
|
||||
saveProjectAs
|
||||
scaleFractureTemplate
|
||||
setExportFolder
|
||||
setFractureContainment
|
||||
setMainWindowSize
|
||||
setPlotWindowSize
|
||||
setStartDir
|
||||
setTimeStep
|
||||
stackCurves
|
||||
unstackCurves
|
@ -23,12 +23,14 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaThermalFractureDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaResultNames.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaRftDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaDateTimeDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotCollectionScheduler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaScheduler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -56,12 +58,14 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaThermalFractureDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaResultNames.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaRftDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaDateTimeDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotCollectionScheduler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaScheduler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
@ -674,6 +674,7 @@ bool RiaApplication::loadProject( const QString& projectFileName,
|
||||
sumMainCollection->updateAutoShortName();
|
||||
for ( auto sumCaseGroup : sumMainCollection->summaryCaseCollections() )
|
||||
{
|
||||
sumCaseGroup->ensureNameIsUpdated();
|
||||
sumCaseGroup->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
@ -710,7 +711,7 @@ bool RiaApplication::loadProject( const QString& projectFileName,
|
||||
|
||||
// Recalculate the results from grid property calculations.
|
||||
// Has to be done late since the results are filtered by view cell visibility
|
||||
for ( auto gridCalculation : m_project->gridCalculationCollection()->calculations() )
|
||||
for ( auto gridCalculation : m_project->gridCalculationCollection()->sortedGridCalculations() )
|
||||
{
|
||||
gridCalculation->calculate();
|
||||
gridCalculation->updateDependentObjects();
|
||||
@ -1180,11 +1181,8 @@ void RiaApplication::terminateProcess()
|
||||
{
|
||||
if ( m_workerProcess )
|
||||
{
|
||||
m_workerProcess->close();
|
||||
m_workerProcess->kill();
|
||||
}
|
||||
|
||||
m_runningWorkerProcess = false;
|
||||
m_workerProcess = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -24,9 +24,7 @@
|
||||
#include "RigEclipseCaseData.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
@ -55,19 +53,7 @@ RiaCompletionTypeCalculationScheduler* RiaCompletionTypeCalculationScheduler::in
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAndRedrawAllViews()
|
||||
{
|
||||
std::vector<RimEclipseCase*> eclipseCases =
|
||||
RimProject::current()->activeOilField()->analysisModels->cases().children();
|
||||
|
||||
scheduleRecalculateCompletionTypeAndRedrawAllViews( eclipseCases );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAndRedrawAllViews( RimEclipseCase* eclipseCase )
|
||||
{
|
||||
std::vector<RimEclipseCase*> eclipseCases;
|
||||
eclipseCases.push_back( eclipseCase );
|
||||
auto eclipseCases = RimProject::current()->eclipseCases();
|
||||
|
||||
scheduleRecalculateCompletionTypeAndRedrawAllViews( eclipseCases );
|
||||
}
|
||||
@ -93,10 +79,23 @@ void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAnd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::clearCompletionTypeResultsInAllCases()
|
||||
{
|
||||
std::vector<RimEclipseCase*> eclipseCases =
|
||||
RimProject::current()->activeOilField()->analysisModels->cases().children();
|
||||
auto eclipseCases = RimProject::current()->eclipseCases();
|
||||
|
||||
clearCompletionTypeResults( eclipseCases );
|
||||
|
||||
// Clear geometry cache in views to recreate potential property filter geometry
|
||||
for ( auto eclipseCase : eclipseCases )
|
||||
{
|
||||
if ( !eclipseCase ) continue;
|
||||
|
||||
for ( auto view : eclipseCase->views() )
|
||||
{
|
||||
if ( auto eclipseView = dynamic_cast<RimEclipseView*>( view ) )
|
||||
{
|
||||
eclipseView->scheduleReservoirGridGeometryRegen();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -124,18 +123,15 @@ void RiaCompletionTypeCalculationScheduler::performScheduledUpdates()
|
||||
{
|
||||
std::set<RimEclipseCase*> uniqueCases( m_eclipseCasesToRecalculate.begin(), m_eclipseCasesToRecalculate.end() );
|
||||
|
||||
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
|
||||
for ( RimEclipseCase* eclipseCase : uniqueCases )
|
||||
{
|
||||
if ( eclipseCase )
|
||||
{
|
||||
for ( const auto& w : eclipseCase->views() )
|
||||
for ( auto view : eclipseCase->views() )
|
||||
{
|
||||
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( w );
|
||||
if ( eclView )
|
||||
if ( auto eclipseView = dynamic_cast<RimEclipseView*>( view ) )
|
||||
{
|
||||
eclView->calculateCompletionTypeAndRedrawIfRequired();
|
||||
eclipseView->calculateCompletionTypeAndRedrawIfRequired();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -146,6 +142,7 @@ void RiaCompletionTypeCalculationScheduler::performScheduledUpdates()
|
||||
// Recalculation of completion type causes active view to be set to potentially a different view
|
||||
// Also current index in project tree is changed. Restore both to initial state.
|
||||
|
||||
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
if ( activeView && activeView->viewer() )
|
||||
{
|
||||
RiaApplication::instance()->setActiveReservoirView( activeView );
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
void scheduleRecalculateCompletionTypeAndRedrawAllViews();
|
||||
void clearCompletionTypeResultsInAllCases();
|
||||
|
||||
void scheduleRecalculateCompletionTypeAndRedrawAllViews( RimEclipseCase* eclipseCase );
|
||||
void scheduleRecalculateCompletionTypeAndRedrawAllViews( const std::vector<RimEclipseCase*>& eclipseCases );
|
||||
void clearCompletionTypeResults( const std::vector<RimEclipseCase*>& eclipseCases );
|
||||
|
||||
void performScheduledUpdates() override;
|
||||
@ -50,8 +50,6 @@ private:
|
||||
RiaCompletionTypeCalculationScheduler( const RiaCompletionTypeCalculationScheduler& o ) = delete;
|
||||
void operator=( const RiaCompletionTypeCalculationScheduler& o ) = delete;
|
||||
|
||||
void scheduleRecalculateCompletionTypeAndRedrawAllViews( const std::vector<RimEclipseCase*>& eclipseCases );
|
||||
|
||||
private:
|
||||
std::vector<caf::PdmPointer<RimEclipseCase>> m_eclipseCasesToRecalculate;
|
||||
};
|
||||
|
@ -104,7 +104,7 @@ void RiaConsoleApplication::initialize()
|
||||
RiaApplication::initialize();
|
||||
|
||||
RiaLogging::setLoggerInstance( std::make_unique<RiaStdOutLogger>() );
|
||||
RiaLogging::loggerInstance()->setLevel( int( RILogLevel::RI_LL_DEBUG ) );
|
||||
RiaLogging::loggerInstance()->setLevel( int( RiaLogging::logLevelBasedOnPreferences() ) );
|
||||
|
||||
m_socketServer = new RiaSocketServer( this );
|
||||
}
|
||||
|
@ -271,6 +271,10 @@ RiaDefines::ImportFileType RiaDefines::obtainFileTypeFromFileName( const QString
|
||||
{
|
||||
return ImportFileType::ECLIPSE_INPUT_FILE;
|
||||
}
|
||||
else if ( fileName.endsWith( "ROFF", Qt::CaseInsensitive ) || fileName.endsWith( "ROFFASC", Qt::CaseInsensitive ) )
|
||||
{
|
||||
return ImportFileType::ROFF_FILE;
|
||||
}
|
||||
else if ( fileName.endsWith( "SMSPEC", Qt::CaseInsensitive ) )
|
||||
{
|
||||
return ImportFileType::ECLIPSE_SUMMARY_FILE;
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "enum_bitmask.hpp"
|
||||
|
||||
#include <QString>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
@ -124,8 +126,9 @@ enum class ImportFileType
|
||||
ECLIPSE_SUMMARY_FILE = 0x08,
|
||||
GEOMECH_ODB_FILE = 0x10,
|
||||
RESINSIGHT_PROJECT_FILE = 0x20,
|
||||
ROFF_FILE = 0x30,
|
||||
ECLIPSE_RESULT_GRID = ECLIPSE_GRID_FILE | ECLIPSE_EGRID_FILE,
|
||||
ANY_ECLIPSE_FILE = ECLIPSE_RESULT_GRID | ECLIPSE_INPUT_FILE | ECLIPSE_SUMMARY_FILE,
|
||||
ANY_ECLIPSE_FILE = ECLIPSE_RESULT_GRID | ECLIPSE_INPUT_FILE | ECLIPSE_SUMMARY_FILE | ROFF_FILE,
|
||||
ANY_IMPORT_FILE = 0xFF
|
||||
};
|
||||
|
||||
@ -213,18 +216,20 @@ enum class MultiPlotPageUpdateType : uint32_t
|
||||
ALL = 0b00000111
|
||||
};
|
||||
|
||||
constexpr enum MultiPlotPageUpdateType operator|( const enum MultiPlotPageUpdateType selfValue,
|
||||
const enum MultiPlotPageUpdateType inValue )
|
||||
{
|
||||
return ( enum MultiPlotPageUpdateType )( uint32_t( selfValue ) | uint32_t( inValue ) );
|
||||
}
|
||||
|
||||
constexpr enum MultiPlotPageUpdateType operator&( const enum MultiPlotPageUpdateType selfValue,
|
||||
const enum MultiPlotPageUpdateType inValue )
|
||||
{
|
||||
return ( enum MultiPlotPageUpdateType )( uint32_t( selfValue ) & uint32_t( inValue ) );
|
||||
}
|
||||
|
||||
std::vector<double> viewScaleOptions();
|
||||
|
||||
enum class View3dContent
|
||||
{
|
||||
NONE = 0b00000000,
|
||||
ECLIPSE_DATA = 0b00000001,
|
||||
GEOMECH_DATA = 0b00000010,
|
||||
FLAT_INTERSECTION = 0b00000100,
|
||||
CONTOUR = 0b00001000,
|
||||
ALL = 0b00001111
|
||||
};
|
||||
|
||||
}; // namespace RiaDefines
|
||||
|
||||
// Activate bit mask operators at global scope
|
||||
ENABLE_BITMASK_OPERATORS( RiaDefines::MultiPlotPageUpdateType )
|
||||
ENABLE_BITMASK_OPERATORS( RiaDefines::View3dContent )
|
||||
|
@ -434,7 +434,8 @@ void RiaGuiApplication::initialize()
|
||||
logger->addMessagePanel( m_mainWindow->messagePanel() );
|
||||
logger->addMessagePanel( m_mainPlotWindow->messagePanel() );
|
||||
RiaLogging::setLoggerInstance( std::move( logger ) );
|
||||
RiaLogging::loggerInstance()->setLevel( int( RILogLevel::RI_LL_DEBUG ) );
|
||||
|
||||
RiaLogging::loggerInstance()->setLevel( int( RiaLogging::logLevelBasedOnPreferences() ) );
|
||||
}
|
||||
m_socketServer = new RiaSocketServer( this );
|
||||
}
|
||||
@ -1209,6 +1210,9 @@ void RiaGuiApplication::onProjectBeingOpened()
|
||||
{
|
||||
// When importing a project, do not maximize the first MDI window to be created
|
||||
m_maximizeWindowGuard = std::make_unique<RiuMdiMaximizeWindowGuard>();
|
||||
|
||||
if ( m_mainWindow ) m_mainWindow->setBlockSubWindowActivatedSignal( true );
|
||||
if ( mainPlotWindow() ) mainPlotWindow()->setBlockSubWindowActivatedSignal( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1269,6 +1273,9 @@ void RiaGuiApplication::onProjectOpened()
|
||||
|
||||
processEvents();
|
||||
|
||||
if ( m_mainWindow ) m_mainWindow->setBlockSubWindowActivatedSignal( false );
|
||||
if ( mainPlotWindow() ) mainPlotWindow()->setBlockSubWindowActivatedSignal( false );
|
||||
|
||||
// Make sure to process events before this function to avoid strange Qt crash
|
||||
RiuPlotMainWindowTools::refreshToolbars();
|
||||
}
|
||||
@ -1568,7 +1575,7 @@ void RiaGuiApplication::stopMonitoringWorkProgress()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGuiApplication::slotWorkerProcessFinished( int exitCode, QProcess::ExitStatus exitStatus )
|
||||
{
|
||||
CAF_ASSERT( m_mainWindow );
|
||||
if ( m_mainWindow == nullptr ) return;
|
||||
|
||||
m_mainWindow->processMonitor()->stopMonitorWorkProcess();
|
||||
|
||||
|
@ -35,8 +35,140 @@ void caf::AppEnum<RiaDefines::PlotAxis>::setUp()
|
||||
|
||||
setDefault( RiaDefines::PlotAxis::PLOT_AXIS_LEFT );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::MultiPlotAxisVisibility>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE, "ONE_VISIBLE", "One Axis Per Plot" );
|
||||
addItem( RiaDefines::MultiPlotAxisVisibility::ALL_VISIBLE, "ALL_VISIBLE", "All Axis Visible" );
|
||||
|
||||
setDefault( RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::ObjectNamingMethod>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::ObjectNamingMethod::CUSTOM, "CUSTOM", "Custom" );
|
||||
addItem( RiaDefines::ObjectNamingMethod::AUTO, "AUTO", "Auto" );
|
||||
addItem( RiaDefines::ObjectNamingMethod::TEMPLATE, "TEMPLATE", "Template" );
|
||||
|
||||
setDefault( RiaDefines::ObjectNamingMethod::AUTO );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<Qt::PenStyle>::setUp()
|
||||
{
|
||||
addItem( Qt::PenStyle::NoPen, "NO_PEN", "No Pen" );
|
||||
addItem( Qt::PenStyle::SolidLine, "SOLID_LINE", "Solid Line" );
|
||||
addItem( Qt::PenStyle::DashLine, "DASH_LINE", "Dash Line" );
|
||||
addItem( Qt::PenStyle::DotLine, "DOT_LINE", "Dot Line" );
|
||||
addItem( Qt::PenStyle::DashDotLine, "DASH_DOT_LINE", "Dash Dot Line" );
|
||||
addItem( Qt::PenStyle::DashDotDotLine, "DASH_DOT_DOT_LINE", "Dash Dot Dot Line" );
|
||||
|
||||
setDefault( Qt::PenStyle::SolidLine );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::Orientation>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::Orientation::HORIZONTAL, "HORIZONTAL", "Horizontal" );
|
||||
addItem( RiaDefines::Orientation::VERTICAL, "VERTICAL", "Vertical" );
|
||||
setDefault( RiaDefines::Orientation::VERTICAL );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::WindowTileMode>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::WindowTileMode::DEFAULT, "DEFAULT", "Default" );
|
||||
addItem( RiaDefines::WindowTileMode::VERTICAL, "VERTICAL", "Vertical" );
|
||||
addItem( RiaDefines::WindowTileMode::HORIZONTAL, "HORIZONTAL", "Horizontal" );
|
||||
addItem( RiaDefines::WindowTileMode::UNDEFINED, "UNDEFINED", "Undefined" );
|
||||
|
||||
setDefault( RiaDefines::WindowTileMode::UNDEFINED );
|
||||
}
|
||||
|
||||
}; // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::namingVariableCase()
|
||||
{
|
||||
return "$CASE";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::namingVariableWell()
|
||||
{
|
||||
return "$WELL";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::namingVariableRefWell()
|
||||
{
|
||||
return "$REF_WELL";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::namingVariableWellBranch()
|
||||
{
|
||||
return "$WELL_BRANCH";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::namingVariableResultName()
|
||||
{
|
||||
return "$RESULT_NAME";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::namingVariableResultType()
|
||||
{
|
||||
return "$RESULT_TYPE";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::namingVariableTime()
|
||||
{
|
||||
return "$TIME";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::namingVariableTimestep()
|
||||
{
|
||||
return "$TIME_STEP";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::namingVariableAirGap()
|
||||
{
|
||||
return "$AIR_GAP";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::namingVariableWaterDepth()
|
||||
{
|
||||
return "$WATER_DEPTH";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -115,3 +247,27 @@ double RiaDefines::scalingFactor( QPaintDevice* paintDevice )
|
||||
|
||||
return scaling;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::curveNameGroupName()
|
||||
{
|
||||
return "Curve Name";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::appearanceGroupName()
|
||||
{
|
||||
return "Appearance";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::additionalDataSourcesGroupName()
|
||||
{
|
||||
return "Additional Data Sources";
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
class QPaintDevice;
|
||||
class QString;
|
||||
|
||||
// Defines relate to plotting
|
||||
namespace RiaDefines
|
||||
@ -59,6 +60,39 @@ enum class Orientation
|
||||
VERTICAL
|
||||
};
|
||||
|
||||
enum class MultiPlotAxisVisibility
|
||||
{
|
||||
ONE_VISIBLE,
|
||||
ALL_VISIBLE
|
||||
};
|
||||
|
||||
enum class ObjectNamingMethod
|
||||
{
|
||||
CUSTOM,
|
||||
AUTO,
|
||||
TEMPLATE
|
||||
};
|
||||
|
||||
enum class WindowTileMode
|
||||
{
|
||||
DEFAULT,
|
||||
VERTICAL,
|
||||
HORIZONTAL,
|
||||
UNDEFINED,
|
||||
};
|
||||
|
||||
// Defines relate to curve and plot template names
|
||||
QString namingVariableCase();
|
||||
QString namingVariableWell();
|
||||
QString namingVariableRefWell();
|
||||
QString namingVariableWellBranch();
|
||||
QString namingVariableResultName();
|
||||
QString namingVariableResultType();
|
||||
QString namingVariableTime();
|
||||
QString namingVariableTimestep();
|
||||
QString namingVariableAirGap();
|
||||
QString namingVariableWaterDepth();
|
||||
|
||||
double minimumDefaultValuePlot();
|
||||
double minimumDefaultLogValuePlot();
|
||||
double maximumDefaultValuePlot();
|
||||
@ -69,4 +103,9 @@ PlotAxis opposite( PlotAxis axis );
|
||||
|
||||
double scalingFactor( QPaintDevice* paintDevice );
|
||||
|
||||
// Project editor group names
|
||||
QString curveNameGroupName();
|
||||
QString appearanceGroupName();
|
||||
QString additionalDataSourcesGroupName();
|
||||
|
||||
}; // namespace RiaDefines
|
||||
|
@ -34,28 +34,6 @@ CAF_PDM_SOURCE_INIT( RiaPreferencesGeoMech, "RiaPreferencesGeoMech" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferencesGeoMech::RiaPreferencesGeoMech()
|
||||
{
|
||||
CAF_PDM_InitFieldNoDefault( &m_geomechFRAPreprocCommand, "geomechFRAPreprocCommand", "Pre-Processing Command" );
|
||||
m_geomechFRAPreprocCommand.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_geomechFRAPreprocCommand.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_geomechFRAPostprocCommand, "geomechFRAPostprocCommand", "Post-Processing Command" );
|
||||
m_geomechFRAPostprocCommand.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_geomechFRAPostprocCommand.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_geomechFRAMacrisCommand, "geomechFRAMacrisCommand", "Main Macris Command" );
|
||||
m_geomechFRAMacrisCommand.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_geomechFRAMacrisCommand.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_geomechFRADefaultBasicXML, "geomechFRADefaultXML", "Basic Processing Parameter XML File" );
|
||||
m_geomechFRADefaultBasicXML.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_geomechFRADefaultBasicXML.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_geomechFRADefaultAdvXML,
|
||||
"geomechFRADefaultAdvXML",
|
||||
"Advanced Processing Parameter XML File" );
|
||||
m_geomechFRADefaultAdvXML.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_geomechFRADefaultAdvXML.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_geomechWIADefaultXML, "geomechWIADefaultXML", "Default Parameter XML File" );
|
||||
m_geomechWIADefaultXML.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_geomechWIADefaultXML.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
@ -87,17 +65,6 @@ RiaPreferencesGeoMech* RiaPreferencesGeoMech::current()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferencesGeoMech::appendItems( caf::PdmUiOrdering& uiOrdering ) const
|
||||
{
|
||||
caf::PdmUiGroup* faultRAGroup = uiOrdering.addNewGroup( "Fault Reactivation Assessment" );
|
||||
caf::PdmUiGroup* cmdFRAGroup = faultRAGroup->addNewGroup( "Commands (without parameters)" );
|
||||
|
||||
cmdFRAGroup->add( &m_geomechFRAPreprocCommand );
|
||||
cmdFRAGroup->add( &m_geomechFRAPostprocCommand );
|
||||
cmdFRAGroup->add( &m_geomechFRAMacrisCommand );
|
||||
|
||||
caf::PdmUiGroup* paramFRAGroup = faultRAGroup->addNewGroup( "Parameters" );
|
||||
paramFRAGroup->add( &m_geomechFRADefaultBasicXML );
|
||||
paramFRAGroup->add( &m_geomechFRADefaultAdvXML );
|
||||
|
||||
caf::PdmUiGroup* wellIAGroup = uiOrdering.addNewGroup( "Well Integrity Analysis" );
|
||||
wellIAGroup->add( &m_geomechWIACommand );
|
||||
wellIAGroup->add( &m_geomechWIADefaultXML );
|
||||
@ -114,46 +81,6 @@ void RiaPreferencesGeoMech::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferencesGeoMech::geomechFRAPreprocCommand() const
|
||||
{
|
||||
return m_geomechFRAPreprocCommand;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferencesGeoMech::geomechFRAPostprocCommand() const
|
||||
{
|
||||
return m_geomechFRAPostprocCommand;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferencesGeoMech::geomechFRAMacrisCommand() const
|
||||
{
|
||||
return m_geomechFRAMacrisCommand;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferencesGeoMech::geomechFRADefaultBasicXML() const
|
||||
{
|
||||
return m_geomechFRADefaultBasicXML;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferencesGeoMech::geomechFRADefaultAdvXML() const
|
||||
{
|
||||
return m_geomechFRADefaultAdvXML;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -186,21 +113,6 @@ bool RiaPreferencesGeoMech::waitBeforeRunWIA() const
|
||||
return m_waitForInputFileEdit;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGeoMech::validateFRASettings() const
|
||||
{
|
||||
QStringList files;
|
||||
files << geomechFRAPreprocCommand();
|
||||
files << geomechFRAPostprocCommand();
|
||||
files << geomechFRAMacrisCommand();
|
||||
files << geomechFRADefaultBasicXML();
|
||||
files << geomechFRADefaultAdvXML();
|
||||
|
||||
return filesExists( files );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -36,16 +36,9 @@ public:
|
||||
|
||||
void appendItems( caf::PdmUiOrdering& uiOrdering ) const;
|
||||
|
||||
bool validateFRASettings() const;
|
||||
bool validateWIASettings() const;
|
||||
|
||||
// geomech settings
|
||||
QString geomechFRAPreprocCommand() const;
|
||||
QString geomechFRAPostprocCommand() const;
|
||||
QString geomechFRAMacrisCommand() const;
|
||||
QString geomechFRADefaultBasicXML() const;
|
||||
QString geomechFRADefaultAdvXML() const;
|
||||
|
||||
QString geomechWIADefaultXML() const;
|
||||
QString geomechWIACommand() const;
|
||||
bool waitBeforeRunWIA() const;
|
||||
@ -58,12 +51,6 @@ protected:
|
||||
private:
|
||||
bool filesExists( QStringList& filelist ) const;
|
||||
|
||||
caf::PdmField<QString> m_geomechFRAPreprocCommand;
|
||||
caf::PdmField<QString> m_geomechFRAPostprocCommand;
|
||||
caf::PdmField<QString> m_geomechFRAMacrisCommand;
|
||||
caf::PdmField<QString> m_geomechFRADefaultBasicXML;
|
||||
caf::PdmField<QString> m_geomechFRADefaultAdvXML;
|
||||
|
||||
caf::PdmField<QString> m_geomechWIADefaultXML;
|
||||
caf::PdmField<QString> m_geomechWIACommand;
|
||||
caf::PdmField<bool> m_waitForInputFileEdit;
|
||||
|
@ -67,14 +67,6 @@ QString RiaDefines::segmentBranchNumberResultName()
|
||||
return "SegmentBranchNumber";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::segmentOneBasedBranchIndexResultName()
|
||||
{
|
||||
return "SegmentOneBasedBranchIndex";
|
||||
}
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
|
@ -29,7 +29,6 @@ QString segmentNumberResultName();
|
||||
|
||||
QString allBranches();
|
||||
QString segmentBranchNumberResultName();
|
||||
QString segmentOneBasedBranchIndexResultName();
|
||||
|
||||
enum class RftBranchType
|
||||
{
|
||||
|
147
ApplicationLibCode/Application/RiaSummaryDefines.cpp
Normal file
147
ApplicationLibCode/Application/RiaSummaryDefines.cpp
Normal file
@ -0,0 +1,147 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022 Equinor ASA
|
||||
//
|
||||
// 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 "RiaSummaryDefines.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryField()
|
||||
{
|
||||
return "Field";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryAquifer()
|
||||
{
|
||||
return "Aquifer";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryNetwork()
|
||||
{
|
||||
return "Network";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryMisc()
|
||||
{
|
||||
return "Misc";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryRegion()
|
||||
{
|
||||
return "Region";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryRegion2Region()
|
||||
{
|
||||
return "Region-Region";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryWell()
|
||||
{
|
||||
return "Well";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryWellGroup()
|
||||
{
|
||||
return "Group";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryWellSegment()
|
||||
{
|
||||
return "Well Segment";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryCompletion()
|
||||
{
|
||||
return "Completion";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summarySegment()
|
||||
{
|
||||
return "Segment";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryBlock()
|
||||
{
|
||||
return "Block";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryLgrCompletion()
|
||||
{
|
||||
return "LGR Completion";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryLgrWell()
|
||||
{
|
||||
return "LGR Well";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryLgrBlock()
|
||||
{
|
||||
return "LGR Block";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::summaryCalculated()
|
||||
{
|
||||
return "Calculated";
|
||||
}
|
42
ApplicationLibCode/Application/RiaSummaryDefines.h
Normal file
42
ApplicationLibCode/Application/RiaSummaryDefines.h
Normal file
@ -0,0 +1,42 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022 Equinor ASA
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace RiaDefines
|
||||
{
|
||||
QString summaryField();
|
||||
QString summaryAquifer();
|
||||
QString summaryNetwork();
|
||||
QString summaryMisc();
|
||||
QString summaryRegion();
|
||||
QString summaryRegion2Region();
|
||||
QString summaryWell();
|
||||
QString summaryWellGroup();
|
||||
QString summaryWellSegment();
|
||||
QString summaryCompletion();
|
||||
QString summarySegment();
|
||||
QString summaryBlock();
|
||||
QString summaryLgrCompletion();
|
||||
QString summaryLgrWell();
|
||||
QString summaryLgrBlock();
|
||||
QString summaryCalculated();
|
||||
|
||||
}; // namespace RiaDefines
|
123
ApplicationLibCode/Application/RiaThermalFractureDefines.cpp
Normal file
123
ApplicationLibCode/Application/RiaThermalFractureDefines.cpp
Normal file
@ -0,0 +1,123 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022- Equinor ASA
|
||||
//
|
||||
// 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 "RiaThermalFractureDefines.h"
|
||||
#include "RiaFractureDefines.h"
|
||||
|
||||
#include "cafAssert.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace RiaDefines
|
||||
{
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString leakoffPressureDropResultName()
|
||||
{
|
||||
return "LeakoffPressureDrop";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString filtratePressureDropResultName()
|
||||
{
|
||||
return "FiltratePressureDrop";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString leakoffMobilityResultName()
|
||||
{
|
||||
return "LeakoffMobility";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString filterCakeMobilityResultName()
|
||||
{
|
||||
return "FilterCakeMobility";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString injectivityFactorResultName()
|
||||
{
|
||||
return "InjectivityFactor";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString viscosityResultName()
|
||||
{
|
||||
return "Viscosity";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString getExpectedThermalFractureUnit( const QString& name, RiaDefines::EclipseUnitSystem unitSystem )
|
||||
{
|
||||
CAF_ASSERT( unitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC ||
|
||||
unitSystem == RiaDefines::EclipseUnitSystem::UNITS_FIELD );
|
||||
|
||||
// parameter name --> { metric unit, field unit }
|
||||
std::map<QString, std::pair<QString, QString>> mapping =
|
||||
{ { "XCoord", { "m", "feet" } },
|
||||
{ "YCoord", { "m", "feet" } },
|
||||
{ "ZCoord", { "m", "feet" } },
|
||||
{ "Width", { "cm", "inches" } },
|
||||
{ "Pressure", { "BARa", "psia" } },
|
||||
{ "Temperature", { "deg C", "deg F" } },
|
||||
{ "Stress", { "BARa", "psia" } },
|
||||
{ "Density", { "Kg/m3", "lb/ft3" } },
|
||||
{ RiaDefines::viscosityResultName(), { "mPa.s", "centipoise" } },
|
||||
{ RiaDefines::leakoffMobilityResultName(), { "m/day/bar", "ft/day/psi" } },
|
||||
{ "Conductivity",
|
||||
{ RiaDefines::unitStringConductivity( RiaDefines::EclipseUnitSystem::UNITS_METRIC ),
|
||||
RiaDefines::unitStringConductivity( RiaDefines::EclipseUnitSystem::UNITS_FIELD ) } },
|
||||
{ "Velocity", { "m/sec", "ft/sec" } },
|
||||
{ "ResPressure", { "BARa", "psia" } },
|
||||
{ "ResTemperature", { "deg C", "deg F" } },
|
||||
{ "FiltrateThickness", { "cm", "inches" } },
|
||||
{ RiaDefines::filtratePressureDropResultName(), { "bar", "psi" } },
|
||||
{ "EffectiveResStress", { "bar", "psi" } },
|
||||
{ "EffectiveFracStress", { "bar", "psi" } },
|
||||
{ RiaDefines::leakoffPressureDropResultName(), { "bar", "psi" } },
|
||||
{ RiaDefines::injectivityFactorResultName(), { "factor", "factor" } },
|
||||
{ RiaDefines::filterCakeMobilityResultName(), { "m/day/bar", "ft/day/psi" } } };
|
||||
|
||||
auto res = std::find_if( mapping.begin(), mapping.end(), [&]( const auto& val ) { return val.first == name; } );
|
||||
|
||||
if ( res != mapping.end() )
|
||||
{
|
||||
if ( unitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC )
|
||||
return res->second.first;
|
||||
else
|
||||
return res->second.second;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
}; // namespace RiaDefines
|
@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
// Copyright (C) 2022- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -18,24 +18,21 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <list>
|
||||
|
||||
class RimFaultRASettings;
|
||||
class RimGenericParameter;
|
||||
|
||||
class RifFaultRAXmlWriter
|
||||
namespace RiaDefines
|
||||
{
|
||||
public:
|
||||
RifFaultRAXmlWriter( RimFaultRASettings* settings );
|
||||
~RifFaultRAXmlWriter();
|
||||
QString leakoffPressureDropResultName();
|
||||
QString filtratePressureDropResultName();
|
||||
QString leakoffMobilityResultName();
|
||||
QString filterCakeMobilityResultName();
|
||||
QString injectivityFactorResultName();
|
||||
QString viscosityResultName();
|
||||
|
||||
bool writeCalculateFile( QString filename, int faultID, QString& outErrorText );
|
||||
bool writeCalibrateFile( QString filename, int faultID, QString& outErrorText );
|
||||
QString getExpectedThermalFractureUnit( const QString& name, RiaDefines::EclipseUnitSystem unitSystem );
|
||||
|
||||
private:
|
||||
bool writeParametersToXML( QString filename, std::list<RimGenericParameter*>& params, QString& outErrorText );
|
||||
|
||||
RimFaultRASettings* m_settings;
|
||||
};
|
||||
}; // namespace RiaDefines
|
@ -49,6 +49,9 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaVec3Tools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryStringTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNetworkTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaOpenMPTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNumericalTools.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -95,6 +98,9 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaVec3Tools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryStringTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNetworkTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaOpenMPTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNumericalTools.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES})
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include <QDir>
|
||||
|
||||
#include <filesystem>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
@ -362,3 +363,16 @@ std::map<QString, QStringList> RiaFilePathTools::keyPathComponentsForEachFilePat
|
||||
|
||||
return keyComponents;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaFilePathTools::isFirstOlderThanSecond( const std::string& firstFileName, const std::string& secondFileName )
|
||||
{
|
||||
if ( !std::filesystem::exists( firstFileName ) || !std::filesystem::exists( secondFileName ) ) return false;
|
||||
|
||||
auto timeFirstFile = std::filesystem::last_write_time( firstFileName );
|
||||
auto timeSecondFile = std::filesystem::last_write_time( secondFileName );
|
||||
|
||||
return ( timeFirstFile < timeSecondFile );
|
||||
}
|
||||
|
@ -48,4 +48,6 @@ public:
|
||||
static QStringList splitPathIntoComponents( const QString& path, bool splitExtensionIntoSeparateEntry = false );
|
||||
|
||||
static std::map<QString, QStringList> keyPathComponentsForEachFilePath( const QStringList& filePaths );
|
||||
|
||||
static bool isFirstOlderThanSecond( const std::string& firstFileName, const std::string& secondFileName );
|
||||
};
|
||||
|
@ -27,6 +27,10 @@
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -23,6 +23,9 @@
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRoffCase.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
@ -508,3 +509,51 @@ bool RiaImportEclipseCaseTools::addEclipseCases( const QStringList& fil
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiaImportEclipseCaseTools::openRoffCaseFromFileNames( const QStringList& fileNames, bool createDefaultView )
|
||||
{
|
||||
CAF_ASSERT( !fileNames.empty() );
|
||||
|
||||
auto* roffCase = new RimRoffCase();
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* project = app->project();
|
||||
project->assignCaseIdToCase( roffCase );
|
||||
roffCase->setGridFileName( fileNames[0] );
|
||||
|
||||
bool gridImportSuccess = roffCase->openEclipseGridFile();
|
||||
if ( !gridImportSuccess )
|
||||
{
|
||||
RiaLogging::error( "Failed to import grid" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels()
|
||||
: nullptr;
|
||||
if ( !analysisModels ) return -1;
|
||||
|
||||
analysisModels->cases.push_back( roffCase );
|
||||
|
||||
RimEclipseView* eclipseView = nullptr;
|
||||
if ( createDefaultView )
|
||||
{
|
||||
eclipseView = roffCase->createAndAddReservoirView();
|
||||
|
||||
eclipseView->cellResult()->setResultType( RiaDefines::ResultCatType::INPUT_PROPERTY );
|
||||
|
||||
if ( RiaGuiApplication::isRunning() )
|
||||
{
|
||||
if ( RiuMainWindow::instance() )
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( eclipseView->cellResult() );
|
||||
}
|
||||
|
||||
eclipseView->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
analysisModels->updateConnectedEditors();
|
||||
|
||||
return roffCase->caseId();
|
||||
}
|
||||
|
@ -52,6 +52,8 @@ public:
|
||||
bool createView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings = nullptr );
|
||||
|
||||
static int openRoffCaseFromFileNames( const QStringList& fileNames, bool createDefaultView );
|
||||
|
||||
private:
|
||||
static int openEclipseCaseShowTimeStepFilterImpl( const QString& fileName,
|
||||
bool showTimeStepFilter,
|
||||
|
@ -187,6 +187,16 @@ void RiaLogging::setLoggerInstance( std::unique_ptr<RiaLogger> loggerInstance )
|
||||
sm_logger = std::move( loggerInstance );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RILogLevel RiaLogging::logLevelBasedOnPreferences()
|
||||
{
|
||||
if ( RiaApplication::enableDevelopmentFeatures() ) return RILogLevel::RI_LL_DEBUG;
|
||||
|
||||
return RILogLevel::RI_LL_INFO;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -63,6 +63,8 @@ public:
|
||||
static RiaLogger* loggerInstance();
|
||||
static void setLoggerInstance( std::unique_ptr<RiaLogger> loggerInstance );
|
||||
|
||||
static RILogLevel logLevelBasedOnPreferences();
|
||||
|
||||
static void error( const QString& message );
|
||||
static void warning( const QString& message );
|
||||
static void info( const QString& message );
|
||||
|
102
ApplicationLibCode/Application/Tools/RiaNetworkTools.cpp
Normal file
102
ApplicationLibCode/Application/Tools/RiaNetworkTools.cpp
Normal file
@ -0,0 +1,102 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022 Equinor ASA
|
||||
//
|
||||
// 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 "RiaNetworkTools.h"
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QEventLoop>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QStringList>
|
||||
#include <QUrl>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaNetworkTools::openUrl( const QString& urlString )
|
||||
{
|
||||
QDesktopServices::openUrl( QUrl( urlString ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaNetworkTools::createAndOpenUrlWithFallback( const QString& urlSubString )
|
||||
{
|
||||
QStringList urls;
|
||||
|
||||
QString urlStringWithPrefix = urlSubString.trimmed();
|
||||
if ( urlStringWithPrefix.isEmpty() ) return;
|
||||
if ( urlStringWithPrefix[0] != '/' ) urlStringWithPrefix = '/' + urlStringWithPrefix;
|
||||
|
||||
urls += "https://resinsight.org" + urlStringWithPrefix;
|
||||
urls += "https://opm.github.io/ResInsight-UserDocumentation" + urlStringWithPrefix;
|
||||
|
||||
openUrlWithFallback( urls );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaNetworkTools::openUrlWithFallback( const QStringList& urlList )
|
||||
{
|
||||
for ( const auto& url : urlList )
|
||||
{
|
||||
if ( doesResourceExist( url ) )
|
||||
{
|
||||
QDesktopServices::openUrl( QUrl( url ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaNetworkTools::doesResourceExist( const QString& urlString )
|
||||
{
|
||||
// Based on https://karanbalkar.com/posts/sending-http-request-using-qt5/
|
||||
|
||||
// create custom temporary event loop on stack
|
||||
QEventLoop eventLoop;
|
||||
|
||||
// "quit()" the event-loop, when the network request "finished()"
|
||||
QNetworkAccessManager mgr;
|
||||
QObject::connect( &mgr, SIGNAL( finished( QNetworkReply* ) ), &eventLoop, SLOT( quit() ) );
|
||||
|
||||
// the HTTP request
|
||||
const QUrl qurl( urlString );
|
||||
QNetworkRequest request( qurl );
|
||||
QNetworkReply* reply = mgr.get( request );
|
||||
eventLoop.exec(); // blocks stack until "finished()" has been called
|
||||
|
||||
auto statusCode = request.attribute( QNetworkRequest::HttpStatusCodeAttribute ).toInt();
|
||||
|
||||
auto error = reply->error();
|
||||
if ( error == QNetworkReply::NoError && statusCode == 200 )
|
||||
{
|
||||
delete reply;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
delete reply;
|
||||
|
||||
return false;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
// Copyright (C) 2022 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -18,17 +18,20 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RicRunFaultReactAssessmentFeature.h"
|
||||
#include <QString>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RicRunBasicFaultReactAssessmentFeature : public RicRunFaultReactAssessmentFeature
|
||||
class RiaNetworkTools
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
public:
|
||||
static void openUrl( const QString& urlString );
|
||||
static void createAndOpenUrlWithFallback( const QString& urlSubString );
|
||||
static void openUrlWithFallback( const QStringList& urlList );
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
private:
|
||||
static bool doesResourceExist( const QString& urlString );
|
||||
};
|
95
ApplicationLibCode/Application/Tools/RiaNumericalTools.cpp
Normal file
95
ApplicationLibCode/Application/Tools/RiaNumericalTools.cpp
Normal file
@ -0,0 +1,95 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022 Equinor ASA
|
||||
//
|
||||
// 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 "RiaNumericalTools.h"
|
||||
|
||||
#include "cvfMath.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaNumericalTools::roundToClosestPowerOfTenCeil( double value )
|
||||
{
|
||||
auto exponent = computeTenExponentCeil( value );
|
||||
return pow( 10.0, exponent );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaNumericalTools::roundToClosestPowerOfTenFloor( double value )
|
||||
{
|
||||
auto exponent = computeTenExponentFloor( value );
|
||||
return pow( 10.0, exponent );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaNumericalTools::computeTenExponentCeil( double value )
|
||||
{
|
||||
if ( value < 0.0 ) return 0.0;
|
||||
|
||||
double logDecValueMax = log10( value );
|
||||
logDecValueMax = cvf::Math::ceil( logDecValueMax );
|
||||
|
||||
return logDecValueMax;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaNumericalTools::computeTenExponentFloor( double value )
|
||||
{
|
||||
if ( value < 0.0 ) return 0.0;
|
||||
|
||||
double logDecValueMin = log10( value );
|
||||
logDecValueMin = cvf::Math::floor( logDecValueMin );
|
||||
|
||||
return logDecValueMin;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaNumericalTools::roundToNumSignificantDigits( double value, double numSignificantDigits )
|
||||
{
|
||||
double absoluteValue = cvf::Math::abs( value );
|
||||
if ( absoluteValue == 0.0 )
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double logDecValue = log10( absoluteValue );
|
||||
logDecValue = cvf::Math::ceil( logDecValue );
|
||||
|
||||
double factor = pow( 10.0, numSignificantDigits - logDecValue );
|
||||
|
||||
double tmp = value * factor;
|
||||
double integerPart;
|
||||
double fraction = modf( tmp, &integerPart );
|
||||
|
||||
if ( cvf::Math::abs( fraction ) >= 0.5 ) ( integerPart >= 0 ) ? integerPart++ : integerPart--;
|
||||
|
||||
double roundedValue = integerPart / factor;
|
||||
|
||||
return roundedValue;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
// Copyright (C) 2022 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -18,17 +18,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RimFaultRAPreprocSettings;
|
||||
class RimFaultRAPostprocSettings;
|
||||
|
||||
class RifFaultRAJSonWriter
|
||||
namespace RiaNumericalTools
|
||||
{
|
||||
public:
|
||||
static bool writeToPreprocFile( RimFaultRAPreprocSettings& settings, QString& outErrorText );
|
||||
static bool writeToPostprocFile( int faultID, RimFaultRAPostprocSettings* settings, QString& outErrorText );
|
||||
double roundToClosestPowerOfTenCeil( double value );
|
||||
double roundToClosestPowerOfTenFloor( double value );
|
||||
double computeTenExponentCeil( double value );
|
||||
double computeTenExponentFloor( double value );
|
||||
|
||||
private:
|
||||
RifFaultRAJSonWriter(){};
|
||||
};
|
||||
double roundToNumSignificantDigits( double value, double numSignificantDigits );
|
||||
|
||||
}; // namespace RiaNumericalTools
|
@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
// Copyright (C) 2022 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -16,31 +16,35 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicRunAdvFaultReactAssessment3dFeature.h"
|
||||
#include "RiaOpenMPTools.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicRunAdvFaultReactAssessment3dFeature, "RicRunAdvFaultReactAssessment3dFeature" );
|
||||
#ifdef USE_OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunAdvFaultReactAssessment3dFeature::onActionTriggered( bool isChecked )
|
||||
int RiaOpenMPTools::availableThreadCount()
|
||||
{
|
||||
QVariant userData = this->userData();
|
||||
if ( userData.isNull() || userData.type() != QVariant::String ) return;
|
||||
int numberOfThreads = 1;
|
||||
#ifdef USE_OPENMP
|
||||
numberOfThreads = omp_get_max_threads();
|
||||
#endif
|
||||
|
||||
QString faultName = userData.toString();
|
||||
|
||||
int faultID = faultIDFromName( faultName );
|
||||
if ( faultID >= 0 ) runAdvancedProcessing( faultID );
|
||||
return numberOfThreads;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunAdvFaultReactAssessment3dFeature::setupActionLook( QAction* actionToSetup )
|
||||
int RiaOpenMPTools::currentThreadIndex()
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/fault_react_24x24.png" ) );
|
||||
actionToSetup->setText( "Run Advanced Processing" );
|
||||
int myThread = 0;
|
||||
|
||||
#ifdef USE_OPENMP
|
||||
myThread = omp_get_thread_num();
|
||||
#endif
|
||||
|
||||
return myThread;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
// Copyright (C) 2022 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -18,16 +18,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RicRunBasicFaultReactAssessment3dFeature.h"
|
||||
#include <QString>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//
|
||||
//==================================================================================================
|
||||
class RicRunAdvFaultReactAssessment3dFeature : public RicRunBasicFaultReactAssessment3dFeature
|
||||
namespace RiaOpenMPTools
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
int availableThreadCount();
|
||||
int currentThreadIndex();
|
||||
}; // namespace RiaOpenMPTools
|
@ -83,6 +83,9 @@ RiaRegressionTest::RiaRegressionTest()
|
||||
|
||||
CAF_PDM_InitField( &invalidateExternalFilePaths, "invalidateExternalFilePaths", false, "Invalidate External File Paths" );
|
||||
CAF_PDM_InitFieldNoDefault( &overridePlotEngine, "forcePlotEngine", "Force Plot Engine" );
|
||||
|
||||
CAF_PDM_InitField( &exportSnapshots3dViews, "exportSnapshots3dViews", true, "Export Snapshots 3D Views" );
|
||||
CAF_PDM_InitField( &exportSnapshotsPlots, "exportSnapshotsPlots", true, "Export Snapshots Plots" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -53,6 +53,9 @@ public:
|
||||
caf::PdmField<bool> appendTestsAfterTestFilter;
|
||||
caf::PdmField<bool> invalidateExternalFilePaths;
|
||||
|
||||
caf::PdmField<bool> exportSnapshots3dViews;
|
||||
caf::PdmField<bool> exportSnapshotsPlots;
|
||||
|
||||
caf::PdmField<caf::AppEnum<PlotEngine>> overridePlotEngine;
|
||||
|
||||
protected:
|
||||
|
@ -238,15 +238,22 @@ void RiaRegressionTestRunner::runRegressionTest()
|
||||
// Wait until all command objects have completed
|
||||
app->waitUntilCommandObjectsHasBeenProcessed();
|
||||
|
||||
setDefaultSnapshotSizeFor3dViews();
|
||||
|
||||
QString fullPathGeneratedFolder = testCaseFolder.absoluteFilePath( generatedFolderName );
|
||||
RicSnapshotAllViewsToFileFeature::exportSnapshotOfViewsIntoFolder( fullPathGeneratedFolder );
|
||||
if ( regressionTestConfig.exportSnapshots3dViews )
|
||||
{
|
||||
setDefaultSnapshotSizeFor3dViews();
|
||||
|
||||
QApplication::processEvents();
|
||||
setDefaultSnapshotSizeForPlotWindows();
|
||||
RicSnapshotAllViewsToFileFeature::exportSnapshotOfViewsIntoFolder( fullPathGeneratedFolder );
|
||||
|
||||
RicSnapshotAllPlotsToFileFeature::exportSnapshotOfPlotsIntoFolder( fullPathGeneratedFolder );
|
||||
QApplication::processEvents();
|
||||
}
|
||||
|
||||
if ( regressionTestConfig.exportSnapshotsPlots )
|
||||
{
|
||||
setDefaultSnapshotSizeForPlotWindows();
|
||||
|
||||
RicSnapshotAllPlotsToFileFeature::exportSnapshotOfPlotsIntoFolder( fullPathGeneratedFolder );
|
||||
}
|
||||
|
||||
uint64_t usedMemoryBeforeClose = caf::MemoryInspector::getApplicationPhysicalMemoryUsageMiB();
|
||||
|
||||
@ -620,7 +627,7 @@ QFileInfoList RiaRegressionTestRunner::subDirectoriesForTestExecution( const QDi
|
||||
{
|
||||
QString trimmed = s.trimmed();
|
||||
if ( ( m_appendAllTestsAfterLastItemInFilter && anyMatchFound ) ||
|
||||
baseName.contains( trimmed, Qt::CaseInsensitive ) )
|
||||
baseName.compare( trimmed, Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
foldersMatchingTestFilter.push_back( fi );
|
||||
anyMatchFound = true;
|
||||
|
@ -26,6 +26,9 @@
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -140,6 +140,30 @@ QStringList RiaTextStringTools::splitSkipEmptyParts( const QString& text, const
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaTextStringTools::replaceTemplateTextWithValues( const QString& templateText,
|
||||
const std::map<QString, QString>& valueMap )
|
||||
{
|
||||
QString resolvedText = templateText;
|
||||
|
||||
// Use a regular expression to find all occurrences of ${key} in the text and replace with the value
|
||||
|
||||
for ( const auto& [key, value] : valueMap )
|
||||
{
|
||||
QString regexString = key;
|
||||
regexString.replace( "$", "\\$" );
|
||||
regexString += "\\b";
|
||||
|
||||
QRegularExpression rx( regexString );
|
||||
|
||||
resolvedText.replace( rx, value );
|
||||
}
|
||||
|
||||
return resolvedText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
#include <map>
|
||||
|
||||
class QStringList;
|
||||
|
||||
@ -36,4 +37,6 @@ QString trimNonAlphaNumericCharacters( const QString& s );
|
||||
QStringList splitSkipEmptyParts( const QString& text, const QString& sep = " " );
|
||||
QStringList splitSkipEmptyParts( const QString& text, const QRegExp& regExp );
|
||||
|
||||
QString replaceTemplateTextWithValues( const QString& templateText, const std::map<QString, QString>& valueMap );
|
||||
|
||||
} // namespace RiaTextStringTools
|
||||
|
@ -79,7 +79,7 @@ void RiaPolyArcLineSampler::sampleSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Ve
|
||||
{
|
||||
cvf::Vec3d p1p2 = p2 - p1;
|
||||
|
||||
CVF_ASSERT( p1p2.lengthSquared() > 1e-20 );
|
||||
if ( p1p2.lengthSquared() < 1e-20 ) return;
|
||||
|
||||
if ( cvf::GeometryTools::getAngle( t1, p1p2 ) < 1e-5 || p1p2.length() < m_maxSamplingsInterval )
|
||||
{
|
||||
|
188
ApplicationLibCode/Application/Tools/enum_bitmask.hpp
Normal file
188
ApplicationLibCode/Application/Tools/enum_bitmask.hpp
Normal file
@ -0,0 +1,188 @@
|
||||
//////////////////////////////////////////////////
|
||||
// Taken from
|
||||
// https://gist.github.com/StrikerX3/46b9058d6c61387b3f361ef9d7e00cd4
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
Type-safe enum class bitmasks.
|
||||
Based on work by Andre Haupt from his blog at
|
||||
http://blog.bitwigglers.org/using-enum-classes-as-type-safe-bitmasks/
|
||||
To enable enum classes to be used as bitmasks, use the ENABLE_BITMASK_OPERATORS
|
||||
macro:
|
||||
enum class MyBitmask {
|
||||
None = 0b0000,
|
||||
One = 0b0001,
|
||||
Two = 0b0010,
|
||||
Three = 0b0100,
|
||||
};
|
||||
ENABLE_BITMASK_OPERATORS(MyBitmask)
|
||||
From now on, MyBitmask's values can be used with bitwise operators.
|
||||
You may find it cumbersome to check for the presence or absence of specific
|
||||
values in enum class bitmasks. For example:
|
||||
MyBitmask bm = ...;
|
||||
MyBitmask oneAndThree = (MyBitmask::One | MyBitmask::Three);
|
||||
// Check if either bit one or three is set
|
||||
if (bm & oneAndThree != MyBitmask::None) {
|
||||
...
|
||||
}
|
||||
// Check if both bits one and three are set
|
||||
if (bm & oneAndThree == oneAndThree) {
|
||||
...
|
||||
}
|
||||
To help with that, you can wrap the bitmask into the BitmaskEnum type, which
|
||||
provides a set of bitmask checks and useful conversions:
|
||||
MyBitmask bm = ...;
|
||||
MyBitmask oneAndThree = (MyBitmask::One | MyBitmask::Three);
|
||||
auto wbm = BitmaskEnum(bm);
|
||||
// Check if either bit one or three is set
|
||||
if (bm.AnyOf(oneAndThree)) {
|
||||
...
|
||||
}
|
||||
// Check if both bits one and three are set
|
||||
if (bm.AllOf(oneAndThree)) {
|
||||
...
|
||||
}
|
||||
// Check if any bit is set
|
||||
if (bm) {
|
||||
...
|
||||
}
|
||||
// Convert back to the enum class
|
||||
MyBitmask backToEnum = wbm;
|
||||
-------------------------------------------------------------------------------
|
||||
MIT License
|
||||
Copyright (c) 2019 Ivan Roberto de Oliveira
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#define ENABLE_BITMASK_OPERATORS( x ) \
|
||||
template <> \
|
||||
struct is_bitmask_enum<x> \
|
||||
{ \
|
||||
static const bool enable = true; \
|
||||
};
|
||||
|
||||
template <typename Enum>
|
||||
struct is_bitmask_enum
|
||||
{
|
||||
static const bool enable = false;
|
||||
};
|
||||
|
||||
template <class Enum>
|
||||
inline constexpr bool is_bitmask_enum_v = is_bitmask_enum<Enum>::enable;
|
||||
|
||||
// ----- Bitwise operators ----------------------------------------------------
|
||||
|
||||
template <typename Enum>
|
||||
typename std::enable_if_t<is_bitmask_enum_v<Enum>, Enum> operator|( Enum lhs, Enum rhs )
|
||||
{
|
||||
using underlying = typename std::underlying_type_t<Enum>;
|
||||
return static_cast<Enum>( static_cast<underlying>( lhs ) | static_cast<underlying>( rhs ) );
|
||||
}
|
||||
|
||||
template <typename Enum>
|
||||
typename std::enable_if_t<is_bitmask_enum_v<Enum>, Enum> operator&( Enum lhs, Enum rhs )
|
||||
{
|
||||
using underlying = typename std::underlying_type_t<Enum>;
|
||||
return static_cast<Enum>( static_cast<underlying>( lhs ) & static_cast<underlying>( rhs ) );
|
||||
}
|
||||
|
||||
template <typename Enum>
|
||||
typename std::enable_if_t<is_bitmask_enum_v<Enum>, Enum> operator^( Enum lhs, Enum rhs )
|
||||
{
|
||||
using underlying = typename std::underlying_type_t<Enum>;
|
||||
return static_cast<Enum>( static_cast<underlying>( lhs ) ^ static_cast<underlying>( rhs ) );
|
||||
}
|
||||
|
||||
template <typename Enum>
|
||||
typename std::enable_if_t<is_bitmask_enum_v<Enum>, Enum> operator~( Enum rhs )
|
||||
{
|
||||
using underlying = typename std::underlying_type_t<Enum>;
|
||||
return static_cast<Enum>( ~static_cast<underlying>( rhs ) );
|
||||
}
|
||||
|
||||
// ----- Bitwise assignment operators -----------------------------------------
|
||||
|
||||
template <typename Enum>
|
||||
typename std::enable_if_t<is_bitmask_enum_v<Enum>, Enum> operator|=( Enum& lhs, Enum rhs )
|
||||
{
|
||||
using underlying = typename std::underlying_type_t<Enum>;
|
||||
lhs = static_cast<Enum>( static_cast<underlying>( lhs ) | static_cast<underlying>( rhs ) );
|
||||
return lhs;
|
||||
}
|
||||
|
||||
template <typename Enum>
|
||||
typename std::enable_if_t<is_bitmask_enum_v<Enum>, Enum> operator&=( Enum& lhs, Enum rhs )
|
||||
{
|
||||
using underlying = typename std::underlying_type_t<Enum>;
|
||||
lhs = static_cast<Enum>( static_cast<underlying>( lhs ) & static_cast<underlying>( rhs ) );
|
||||
return lhs;
|
||||
}
|
||||
|
||||
template <typename Enum>
|
||||
typename std::enable_if_t<is_bitmask_enum_v<Enum>, Enum> operator^=( Enum& lhs, Enum rhs )
|
||||
{
|
||||
using underlying = typename std::underlying_type_t<Enum>;
|
||||
lhs = static_cast<Enum>( static_cast<underlying>( lhs ) ^ static_cast<underlying>( rhs ) );
|
||||
return lhs;
|
||||
}
|
||||
|
||||
// ----- Bitwise mask checks --------------------------------------------------
|
||||
|
||||
template <typename Enum>
|
||||
struct BitmaskEnum
|
||||
{
|
||||
const Enum value;
|
||||
static const Enum none = static_cast<Enum>( 0 );
|
||||
|
||||
using underlying = typename std::underlying_type_t<Enum>;
|
||||
|
||||
BitmaskEnum( Enum value )
|
||||
: value( value )
|
||||
{
|
||||
static_assert( is_bitmask_enum_v<Enum> );
|
||||
}
|
||||
|
||||
// Convert back to enum if required
|
||||
inline operator Enum() const { return value; }
|
||||
|
||||
// Convert to true if there is any bit set in the bitmask
|
||||
inline operator bool() const { return Any(); }
|
||||
|
||||
// Returns true if any bit is set
|
||||
inline bool Any() const { return value != none; }
|
||||
|
||||
// Returns true if all bits are clear
|
||||
inline bool None() const { return value == none; }
|
||||
|
||||
// Returns true if any bit in the given mask is set
|
||||
inline bool AnyOf( const Enum& mask ) const { return ( value & mask ) != none; }
|
||||
|
||||
// Returns true if all bits in the given mask are set
|
||||
inline bool AllOf( const Enum& mask ) const { return ( value & mask ) == mask; }
|
||||
|
||||
// Returns true if none of the bits in the given mask are set
|
||||
inline bool NoneOf( const Enum& mask ) const { return ( value & mask ) == none; }
|
||||
|
||||
// Returns true if any bits excluding the mask are set
|
||||
inline bool AnyExcept( const Enum& mask ) const { return ( value & ~mask ) != none; }
|
||||
|
||||
// Returns true if no bits excluding the mask are set
|
||||
inline bool NoneExcept( const Enum& mask ) const { return ( value & ~mask ) == none; }
|
||||
};
|
@ -34,7 +34,6 @@ if(Qt5Core_FOUND)
|
||||
Gui
|
||||
OpenGL
|
||||
Network
|
||||
Script
|
||||
Widgets
|
||||
Xml
|
||||
Concurrent
|
||||
@ -47,7 +46,6 @@ if(Qt5Core_FOUND)
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt5::OpenGL
|
||||
Qt5::Script
|
||||
Qt5::Widgets
|
||||
Qt5::Xml
|
||||
Qt5::Concurrent
|
||||
@ -192,6 +190,7 @@ list(
|
||||
ProjectDataModel/WellLog/CMakeLists_files.cmake
|
||||
ProjectDataModel/WellMeasurement/CMakeLists_files.cmake
|
||||
ProjectDataModel/WellPath/CMakeLists_files.cmake
|
||||
ProjectDataModel/Tools/CMakeLists_files.cmake
|
||||
ProjectDataModelCommands/CMakeLists_files.cmake
|
||||
ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake
|
||||
GeoMech/GeoMechVisualization/CMakeLists_files.cmake
|
||||
|
@ -25,12 +25,13 @@
|
||||
|
||||
#include "RimGridCrossPlot.h"
|
||||
#include "RimGridCrossPlotCurve.h"
|
||||
#include "RimPlot.h"
|
||||
#include "RimPlotWindow.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimVfpPlot.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuTextDialog.h"
|
||||
@ -174,7 +175,7 @@ bool RicShowPlotDataFeature::isCommandEnabled()
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<RimPlot*> selection;
|
||||
std::vector<RimPlotWindow*> selection;
|
||||
getSelection( selection );
|
||||
|
||||
int validPlots = 0;
|
||||
@ -186,9 +187,9 @@ bool RicShowPlotDataFeature::isCommandEnabled()
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( dynamic_cast<RimSummaryPlot*>( plot ) != nullptr ||
|
||||
( dynamic_cast<RimWellLogPlot*>( plot ) != nullptr || dynamic_cast<RimGridCrossPlot*>( plot ) != nullptr ||
|
||||
dynamic_cast<RimVfpPlot*>( plot ) != nullptr ) )
|
||||
if ( dynamic_cast<RimSummaryPlot*>( plot ) || dynamic_cast<RimWellLogPlot*>( plot ) ||
|
||||
dynamic_cast<RimWellLogTrack*>( plot ) || dynamic_cast<RimGridCrossPlot*>( plot ) ||
|
||||
dynamic_cast<RimVfpPlot*>( plot ) )
|
||||
{
|
||||
validPlots++;
|
||||
}
|
||||
@ -217,55 +218,48 @@ void RicShowPlotDataFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
std::vector<RimPlot*> selection;
|
||||
std::vector<RimPlotWindow*> selection;
|
||||
getSelection( selection );
|
||||
|
||||
std::vector<RimSummaryPlot*> selectedSummaryPlots;
|
||||
std::vector<RimWellLogPlot*> wellLogPlots;
|
||||
std::vector<RimGridCrossPlot*> crossPlots;
|
||||
std::vector<RimVfpPlot*> vfpPlots;
|
||||
std::vector<RimWellLogTrack*> depthTracks;
|
||||
|
||||
for ( auto plot : selection )
|
||||
{
|
||||
auto sumPlot = dynamic_cast<RimSummaryPlot*>( plot );
|
||||
if ( sumPlot )
|
||||
if ( auto sumPlot = dynamic_cast<RimSummaryPlot*>( plot ) )
|
||||
{
|
||||
selectedSummaryPlots.push_back( sumPlot );
|
||||
continue;
|
||||
}
|
||||
|
||||
auto wellPlot = dynamic_cast<RimWellLogPlot*>( plot );
|
||||
if ( wellPlot )
|
||||
if ( auto wellPlot = dynamic_cast<RimWellLogPlot*>( plot ) )
|
||||
{
|
||||
wellLogPlots.push_back( wellPlot );
|
||||
continue;
|
||||
}
|
||||
|
||||
auto xPlot = dynamic_cast<RimGridCrossPlot*>( plot );
|
||||
if ( xPlot )
|
||||
if ( auto xPlot = dynamic_cast<RimGridCrossPlot*>( plot ) )
|
||||
{
|
||||
crossPlots.push_back( xPlot );
|
||||
continue;
|
||||
}
|
||||
|
||||
auto vfpPlot = dynamic_cast<RimVfpPlot*>( plot );
|
||||
if ( vfpPlot )
|
||||
if ( auto vfpPlot = dynamic_cast<RimVfpPlot*>( plot ) )
|
||||
{
|
||||
vfpPlots.push_back( vfpPlot );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( auto depthTrack = dynamic_cast<RimWellLogTrack*>( plot ) )
|
||||
{
|
||||
depthTracks.push_back( depthTrack );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( selectedSummaryPlots.empty() && wellLogPlots.empty() && crossPlots.empty() && vfpPlots.empty() )
|
||||
{
|
||||
CVF_ASSERT( false );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
RiuPlotMainWindow* plotwindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
CVF_ASSERT( plotwindow );
|
||||
|
||||
for ( RimSummaryPlot* summaryPlot : selectedSummaryPlots )
|
||||
{
|
||||
auto textProvider = new RiuTabbedSummaryPlotTextProvider( summaryPlot );
|
||||
@ -279,6 +273,13 @@ void RicShowPlotDataFeature::onActionTriggered( bool isChecked )
|
||||
RicShowPlotDataFeature::showTextWindow( title, text );
|
||||
}
|
||||
|
||||
for ( auto* plot : depthTracks )
|
||||
{
|
||||
QString title = plot->description();
|
||||
QString text = plot->asciiDataForPlotExport();
|
||||
RicShowPlotDataFeature::showTextWindow( title, text );
|
||||
}
|
||||
|
||||
for ( RimVfpPlot* vfpPlot : vfpPlots )
|
||||
{
|
||||
QString title = vfpPlot->description();
|
||||
@ -339,7 +340,7 @@ void RicShowPlotDataFeature::showTextWindow( const QString& title, const QString
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowPlotDataFeature::getSelection( std::vector<RimPlot*>& selection )
|
||||
void RicShowPlotDataFeature::getSelection( std::vector<RimPlotWindow*>& selection )
|
||||
{
|
||||
if ( sender() )
|
||||
{
|
||||
|
@ -20,11 +20,10 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
class RiuTabbedTextProvider;
|
||||
class RimPlot;
|
||||
class RimPlotWindow;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -39,7 +38,7 @@ protected:
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
private:
|
||||
void getSelection( std::vector<RimPlot*>& selection );
|
||||
void getSelection( std::vector<RimPlotWindow*>& selection );
|
||||
|
||||
public:
|
||||
static void showTabbedTextWindow( RiuTabbedTextProvider* textProvider );
|
||||
|
@ -20,7 +20,11 @@
|
||||
#include "RicTileWindowsFeature.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuMdiArea.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -28,12 +32,33 @@
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicTileWindowsFeature, "RicTileWindowsFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTileWindowsFeature::applyTiling( RiuMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode )
|
||||
{
|
||||
auto mode = requestedTileMode;
|
||||
|
||||
if ( auto proj = RimProject::current() )
|
||||
{
|
||||
// If requested mode is set, reset tiling mode to undefined
|
||||
if ( proj->subWindowsTileMode3DWindow() == requestedTileMode ) mode = RiaDefines::WindowTileMode::UNDEFINED;
|
||||
|
||||
proj->setSubWindowsTileMode3DWindow( mode );
|
||||
}
|
||||
|
||||
if ( mainWindow )
|
||||
{
|
||||
mainWindow->mdiArea()->applyTiling();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTileWindowsFeature::isCommandEnabled()
|
||||
{
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
auto* mainWindow = RiuMainWindow::instance();
|
||||
if ( mainWindow )
|
||||
{
|
||||
return mainWindow->isAnyMdiSubWindowVisible();
|
||||
@ -49,18 +74,8 @@ void RicTileWindowsFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
if ( mainWindow )
|
||||
{
|
||||
if ( !mainWindow->subWindowsAreTiled() )
|
||||
{
|
||||
mainWindow->tileSubWindows();
|
||||
}
|
||||
else
|
||||
{
|
||||
mainWindow->clearWindowTiling();
|
||||
}
|
||||
}
|
||||
auto* mainWindow = RiuMainWindow::instance();
|
||||
applyTiling( mainWindow, RiaDefines::WindowTileMode::DEFAULT );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -78,15 +93,34 @@ void RicTileWindowsFeature::setupActionLook( QAction* actionToSetup )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTileWindowsFeature::isCommandChecked()
|
||||
{
|
||||
if ( RiaGuiApplication::instance()->mainWindow() )
|
||||
{
|
||||
return RiaGuiApplication::instance()->mainWindow()->subWindowsAreTiled();
|
||||
}
|
||||
return false;
|
||||
auto proj = RimProject::current();
|
||||
|
||||
return proj ? ( proj->subWindowsTileMode3DWindow() == RiaDefines::WindowTileMode::DEFAULT ) : false;
|
||||
}
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicTilePlotWindowsFeature, "RicTilePlotWindowsFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTilePlotWindowsFeature::applyTiling( RiuPlotMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode )
|
||||
{
|
||||
auto mode = requestedTileMode;
|
||||
|
||||
if ( auto proj = RimProject::current() )
|
||||
{
|
||||
// If requested mode is set, reset tiling mode to undefined
|
||||
if ( proj->subWindowsTileModePlotWindow() == requestedTileMode ) mode = RiaDefines::WindowTileMode::UNDEFINED;
|
||||
|
||||
proj->setSubWindowsTileModePlotWindow( mode );
|
||||
}
|
||||
|
||||
if ( mainWindow )
|
||||
{
|
||||
mainWindow->mdiArea()->applyTiling();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -106,18 +140,10 @@ bool RicTilePlotWindowsFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTilePlotWindowsFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
if ( mainPlotWindow )
|
||||
{
|
||||
if ( !mainPlotWindow->subWindowsAreTiled() )
|
||||
{
|
||||
mainPlotWindow->tileSubWindows();
|
||||
}
|
||||
else
|
||||
{
|
||||
mainPlotWindow->clearWindowTiling();
|
||||
}
|
||||
}
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
auto* mainWindow = RiuPlotMainWindow::instance();
|
||||
RicTilePlotWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::DEFAULT );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -135,9 +161,197 @@ void RicTilePlotWindowsFeature::setupActionLook( QAction* actionToSetup )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTilePlotWindowsFeature::isCommandChecked()
|
||||
{
|
||||
if ( RiaGuiApplication::instance()->mainPlotWindow() )
|
||||
auto proj = RimProject::current();
|
||||
|
||||
return proj ? ( proj->subWindowsTileModePlotWindow() == RiaDefines::WindowTileMode::DEFAULT ) : false;
|
||||
}
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicTileWindowsVerticallyFeature, "RicTileWindowsVerticallyFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTileWindowsVerticallyFeature::isCommandEnabled()
|
||||
{
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
if ( mainWindow )
|
||||
{
|
||||
return RiaGuiApplication::instance()->mainPlotWindow()->subWindowsAreTiled();
|
||||
return mainWindow->isAnyMdiSubWindowVisible();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTileWindowsVerticallyFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
auto* mainWindow = RiuMainWindow::instance();
|
||||
RicTileWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::VERTICAL );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTileWindowsVerticallyFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Tile Windows Vertically" );
|
||||
actionToSetup->setIcon( QIcon( ":/TileWindows.svg" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTileWindowsVerticallyFeature::isCommandChecked()
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
|
||||
return proj ? ( proj->subWindowsTileMode3DWindow() == RiaDefines::WindowTileMode::VERTICAL ) : false;
|
||||
}
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicTileWindowsHorizontallyFeature, "RicTileWindowsHorizontallyFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTileWindowsHorizontallyFeature::isCommandEnabled()
|
||||
{
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
if ( mainWindow )
|
||||
{
|
||||
return mainWindow->isAnyMdiSubWindowVisible();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTileWindowsHorizontallyFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
auto* mainWindow = RiuMainWindow::instance();
|
||||
RicTileWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::HORIZONTAL );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTileWindowsHorizontallyFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Tile Windows Horizontally" );
|
||||
actionToSetup->setIcon( QIcon( ":/TileWindows.svg" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTileWindowsHorizontallyFeature::isCommandChecked()
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
|
||||
return proj ? ( proj->subWindowsTileMode3DWindow() == RiaDefines::WindowTileMode::HORIZONTAL ) : false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// Main Plot window features
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicTilePlotWindowsVerticallyFeature, "RicTilePlotWindowsVerticallyFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTilePlotWindowsVerticallyFeature::isCommandEnabled()
|
||||
{
|
||||
auto* mainWindow = RiuPlotMainWindow::instance();
|
||||
if ( mainWindow )
|
||||
{
|
||||
return mainWindow->isAnyMdiSubWindowVisible();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTilePlotWindowsVerticallyFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
auto* mainWindow = RiuPlotMainWindow::instance();
|
||||
RicTilePlotWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::VERTICAL );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTilePlotWindowsVerticallyFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Tile Windows Vertically" );
|
||||
actionToSetup->setIcon( QIcon( ":/TileWindows.svg" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTilePlotWindowsVerticallyFeature::isCommandChecked()
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
|
||||
return proj ? ( proj->subWindowsTileModePlotWindow() == RiaDefines::WindowTileMode::VERTICAL ) : false;
|
||||
}
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicTilePlotWindowsHorizontallyFeature, "RicTilePlotWindowsHorizontallyFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTilePlotWindowsHorizontallyFeature::isCommandEnabled()
|
||||
{
|
||||
auto* mainWindow = RiuPlotMainWindow::instance();
|
||||
if ( mainWindow )
|
||||
{
|
||||
return mainWindow->isAnyMdiSubWindowVisible();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTilePlotWindowsHorizontallyFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
auto* mainWindow = RiuPlotMainWindow::instance();
|
||||
RicTilePlotWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::HORIZONTAL );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicTilePlotWindowsHorizontallyFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Tile Windows Horizontally" );
|
||||
actionToSetup->setIcon( QIcon( ":/TileWindows.svg" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicTilePlotWindowsHorizontallyFeature::isCommandChecked()
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
|
||||
return proj ? ( proj->subWindowsTileModePlotWindow() == RiaDefines::WindowTileMode::HORIZONTAL ) : false;
|
||||
}
|
||||
|
@ -19,8 +19,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaPlotDefines.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RiuMainWindow;
|
||||
class RiuPlotMainWindow;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
@ -28,6 +33,37 @@ class RicTileWindowsFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
static void applyTiling( RiuMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode );
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
bool isCommandChecked() override;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicTileWindowsVerticallyFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
bool isCommandChecked() override;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicTileWindowsHorizontallyFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
@ -42,6 +78,37 @@ class RicTilePlotWindowsFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
static void applyTiling( RiuPlotMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode );
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
bool isCommandChecked() override;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicTilePlotWindowsVerticallyFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
bool isCommandChecked() override;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicTilePlotWindowsHorizontallyFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
|
@ -52,6 +52,7 @@ void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered( bool is
|
||||
RimPerforationInterval* perforationInterval = new RimPerforationInterval;
|
||||
double measuredDepth = wellPathSelItem->m_measuredDepth;
|
||||
perforationInterval->setStartAndEndMD( measuredDepth, measuredDepth + 50 );
|
||||
perforationInterval->setUnitSystemSpecificDefaults();
|
||||
|
||||
wellPath->perforationIntervalCollection()->appendPerforation( perforationInterval );
|
||||
|
||||
|
@ -57,6 +57,7 @@ void RicNewPerforationIntervalFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
RimPerforationInterval* perforationInterval = new RimPerforationInterval;
|
||||
perforationInterval->setStartAndEndMD( wellPath->uniqueStartMD(), wellPath->uniqueEndMD() );
|
||||
perforationInterval->setUnitSystemSpecificDefaults();
|
||||
|
||||
perforationCollection->appendPerforation( perforationInterval );
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "RimStimPlanModelPlot.h"
|
||||
#include "RimStimPlanModelPlotCollection.h"
|
||||
#include "RimStimPlanModelTemplate.h"
|
||||
#include "RimWellLogPlotNameConfig.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
@ -166,7 +167,6 @@ RimStimPlanModelPlot* RicNewStimPlanModelPlotFeature::createPlot( RimStimPlanMod
|
||||
{
|
||||
auto task = progInfo.task( "Updating all tracks", 5 );
|
||||
|
||||
plot->nameConfig()->setAutoNameTags( false, false, false, false, false );
|
||||
plot->setPlotTitleVisible( true );
|
||||
plot->setLegendsVisible( true );
|
||||
plot->setLegendsHorizontal( false );
|
||||
@ -445,6 +445,7 @@ RimStimPlanModelPlot* RicNewStimPlanModelPlotFeature::createStimPlanModelPlot( b
|
||||
|
||||
stimPlanModelPlotColl->addStimPlanModelPlot( plot );
|
||||
|
||||
plot->setNamingMethod( RiaDefines::ObjectNamingMethod::CUSTOM );
|
||||
if ( !plotDescription.isEmpty() )
|
||||
{
|
||||
plot->nameConfig()->setCustomName( plotDescription );
|
||||
@ -455,6 +456,8 @@ RimStimPlanModelPlot* RicNewStimPlanModelPlotFeature::createStimPlanModelPlot( b
|
||||
QString( "StimPlan Model Plot %1" ).arg( stimPlanModelPlotCollection()->stimPlanModelPlots().size() ) );
|
||||
}
|
||||
|
||||
stimPlanModelPlotColl->updateAllRequiredEditors();
|
||||
|
||||
if ( showAfterCreation )
|
||||
{
|
||||
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
||||
|
@ -18,15 +18,17 @@
|
||||
|
||||
#include "RicExportCompletionsForVisibleWellPathsFeature.h"
|
||||
|
||||
#include "RicWellPathExportCompletionDataFeature.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RicWellPathExportCompletionDataFeature.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimWellMeasurementCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -74,7 +76,7 @@ bool RicExportCompletionsForVisibleWellPathsFeature::isCommandEnabled()
|
||||
void RicExportCompletionsForVisibleWellPathsFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths = visibleWellPaths();
|
||||
CVF_ASSERT( wellPaths.size() > 0 );
|
||||
if ( wellPaths.empty() ) return RiaLogging::warning( "No visible well paths found, no data exported." );
|
||||
|
||||
std::vector<RimSimWellInView*> simWells;
|
||||
QString dialogTitle = "Export Completion Data for Visible Well Paths";
|
||||
|
@ -46,6 +46,7 @@
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigEclipseToStimPlanCalculator.h"
|
||||
@ -62,6 +63,9 @@
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathStimplanIntersector.h"
|
||||
|
||||
#include "cvfGeometryTools.h"
|
||||
#include "cvfPlane.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -516,7 +520,7 @@ void RicExportFractureCompletionsImpl::getWellPressuresAndInitialProductionTimeS
|
||||
bool RicExportFractureCompletionsImpl::checkForStimPlanConductivity( const RimFractureTemplate* fracTemplate,
|
||||
const RimFracture* fracture )
|
||||
{
|
||||
auto fracTemplateStimPlan = dynamic_cast<const RimStimPlanFractureTemplate*>( fracTemplate );
|
||||
auto fracTemplateStimPlan = dynamic_cast<const RimMeshFractureTemplate*>( fracTemplate );
|
||||
if ( fracTemplateStimPlan )
|
||||
{
|
||||
if ( !fracTemplateStimPlan->hasConductivity() )
|
||||
@ -607,11 +611,13 @@ void RicExportFractureCompletionsImpl::calculateFractureToWellTransmissibilities
|
||||
gsl::not_null<const RigWellPath*> wellPathGeometry,
|
||||
RigTransmissibilityCondenser& transCondenser )
|
||||
{
|
||||
////
|
||||
// If fracture has orientation Azimuth or Transverse, assume only radial inflow
|
||||
// If fracture has orientation Azimuth (without user-defined perforation length) or Transverse,
|
||||
// assume only radial inflow
|
||||
bool useRadialInflow = ( fracTemplate->orientationType() == RimFractureTemplate::AZIMUTH &&
|
||||
!fracTemplate->useUserDefinedPerforationLength() ) ||
|
||||
fracTemplate->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH;
|
||||
|
||||
if ( fracTemplate->orientationType() == RimFractureTemplate::AZIMUTH ||
|
||||
fracTemplate->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH )
|
||||
if ( useRadialInflow )
|
||||
{
|
||||
std::pair<size_t, size_t> wellCellIJ = fractureGrid->fractureCellAtWellCenter();
|
||||
size_t wellCellIndex = fractureGrid->getGlobalIndexFromIJ( wellCellIJ.first, wellCellIJ.second );
|
||||
@ -630,12 +636,27 @@ void RicExportFractureCompletionsImpl::calculateFractureToWellTransmissibilities
|
||||
{ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, wellCellIndex },
|
||||
radialTrans );
|
||||
}
|
||||
else if ( fracTemplate->orientationType() == RimFractureTemplate::ALONG_WELL_PATH )
|
||||
else
|
||||
{
|
||||
////
|
||||
// If fracture has orientation along well, linear inflow along well and radial flow at endpoints
|
||||
std::vector<cvf::Vec3d> wellPathPoints;
|
||||
|
||||
RigWellPathStimplanIntersector wellFractureIntersector( wellPathGeometry, fracture );
|
||||
if ( fracTemplate->orientationType() == RimFractureTemplate::ALONG_WELL_PATH )
|
||||
{
|
||||
// If fracture has orientation along well, linear inflow along well and radial flow at endpoints
|
||||
wellPathPoints =
|
||||
wellPathGeometry->wellPathPointsIncludingInterpolatedIntersectionPoint( fracture->fractureMD() );
|
||||
}
|
||||
else
|
||||
{
|
||||
// If fracture has azimuth orientation with user-defined perforation length use linear inflow along
|
||||
// well and radial flow at endpoints on a well path which is rotated into the fracture plane.
|
||||
CAF_ASSERT( fracTemplate->orientationType() == RimFractureTemplate::AZIMUTH );
|
||||
CAF_ASSERT( fracTemplate->useUserDefinedPerforationLength() );
|
||||
|
||||
wellPathPoints = computeWellPointsInFracturePlane( fracture, wellPathGeometry );
|
||||
}
|
||||
|
||||
RigWellPathStimplanIntersector wellFractureIntersector( wellPathPoints, fracture );
|
||||
const std::map<size_t, RigWellPathStimplanIntersector::WellCellIntersection>& fractureWellCells =
|
||||
wellFractureIntersector.intersections();
|
||||
|
||||
@ -671,6 +692,87 @@ void RicExportFractureCompletionsImpl::calculateFractureToWellTransmissibilities
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3d>
|
||||
RicExportFractureCompletionsImpl::computeWellPointsInFracturePlane( gsl::not_null<const RimFracture*> fracture,
|
||||
gsl::not_null<const RigWellPath*> wellPathGeometry )
|
||||
|
||||
{
|
||||
std::vector<cvf::Vec3d> wellPathPoints =
|
||||
wellPathGeometry->wellPathPointsIncludingInterpolatedIntersectionPoint( fracture->fractureMD() );
|
||||
|
||||
RiaLogging::info( "Using user-defined perforation length on azimuth fracture." );
|
||||
RiaLogging::info( QString( "Perforation length: %1" ).arg( fracture->perforationLength() ) );
|
||||
double startMd = fracture->fractureMD() - fracture->perforationLength() / 2.0;
|
||||
double endMd = fracture->fractureMD() + fracture->perforationLength() / 2.0;
|
||||
|
||||
cvf::Vec3d anchorPosition = wellPathGeometry->interpolatedPointAlongWellPath( fracture->fractureMD() );
|
||||
|
||||
auto coordsAndMd = wellPathGeometry->clippedPointSubset( startMd, endMd );
|
||||
|
||||
auto wellPathCoords = coordsAndMd.first;
|
||||
cvf::Vec3d startPos = wellPathCoords.front();
|
||||
cvf::Vec3d endPos = wellPathCoords.back();
|
||||
|
||||
cvf::Vec3d wellPathTangent = endPos - startPos;
|
||||
|
||||
cvf::Plane fracturePlane;
|
||||
auto fractureTransform = fracture->transformMatrix();
|
||||
fracturePlane.setFromPointAndNormal( fractureTransform.translation(),
|
||||
static_cast<cvf::Vec3d>( fractureTransform.col( 2 ) ) );
|
||||
|
||||
// Get the direction from the start position to the fracture plane
|
||||
cvf::Vec3d startPosInFracturePlane = fracturePlane.projectPoint( startPos );
|
||||
cvf::Vec3d directionToStartPosInFracturePlane = ( startPosInFracturePlane - anchorPosition ).getNormalized();
|
||||
cvf::Vec3d directionToStartPos = ( startPos - anchorPosition ).getNormalized();
|
||||
|
||||
auto vecToString = []( const cvf::Vec3d& vec ) {
|
||||
return QString( "[%1 %2 %3]" ).arg( vec.x() ).arg( vec.y() ).arg( vec.z() );
|
||||
};
|
||||
|
||||
RiaLogging::info( QString( "Start perforation position: %1" ).arg( vecToString( startPos ) ) );
|
||||
RiaLogging::info(
|
||||
QString( "Start perforation position in fracture plane: %1" ).arg( vecToString( startPosInFracturePlane ) ) );
|
||||
RiaLogging::info( QString( "Anchor pos: %1" ).arg( vecToString( anchorPosition ) ) );
|
||||
RiaLogging::info(
|
||||
QString( "Direction anchor to start position in plane: %1" ).arg( vecToString( directionToStartPosInFracturePlane ) ) );
|
||||
RiaLogging::info(
|
||||
QString( "Direction anchor to original start position: %1" ).arg( vecToString( directionToStartPos ) ) );
|
||||
|
||||
// Find the angle between the real direction (tangential to well path) and the fracture plane
|
||||
double angle = cvf::GeometryTools::getAngle( directionToStartPosInFracturePlane, directionToStartPos );
|
||||
RiaLogging::info( QString( "Angle: %1 degrees." ).arg( cvf::Math::toDegrees( angle ) ) );
|
||||
auto rotMat =
|
||||
cvf::GeometryTools::rotationMatrixBetweenVectors( directionToStartPos, directionToStartPosInFracturePlane );
|
||||
|
||||
auto rotatePoint = []( const cvf::Vec3d& point, const cvf::Vec3d& offset, auto rotMat ) {
|
||||
cvf::Vec3d p = point - offset;
|
||||
p.transformPoint( rotMat );
|
||||
p += offset;
|
||||
return p;
|
||||
};
|
||||
|
||||
// Rotate the well path points into the plane
|
||||
for ( auto& r : wellPathPoints )
|
||||
{
|
||||
r = rotatePoint( r, anchorPosition, rotMat );
|
||||
}
|
||||
|
||||
cvf::Vec3d transformedStartPos = rotatePoint( startPos, anchorPosition, rotMat );
|
||||
RiaLogging::info( QString( "Perforation start position: original: %1 --> adapted: %2" )
|
||||
.arg( vecToString( startPos ) )
|
||||
.arg( vecToString( transformedStartPos ) ) );
|
||||
|
||||
cvf::Vec3d transformedEndPos = rotatePoint( endPos, anchorPosition, rotMat );
|
||||
RiaLogging::info( QString( "Perforation end position: original: %1 --> adapted: %2" )
|
||||
.arg( vecToString( endPos ) )
|
||||
.arg( vecToString( transformedEndPos ) ) );
|
||||
|
||||
return wellPathPoints;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "RigCompletionData.h"
|
||||
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <gsl/gsl>
|
||||
|
||||
#include <map>
|
||||
@ -151,5 +153,8 @@ private:
|
||||
const RigMainGrid* mainGrid,
|
||||
const RigFractureGrid* fractureGrid );
|
||||
|
||||
static std::vector<cvf::Vec3d> computeWellPointsInFracturePlane( gsl::not_null<const RimFracture*> fracture,
|
||||
gsl::not_null<const RigWellPath*> wellPathGeometry );
|
||||
|
||||
static bool loadResultsByName( RigCaseCellResultsData* cellResultsData, const std::vector<QString>& resultNames );
|
||||
};
|
||||
|
@ -676,9 +676,6 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo(
|
||||
double maxSegmentLength = enableSegmentSplitting ? mswParameters->maxSegmentLength()
|
||||
: std::numeric_limits<double>::infinity();
|
||||
|
||||
double subStartMD = wellPath->fishbonesCollection()->startMD();
|
||||
double subStartTVD = RicMswTableFormatterTools::tvdFromMeasuredDepth( branch->wellPath(), subStartMD );
|
||||
|
||||
auto unitSystem = exportInfo->unitSystem();
|
||||
|
||||
for ( RimFishbones* subs : fishbonesSubs )
|
||||
@ -808,9 +805,6 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo(
|
||||
segmentOnParentBranch->addCompletion( std::move( icdCompletion ) );
|
||||
}
|
||||
}
|
||||
|
||||
subStartMD = subEndMD;
|
||||
subStartTVD = subEndTVD;
|
||||
}
|
||||
}
|
||||
exportInfo->setHasSubGridIntersections( exportInfo->hasSubGridIntersections() || foundSubGridIntersections );
|
||||
@ -1008,10 +1002,14 @@ bool RicWellPathExportMswCompletionsImpl::generatePerforationsMswExportInfo(
|
||||
auto childMswBranch = createChildMswBranch( childWellPath );
|
||||
auto childCellIntersections = generateCellSegments( eclipseCase, childWellPath );
|
||||
|
||||
// Start MD of child well path at the tie in location
|
||||
const double tieInOnParentWellPath =
|
||||
childWellPath->wellPathTieIn() ? childWellPath->wellPathTieIn()->tieInMeasuredDepth() : initialMD;
|
||||
|
||||
if ( generatePerforationsMswExportInfo( eclipseCase,
|
||||
childWellPath,
|
||||
timeStep,
|
||||
initialMD,
|
||||
tieInOnParentWellPath,
|
||||
childCellIntersections,
|
||||
exportInfo,
|
||||
childMswBranch.get() ) )
|
||||
|
@ -34,9 +34,9 @@
|
||||
#include "RimFractureContainment.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimFractureTemplateCollection.h"
|
||||
#include "RimMeshFractureTemplate.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimStimPlanFractureTemplate.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
@ -81,8 +81,8 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport(
|
||||
|
||||
textStream << lineStart << "\n";
|
||||
|
||||
std::vector<RimStimPlanFractureTemplate*> stimPlanTemplates;
|
||||
std::vector<RimEllipseFractureTemplate*> ellipseTemplates;
|
||||
std::vector<RimMeshFractureTemplate*> stimPlanTemplates;
|
||||
std::vector<RimEllipseFractureTemplate*> ellipseTemplates;
|
||||
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
@ -101,7 +101,7 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport(
|
||||
continue;
|
||||
}
|
||||
|
||||
auto stimPlanTemplate = dynamic_cast<RimStimPlanFractureTemplate*>( fracTemplate );
|
||||
auto stimPlanTemplate = dynamic_cast<RimMeshFractureTemplate*>( fracTemplate );
|
||||
if ( stimPlanTemplate )
|
||||
{
|
||||
stimPlanTemplates.push_back( stimPlanTemplate );
|
||||
@ -269,7 +269,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createWellFileLocationText( co
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFileLocationText(
|
||||
const std::vector<RimStimPlanFractureTemplate*>& stimPlanTemplates ) const
|
||||
const std::vector<RimMeshFractureTemplate*>& stimPlanTemplates ) const
|
||||
{
|
||||
if ( stimPlanTemplates.empty() ) return "";
|
||||
|
||||
@ -307,7 +307,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFileLocationText
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicWellPathFractureTextReportFeatureImpl::createStimPlanFractureText(
|
||||
const std::vector<RimStimPlanFractureTemplate*>& stimPlanTemplates ) const
|
||||
const std::vector<RimMeshFractureTemplate*>& stimPlanTemplates ) const
|
||||
{
|
||||
if ( stimPlanTemplates.empty() ) return "";
|
||||
|
||||
@ -584,7 +584,9 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureInstancesText(
|
||||
formatter.add( fracture->tilt() );
|
||||
|
||||
if ( fracture->fractureTemplate() &&
|
||||
fracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH )
|
||||
( fracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH ||
|
||||
( fracture->fractureTemplate()->orientationType() == RimFractureTemplate::AZIMUTH &&
|
||||
fracture->fractureTemplate()->useUserDefinedPerforationLength() ) ) )
|
||||
{
|
||||
formatter.add( fracture->perforationLength() );
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class RimWellPathFracture;
|
||||
class RimEclipseCase;
|
||||
class RimFractureTemplate;
|
||||
class RimEllipseFractureTemplate;
|
||||
class RimStimPlanFractureTemplate;
|
||||
class RimMeshFractureTemplate;
|
||||
class RifTextDataTableFormatter;
|
||||
class RicWellPathFractureReportItem;
|
||||
|
||||
@ -43,8 +43,8 @@ public:
|
||||
|
||||
private:
|
||||
QString createWellFileLocationText( const std::vector<RimWellPath*>& wellPaths ) const;
|
||||
QString createStimPlanFileLocationText( const std::vector<RimStimPlanFractureTemplate*>& stimPlanTemplates ) const;
|
||||
QString createStimPlanFractureText( const std::vector<RimStimPlanFractureTemplate*>& stimPlanTemplates ) const;
|
||||
QString createStimPlanFileLocationText( const std::vector<RimMeshFractureTemplate*>& stimPlanTemplates ) const;
|
||||
QString createStimPlanFractureText( const std::vector<RimMeshFractureTemplate*>& stimPlanTemplates ) const;
|
||||
QString createEllipseFractureText( const std::vector<RimEllipseFractureTemplate*>& ellipseTemplates ) const;
|
||||
QString createFractureText( const std::vector<RimFractureTemplate*>& fractureTemplates ) const;
|
||||
QString createFractureInstancesText( const std::vector<RimWellPathFracture*>& fractureTemplates ) const;
|
||||
|
@ -19,6 +19,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicEclipseShowOnlyFaultFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRenameCaseFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicImportRoffCaseFeature.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -42,6 +43,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicEclipseShowOnlyFaultFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRenameCaseFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicImportRoffCaseFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
@ -19,13 +19,18 @@
|
||||
|
||||
#include "RicAddEclipseInputPropertyFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseInputPropertyCollection.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimRoffCase.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "RiuFileDialogTools.h"
|
||||
|
||||
@ -44,6 +49,7 @@ bool RicAddEclipseInputPropertyFeature::isCommandEnabled()
|
||||
{
|
||||
return caf::SelectionManager::instance()->selectedItemOfType<RimEclipseInputCase>() ||
|
||||
caf::SelectionManager::instance()->selectedItemOfType<RimEclipseResultCase>() ||
|
||||
caf::SelectionManager::instance()->selectedItemOfType<RimRoffCase>() ||
|
||||
caf::SelectionManager::instance()->selectedItemOfType<RimEclipseCellColors>() ||
|
||||
caf::SelectionManager::instance()->selectedItemOfType<RimEclipseView>();
|
||||
}
|
||||
@ -67,10 +73,13 @@ void RicAddEclipseInputPropertyFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QString defaultDir = app->lastUsedDialogDirectoryWithFallback( "INPUT_FILES", casePath );
|
||||
QStringList fileNames = RiuFileDialogTools::getOpenFileNames( Riu3DMainWindowTools::mainWindowWidget(),
|
||||
QString filePattern = RicImportGeneralDataFeature::getFilePattern( { RiaDefines::ImportFileType::ECLIPSE_INPUT_FILE,
|
||||
RiaDefines::ImportFileType::ROFF_FILE },
|
||||
true );
|
||||
QStringList fileNames = RiuFileDialogTools::getOpenFileNames( Riu3DMainWindowTools::mainWindowWidget(),
|
||||
"Select Eclipse Input Property Files",
|
||||
defaultDir,
|
||||
"All Files (*.* *)" );
|
||||
filePattern );
|
||||
|
||||
if ( fileNames.isEmpty() ) return;
|
||||
|
||||
|
@ -61,7 +61,7 @@ std::vector<RimEclipsePropertyFilterCollection*> RicEclipsePropertyFilterFeature
|
||||
void RicEclipsePropertyFilterFeatureImpl::addPropertyFilter( RimEclipsePropertyFilterCollection* propertyFilterCollection )
|
||||
{
|
||||
RimEclipsePropertyFilter* propertyFilter = new RimEclipsePropertyFilter();
|
||||
propertyFilterCollection->propertyFilters.push_back( propertyFilter );
|
||||
propertyFilterCollection->propertyFiltersField().push_back( propertyFilter );
|
||||
setDefaults( propertyFilter );
|
||||
|
||||
propertyFilterCollection->reservoirView()->scheduleGeometryRegen( PROPERTY_FILTERED );
|
||||
@ -69,6 +69,8 @@ void RicEclipsePropertyFilterFeatureImpl::addPropertyFilter( RimEclipsePropertyF
|
||||
|
||||
propertyFilterCollection->updateConnectedEditors();
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter, false );
|
||||
|
||||
propertyFilterCollection->onChildAdded( nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -78,7 +80,7 @@ void RicEclipsePropertyFilterFeatureImpl::insertPropertyFilter( RimEclipseProper
|
||||
size_t index )
|
||||
{
|
||||
RimEclipsePropertyFilter* propertyFilter = new RimEclipsePropertyFilter();
|
||||
propertyFilterCollection->propertyFilters.insertAt( static_cast<int>( index ), propertyFilter );
|
||||
propertyFilterCollection->propertyFiltersField().insertAt( static_cast<int>( index ), propertyFilter );
|
||||
setDefaults( propertyFilter );
|
||||
|
||||
propertyFilterCollection->reservoirView()->scheduleGeometryRegen( PROPERTY_FILTERED );
|
||||
|
@ -59,8 +59,8 @@ void RicEclipsePropertyFilterInsertExec::redo()
|
||||
RimEclipsePropertyFilterCollection* propertyFilterCollection = nullptr;
|
||||
m_propertyFilter->firstAncestorOrThisOfTypeAsserted( propertyFilterCollection );
|
||||
|
||||
size_t index = propertyFilterCollection->propertyFilters.indexOf( m_propertyFilter );
|
||||
CVF_ASSERT( index < propertyFilterCollection->propertyFilters.size() );
|
||||
size_t index = propertyFilterCollection->propertyFiltersField().indexOf( m_propertyFilter );
|
||||
CVF_ASSERT( index < propertyFilterCollection->propertyFilters().size() );
|
||||
|
||||
RicEclipsePropertyFilterFeatureImpl::insertPropertyFilter( propertyFilterCollection, index );
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ void RicEclipsePropertyFilterNewExec::redo()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicEclipsePropertyFilterNewExec::undo()
|
||||
{
|
||||
m_propertyFilterCollection->propertyFilters.erase( m_propertyFilterCollection->propertyFilters.size() - 1 );
|
||||
m_propertyFilterCollection->propertyFiltersField().erase( m_propertyFilterCollection->propertyFilters().size() - 1 );
|
||||
|
||||
m_propertyFilterCollection->updateConnectedEditors();
|
||||
}
|
||||
|
@ -75,6 +75,6 @@ void RicImportEclipseCaseFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicImportEclipseCaseFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Case48x48.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/Case.svg" ) );
|
||||
actionToSetup->setText( "Import Eclipse Case" );
|
||||
}
|
||||
|
@ -21,10 +21,6 @@
|
||||
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
|
@ -19,20 +19,6 @@
|
||||
|
||||
#include "RicImportInputEclipseCaseFeature.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPorosityModel.h"
|
||||
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicImportInputEclipseCaseFeature, "RicImportInputEclipseCaseFeature" );
|
||||
|
@ -21,12 +21,6 @@
|
||||
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class QStringList;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
// Copyright (C) 2022- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -16,43 +16,33 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicRunAdvFaultReactAssessmentFeature.h"
|
||||
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimFaultRASettings.h"
|
||||
#include "RicImportRoffCaseFeature.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicRunAdvFaultReactAssessmentFeature, "RicRunAdvFaultReactAssessmentFeature" );
|
||||
CAF_CMD_SOURCE_INIT( RicImportRoffCaseFeature, "RicImportRoffCaseFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicRunAdvFaultReactAssessmentFeature::isCommandEnabled()
|
||||
bool RicImportRoffCaseFeature::isCommandEnabled()
|
||||
{
|
||||
RimFaultInViewCollection* faultColl = faultCollection();
|
||||
|
||||
if ( faultColl )
|
||||
{
|
||||
return faultColl->faultRAAdvancedEnabled();
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunAdvFaultReactAssessmentFeature::onActionTriggered( bool isChecked )
|
||||
void RicImportRoffCaseFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
runAdvancedProcessing( selectedFaultID() );
|
||||
RicImportGeneralDataFeature::openFileDialog( RiaDefines::ImportFileType::ROFF_FILE );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunAdvFaultReactAssessmentFeature::setupActionLook( QAction* actionToSetup )
|
||||
void RicImportRoffCaseFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/fault_react_24x24.png" ) );
|
||||
actionToSetup->setText( "Run Advanced Processing" );
|
||||
actionToSetup->setIcon( QIcon( ":/EclipseInput48x48.png" ) );
|
||||
actionToSetup->setText( "Import Roff Case" );
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
// Copyright (C) 2022- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -18,17 +18,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RicRunFaultReactAssessmentFeature.h"
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicRunAdvFaultReactAssessmentFeature : public RicRunFaultReactAssessmentFeature
|
||||
class RicImportRoffCaseFeature : public RicImportGeneralDataFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
bool isCommandEnabled() override;
|
||||
};
|
@ -134,7 +134,7 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
|
||||
|
||||
if ( !worked )
|
||||
{
|
||||
RiaLogging::error( QString( "Unable to write grid to '%1'" ).arg( exportSettings.exportGridFilename ) );
|
||||
RiaLogging::error( QString( "Unable to write grid to '%1'" ).arg( exportSettings.exportGridFilename() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -78,8 +78,7 @@ RicExportEclipseSectorModelUi::RicExportEclipseSectorModelUi()
|
||||
CAF_PDM_InitObject( "Export Visible Cells as Eclipse Input Grid" );
|
||||
|
||||
CAF_PDM_InitField( &exportGrid, "ExportGrid", true, "Export Grid Data", "", "Includes COORD, ZCORN and ACTNUM", "" );
|
||||
CAF_PDM_InitField( &exportGridFilename, "ExportGridFilename", QString(), "Grid File Name" );
|
||||
exportGridFilename.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
CAF_PDM_InitField( &m_exportGridFilename, "ExportGridFilename", QString(), "Grid File Name" );
|
||||
CAF_PDM_InitField( &exportInLocalCoordinates,
|
||||
"ExportInLocalCoords",
|
||||
false,
|
||||
@ -107,8 +106,7 @@ RicExportEclipseSectorModelUi::RicExportEclipseSectorModelUi()
|
||||
CAF_PDM_InitFieldNoDefault( &exportFaults, "ExportFaults", "Export Fault Data" );
|
||||
exportFaults = EXPORT_TO_SINGLE_SEPARATE_FILE;
|
||||
|
||||
CAF_PDM_InitField( &exportFaultsFilename, "ExportFaultsFilename", QString(), "Faults File Name" );
|
||||
exportFaultsFilename.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
CAF_PDM_InitField( &m_exportFaultsFilename, "ExportFaultsFilename", QString(), "Faults File Name" );
|
||||
|
||||
QString ijkLabel = "Cell Count I, J, K";
|
||||
CAF_PDM_InitField( &refinementCountI, "RefinementCountI", 1, ijkLabel );
|
||||
@ -116,14 +114,16 @@ RicExportEclipseSectorModelUi::RicExportEclipseSectorModelUi()
|
||||
CAF_PDM_InitField( &refinementCountK, "RefinementCountK", 1, "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &exportParameters, "ExportParams", "Export Parameters" );
|
||||
CAF_PDM_InitField( &exportParametersFilename, "ExportParamsFilename", QString(), "File Name" );
|
||||
exportParametersFilename.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
CAF_PDM_InitField( &m_exportParametersFilename, "ExportParamsFilename", QString(), "File Name" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &selectedKeywords, "ExportMainKeywords", "Keywords to Export" );
|
||||
|
||||
exportGridFilename = defaultGridFileName();
|
||||
exportParametersFilename = defaultResultsFileName();
|
||||
exportFaultsFilename = defaultFaultsFileName();
|
||||
CAF_PDM_InitFieldNoDefault( &m_exportFolder, "ExportFolder", "Export Folder" );
|
||||
m_exportFolder = defaultFolder();
|
||||
|
||||
m_exportGridFilename = defaultGridFileName();
|
||||
m_exportParametersFilename = defaultResultsFileName();
|
||||
m_exportFaultsFilename = defaultFaultsFileName();
|
||||
|
||||
m_tabNames << "Grid Data";
|
||||
m_tabNames << "Parameters";
|
||||
@ -241,7 +241,7 @@ void RicExportEclipseSectorModelUi::defineEditorAttribute( const caf::PdmFieldHa
|
||||
|
||||
auto* lineEditorAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
|
||||
|
||||
if ( field == &exportParametersFilename || field == &exportGridFilename || field == &exportFaultsFilename )
|
||||
if ( field == &m_exportParametersFilename || field == &m_exportGridFilename || field == &m_exportFaultsFilename )
|
||||
{
|
||||
auto* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
|
||||
if ( myAttr )
|
||||
@ -287,6 +287,15 @@ void RicExportEclipseSectorModelUi::defineEditorAttribute( const caf::PdmFieldHa
|
||||
lineEditorAttr->validator = new QIntValidator( 1, (int)gridDimensions.z(), nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
if ( field == &m_exportFolder )
|
||||
{
|
||||
caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
|
||||
if ( myAttr )
|
||||
{
|
||||
myAttr->m_selectDirectory = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -296,10 +305,12 @@ void RicExportEclipseSectorModelUi::defineUiOrdering( QString uiConfigName, caf:
|
||||
{
|
||||
if ( uiConfigName == m_tabNames[0] )
|
||||
{
|
||||
uiOrdering.add( &m_exportFolder );
|
||||
|
||||
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Grid Export" );
|
||||
gridGroup->add( &exportGrid );
|
||||
gridGroup->add( &exportGridFilename );
|
||||
exportGridFilename.uiCapability()->setUiReadOnly( !exportGrid() );
|
||||
gridGroup->add( &m_exportGridFilename );
|
||||
m_exportGridFilename.uiCapability()->setUiReadOnly( !exportGrid() );
|
||||
gridGroup->add( &exportInLocalCoordinates );
|
||||
exportInLocalCoordinates.uiCapability()->setUiReadOnly( !exportGrid() );
|
||||
|
||||
@ -336,7 +347,7 @@ void RicExportEclipseSectorModelUi::defineUiOrdering( QString uiConfigName, caf:
|
||||
{
|
||||
if ( exportFaults() == EXPORT_TO_SINGLE_SEPARATE_FILE )
|
||||
{
|
||||
faultsGroup->add( &exportFaultsFilename );
|
||||
faultsGroup->add( &m_exportFaultsFilename );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -349,7 +360,7 @@ void RicExportEclipseSectorModelUi::defineUiOrdering( QString uiConfigName, caf:
|
||||
{
|
||||
if ( exportParameters() == EXPORT_TO_SINGLE_SEPARATE_FILE )
|
||||
{
|
||||
resultsGroup->add( &exportParametersFilename );
|
||||
resultsGroup->add( &m_exportParametersFilename );
|
||||
}
|
||||
}
|
||||
|
||||
@ -388,48 +399,6 @@ void RicExportEclipseSectorModelUi::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
applyBoundaryDefaults();
|
||||
this->updateConnectedEditors();
|
||||
}
|
||||
else if ( changedField == &exportGridFilename )
|
||||
{
|
||||
QFileInfo info( exportGridFilename() );
|
||||
QDir dirPath = info.absoluteDir();
|
||||
|
||||
if ( exportParametersFilename() == defaultResultsFileName() )
|
||||
{
|
||||
exportParametersFilename = dirPath.absoluteFilePath( "RESULTS.GRDECL" );
|
||||
}
|
||||
if ( exportFaultsFilename() == defaultFaultsFileName() )
|
||||
{
|
||||
exportFaultsFilename = dirPath.absoluteFilePath( "FAULTS.GRDECL" );
|
||||
}
|
||||
}
|
||||
else if ( changedField == &exportParametersFilename )
|
||||
{
|
||||
QFileInfo info( exportParametersFilename() );
|
||||
QDir dirPath = info.absoluteDir();
|
||||
|
||||
if ( exportGridFilename() == defaultGridFileName() )
|
||||
{
|
||||
exportGridFilename = dirPath.absoluteFilePath( "GRID.GRDECL" );
|
||||
}
|
||||
if ( exportFaultsFilename() == defaultFaultsFileName() )
|
||||
{
|
||||
exportFaultsFilename = dirPath.absoluteFilePath( "FAULTS.GRDECL" );
|
||||
}
|
||||
}
|
||||
else if ( changedField == &exportFaultsFilename )
|
||||
{
|
||||
QFileInfo info( exportFaultsFilename() );
|
||||
QDir dirPath = info.absoluteDir();
|
||||
|
||||
if ( exportGridFilename() == defaultGridFileName() )
|
||||
{
|
||||
exportGridFilename = dirPath.absoluteFilePath( "GRID.GRDECL" );
|
||||
}
|
||||
if ( exportParametersFilename() == defaultResultsFileName() )
|
||||
{
|
||||
exportParametersFilename = dirPath.absoluteFilePath( "RESULTS.GRDECL" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -533,8 +502,7 @@ QString RicExportEclipseSectorModelUi::defaultFolder() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicExportEclipseSectorModelUi::defaultGridFileName() const
|
||||
{
|
||||
QDir baseDir( defaultFolder() );
|
||||
return baseDir.absoluteFilePath( "GRID.GRDECL" );
|
||||
return "GRID.GRDECL";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -542,8 +510,7 @@ QString RicExportEclipseSectorModelUi::defaultGridFileName() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicExportEclipseSectorModelUi::defaultResultsFileName() const
|
||||
{
|
||||
QDir baseDir( defaultFolder() );
|
||||
return baseDir.absoluteFilePath( "RESULTS.GRDECL" );
|
||||
return "RESULTS.GRDECL";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -551,8 +518,7 @@ QString RicExportEclipseSectorModelUi::defaultResultsFileName() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicExportEclipseSectorModelUi::defaultFaultsFileName() const
|
||||
{
|
||||
QDir baseDir( defaultFolder() );
|
||||
return baseDir.absoluteFilePath( "FAULTS.GRDECL" );
|
||||
return "FAULTS.GRDECL";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -618,3 +584,27 @@ void RicExportEclipseSectorModelUi::removeInvalidKeywords()
|
||||
}
|
||||
selectedKeywords.v().swap( validKeywords );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicExportEclipseSectorModelUi::exportFaultsFilename() const
|
||||
{
|
||||
return m_exportFolder().path() + "/" + m_exportFaultsFilename();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicExportEclipseSectorModelUi::exportGridFilename() const
|
||||
{
|
||||
return m_exportFolder().path() + "/" + m_exportGridFilename();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicExportEclipseSectorModelUi::exportParametersFilename() const
|
||||
{
|
||||
return m_exportFolder().path() + "/" + m_exportParametersFilename();
|
||||
}
|
||||
|
@ -74,16 +74,17 @@ public:
|
||||
void applyBoundaryDefaults();
|
||||
void removeInvalidKeywords();
|
||||
|
||||
caf::PdmField<bool> exportGrid;
|
||||
caf::PdmField<QString> exportGridFilename;
|
||||
caf::PdmField<bool> exportInLocalCoordinates;
|
||||
caf::PdmField<bool> makeInvisibleCellsInactive;
|
||||
QString exportFaultsFilename() const;
|
||||
QString exportGridFilename() const;
|
||||
QString exportParametersFilename() const;
|
||||
|
||||
caf::PdmField<bool> exportGrid;
|
||||
caf::PdmField<bool> exportInLocalCoordinates;
|
||||
caf::PdmField<bool> makeInvisibleCellsInactive;
|
||||
|
||||
caf::PdmField<ResultExportOptionsEnum> exportFaults;
|
||||
caf::PdmField<QString> exportFaultsFilename;
|
||||
|
||||
caf::PdmField<ResultExportOptionsEnum> exportParameters;
|
||||
caf::PdmField<QString> exportParametersFilename;
|
||||
|
||||
caf::PdmField<std::vector<QString>> selectedKeywords;
|
||||
|
||||
@ -115,6 +116,11 @@ protected:
|
||||
QString defaultFaultsFileName() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<caf::FilePath> m_exportFolder;
|
||||
caf::PdmField<QString> m_exportFaultsFilename;
|
||||
caf::PdmField<QString> m_exportParametersFilename;
|
||||
caf::PdmField<QString> m_exportGridFilename;
|
||||
|
||||
RigEclipseCaseData* m_caseData;
|
||||
cvf::Vec3i m_visibleMin;
|
||||
cvf::Vec3i m_visibleMax;
|
||||
|
@ -64,12 +64,14 @@ RicExportToLasFileResampleUi::RicExportToLasFileResampleUi( void )
|
||||
exportFolder.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
CAF_PDM_InitField( &filePrefix, "FilePrefix", QString( "" ), "File Prefix" );
|
||||
CAF_PDM_InitField( &capitalizeFileName, "CapitalizeFileName", false, "Capitalize File Name" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &capitalizeFileName );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &curveUnitConversion, "CurveUnitConversion", "Curve Units" );
|
||||
|
||||
CAF_PDM_InitField( &activateResample, "ActivateResample", false, "Resample Curve Data" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &activateResample );
|
||||
|
||||
CAF_PDM_InitField( &resampleInterval, "ResampleInterval", 1.0, "Resample Interval [m]" );
|
||||
CAF_PDM_InitField( &resampleInterval, "ResampleInterval", 1.0, " Resample Interval [m]" );
|
||||
|
||||
CAF_PDM_InitField( &exportTvdrkb, "ExportTvdrkb", false, "Export TVDRKB" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &exportTvdrkb );
|
||||
@ -192,12 +194,8 @@ void RicExportToLasFileResampleUi::defineUiOrdering( QString uiConfigName, caf::
|
||||
uiOrdering.add( &curveUnitConversion );
|
||||
}
|
||||
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Resampling" );
|
||||
|
||||
group->add( &activateResample );
|
||||
group->add( &resampleInterval );
|
||||
}
|
||||
uiOrdering.add( &activateResample );
|
||||
uiOrdering.add( &resampleInterval );
|
||||
|
||||
caf::PdmUiGroup* tvdrkbGroup = uiOrdering.addNewGroup( "TVDRKB" );
|
||||
tvdrkbGroup->add( &exportTvdrkb );
|
||||
|
@ -225,8 +225,6 @@ void RicPlotProductionRateFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
mainPlotWindow->selectAsCurrentItem( summaryPlotToSelect );
|
||||
mainPlotWindow->setExpanded( summaryPlotToSelect );
|
||||
|
||||
mainPlotWindow->tileSubWindows();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ void RicShowContributingWellsFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
modifiedView->createDisplayModelAndRedraw();
|
||||
|
||||
std::vector<RimGridView*> viewsToUpdate;
|
||||
std::vector<Rim3dView*> viewsToUpdate;
|
||||
viewsToUpdate.push_back( modifiedView );
|
||||
|
||||
RimViewManipulator::applySourceViewCameraOnDestinationViews( eclipseView, viewsToUpdate );
|
||||
|
@ -157,7 +157,7 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells( Rim
|
||||
}
|
||||
|
||||
RimEclipsePropertyFilter* propertyFilter = new RimEclipsePropertyFilter();
|
||||
propertyFilterCollection->propertyFilters().push_back( propertyFilter );
|
||||
propertyFilterCollection->propertyFiltersField().push_back( propertyFilter );
|
||||
|
||||
propertyFilter->resultDefinition()->setEclipseCase( viewToModify->eclipseCase() );
|
||||
propertyFilter->resultDefinition()->setTofAndSelectTracer( selectedWell->name() );
|
||||
|
@ -18,9 +18,6 @@
|
||||
|
||||
#include "RicPlaceThermalFractureUsingTemplateDataFeature.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimThermalFractureTemplate.h"
|
||||
#include "RimWellPath.h"
|
||||
@ -45,38 +42,23 @@ void RicPlaceThermalFractureUsingTemplateDataFeature::onActionTriggered( bool is
|
||||
|
||||
if ( !fracture->fractureTemplate() ) return;
|
||||
|
||||
placeUsingTemplateData( fracture );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicPlaceThermalFractureUsingTemplateDataFeature::placeUsingTemplateData( RimWellPathFracture* fracture )
|
||||
{
|
||||
RimThermalFractureTemplate* thermalTemplate = dynamic_cast<RimThermalFractureTemplate*>( fracture->fractureTemplate() );
|
||||
if ( !thermalTemplate ) return;
|
||||
if ( !thermalTemplate ) return false;
|
||||
|
||||
RimWellPath* wellPath = nullptr;
|
||||
fracture->firstAncestorOrThisOfTypeAsserted( wellPath );
|
||||
|
||||
auto wellPathGeometry = wellPath->wellPathGeometry();
|
||||
if ( !wellPathGeometry ) return;
|
||||
|
||||
auto [centerPosition, rotation] = thermalTemplate->computePositionAndRotation();
|
||||
|
||||
// TODO: y conversion is workaround for strange test data
|
||||
centerPosition.y() = std::fabs( centerPosition.y() );
|
||||
centerPosition.z() *= -1.0;
|
||||
|
||||
double md = wellPathGeometry->closestMeasuredDepth( centerPosition );
|
||||
|
||||
RiaLogging::info( QString( "Placing thermal fracture. Posotion: [%1 %2 %3]" )
|
||||
.arg( centerPosition.x() )
|
||||
.arg( centerPosition.y() )
|
||||
.arg( centerPosition.z() ) );
|
||||
RiaLogging::info( QString( "Computed MD: %1" ).arg( md ) );
|
||||
|
||||
fracture->setMeasuredDepth( md );
|
||||
|
||||
fracture->setAzimuth( rotation.x() );
|
||||
fracture->setDip( rotation.y() );
|
||||
fracture->setTilt( rotation.z() );
|
||||
if ( !thermalTemplate->placeFractureUsingTemplateData( fracture ) ) return false;
|
||||
|
||||
fracture->updateConnectedEditors();
|
||||
RimProject* project = RimProject::current();
|
||||
project->reloadCompletionTypeResultsInAllViews();
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -29,6 +29,9 @@ class RicPlaceThermalFractureUsingTemplateDataFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
static bool placeUsingTemplateData( RimWellPathFracture* fracture );
|
||||
|
||||
protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
@ -8,12 +8,6 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewExec.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseTimeStepFilterFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewFaultReactAssessmentFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellIntegrityAnalysisFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunWellIntegrityAnalysisFeature.h
|
||||
)
|
||||
@ -28,12 +22,6 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewExec.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseTimeStepFilterFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewFaultReactAssessmentFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellIntegrityAnalysisFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunWellIntegrityAnalysisFeature.cpp
|
||||
)
|
||||
|
@ -1,308 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// 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 "RicNewFaultReactAssessmentFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaEclipseFileNameTools.h"
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaPreferencesGeoMech.h"
|
||||
|
||||
#include "RifFaultRAJsonWriter.h"
|
||||
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimFaultRAPreprocSettings.h"
|
||||
#include "RimFaultRASettings.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimProcess.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "RiuFileDialogTools.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafSelectionManagerTools.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QMessageBox>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicNewFaultReactAssessmentFeature, "RicNewFaultReactAssessmentFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewFaultReactAssessmentFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewFaultReactAssessmentFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimFaultRAPreprocSettings frapSettings;
|
||||
|
||||
// make sure the user has set up geomech/FRA things in preferences
|
||||
if ( !RiaPreferencesGeoMech::current()->validateFRASettings() )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
"Fault Reactivation Assessment",
|
||||
"Fault Reactivation Assessment has not been properly set up.\nPlease go to ResInsight "
|
||||
"preferences and set/check the GeoMechanical settings." );
|
||||
return;
|
||||
}
|
||||
|
||||
// ask user for preprocessing settings
|
||||
if ( !showSettingsGUI( frapSettings ) ) return;
|
||||
|
||||
if ( frapSettings.cleanBaseDirectory() )
|
||||
{
|
||||
auto reply = QMessageBox::question( nullptr,
|
||||
QString( "Clean output directory" ),
|
||||
QString( "Are you sure you want to delete all files and subfolders in the "
|
||||
"selected output directory?\n%1 " )
|
||||
.arg( frapSettings.outputBaseDirectory() ),
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::No );
|
||||
if ( reply == QMessageBox::No )
|
||||
{
|
||||
frapSettings.setCleanBaseDirectory( false );
|
||||
}
|
||||
}
|
||||
|
||||
// make sure our work dir is there
|
||||
prepareDirectory( frapSettings.outputBaseDirectory(), frapSettings.cleanBaseDirectory() );
|
||||
|
||||
// run the preproc steps needed
|
||||
if ( !runPreProc( frapSettings ) ) return;
|
||||
|
||||
QStringList gridList;
|
||||
gridList << frapSettings.outputEclipseFilename();
|
||||
|
||||
// load the new grid
|
||||
bool createView = true;
|
||||
int caseId = RiaImportEclipseCaseTools::openEclipseInputCaseFromFileNames( gridList, createView );
|
||||
if ( caseId < 0 )
|
||||
{
|
||||
QMessageBox::critical( nullptr, "Fault Reactivation Assessment", "Unable to load generated Eclipse grid." );
|
||||
return;
|
||||
}
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
RimEclipseInputCase* fraCase = dynamic_cast<RimEclipseInputCase*>( project->eclipseCaseFromCaseId( caseId ) );
|
||||
if ( fraCase == nullptr )
|
||||
{
|
||||
QMessageBox::critical( nullptr, "Fault Reactivation Assessment", "Unable to find generated Eclipse grid." );
|
||||
return;
|
||||
}
|
||||
|
||||
RimEclipseView* view = getView( fraCase );
|
||||
if ( view == nullptr )
|
||||
{
|
||||
QMessageBox::critical( nullptr, "Fault Reactivation Assessment", "Unable to find view for generated Eclipse grid." );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( view->faultCollection() )
|
||||
{
|
||||
view->faultCollection()->enableFaultRA( true );
|
||||
view->faultCollection()->faultRASettings()->initFromPreprocSettings( &frapSettings, fraCase );
|
||||
}
|
||||
|
||||
cleanUpParameterFiles();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewFaultReactAssessmentFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/fault_react_24x24.png" ) );
|
||||
actionToSetup->setText( "New Fault Reactivation Assessment" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewFaultReactAssessmentFeature::prepareDirectory( QString dirname, bool deleteExistingContent ) const
|
||||
{
|
||||
QDir dir( dirname );
|
||||
|
||||
if ( deleteExistingContent && dir.exists() )
|
||||
{
|
||||
dir.setFilter( QDir::Files | QDir::Dirs | QDir::NoSymLinks );
|
||||
|
||||
for ( auto& entry : dir.entryInfoList() )
|
||||
{
|
||||
if ( entry.isDir() && entry.fileName() != "." && entry.fileName() != ".." )
|
||||
entry.dir().removeRecursively();
|
||||
else if ( entry.isFile() )
|
||||
QFile::remove( entry.absoluteFilePath() );
|
||||
}
|
||||
}
|
||||
|
||||
dir.mkpath( "." );
|
||||
dir.mkpath( "Eclipse" );
|
||||
dir.mkpath( "Abaqus" );
|
||||
dir.mkpath( "tmp" );
|
||||
dir.mkpath( "tsurf" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewFaultReactAssessmentFeature::showSettingsGUI( RimFaultRAPreprocSettings& settings )
|
||||
{
|
||||
// get the case we should be working with
|
||||
std::vector<RimGeoMechCase*> geomechCases = caf::selectedObjectsByTypeStrict<RimGeoMechCase*>();
|
||||
std::vector<RimEclipseResultCase*> eclipseCases = caf::selectedObjectsByTypeStrict<RimEclipseResultCase*>();
|
||||
if ( geomechCases.empty() && eclipseCases.empty() ) return false;
|
||||
|
||||
// get base directory for our work, should be a new, empty folder somewhere
|
||||
QString defaultDir =
|
||||
RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder( "FAULT_REACT_ASSESSMENT" );
|
||||
QString baseDir = RiuFileDialogTools::getExistingDirectory( nullptr, tr( "Select Working Directory" ), defaultDir );
|
||||
if ( baseDir.isNull() ) return false;
|
||||
RiaApplication::instance()->setLastUsedDialogDirectory( "FAULT_REACT_ASSESSMENT", baseDir );
|
||||
|
||||
// ask the user for the options we need in the preproc step
|
||||
if ( !geomechCases.empty() ) settings.setGeoMechCase( geomechCases[0] );
|
||||
if ( !eclipseCases.empty() ) settings.setEclipseCase( eclipseCases[0] );
|
||||
settings.setOutputBaseDirectory( baseDir );
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog( nullptr,
|
||||
&settings,
|
||||
"Fault Reactivation Assessment Preprocessing",
|
||||
"",
|
||||
QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
|
||||
if ( settings.geoMechSelected() )
|
||||
propertyDialog.resize( QSize( 520, 520 ) );
|
||||
else
|
||||
propertyDialog.resize( QSize( 520, 420 ) );
|
||||
|
||||
// make sure we always have an eclipse case selected
|
||||
while ( true )
|
||||
{
|
||||
if ( propertyDialog.exec() != QDialog::Accepted ) break;
|
||||
if ( settings.eclipseCase() != nullptr ) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewFaultReactAssessmentFeature::runPreProc( RimFaultRAPreprocSettings& settings )
|
||||
{
|
||||
caf::ProgressInfo runProgress( 2, "Running preprocessing, please wait..." );
|
||||
|
||||
// is geomech enabled? If so, run preproc script to generate rpt files
|
||||
if ( settings.geoMechSelected() )
|
||||
{
|
||||
QString errorText;
|
||||
if ( !RifFaultRAJSonWriter::writeToPreprocFile( settings, errorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr, "Fault Reactivation Assessment Preprocessing", errorText );
|
||||
return false;
|
||||
}
|
||||
|
||||
runProgress.setProgressDescription( "Preproc script." );
|
||||
|
||||
// run the python preprocessing script
|
||||
QString command = RiaPreferencesGeoMech::current()->geomechFRAPreprocCommand();
|
||||
QStringList parameters = settings.preprocParameterList();
|
||||
|
||||
addParameterFileForCleanUp( settings.preprocParameterFilename() );
|
||||
|
||||
RimProcess process;
|
||||
process.setCommand( command );
|
||||
process.setParameters( parameters );
|
||||
if ( !process.execute() )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
"Fault Reactivation Assessment Preprocessing",
|
||||
"Failed to run preprocessing script. Check log window for additional information." );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
runProgress.incrementProgress();
|
||||
runProgress.setProgressDescription( "Macris prepare command." );
|
||||
|
||||
// run the java macris program in prepare mode
|
||||
QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand();
|
||||
QStringList parameters = settings.macrisPrepareParameterList();
|
||||
|
||||
RimProcess process;
|
||||
process.setCommand( command );
|
||||
process.setParameters( parameters );
|
||||
if ( !process.execute() )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
"Fault Reactivation Assessment Preprocessing",
|
||||
"Failed to run Macrix prepare command. Check log window for additional information." );
|
||||
return false;
|
||||
}
|
||||
|
||||
runProgress.incrementProgress();
|
||||
|
||||
return true;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView* RicNewFaultReactAssessmentFeature::getView( RimEclipseInputCase* eCase )
|
||||
{
|
||||
std::vector<RimEclipseView*> views;
|
||||
eCase->descendantsOfType( views );
|
||||
if ( views.size() > 0 ) return views[0];
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewFaultReactAssessmentFeature::addParameterFileForCleanUp( QString filename )
|
||||
{
|
||||
m_parameterFilesToCleanUp.push_back( filename );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewFaultReactAssessmentFeature::cleanUpParameterFiles()
|
||||
{
|
||||
if ( !RiaPreferencesGeoMech::current()->keepTemporaryFiles() )
|
||||
{
|
||||
for ( auto& filename : m_parameterFilesToCleanUp )
|
||||
{
|
||||
if ( QFile::exists( filename ) ) QFile::remove( filename );
|
||||
}
|
||||
}
|
||||
m_parameterFilesToCleanUp.clear();
|
||||
}
|
@ -97,7 +97,7 @@ void RicNewWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked )
|
||||
void RicNewWellIntegrityAnalysisFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/WellIntAnalysis.png" ) );
|
||||
actionToSetup->setText( "New Well Integration Analysis at this Depth" );
|
||||
actionToSetup->setText( "New Well Integrity Analysis at this Depth" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -1,75 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// 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 "RicRunBasicFaultReactAssessment3dFeature.h"
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimFaultRASettings.h"
|
||||
#include "RimGridView.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QVariant>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicRunBasicFaultReactAssessment3dFeature, "RicRunBasicFaultReactAssessment3dFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicRunBasicFaultReactAssessment3dFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunBasicFaultReactAssessment3dFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
QVariant userData = this->userData();
|
||||
if ( userData.isNull() || userData.type() != QVariant::String ) return;
|
||||
|
||||
QString faultName = userData.toString();
|
||||
|
||||
int faultID = faultIDFromName( faultName );
|
||||
if ( faultID >= 0 ) runBasicProcessing( faultID );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunBasicFaultReactAssessment3dFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/fault_react_24x24.png" ) );
|
||||
actionToSetup->setText( "Run Basic Processing" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFaultInViewCollection* RicRunBasicFaultReactAssessment3dFeature::faultCollection()
|
||||
{
|
||||
RimGridView* viewOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
|
||||
RimEclipseView* theView = dynamic_cast<RimEclipseView*>( viewOrComparisonView );
|
||||
|
||||
CAF_ASSERT( theView );
|
||||
|
||||
return theView->faultCollection();
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// 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 "RicRunBasicFaultReactAssessmentFeature.h"
|
||||
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimFaultRASettings.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicRunBasicFaultReactAssessmentFeature, "RicRunBasicFaultReactAssessmentFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicRunBasicFaultReactAssessmentFeature::isCommandEnabled()
|
||||
{
|
||||
RimFaultInViewCollection* faultColl = faultCollection();
|
||||
if ( faultColl )
|
||||
{
|
||||
return ( faultColl->faultRAEnabled() );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunBasicFaultReactAssessmentFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
runBasicProcessing( selectedFaultID() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunBasicFaultReactAssessmentFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/fault_react_24x24.png" ) );
|
||||
actionToSetup->setText( "Run Basic Processing" );
|
||||
}
|
@ -1,391 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// 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 "RicRunFaultReactAssessmentFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaEclipseFileNameTools.h"
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaPreferencesGeoMech.h"
|
||||
#include "RiaResultNames.h"
|
||||
|
||||
#include "RifFaultRAJsonWriter.h"
|
||||
#include "RifFaultRAXmlWriter.h"
|
||||
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFaultInView.h"
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimFaultRAPostprocSettings.h"
|
||||
#include "RimFaultRAPreprocSettings.h"
|
||||
#include "RimFaultRASettings.h"
|
||||
#include "RimFileSurface.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProcess.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSurface.h"
|
||||
#include "RimSurfaceCollection.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "RiuFileDialogTools.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafSelectionManagerTools.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QMessageBox>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicRunFaultReactAssessmentFeature::RicRunFaultReactAssessmentFeature()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFaultInViewCollection* RicRunFaultReactAssessmentFeature::faultCollection()
|
||||
{
|
||||
RimFaultInViewCollection* faultColl =
|
||||
dynamic_cast<RimFaultInViewCollection*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
|
||||
if ( faultColl ) return faultColl;
|
||||
|
||||
RimFaultInView* selObj = dynamic_cast<RimFaultInView*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( selObj )
|
||||
{
|
||||
if ( !selObj->name().startsWith( RiaResultNames::faultReactAssessmentPrefix() ) ) return nullptr;
|
||||
selObj->firstAncestorOrThisOfType( faultColl );
|
||||
}
|
||||
|
||||
return faultColl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RicRunFaultReactAssessmentFeature::faultIDFromName( QString faultName ) const
|
||||
{
|
||||
int retval = -1;
|
||||
|
||||
QString lookFor = RiaResultNames::faultReactAssessmentPrefix();
|
||||
QString name = faultName;
|
||||
if ( !name.startsWith( lookFor ) ) return retval;
|
||||
|
||||
name = name.mid( lookFor.length() );
|
||||
if ( name.size() == 0 ) return retval;
|
||||
|
||||
bool bOK;
|
||||
retval = name.toInt( &bOK );
|
||||
if ( !bOK ) retval = -1;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RicRunFaultReactAssessmentFeature::selectedFaultID()
|
||||
{
|
||||
int retval = -1;
|
||||
RimFaultInView* selObj = dynamic_cast<RimFaultInView*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( selObj )
|
||||
{
|
||||
return faultIDFromName( selObj->name() );
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicRunFaultReactAssessmentFeature::runPostProcessing( int faultID, RimFaultRASettings* settings )
|
||||
{
|
||||
RimFaultRAPostprocSettings postproc_settings;
|
||||
postproc_settings.initFromSettings( settings );
|
||||
|
||||
QString outErrorText;
|
||||
if ( !RifFaultRAJSonWriter::writeToPostprocFile( faultID, &postproc_settings, outErrorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Unable to write postproc parameter file! " + outErrorText );
|
||||
return false;
|
||||
}
|
||||
|
||||
QString command = RiaPreferencesGeoMech::current()->geomechFRAPostprocCommand();
|
||||
QStringList parameters = postproc_settings.postprocCommandParameters( faultID );
|
||||
|
||||
RimProcess process;
|
||||
process.setCommand( command );
|
||||
process.setParameters( parameters );
|
||||
|
||||
addParameterFileForCleanUp( postproc_settings.postprocParameterFilename( faultID ) );
|
||||
|
||||
if ( !process.execute() )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Failed to run post processing command. Check log window for additional "
|
||||
"information." );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunFaultReactAssessmentFeature::addParameterFileForCleanUp( QString filename )
|
||||
{
|
||||
m_parameterFilesToCleanUp.push_back( filename );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunFaultReactAssessmentFeature::cleanUpParameterFiles()
|
||||
{
|
||||
if ( !RiaPreferencesGeoMech::current()->keepTemporaryFiles() )
|
||||
{
|
||||
for ( auto& filename : m_parameterFilesToCleanUp )
|
||||
{
|
||||
removeFile( filename );
|
||||
}
|
||||
}
|
||||
m_parameterFilesToCleanUp.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunFaultReactAssessmentFeature::removeFile( QString filename )
|
||||
{
|
||||
if ( QFile::exists( filename ) ) QFile::remove( filename );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSurfaceCollection* RicRunFaultReactAssessmentFeature::surfaceCollection()
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
RimSurfaceCollection* surfColl = proj->activeOilField()->surfaceCollection();
|
||||
|
||||
if ( surfColl )
|
||||
{
|
||||
for ( auto& subColl : surfColl->subCollections() )
|
||||
{
|
||||
if ( subColl->collectionName() == "FaultRA" )
|
||||
{
|
||||
return subColl;
|
||||
}
|
||||
}
|
||||
|
||||
// No FaultRA collection found, make one
|
||||
RimSurfaceCollection* fraCollection = new RimSurfaceCollection();
|
||||
fraCollection->setCollectionName( "FaultRA" );
|
||||
surfColl->addSubCollection( fraCollection );
|
||||
return fraCollection;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunFaultReactAssessmentFeature::reloadSurfaces( RimFaultRASettings* settings )
|
||||
{
|
||||
RimSurfaceCollection* surfColl = surfaceCollection();
|
||||
if ( !surfColl ) return;
|
||||
|
||||
// get rid of any files removed by the processing
|
||||
surfColl->removeMissingFileSurfaces();
|
||||
|
||||
bool showLegendInView = false;
|
||||
|
||||
// ask the collection to reload the existing files
|
||||
surfColl->reloadSurfaces( surfColl->surfaces(), showLegendInView );
|
||||
|
||||
// get all the files in the folder, skip the ones we alreday have
|
||||
QStringList newFiles;
|
||||
|
||||
QDirIterator tsurfIt( settings->tsurfOutputDirectory(), { "*.ts" }, QDir::Files );
|
||||
while ( tsurfIt.hasNext() )
|
||||
{
|
||||
QString filename = tsurfIt.next();
|
||||
if ( surfColl->containsFileSurface( filename ) ) continue;
|
||||
newFiles << filename;
|
||||
}
|
||||
|
||||
// import the new surfaces
|
||||
surfColl->importSurfacesFromFiles( newFiles, showLegendInView );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunFaultReactAssessmentFeature::runBasicProcessing( int faultID )
|
||||
{
|
||||
RimFaultInViewCollection* coll = faultCollection();
|
||||
if ( coll == nullptr ) return;
|
||||
|
||||
RimFaultRASettings* fraSettings = coll->faultRASettings();
|
||||
if ( fraSettings == nullptr ) return;
|
||||
|
||||
caf::ProgressInfo runProgress( 3, "Running Basic Fault RA processing, please wait..." );
|
||||
|
||||
{
|
||||
runProgress.setProgressDescription( "Macris calculate command." );
|
||||
QString paramfilename = fraSettings->basicParameterXMLFilename( faultID );
|
||||
|
||||
RifFaultRAXmlWriter xmlwriter( fraSettings );
|
||||
QString outErrorText;
|
||||
if ( !xmlwriter.writeCalculateFile( paramfilename, faultID, outErrorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Unable to write parameter file! " + outErrorText );
|
||||
return;
|
||||
}
|
||||
|
||||
addParameterFileForCleanUp( paramfilename );
|
||||
|
||||
// remove any existing database file
|
||||
removeFile( fraSettings->basicMacrisDatabase() );
|
||||
|
||||
// run the java macris program in calculate mode
|
||||
QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand();
|
||||
QStringList parameters = fraSettings->basicMacrisParameters( faultID );
|
||||
|
||||
RimProcess process;
|
||||
process.setCommand( command );
|
||||
process.setParameters( parameters );
|
||||
if ( !process.execute() )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
"Basic Fault Reactivation Assessment Processing",
|
||||
"Failed to run Macris calculate command. Check log window for additional "
|
||||
"information." );
|
||||
cleanUpParameterFiles();
|
||||
return;
|
||||
}
|
||||
|
||||
runProgress.incrementProgress();
|
||||
}
|
||||
|
||||
runProgress.setProgressDescription( "Generating surface results." );
|
||||
|
||||
if ( runPostProcessing( faultID, fraSettings ) )
|
||||
{
|
||||
runProgress.incrementProgress();
|
||||
|
||||
runProgress.setProgressDescription( "Importing surface results." );
|
||||
|
||||
// reload output surfaces
|
||||
reloadSurfaces( fraSettings );
|
||||
}
|
||||
// delete parameter files
|
||||
cleanUpParameterFiles();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicRunFaultReactAssessmentFeature::runAdvancedProcessing( int faultID )
|
||||
{
|
||||
RimFaultInViewCollection* coll = faultCollection();
|
||||
if ( coll == nullptr ) return;
|
||||
|
||||
RimFaultRASettings* fraSettings = coll->faultRASettings();
|
||||
if ( fraSettings == nullptr ) return;
|
||||
|
||||
caf::ProgressInfo runProgress( 3, "Running Advanced Fault RA processing, please wait..." );
|
||||
|
||||
runProgress.setProgressDescription( "Macris calibrate command." );
|
||||
QString paramfilename = fraSettings->basicParameterXMLFilename( faultID );
|
||||
|
||||
RifFaultRAXmlWriter xmlwriter( fraSettings );
|
||||
QString outErrorText;
|
||||
if ( !xmlwriter.writeCalculateFile( paramfilename, faultID, outErrorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Unable to write parameter file! " + outErrorText );
|
||||
return;
|
||||
}
|
||||
|
||||
QString paramfilename2 = fraSettings->advancedParameterXMLFilename( faultID );
|
||||
if ( !xmlwriter.writeCalibrateFile( paramfilename2, faultID, outErrorText ) )
|
||||
{
|
||||
QMessageBox::warning( nullptr,
|
||||
"Fault Reactivation Assessment Processing",
|
||||
"Unable to write calibrate parameter file! " + outErrorText );
|
||||
return;
|
||||
}
|
||||
|
||||
addParameterFileForCleanUp( paramfilename );
|
||||
addParameterFileForCleanUp( paramfilename2 );
|
||||
|
||||
// remove any existing database file
|
||||
removeFile( fraSettings->advancedMacrisDatabase() );
|
||||
|
||||
// run the java macris program in calibrate mode
|
||||
QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand();
|
||||
QStringList parameters = fraSettings->advancedMacrisParameters( faultID );
|
||||
|
||||
RimProcess process;
|
||||
process.setCommand( command );
|
||||
process.setParameters( parameters );
|
||||
if ( !process.execute() )
|
||||
{
|
||||
QMessageBox::critical( nullptr,
|
||||
"Advanced Fault Reactivation Assessment Processing",
|
||||
"Failed to run Macris calibrate command. Check log window for additional information." );
|
||||
cleanUpParameterFiles();
|
||||
return;
|
||||
}
|
||||
|
||||
runProgress.incrementProgress();
|
||||
|
||||
runProgress.setProgressDescription( "Generating surface results." );
|
||||
|
||||
if ( runPostProcessing( faultID, fraSettings ) )
|
||||
{
|
||||
runProgress.incrementProgress();
|
||||
|
||||
runProgress.setProgressDescription( "Importing surface results." );
|
||||
|
||||
// reload output surfaces
|
||||
reloadSurfaces( fraSettings );
|
||||
}
|
||||
|
||||
// delete parameter files
|
||||
cleanUpParameterFiles();
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 Equinor ASA
|
||||
//
|
||||
// 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
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimFaultInViewCollection;
|
||||
class RimFaultRASettings;
|
||||
class RimSurfaceCollection;
|
||||
|
||||
#include <QString>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicRunFaultReactAssessmentFeature : public caf::CmdFeature
|
||||
{
|
||||
protected:
|
||||
RicRunFaultReactAssessmentFeature();
|
||||
|
||||
virtual RimFaultInViewCollection* faultCollection();
|
||||
|
||||
int selectedFaultID();
|
||||
int faultIDFromName( QString faultname ) const;
|
||||
|
||||
RimSurfaceCollection* surfaceCollection();
|
||||
|
||||
bool runPostProcessing( int faultID, RimFaultRASettings* settings );
|
||||
void reloadSurfaces( RimFaultRASettings* settings );
|
||||
|
||||
void addParameterFileForCleanUp( QString filename );
|
||||
void cleanUpParameterFiles();
|
||||
|
||||
void removeFile( QString filename );
|
||||
|
||||
void runBasicProcessing( int faultID );
|
||||
void runAdvancedProcessing( int faultID );
|
||||
|
||||
private:
|
||||
std::list<QString> m_parameterFilesToCleanUp;
|
||||
};
|
@ -19,15 +19,17 @@
|
||||
|
||||
#include "RicPasteEclipseViewsFeature.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "RicPasteFeatureImpl.h"
|
||||
|
||||
#include "Rim2dIntersectionViewCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseContourMapView.h"
|
||||
#include "RimEclipseContourMapViewCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafPdmDocument.h"
|
||||
#include "cafPdmObjectGroup.h"
|
||||
#include "cafSelectionManager.h"
|
||||
@ -47,13 +49,12 @@ bool RicPasteEclipseViewsFeature::isCommandEnabled()
|
||||
std::vector<caf::PdmPointer<RimEclipseView>> typedObjects;
|
||||
objectGroup.objectsByType( &typedObjects );
|
||||
|
||||
if ( typedObjects.size() == 0 )
|
||||
if ( typedObjects.empty() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
caf::PdmObjectHandle* destinationObject =
|
||||
dynamic_cast<caf::PdmObjectHandle*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
auto* destinationObject = dynamic_cast<caf::PdmObjectHandle*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
|
||||
RimIdenticalGridCaseGroup* gridCaseGroup = RicPasteFeatureImpl::findGridCaseGroup( destinationObject );
|
||||
if ( gridCaseGroup ) return false;
|
||||
@ -69,8 +70,7 @@ bool RicPasteEclipseViewsFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicPasteEclipseViewsFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
caf::PdmObjectHandle* destinationObject =
|
||||
dynamic_cast<caf::PdmObjectHandle*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
auto* destinationObject = dynamic_cast<caf::PdmObjectHandle*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
|
||||
RimEclipseCase* eclipseCase = RicPasteFeatureImpl::findEclipseCase( destinationObject );
|
||||
assert( eclipseCase );
|
||||
@ -78,7 +78,7 @@ void RicPasteEclipseViewsFeature::onActionTriggered( bool isChecked )
|
||||
caf::PdmObjectGroup objectGroup;
|
||||
RicPasteFeatureImpl::findObjectsFromClipboardRefs( &objectGroup );
|
||||
|
||||
if ( objectGroup.objects.size() == 0 ) return;
|
||||
if ( objectGroup.objects.empty() ) return;
|
||||
|
||||
std::vector<caf::PdmPointer<RimEclipseView>> eclipseViews;
|
||||
objectGroup.objectsByType( &eclipseViews );
|
||||
@ -86,15 +86,26 @@ void RicPasteEclipseViewsFeature::onActionTriggered( bool isChecked )
|
||||
RimEclipseView* lastViewCopy = nullptr;
|
||||
|
||||
// Add cases to case group
|
||||
for ( size_t i = 0; i < eclipseViews.size(); i++ )
|
||||
for ( const auto& eclipseView : eclipseViews )
|
||||
{
|
||||
RimEclipseView* rimReservoirView = dynamic_cast<RimEclipseView*>(
|
||||
eclipseViews[i]->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
|
||||
auto* rimReservoirView = dynamic_cast<RimEclipseView*>(
|
||||
eclipseView->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
|
||||
CVF_ASSERT( rimReservoirView );
|
||||
|
||||
QString nameOfCopy = QString( "Copy of " ) + rimReservoirView->name();
|
||||
rimReservoirView->setName( nameOfCopy );
|
||||
eclipseCase->reservoirViews().push_back( rimReservoirView );
|
||||
|
||||
if ( dynamic_cast<RimEclipseContourMapView*>( eclipseView.p() ) )
|
||||
{
|
||||
auto contourMapView = dynamic_cast<RimEclipseContourMapView*>( rimReservoirView );
|
||||
CVF_ASSERT( contourMapView );
|
||||
|
||||
eclipseCase->contourMapCollection()->push_back( contourMapView );
|
||||
}
|
||||
else
|
||||
{
|
||||
eclipseCase->reservoirViews().push_back( rimReservoirView );
|
||||
}
|
||||
|
||||
rimReservoirView->setEclipseCase( eclipseCase );
|
||||
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimSummaryAddressCollection.h"
|
||||
#include "RimSummaryAddressModifier.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
@ -112,6 +114,8 @@ void RicAppendSummaryPlotsForObjectsFeature::appendPlots( RimSummaryMultiPlot* s
|
||||
}
|
||||
info.incrementProgress();
|
||||
}
|
||||
|
||||
summaryMultiPlot->updatePlotTitles();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -32,6 +32,8 @@
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimSummaryAddressCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
|
@ -77,6 +77,7 @@ void RicCloseSummaryCaseFeature::deleteSummaryCases( std::vector<RimSummaryCase*
|
||||
for ( auto plot : plotsToUpdate )
|
||||
{
|
||||
plot->updateConnectedEditors();
|
||||
plot->updatePlots();
|
||||
}
|
||||
|
||||
summaryCaseMainCollection->updateAllRequiredEditors();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user