10
.github/workflows/ResInsightWithCache.yml
vendored
@ -50,16 +50,6 @@ jobs:
|
||||
build-python-module: true,
|
||||
execute-unit-tests: true,
|
||||
}
|
||||
- {
|
||||
name: "Mac OS",
|
||||
os: macos-latest,
|
||||
cc: "clang",
|
||||
cxx: "clang++",
|
||||
vcpkg-response-file: vcpkg_x64-osx.txt,
|
||||
vcpkg-triplet: x64-osx,
|
||||
build-python-module: false,
|
||||
execute-unit-tests: false,
|
||||
}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
@ -21,15 +21,11 @@ endif()
|
||||
# Open GL
|
||||
find_package(OpenGL)
|
||||
|
||||
find_package(
|
||||
Qt5
|
||||
COMPONENTS Core
|
||||
QUIET
|
||||
)
|
||||
find_package(Qt5 ${RI_QT_MINIMUM_VERSION} COMPONENTS Core)
|
||||
|
||||
if(Qt5Core_FOUND)
|
||||
find_package(
|
||||
Qt5
|
||||
Qt5 ${RI_QT_MINIMUM_VERSION}
|
||||
COMPONENTS Core
|
||||
Gui
|
||||
OpenGL
|
||||
@ -68,9 +64,9 @@ endif()
|
||||
# Defining all the source (and header) files
|
||||
# ##############################################################################
|
||||
|
||||
set(CODE_HEADER_FILES)
|
||||
set(CODE_HEADER_FILES RiaMainTools.h)
|
||||
|
||||
set(CODE_SOURCE_FILES RiaMain.cpp)
|
||||
set(CODE_SOURCE_FILES RiaMain.cpp RiaMainTools.cpp)
|
||||
|
||||
if(RESINSIGHT_ENABLE_GRPC)
|
||||
list(APPEND CODE_HEAD_FILES RiaGrpcConsoleApplication.h
|
||||
@ -210,12 +206,6 @@ if(MSVC)
|
||||
|
||||
set(BUILD_FLAGS_FOR_MSVC "/wd4190 /wd4100 /wd4127 /wd4245 /wd4005")
|
||||
|
||||
if(Qt5Core_VERSION_STRING GREATER_EQUAL 5.10)
|
||||
# Disable warning for deprecated functions in newer versions of Qt
|
||||
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996?view=msvc-160
|
||||
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4996")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 19.14)
|
||||
# The following warning is generated over 800 times from a qwt header only
|
||||
# using VS2015 Disabling temporarily warning C4505 'function' : unreferenced
|
||||
|
BIN
ApplicationExeCode/Resources/AppendNext.png
Normal file
After Width: | Height: | Size: 1004 B |
74
ApplicationExeCode/Resources/AppendNext.svg
Normal file
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
version="1.1"
|
||||
id="Layer_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 16 16"
|
||||
style="enable-background:new 0 0 16 16;"
|
||||
xml:space="preserve"
|
||||
sodipodi:docname="AppendNext.svg"
|
||||
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||
inkscape:export-filename="D:\Repos\OPM\ResInsight\ApplicationExeCode\Resources\AppendNext.png"
|
||||
inkscape:export-xdpi="341.20468"
|
||||
inkscape:export-ydpi="341.20468"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||
id="defs9"><symbol
|
||||
id="FirstAid"><title
|
||||
id="title4273">First Aid</title><path
|
||||
d="m 44,13 0,15 15,0 0,16 -15,0 0,15 -16,0 0,-15 -15,0 0,-16 15,0 0,-15 z"
|
||||
style="stroke:none"
|
||||
id="path4275" /></symbol><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath7666"><use
|
||||
x="0"
|
||||
y="0"
|
||||
xlink:href="#g7662"
|
||||
id="use7668" /></clipPath></defs><sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="44.9375"
|
||||
inkscape:cx="6.9652295"
|
||||
inkscape:cy="6.2197497"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1351"
|
||||
inkscape:window-x="-9"
|
||||
inkscape:window-y="-9"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g7616" />
|
||||
<style
|
||||
type="text/css"
|
||||
id="style2">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#75BEFF;}
|
||||
</style>
|
||||
|
||||
<g
|
||||
id="g7616"
|
||||
inkscape:groupmode="layer"><g
|
||||
id="g7664"
|
||||
clip-path="url(#clipPath7666)"><g
|
||||
inkscape:label="Clip"
|
||||
id="g7662"><path
|
||||
class="st0"
|
||||
d="M 13.9,2.8 H 2.1 L 8,13.2 Z"
|
||||
id="path4" /><use
|
||||
xlink:href="#FirstAid"
|
||||
style="opacity:0.69;fill:#008000;stroke:#000000"
|
||||
id="use6694"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%"
|
||||
transform="matrix(0.16145491,0,0,0.15825119,5.9080974,4.7174215)" /></g></g></g></svg>
|
After Width: | Height: | Size: 2.3 KiB |
BIN
ApplicationExeCode/Resources/AppendNextCurve.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
70
ApplicationExeCode/Resources/AppendNextCurve.svg
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
version="1.1"
|
||||
id="Layer_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 16 16"
|
||||
style="enable-background:new 0 0 16 16;"
|
||||
xml:space="preserve"
|
||||
sodipodi:docname="AppendNextCurve.svg"
|
||||
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||
inkscape:export-filename="D:\Repos\OPM\ResInsight\ApplicationExeCode\Resources\AppendNextCurve.png"
|
||||
inkscape:export-xdpi="279.2092"
|
||||
inkscape:export-ydpi="279.2092"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||
id="defs9"><symbol
|
||||
id="FirstAid"><title
|
||||
id="title4273">First Aid</title><path
|
||||
d="m 44,13 0,15 15,0 0,16 -15,0 0,15 -16,0 0,-15 -15,0 0,-16 15,0 0,-15 z"
|
||||
style="stroke:none"
|
||||
id="path4275" /></symbol></defs><sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="36.543278"
|
||||
inkscape:cx="6.0613062"
|
||||
inkscape:cy="6.2254951"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1351"
|
||||
inkscape:window-x="-9"
|
||||
inkscape:window-y="-9"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g7616" />
|
||||
<style
|
||||
type="text/css"
|
||||
id="style2">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#75BEFF;}
|
||||
</style>
|
||||
|
||||
<g
|
||||
id="g7616"
|
||||
inkscape:groupmode="layer"><path
|
||||
class="st0"
|
||||
d="M 13.9,2.8 H 2.1 L 8,13.2 Z"
|
||||
id="path4" /><use
|
||||
xlink:href="#FirstAid"
|
||||
style="opacity:0.69;fill:#008000;stroke:#000000"
|
||||
id="use6694"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%"
|
||||
transform="matrix(0.16145491,0,0,0.15825119,5.9080974,4.7174215)" /><path
|
||||
style="fill:#0000ff;stroke:#f60000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;opacity:0.58;fill-opacity:0.01360544"
|
||||
d="m 8.255911,1.5354659 c -0.050314,-0.00137 -0.341591,0.020031 -0.3783032,0.044506 -0.013801,0.0092 -0.00845,0.035306 -0.022253,0.044506 -0.03847,0.025646 -0.1316305,0.013577 -0.1780251,0.044506 -0.026185,0.017457 -0.039435,0.051146 -0.066759,0.066759 -0.038224,0.021842 -0.1151897,0.024215 -0.1557719,0.044506 -0.027662,0.013831 -0.064992,0.093251 -0.089012,0.1112657 -0.061949,0.046462 -0.1019246,0.1329691 -0.1557719,0.2002782 -0.010362,0.012952 -0.032778,0.010525 -0.044506,0.022253 -0.02414,0.02414 -0.071509,0.2145277 -0.089012,0.2670375 -0.04076,0.1222813 0.02235,0.3787897 0.044506,0.4895689 0.032115,0.1605772 0.012547,0.7513386 -0.066759,0.8901252 C 7.0245729,3.8127014 7.0035169,3.870607 6.9652319,3.9165493 6.9177425,3.9735352 6.8426451,4.000789 6.7872045,4.0500695 6.5822709,4.2322327 6.352386,4.3356351 6.0973574,4.4283727 5.9510757,4.4815661 5.8277908,4.5912886 5.6968011,4.6731572 5.561177,4.7579223 5.3684383,4.8015862 5.3184979,4.984701 c -0.05025,0.1842491 -0.063418,0.4117199 -0.044506,0.6008345 0.011312,0.1131173 0.079962,0.2071973 0.1112656,0.3115438 0.065527,0.2184234 0.1079559,0.5515384 0.089012,0.7788595 -0.013522,0.1622592 -0.07994,0.2950421 -0.1335188,0.4450626 -0.018163,0.050856 -0.019094,0.1081233 -0.044506,0.1557719 -0.034907,0.06545 -0.094205,0.115123 -0.1335188,0.178025 C 5.0568186,7.6242502 4.984193,7.822737 4.8734353,7.9888734 4.7177218,8.2224437 4.7710018,8.0686681 4.6063978,8.2781641 4.4559992,8.4695804 4.3489131,8.6723149 4.2726008,8.9012517 c -0.063911,0.191733 -0.022253,0.4455852 -0.022253,0.6453408 0,0.2236424 -0.035808,0.5417555 0,0.7566065 0.00771,0.04628 0.036114,0.08736 0.044506,0.133519 0.019395,0.10667 -0.026942,0.238234 -0.066759,0.333797 -0.072185,0.173243 -0.2096795,0.266095 -0.333797,0.400556 -0.3616343,0.39177 0.1225081,-0.110655 -0.2892906,0.35605 -0.1179896,0.133721 -0.2522022,0.252202 -0.3783032,0.378303 -0.1532224,0.153223 -0.3594091,0.29377 -0.4895689,0.467316 -0.029856,0.03981 -0.040045,0.09154 -0.066759,0.133519 -0.069929,0.109887 -0.1641021,0.194567 -0.178025,0.333797 -0.013019,0.130194 0.020516,0.13873 -0.022253,0.267037 -0.015735,0.04721 -0.054691,0.08524 -0.066759,0.133519 -0.049909,0.199637 -0.043947,0.420291 -0.089013,0.623088 -0.027497,0.123735 -0.1335188,0.08658 -0.1335188,0.178025"
|
||||
id="path7358" /><path
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;opacity:0.65819209"
|
||||
d="m 9.8581363,1.5354659 c -0.1305326,-0.032308 -0.1205116,0.05067 -0.178025,0.089013 -0.012344,0.00823 -0.036277,-0.012344 -0.044506,0 -0.012344,0.018516 0.00995,0.046856 0,0.066759 -0.011961,0.023921 -0.051924,0.022253 -0.066759,0.044506 -0.016963,0.025444 -0.084497,0.1554492 -0.089012,0.178025 -0.00999,0.049927 0.00999,0.105845 0,0.1557719 -0.040371,0.2018541 0.00363,0.4159845 -0.022253,0.6230877 -0.010923,0.087381 -0.063341,0.1232621 -0.089013,0.2002781 -0.00967,0.029015 -0.00529,0.063565 -0.022253,0.089012 -0.035395,0.053093 -0.1106517,0.066146 -0.1557719,0.1112657 -0.06717,0.06717 -0.1108548,0.1553611 -0.178025,0.2225313 -0.033585,0.033585 -0.079492,0.053709 -0.1112657,0.089012 -0.035783,0.039759 -0.05323,0.09376 -0.089012,0.1335188 -0.031773,0.035304 -0.077681,0.055427 -0.1112656,0.089012 C 8.5434839,3.7847497 8.3351863,4.1279594 8.255911,4.3393602 8.1378191,4.6542719 8.2925667,5.0305058 8.1891516,5.340751 8.1663474,5.4091638 8.1529688,5.3815771 8.1001391,5.4520167 8.0482363,5.5212204 8.0244888,5.6102496 7.9666203,5.674548 7.7631844,5.9005879 7.4396456,6.0831566 7.2990264,6.364395 c -0.02098,0.041961 -0.023526,0.091558 -0.044506,0.1335188 -0.016586,0.033173 -0.051696,0.055121 -0.066759,0.089012 -0.087215,0.1962321 -0.033252,0.4220389 -0.06676,0.6230881 C 7.0872221,7.4126895 7.0150699,7.6114866 6.9652295,7.8108484 6.9371388,7.923211 6.9376471,8.0591616 6.8984701,8.1668985 6.8628398,8.2648817 6.7476162,8.4512711 6.6759388,8.5229485 6.6381158,8.5607716 6.5819993,8.5759799 6.54242,8.6119611 6.4342293,8.7103163 6.4141677,8.8082636 6.3421419,8.9235049 6.3001967,8.9906172 6.2121237,9.068775 6.18637,9.1460362 6.138152,9.2906916 6.16813,9.4466361 6.141864,9.5910987 c -0.00593,0.032638 -0.03731,0.056629 -0.044506,0.089013 -0.034355,0.154599 0,0.3547133 0,0.5118213 0,0.116921 0.022993,0.263337 0,0.378303 -0.01013,0.05065 -0.1562658,0.222779 -0.2002781,0.244785 -0.013269,0.0066 -0.032638,-0.0089 -0.044506,0 -0.054332,0.01207 -0.032157,0.08531 -0.066759,0.111266 -0.01681,0.01261 -0.092225,0.02229 -0.1112656,0.04451 -0.2778755,0.324188 -0.333797,0.510928 -0.333797,0.912378 0,0.355322 -0.099795,0.698198 -0.2892906,1.001391 -0.08713,0.139408 -0.049755,0.0345 -0.1112657,0.178025 -0.08333,0.194437 -0.006,0.506987 -0.089012,0.645341 -0.059223,0.0987 -0.1037008,0.185148 -0.1557719,0.28929 -0.026909,0.05382 -0.1012629,0.05676 -0.1112657,0.06676 -0.01049,0.01049 0.00663,0.03124 0,0.04451 -0.028926,0.05785 -0.063556,0.09637 -0.089012,0.155772 -0.025467,0.05942 -0.021522,0.222166 -0.022253,0.222531 -0.013269,0.0066 -0.034016,-0.01049 -0.044506,0 -0.041545,0.04155 0.028017,0.04451 -0.044506,0.04451"
|
||||
id="path7426" /></g></svg>
|
After Width: | Height: | Size: 7.1 KiB |
BIN
ApplicationExeCode/Resources/AppendPrev.png
Normal file
After Width: | Height: | Size: 965 B |
63
ApplicationExeCode/Resources/AppendPrev.svg
Normal file
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
version="1.1"
|
||||
id="Layer_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 16 16"
|
||||
style="enable-background:new 0 0 16 16;"
|
||||
xml:space="preserve"
|
||||
sodipodi:docname="AppendPrev.svg"
|
||||
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||
inkscape:export-filename="D:\Repos\OPM\ResInsight\ApplicationExeCode\Resources\AppendPrev.png"
|
||||
inkscape:export-xdpi="314.46732"
|
||||
inkscape:export-ydpi="314.46732"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||
id="defs9"><symbol
|
||||
id="FirstAid"><title
|
||||
id="title1005">First Aid</title><path
|
||||
d="m 44,13 0,15 15,0 0,16 -15,0 0,15 -16,0 0,-15 -15,0 0,-16 15,0 0,-15 z"
|
||||
style="stroke:none"
|
||||
id="path1007" /></symbol></defs><sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="44.9375"
|
||||
inkscape:cx="6.9652295"
|
||||
inkscape:cy="6.2197497"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1351"
|
||||
inkscape:window-x="-9"
|
||||
inkscape:window-y="-9"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Layer_1" />
|
||||
<style
|
||||
type="text/css"
|
||||
id="style2">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#75BEFF;}
|
||||
</style>
|
||||
|
||||
<g
|
||||
id="g4186"><path
|
||||
class="st0"
|
||||
d="M 2.1,13.2 H 13.9 L 8,2.8 Z"
|
||||
id="path4" /><use
|
||||
xlink:href="#FirstAid"
|
||||
style="opacity:0.78;fill:#008000;stroke:#000000"
|
||||
id="use3426"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%"
|
||||
transform="matrix(0.15988928,0,0,0.15002721,6.0894814,-0.96147989)" /></g></svg>
|
After Width: | Height: | Size: 2.0 KiB |
BIN
ApplicationExeCode/Resources/AppendPrevCurve.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
69
ApplicationExeCode/Resources/AppendPrevCurve.svg
Normal file
@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
version="1.1"
|
||||
id="Layer_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 16 16"
|
||||
style="enable-background:new 0 0 16 16;"
|
||||
xml:space="preserve"
|
||||
sodipodi:docname="AppendPrevCurve.svg"
|
||||
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||
inkscape:export-filename="D:\Repos\OPM\ResInsight\ApplicationExeCode\Resources\AppendPrevCurve.png"
|
||||
inkscape:export-xdpi="314.46732"
|
||||
inkscape:export-ydpi="314.46732"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||
id="defs9"><symbol
|
||||
id="FirstAid"><title
|
||||
id="title1005">First Aid</title><path
|
||||
d="m 44,13 0,15 15,0 0,16 -15,0 0,15 -16,0 0,-15 -15,0 0,-16 15,0 0,-15 z"
|
||||
style="stroke:none"
|
||||
id="path1007" /></symbol></defs><sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="44.9375"
|
||||
inkscape:cx="6.9763561"
|
||||
inkscape:cy="6.2197497"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1351"
|
||||
inkscape:window-x="-9"
|
||||
inkscape:window-y="-9"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Layer_1" />
|
||||
<style
|
||||
type="text/css"
|
||||
id="style2">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#75BEFF;}
|
||||
</style>
|
||||
|
||||
<g
|
||||
id="g4186"><path
|
||||
class="st0"
|
||||
d="M 2.1,13.2 H 13.9 L 8,2.8 Z"
|
||||
id="path4" /><use
|
||||
xlink:href="#FirstAid"
|
||||
style="opacity:0.78;fill:#008000;stroke:#000000"
|
||||
id="use3426"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%"
|
||||
transform="matrix(0.15988928,0,0,0.15002721,6.0894814,-0.96147989)" /></g><path
|
||||
style="opacity:0.58;fill:#0000ff;fill-opacity:0.0136055;stroke:#f60000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 7.8833419,14.663316 c -0.05031,0.0014 -0.341591,-0.02003 -0.378303,-0.04451 -0.0138,-0.0092 -0.0084,-0.03531 -0.02225,-0.04451 -0.03847,-0.02565 -0.131631,-0.01358 -0.178025,-0.04451 -0.02619,-0.01746 -0.03944,-0.05115 -0.06676,-0.06676 -0.03822,-0.02184 -0.11519,-0.02421 -0.155772,-0.04451 -0.02766,-0.01383 -0.06499,-0.09325 -0.08901,-0.111265 -0.06195,-0.04646 -0.101925,-0.13297 -0.155772,-0.200279 -0.01036,-0.01295 -0.03278,-0.01053 -0.04451,-0.02225 -0.02414,-0.02414 -0.07151,-0.214527 -0.08901,-0.267037 -0.04076,-0.122281 0.02235,-0.37879 0.04451,-0.489569 0.03212,-0.160577 0.01255,-0.751339 -0.06676,-0.890125 -0.02967,-0.05192 -0.05073,-0.10983 -0.08901,-0.155772 -0.04749,-0.05699 -0.122587,-0.08424 -0.178028,-0.13352 -0.204933,-0.182164 -0.434818,-0.285566 -0.689847,-0.378304 -0.146281,-0.05319 -0.269566,-0.162915 -0.400556,-0.244784 -0.135624,-0.08477 -0.328363,-0.128429 -0.378303,-0.311544 -0.05025,-0.184249 -0.06342,-0.41172 -0.04451,-0.600834 0.01131,-0.113118 0.07996,-0.207198 0.111265,-0.311544 0.06553,-0.218424 0.107956,-0.5515388 0.08901,-0.7788599 -0.01352,-0.1622592 -0.07994,-0.2950421 -0.133518,-0.4450626 -0.01816,-0.050856 -0.01909,-0.1081233 -0.04451,-0.1557719 -0.03491,-0.06545 -0.09421,-0.115123 -0.133519,-0.178025 C 4.6842469,8.5745317 4.6116209,8.3760449 4.5008629,8.2099085 4.3451499,7.9763382 4.3984299,8.1301135 4.2338259,7.9206178 4.0834269,7.7292015 3.9763409,7.526467 3.9000289,7.2975302 c -0.06391,-0.191733 -0.02225,-0.4455852 -0.02225,-0.6453408 0,-0.2236424 -0.03581,-0.5417555 0,-0.7566069 0.0077,-0.04628 0.03611,-0.08736 0.04451,-0.133519 0.01939,-0.10667 -0.02694,-0.238234 -0.06676,-0.333797 -0.07218,-0.173243 -0.20968,-0.266095 -0.333797,-0.400556 -0.361635,-0.39177 0.122508,0.110655 -0.289291,-0.35605 -0.117989,-0.133721 -0.252202,-0.252202 -0.378303,-0.378303 -0.153222,-0.153223 -0.359409,-0.29377 -0.489569,-0.467316 -0.02986,-0.03981 -0.04005,-0.09154 -0.06676,-0.133519 -0.06993,-0.109887 -0.164102,-0.194567 -0.178025,-0.333797 -0.01302,-0.130194 0.02052,-0.13873 -0.02225,-0.267037 -0.01573,-0.04721 -0.05469,-0.08524 -0.06676,-0.133519 -0.04991,-0.199637 -0.04395,-0.420291 -0.08901,-0.623088 -0.0275,-0.123735 -0.133519,-0.08658 -0.133519,-0.178025"
|
||||
id="path7358" /><path
|
||||
style="opacity:0.658192;fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 9.4855669,14.663316 c -0.130532,0.03231 -0.120511,-0.05067 -0.178025,-0.08901 -0.01234,-0.0082 -0.03628,0.01234 -0.04451,0 -0.01234,-0.01852 0.0099,-0.04686 0,-0.06676 -0.01196,-0.02392 -0.05192,-0.02225 -0.06676,-0.04451 -0.01696,-0.02544 -0.0845,-0.155449 -0.08901,-0.178025 -0.01,-0.04993 0.01,-0.105845 0,-0.155772 -0.04037,-0.201854 0.0036,-0.415984 -0.02225,-0.623087 -0.01092,-0.08738 -0.06334,-0.123262 -0.08901,-0.200278 -0.0097,-0.02901 -0.0053,-0.06357 -0.02225,-0.08901 -0.0354,-0.05309 -0.110651,-0.06615 -0.155772,-0.111266 -0.06717,-0.06717 -0.110854,-0.155361 -0.178025,-0.222531 -0.03358,-0.03358 -0.07949,-0.05371 -0.111265,-0.08901 -0.03578,-0.03976 -0.05323,-0.09376 -0.08901,-0.133519 -0.03177,-0.0353 -0.07768,-0.05543 -0.111266,-0.08901 -0.157491,-0.157492 -0.365789,-0.500701 -0.445064,-0.712102 -0.118092,-0.314912 0.03666,-0.691146 -0.06676,-1.001391 -0.0228,-0.06841 -0.03618,-0.04083 -0.08901,-0.111266 -0.0519,-0.0692 -0.07565,-0.158232 -0.133519,-0.222531 -0.203436,-0.22604 -0.526974,-0.408609 -0.667594,-0.6898471 -0.02098,-0.041961 -0.02353,-0.091558 -0.04451,-0.1335188 -0.01659,-0.033173 -0.0517,-0.055121 -0.06676,-0.089012 -0.08722,-0.1962321 -0.03325,-0.4220389 -0.06676,-0.6230881 -0.03378,-0.2026756 -0.105931,-0.4014727 -0.155771,-0.6008345 -0.02809,-0.1123626 -0.02758,-0.2483132 -0.06676,-0.3560501 -0.03563,-0.097983 -0.150854,-0.2843726 -0.222531,-0.35605 -0.03782,-0.037823 -0.09394,-0.053031 -0.133519,-0.089013 -0.108191,-0.098355 -0.128252,-0.1963025 -0.200278,-0.3115438 -0.04195,-0.067112 -0.130018,-0.1452701 -0.155772,-0.2225313 -0.04822,-0.1446554 -0.01824,-0.3005999 -0.04451,-0.4450625 -0.0059,-0.032638 -0.03731,-0.056629 -0.04451,-0.089013 -0.03435,-0.154599 0,-0.3547133 0,-0.5118213 0,-0.116921 0.02299,-0.263337 0,-0.378303 -0.01013,-0.05065 -0.156266,-0.222779 -0.200278,-0.244785 -0.01327,-0.0066 -0.03264,0.0089 -0.04451,0 -0.05433,-0.01207 -0.03216,-0.08531 -0.06676,-0.111266 -0.01681,-0.01261 -0.09222,-0.02229 -0.111266,-0.04451 -0.277875,-0.324188 -0.333797,-0.510928 -0.333797,-0.912378 0,-0.355322 -0.0998,-0.698198 -0.28929,-1.001391 -0.08713,-0.139408 -0.04976,-0.0345 -0.111266,-0.178025 -0.08333,-0.194437 -0.006,-0.506987 -0.08901,-0.645341 -0.05922,-0.0987 -0.103701,-0.185148 -0.155772,-0.28929 -0.02691,-0.05382 -0.101263,-0.05676 -0.111266,-0.06676 -0.01049,-0.01049 0.0066,-0.03124 0,-0.04451 -0.02893,-0.05785 -0.06356,-0.09637 -0.08901,-0.155772 -0.02547,-0.05942 -0.02152,-0.222166 -0.02225,-0.222531 -0.01327,-0.0066 -0.03402,0.01049 -0.04451,0 -0.04155,-0.04155 0.02802,-0.04451 -0.04451,-0.04451"
|
||||
id="path7426" /></svg>
|
After Width: | Height: | Size: 7.0 KiB |
BIN
ApplicationExeCode/Resources/AxesSync16x16.png
Normal file
After Width: | Height: | Size: 263 B |
BIN
ApplicationExeCode/Resources/CheckOverlay16x16.png
Normal file
After Width: | Height: | Size: 403 B |
BIN
ApplicationExeCode/Resources/DataVector.png
Normal file
After Width: | Height: | Size: 337 B |
BIN
ApplicationExeCode/Resources/DisableZoom.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
70
ApplicationExeCode/Resources/DisableZoom.svg
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
version="1.1"
|
||||
id="svg22083"
|
||||
sodipodi:docname="DisableZoom.svg"
|
||||
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs22087">
|
||||
<symbol
|
||||
id="NoEntry">
|
||||
<title
|
||||
id="title24865">No Entry</title>
|
||||
<circle
|
||||
cx="36"
|
||||
cy="36"
|
||||
r="27"
|
||||
style="stroke:none"
|
||||
id="circle24867" />
|
||||
<rect
|
||||
x="14"
|
||||
y="32"
|
||||
width="44"
|
||||
height="8"
|
||||
style="fill:white;stroke:none"
|
||||
id="rect24869" />
|
||||
</symbol>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="namedview22085"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="77.485677"
|
||||
inkscape:cx="8.0079316"
|
||||
inkscape:cy="8.0079316"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1351"
|
||||
inkscape:window-x="-9"
|
||||
inkscape:window-y="-9"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg22083" />
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M 12.028 6.149 C 12.123 7.566 11.668 8.967 10.758 10.058 L 15.018 14.318 L 14.318 15.028 L 10.058 10.758 C 8.967 11.668 7.566 12.123 6.149 12.028 C 4.731 11.932 3.404 11.293 2.446 10.244 C 1.487 9.195 0.969 7.817 1.001 6.396 C 1.033 4.975 1.612 3.622 2.617 2.617 C 3.622 1.612 4.975 1.033 6.396 1.001 C 7.817 0.969 9.195 1.487 10.244 2.446 C 11.293 3.404 11.932 4.731 12.028 6.149 Z M 6.578 11.038 C 7.77 11.035 8.914 10.561 9.758 9.718 L 9.718 9.738 C 10.145 9.321 10.485 8.823 10.718 8.274 C 10.952 7.725 11.074 7.134 11.078 6.538 C 11.078 5.648 10.814 4.778 10.319 4.038 C 9.825 3.298 9.122 2.721 8.3 2.38 C 7.477 2.039 6.573 1.95 5.7 2.124 C 4.827 2.298 4.025 2.726 3.396 3.356 C 2.766 3.985 2.338 4.787 2.164 5.66 C 1.99 6.533 2.08 7.437 2.42 8.26 C 2.761 9.082 3.337 9.785 4.077 10.279 C 4.817 10.774 5.688 11.038 6.578 11.038 Z"
|
||||
style="fill: rgb(128, 128, 128);"
|
||||
id="path22079" />
|
||||
<use
|
||||
xlink:href="#NoEntry"
|
||||
style="fill:#aa0000;stroke:#000000"
|
||||
id="use26176"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%"
|
||||
transform="matrix(0.11406361,0,0,0.11457168,2.4058544,2.4641851)" />
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
@ -13,6 +13,7 @@
|
||||
<file>AnalysisPlotFilter16x16.png</file>
|
||||
<file>AppLogo48x48.png</file>
|
||||
<file>Axes16x16.png</file>
|
||||
<file>AxesSync16x16.png</file>
|
||||
<file>BottomAxis16x16.png</file>
|
||||
<file>Bullet.png</file>
|
||||
<file>CascadeWindows.svg</file>
|
||||
@ -145,6 +146,7 @@
|
||||
<file>SummaryPlots16x16.png</file>
|
||||
<file>SummaryPlotsLight16x16.png</file>
|
||||
<file>SummaryTemplate16x16.png</file>
|
||||
<file>SummaryEnsembleTemplate16x16.png</file>
|
||||
<file>SummaryXPlotLight16x16.png</file>
|
||||
<file>SummaryXPlotsLight16x16.png</file>
|
||||
<file>Swap.png</file>
|
||||
@ -240,6 +242,33 @@
|
||||
<file>ComboBoxDown.svg</file>
|
||||
<file>ComboBoxUp.svg</file>
|
||||
<file>WellIntAnalysis.png</file>
|
||||
<file>DataVector.png</file>
|
||||
<file>data-sources.svg</file>
|
||||
<file>edit.svg</file>
|
||||
<file>graph.svg</file>
|
||||
<file>messages.svg</file>
|
||||
<file>multiplot.svg</file>
|
||||
<file>plot-manager.svg</file>
|
||||
<file>plots.svg</file>
|
||||
<file>property-editor.svg</file>
|
||||
<file>scripts.svg</file>
|
||||
<file>standard.svg</file>
|
||||
<file>summary-plot.svg</file>
|
||||
<file>undo-stack.svg</file>
|
||||
<file>view.svg</file>
|
||||
<file>view-snapshots.svg</file>
|
||||
<file>well-log-plot.svg</file>
|
||||
<file>window-management.svg</file>
|
||||
<file>DisableZoom.png</file>
|
||||
<file>AppendNext.svg</file>
|
||||
<file>AppendPrev.svg</file>
|
||||
<file>AppendNext.png</file>
|
||||
<file>AppendPrev.png</file>
|
||||
<file>AppendNextCurve.svg</file>
|
||||
<file>AppendPrevCurve.svg</file>
|
||||
<file>AppendNextCurve.png</file>
|
||||
<file>AppendPrevCurve.png</file>
|
||||
<file>CheckOverlay16x16.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/Shader">
|
||||
<file>fs_CellFace.glsl</file>
|
||||
|
BIN
ApplicationExeCode/Resources/SummaryEnsembleTemplate16x16.png
Normal file
After Width: | Height: | Size: 743 B |
@ -1,5 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M 12.028 6.149 C 12.123 7.566 11.668 8.967 10.758 10.058 L 15.018 14.318 L 14.318 15.028 L 10.058 10.758 C 8.967 11.668 7.566 12.123 6.149 12.028 C 4.731 11.932 3.404 11.293 2.446 10.244 C 1.487 9.195 0.969 7.817 1.001 6.396 C 1.033 4.975 1.612 3.622 2.617 2.617 C 3.622 1.612 4.975 1.033 6.396 1.001 C 7.817 0.969 9.195 1.487 10.244 2.446 C 11.293 3.404 11.932 4.731 12.028 6.149 Z M 6.578 11.038 C 7.77 11.035 8.914 10.561 9.758 9.718 L 9.718 9.738 C 10.145 9.321 10.485 8.823 10.718 8.274 C 10.952 7.725 11.074 7.134 11.078 6.538 C 11.078 5.648 10.814 4.778 10.319 4.038 C 9.825 3.298 9.122 2.721 8.3 2.38 C 7.477 2.039 6.573 1.95 5.7 2.124 C 4.827 2.298 4.025 2.726 3.396 3.356 C 2.766 3.985 2.338 4.787 2.164 5.66 C 1.99 6.533 2.08 7.437 2.42 8.26 C 2.761 9.082 3.337 9.785 4.077 10.279 C 4.817 10.774 5.688 11.038 6.578 11.038 Z" style="fill: rgb(128, 128, 128);"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M 9.01749 7.0376 L 9.01749 6.0376 L 7.01749 6.0376 L 7.01749 4.0376 L 6.01749 4.0376 L 6.01749 6.0376 L 4.01749 6.0376 L 4.01749 7.0376 L 6.01749 7.0376 L 6.01749 9.0376 L 7.01749 9.0376 L 7.01749 7.0376 L 9.01749 7.0376 Z" style="fill: rgb(174, 78, 151);"/>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
version="1.1"
|
||||
id="svg22083"
|
||||
sodipodi:docname="ZoomAll.svg"
|
||||
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs22087" />
|
||||
<sodipodi:namedview
|
||||
id="namedview22085"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="77.485677"
|
||||
inkscape:cx="8.0079316"
|
||||
inkscape:cy="8.0079316"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1351"
|
||||
inkscape:window-x="-9"
|
||||
inkscape:window-y="-9"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg22083" />
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M 12.028 6.149 C 12.123 7.566 11.668 8.967 10.758 10.058 L 15.018 14.318 L 14.318 15.028 L 10.058 10.758 C 8.967 11.668 7.566 12.123 6.149 12.028 C 4.731 11.932 3.404 11.293 2.446 10.244 C 1.487 9.195 0.969 7.817 1.001 6.396 C 1.033 4.975 1.612 3.622 2.617 2.617 C 3.622 1.612 4.975 1.033 6.396 1.001 C 7.817 0.969 9.195 1.487 10.244 2.446 C 11.293 3.404 11.932 4.731 12.028 6.149 Z M 6.578 11.038 C 7.77 11.035 8.914 10.561 9.758 9.718 L 9.718 9.738 C 10.145 9.321 10.485 8.823 10.718 8.274 C 10.952 7.725 11.074 7.134 11.078 6.538 C 11.078 5.648 10.814 4.778 10.319 4.038 C 9.825 3.298 9.122 2.721 8.3 2.38 C 7.477 2.039 6.573 1.95 5.7 2.124 C 4.827 2.298 4.025 2.726 3.396 3.356 C 2.766 3.985 2.338 4.787 2.164 5.66 C 1.99 6.533 2.08 7.437 2.42 8.26 C 2.761 9.082 3.337 9.785 4.077 10.279 C 4.817 10.774 5.688 11.038 6.578 11.038 Z"
|
||||
style="fill: rgb(128, 128, 128);"
|
||||
id="path22079" />
|
||||
<g
|
||||
id="g4"
|
||||
transform="matrix(0.00557746,0,0,0.00543996,3.0168927,3.201711)"
|
||||
style="fill:#008000;stroke-width:55.37117685;stroke-miterlimit:4;stroke-dasharray:none;stroke:#00ad00;stroke-opacity:1">
|
||||
<path
|
||||
fill="#1a1a1a"
|
||||
stroke="#1a1a1a"
|
||||
stroke-miterlimit="10"
|
||||
d="m 1084.549,475.525 -0.172,0.029 c -2.313,-15.392 -15.47,-27.231 -31.506,-27.231 -17.665,0 -31.985,14.32 -31.985,31.985 0,0.783 0.175,1.517 0.23,2.287 l -0.382,0.02 0.699,3.117 c 0.145,0.848 0.347,1.664 0.558,2.486 l 3.693,16.469 c 6.98,31.137 10.519,63.201 10.519,95.309 0,240.526 -195.678,436.21 -436.198,436.21 -240.526,0 -436.207,-195.684 -436.207,-436.21 0,-240.526 195.681,-436.204 436.207,-436.204 101.091,0 199.179,35.515 277.265,100.012 l -46.019,57.057 180.673,21.307 -55.121,-176.973 -39.496,48.969 C 827.914,140.541 715.628,99.999 600.004,99.999 c -275.703,0 -500.003,224.297 -500.003,499.997 0,275.706 224.301,500.003 500.003,500.003 275.697,0 499.994,-224.298 499.994,-500.003 0,-35.659 -3.888,-71.536 -11.553,-106.629 z"
|
||||
id="path2"
|
||||
style="fill:#008000;stroke-width:55.37117685;stroke-miterlimit:4;stroke-dasharray:none;stroke:#00ad00;stroke-opacity:1" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 3.1 KiB |
3
ApplicationExeCode/Resources/data-sources.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13 3.5C13 2.119 10.761 1 8 1C5.239 1 3 2.119 3 3.5C3 3.54 3.02 3.577 3.024 3.617H3V12.489L3.056 12.846C3.336 14.056 5.429 15 8 15C10.571 15 12.664 14.056 12.944 12.846L13 12.489V3.617H12.976C12.98 3.577 13 3.54 13 3.5ZM8 2.032C10.442 2.032 12 2.996 12 3.5C12 4.004 10.442 4.968 8 4.968C5.558 4.968 4 4 4 3.5C4 3 5.558 2.032 8 2.032ZM12 12.49L11.97 12.621C11.855 13.116 10.431 14 8 14C5.569 14 4.145 13.116 4.03 12.621L4 12.49V4.99C5.21092 5.69833 6.59796 6.04855 8 6C9.40243 6.04734 10.7895 5.69572 12 4.986V12.486V12.49Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 653 B |
3
ApplicationExeCode/Resources/edit.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.23 1H11.77L3.52002 9.25L3.35999 9.46997L1 13.59L2.41003 15L6.53003 12.64L6.75 12.48L15 4.22998V2.77002L13.23 1ZM2.41003 13.59L3.92004 10.59L5.37 12.04L2.41003 13.59ZM6.23999 11.53L4.46997 9.76001L12.47 1.76001L14.24 3.53003L6.23999 11.53Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 373 B |
3
ApplicationExeCode/Resources/graph.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 14H15V13H2V0H1V13.5L1.5 14ZM3 11.5V3.5L3.5 3H5.5L6 3.5V11.5L5.5 12H3.5L3 11.5ZM5 11V4H4V11H5ZM11 1.5V11.5L11.5 12H13.5L14 11.5V1.5L13.5 1H11.5L11 1.5ZM13 2V11H12V2H13ZM7 11.5V5.5L7.5 5H9.5L10 5.5V11.5L9.5 12H7.5L7 11.5ZM9 11V6H8V11H9Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 410 B |
3
ApplicationExeCode/Resources/messages.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 11.29L5 10.29V11.71L3.85 12.85L3 12.5V10H1.5L1 9.5V1.5L1.5 1H13.5L14 1.5V6H13V2H2V9H3.5L4 9.5V11.29ZM10.29 13L12.15 14.85L13 14.5V13H14.5L15 12.5V7.5L14.5 7H6.5L6 7.5V12.5L6.5 13H10.29ZM10.5 12H7V8H14V12H12.5L12 12.5V13.29L10.85 12.15L10.5 12Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 417 B |
12
ApplicationExeCode/Resources/multiplot.svg
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#424242;}
|
||||
</style>
|
||||
<path class="st0" d="M7,7.5H1L0.5,7v-6L1,0.4h6l0.5,0.5v6L7,7.5z M1.5,6.5h5v-5h-5V6.5z"/>
|
||||
<path class="st0" d="M15.2,7.5h-6L8.6,7v-6l0.5-0.5h6l0.5,0.5v6L15.2,7.5z M9.6,6.5h5v-5h-5V6.5z"/>
|
||||
<path class="st0" d="M6.9,15.7h-6l-0.5-0.5v-6l0.5-0.5h6l0.5,0.5v6L6.9,15.7z M1.4,14.7h5v-5h-5V14.7z"/>
|
||||
<path class="st0" d="M15.1,15.7h-6l-0.5-0.5v-6l0.5-0.5h6l0.5,0.5v6L15.1,15.7z M9.6,14.7h5v-5h-5V14.7z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 801 B |
3
ApplicationExeCode/Resources/plot-manager.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15 6.49999L14.5302 5.99999H7V1.4698L6.5302 1H1.4698L1 1.4698V9.53019L1.4698 9.99999H4V14.5302L4.4698 15H14.5302L15 14.5302V6.49999ZM2 8.99999V3H6V8.99999H2ZM14 14H5V9.99999H6.5302L7 9.53019V8.01341H14V14Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 336 B |
3
ApplicationExeCode/Resources/plots.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 14H15V13H2V0H1V13.5L1.5 14ZM3 11.5V3.5L3.5 3H5.5L6 3.5V11.5L5.5 12H3.5L3 11.5ZM5 11V4H4V11H5ZM11 1.5V11.5L11.5 12H13.5L14 11.5V1.5L13.5 1H11.5L11 1.5ZM13 2V11H12V2H13ZM7 11.5V5.5L7.5 5H9.5L10 5.5V11.5L9.5 12H7.5L7 11.5ZM9 11V6H8V11H9Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 410 B |
6
ApplicationExeCode/Resources/property-editor.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 12.23V3.77L13.13 3H14V2H13L12.69 2.09L11.5 2.9L10.28 2.08L10 2H9V3H9.85L11 3.77V12.23L9.87 13H9V14H10L10.31 13.91L11.5 13.1L12.72 13.92L13 14H14V13H13.15L12 12.23Z" fill="#424242"/>
|
||||
<path d="M1 10.5V5.5L1.5 5H10V6H2V10H10V11H1.5L1 10.5Z" fill="#424242"/>
|
||||
<path d="M13 5H14.5L15 5.5V10.5L14.5 11H13V10H14V6H13V5Z" fill="#424242"/>
|
||||
<path d="M3 7.5V8.5L3.5 9H7.5L8 8.5V7.5L7.5 7H3.5L3 7.5Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 521 B |
3
ApplicationExeCode/Resources/scripts.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4.708 5.578L2.061 8.224L4.708 10.87L4 11.578L1 8.578V7.87L4 4.87L4.708 5.578ZM11.708 4.87L11 5.578L13.647 8.224L11 10.87L11.708 11.578L14.708 8.578V7.87L11.708 4.87ZM4.908 13L5.802 13.448L10.802 3.448L9.908 3L4.908 13Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 350 B |
3
ApplicationExeCode/Resources/standard.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 1L3 2V14L4 15H12L13 14V2L12 1H4ZM4 3V2H12V14H4V13H6V12H4V10H8V9H4V7H6V6H4V4H8V3H4Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 256 B |
19
ApplicationExeCode/Resources/summary-plot.svg
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#424242;}
|
||||
.st1{fill:#424242;}
|
||||
</style>
|
||||
<path class="st0" d="M1.5,14H15v-1H2V0H1v13.5L1.5,14z"/>
|
||||
<polygon class="st1" points="12.4,6.5 9.1,3.9 7.6,5.9 6.8,5.2 8.9,2.5 12.2,5 14.1,2.6 14.9,3.2 "/>
|
||||
<rect x="3.7" y="8.4" transform="matrix(0.5823 -0.8129 0.8129 0.5823 -5.2677 7.5303)" class="st1" width="1.9" height="1"/>
|
||||
<g>
|
||||
<rect x="4.2" y="5.2" transform="matrix(0.5971 -0.8022 0.8022 0.5971 -2.6616 6.0987)" class="st1" width="1" height="1"/>
|
||||
<path class="st1" d="M10,10.3L8.3,9l0.6-0.8l1.7,1.3L10,10.3z M7.4,8.3L5.7,7l0.6-0.8L8,7.5L7.4,8.3z"/>
|
||||
<polygon class="st1" points="12.1,11.8 10.9,10.9 11.5,10.1 11.9,10.4 12.2,10 13,10.6 "/>
|
||||
<rect x="12.7" y="8.8" transform="matrix(0.5959 -0.803 0.803 0.5959 -2.0979 14.4626)" class="st1" width="1.2" height="1"/>
|
||||
<rect x="13.8" y="7.4" transform="matrix(0.5953 -0.8035 0.8035 0.5953 -0.5662 14.7387)" class="st1" width="1" height="1"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -84,6 +84,10 @@ QwtPlot["PvtPlot"]::lineMarker["*"] {
|
||||
color: $textColor;
|
||||
}
|
||||
|
||||
QLabel, RiuQwtPlotLegend {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
QwtPlot["PvtPlot"]::pointMarker["*"] {
|
||||
color: $textColor;
|
||||
}
|
||||
|
3
ApplicationExeCode/Resources/undo-stack.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1 10V9H6.20703C6.11588 9.32228 6.05337 9.65659 6.02242 10H1ZM7.25716 7C7.57052 6.62057 7.93379 6.28389 8.33692 6H1V7H7.25716ZM6.59971 13C6.43777 12.6832 6.30564 12.3486 6.20703 12H1V13H6.59971ZM15 3V4H1V3H15ZM11.6406 13.0312C13.0386 13.0312 14.1719 11.898 14.1719 10.5C14.1719 9.10203 13.0386 7.96875 11.6406 7.96875C10.7037 7.96875 9.88566 8.47778 9.448 9.23438H10.5156V10.0781H8.54688L8.125 9.65625V7.40625H8.96875V8.43775C9.58599 7.63922 10.5533 7.125 11.6406 7.125C13.5046 7.125 15.0156 8.63604 15.0156 10.5C15.0156 12.364 13.5046 13.875 11.6406 13.875C10.2564 13.875 9.06688 13.0417 8.5462 11.8495L9.32848 11.5317C9.7234 12.4154 10.6101 13.0312 11.6406 13.0312Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 838 B |
3
ApplicationExeCode/Resources/view-snapshots.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.707 3H14.5L15 3.5V12.5L14.5 13H1.5L1 12.5V3.5L1.5 3H5.293L6.146 2.146L6.5 2H9.5L9.854 2.146L10.707 3ZM2 12H14V4H10.5L10.146 3.854L9.293 3H6.707L5.854 3.854L5.5 4H2V12ZM3.5 5C3.40111 5 3.30444 5.02932 3.22222 5.08427C3.13999 5.13921 3.0759 5.2173 3.03806 5.30866C3.00022 5.40002 2.99031 5.50055 3.00961 5.59755C3.0289 5.69454 3.07652 5.78363 3.14645 5.85355C3.21637 5.92348 3.30546 5.9711 3.40246 5.99039C3.49945 6.00969 3.59998 5.99978 3.69134 5.96194C3.78271 5.9241 3.86079 5.86001 3.91574 5.77779C3.97068 5.69556 4 5.59889 4 5.5C4 5.36739 3.94732 5.24021 3.85355 5.14645C3.75979 5.05268 3.63261 5 3.5 5ZM8 6C8.39556 6 8.78224 6.1173 9.11114 6.33706C9.44004 6.55682 9.69639 6.86918 9.84776 7.23463C9.99914 7.60009 10.0387 8.00222 9.96157 8.39018C9.8844 8.77814 9.69392 9.13451 9.41421 9.41421C9.13451 9.69392 8.77814 9.8844 8.39018 9.96157C8.00222 10.0387 7.60009 9.99913 7.23463 9.84776C6.86918 9.69638 6.55683 9.44004 6.33706 9.11114C6.1173 8.78224 6 8.39556 6 8C6 7.46957 6.21071 6.96086 6.58579 6.58579C6.96086 6.21071 7.46957 6 8 6ZM8 5C7.40666 5 6.82664 5.17595 6.33329 5.50559C5.83994 5.83524 5.45543 6.30377 5.22836 6.85195C5.0013 7.40013 4.94189 8.00333 5.05765 8.58527C5.1734 9.16721 5.45912 9.70176 5.87868 10.1213C6.29824 10.5409 6.83279 10.8266 7.41473 10.9424C7.99667 11.0581 8.59987 10.9987 9.14805 10.7716C9.69623 10.5446 10.1648 10.1601 10.4944 9.66671C10.8241 9.17336 11 8.59334 11 8C11 7.20435 10.6839 6.44129 10.1213 5.87868C9.55871 5.31607 8.79565 5 8 5Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
3
ApplicationExeCode/Resources/view.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.5 2H1.5L1 2.5V13.5L1.5 14H14.5L15 13.5V2.5L14.5 2ZM14 13H2V6H14V13ZM14 5H2V3H14V5Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 217 B |
12
ApplicationExeCode/Resources/well-log-plot.svg
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#424242;}
|
||||
.st1{fill:#424242;}
|
||||
</style>
|
||||
<path class="st0" d="M1.5,14H15v-1H2V0H1v13.5L1.5,14z"/>
|
||||
<polygon class="st1" points="12.8,11.2 11.8,11.2 11.8,9.3 9.9,9.2 9.9,5.2 12.5,5.2 12.5,2.2 4.2,2.2 4.2,1.2 13.5,1.2 13.5,6.2
|
||||
10.9,6.2 10.9,8.2 12.8,8.3 "/>
|
||||
</svg>
|
After Width: | Height: | Size: 679 B |
3
ApplicationExeCode/Resources/window-management.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 1.5L6.5 1H14.5L15 1.5V3.5V8.5L14.5 9H12V8H14V4H7V5H6V3.5V1.5ZM7 2V3H14V2H7ZM1.5 7L1 7.5V14.5L1.5 15H9.5L10 14.5V7.5L9.5 7H1.5ZM2 9V8H9V9H2ZM2 10H9V14H2V10Z" fill="#424242"/>
|
||||
</svg>
|
After Width: | Height: | Size: 329 B |
@ -18,6 +18,7 @@
|
||||
|
||||
#include "RiaArgumentParser.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaMainTools.h"
|
||||
|
||||
#ifdef ENABLE_GRPC
|
||||
#include "RiaGrpcConsoleApplication.h"
|
||||
@ -26,6 +27,7 @@
|
||||
#include "RiaConsoleApplication.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#endif
|
||||
|
||||
#include "cvfProgramOptions.h"
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
@ -66,8 +68,12 @@ int main( int argc, char* argv[] )
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
// Global initialization
|
||||
RiaLogging::loggerInstance()->setLevel( int( RILogLevel::RI_LL_DEBUG ) );
|
||||
|
||||
// Create feature manager before the application object is created
|
||||
RiaMainTools::initializeSingletons();
|
||||
|
||||
std::unique_ptr<RiaApplication> app( createApplication( argc, argv ) );
|
||||
|
||||
cvf::ProgramOptions progOpt;
|
||||
@ -112,6 +118,9 @@ int main( int argc, char* argv[] )
|
||||
// Make sure project is closed to avoid assert and crash in destruction of widgets
|
||||
app->closeProject();
|
||||
|
||||
app.reset();
|
||||
RiaMainTools::releaseSingletonAndFactoryObjects();
|
||||
|
||||
return 0;
|
||||
}
|
||||
else if ( status == RiaApplication::ApplicationStatus::EXIT_WITH_ERROR )
|
||||
@ -147,6 +156,9 @@ int main( int argc, char* argv[] )
|
||||
throw;
|
||||
}
|
||||
|
||||
app.reset();
|
||||
RiaMainTools::releaseSingletonAndFactoryObjects();
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
|
61
ApplicationExeCode/RiaMainTools.cpp
Normal file
@ -0,0 +1,61 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiaMainTools.h"
|
||||
#include "RiaRegressionTestRunner.h"
|
||||
#include "RiaSocketCommand.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmDefaultObjectFactory.h"
|
||||
#include "cafPdmUiFieldEditorHandle.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaMainTools::initializeSingletons()
|
||||
{
|
||||
caf::CmdFeatureManager::createSingleton();
|
||||
RiaRegressionTestRunner::createSingleton();
|
||||
caf::PdmDefaultObjectFactory::createSingleton();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// This method is used to release memory allocated by static functions. This enables use of memory allocation tools
|
||||
/// after the application has closed down.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaMainTools::releaseSingletonAndFactoryObjects()
|
||||
{
|
||||
caf::CmdFeatureManager::deleteSingleton();
|
||||
RiaRegressionTestRunner::deleteSingleton();
|
||||
caf::PdmDefaultObjectFactory::deleteSingleton();
|
||||
|
||||
{
|
||||
auto factory = caf::Factory<caf::PdmUiFieldEditorHandle, QString>::instance();
|
||||
factory->deleteCreatorObjects();
|
||||
}
|
||||
|
||||
{
|
||||
auto factory = caf::Factory<caf::CmdFeature, std::string>::instance();
|
||||
factory->deleteCreatorObjects();
|
||||
}
|
||||
{
|
||||
auto factory = caf::Factory<RiaSocketCommand, QString>::instance();
|
||||
factory->deleteCreatorObjects();
|
||||
}
|
||||
}
|
25
ApplicationExeCode/RiaMainTools.h
Normal file
@ -0,0 +1,25 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
|
||||
class RiaMainTools
|
||||
{
|
||||
public:
|
||||
static void initializeSingletons();
|
||||
static void releaseSingletonAndFactoryObjects();
|
||||
};
|
@ -21,9 +21,14 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFeatureCommandContext.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStringListSerializer.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.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
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -49,9 +54,14 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFeatureCommandContext.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStringListSerializer.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.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
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
@ -63,8 +73,8 @@ set(QT_MOC_HEADERS
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaConsoleApplication.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaGuiApplication.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaCompletionTypeCalculationScheduler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaScheduler.h
|
||||
)
|
||||
|
||||
source_group(
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "RiaVersionInfo.h"
|
||||
#include "RiaViewRedrawScheduler.h"
|
||||
#include "RiaWellNameComparer.h"
|
||||
|
||||
#include "ExportCommands/RicSnapshotAllViewsToFileFeature.h"
|
||||
#include "HoloLensCommands/RicHoloLensSessionManager.h"
|
||||
@ -39,6 +40,7 @@
|
||||
#include "RicfCommandObject.h"
|
||||
|
||||
#include "CommandRouter/RimCommandRouter.h"
|
||||
#include "PlotTemplates/RimPlotTemplateFolderItem.h"
|
||||
#include "Rim2dIntersectionViewCollection.h"
|
||||
#include "RimAnnotationCollection.h"
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
@ -55,6 +57,7 @@
|
||||
#include "RimGeoMechCellColors.h"
|
||||
#include "RimGeoMechModels.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimGridCalculationCollection.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimObservedDataCollection.h"
|
||||
@ -63,6 +66,7 @@
|
||||
#include "RimOilField.h"
|
||||
#include "RimPlotWindow.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimStimPlanColors.h"
|
||||
#include "RimStimPlanModel.h"
|
||||
@ -94,6 +98,7 @@
|
||||
#include "cafPdmSettings.h"
|
||||
#include "cafPdmUiModelChangeDetector.h"
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafUiProcess.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
@ -161,6 +166,8 @@ RiaApplication::RiaApplication()
|
||||
RiaApplication::~RiaApplication()
|
||||
{
|
||||
RiaFontCache::clear();
|
||||
|
||||
caf::SelectionManager::instance()->setPdmRootObject( nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -701,6 +708,14 @@ bool RiaApplication::loadProject( const QString& projectFileName,
|
||||
// Execute command objects, and release the mutex when the queue is empty
|
||||
executeCommandObjects();
|
||||
|
||||
// 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() )
|
||||
{
|
||||
gridCalculation->calculate();
|
||||
gridCalculation->updateDependentObjects();
|
||||
}
|
||||
|
||||
RiaLogging::info( QString( "Completed open of project file : '%1'" ).arg( projectFileName ) );
|
||||
|
||||
return true;
|
||||
@ -782,6 +797,8 @@ void RiaApplication::closeProject()
|
||||
m_project->close();
|
||||
m_commandQueue.clear();
|
||||
|
||||
RiaWellNameComparer::clearCache();
|
||||
|
||||
onProjectClosed();
|
||||
|
||||
caf::PdmUiModelChangeDetector::instance()->reset();
|
||||
@ -1209,9 +1226,11 @@ void RiaApplication::applyPreferences()
|
||||
|
||||
if ( this->project() )
|
||||
{
|
||||
this->project()->setScriptDirectories( m_preferences->scriptDirectories() );
|
||||
this->project()->setScriptDirectories( m_preferences->scriptDirectories(), m_preferences->maxScriptFoldersDepth() );
|
||||
this->project()->setPlotTemplateFolders( m_preferences->plotTemplateFolders() );
|
||||
this->project()->updateConnectedEditors();
|
||||
|
||||
project()->scriptCollection()->updateConnectedEditors();
|
||||
project()->rootPlotTemplateItem()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
caf::ProgressInfoStatic::setEnabled( RiaPreferencesSystem::current()->showProgressBar() );
|
||||
@ -1494,8 +1513,10 @@ void RiaApplication::initialize()
|
||||
|
||||
// Start with a project
|
||||
m_project = std::make_unique<RimProject>();
|
||||
m_project->setScriptDirectories( m_preferences->scriptDirectories() );
|
||||
m_project->setScriptDirectories( m_preferences->scriptDirectories(), m_preferences->maxScriptFoldersDepth() );
|
||||
m_project->setPlotTemplateFolders( m_preferences->plotTemplateFolders() );
|
||||
|
||||
caf::SelectionManager::instance()->setPdmRootObject( project() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1525,7 +1546,9 @@ void RiaApplication::resetProject()
|
||||
m_project.reset();
|
||||
m_preferences.reset();
|
||||
|
||||
initialize();
|
||||
// Call RiaApplication::initialize() to recreate project and preferences. Do not call virtual method initialize(),
|
||||
// as RiaGuiApplication::initialize() creates a new logger causing console text to disappear.
|
||||
RiaApplication::initialize();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -56,7 +56,7 @@ RiaCompletionTypeCalculationScheduler* RiaCompletionTypeCalculationScheduler::in
|
||||
void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAndRedrawAllViews()
|
||||
{
|
||||
std::vector<RimEclipseCase*> eclipseCases =
|
||||
RimProject::current()->activeOilField()->analysisModels->cases().childObjects();
|
||||
RimProject::current()->activeOilField()->analysisModels->cases().children();
|
||||
|
||||
scheduleRecalculateCompletionTypeAndRedrawAllViews( eclipseCases );
|
||||
}
|
||||
@ -78,38 +78,50 @@ void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAnd
|
||||
void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAndRedrawAllViews(
|
||||
const std::vector<RimEclipseCase*>& eclipseCases )
|
||||
{
|
||||
clearCompletionTypeResults( eclipseCases );
|
||||
|
||||
for ( RimEclipseCase* eclipseCase : eclipseCases )
|
||||
{
|
||||
CVF_ASSERT( eclipseCase );
|
||||
|
||||
if ( eclipseCase->eclipseCaseData() )
|
||||
{
|
||||
eclipseCase->eclipseCaseData()
|
||||
->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
|
||||
->clearScalarResult( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
|
||||
RiaResultNames::completionTypeResultName() );
|
||||
|
||||
// Delete virtual perforation transmissibilities, as these are the basis for the computation of completion type
|
||||
eclipseCase->eclipseCaseData()->setVirtualPerforationTransmissibilities( nullptr );
|
||||
}
|
||||
|
||||
m_eclipseCasesToRecalculate.push_back( eclipseCase );
|
||||
if ( eclipseCase ) m_eclipseCasesToRecalculate.emplace_back( eclipseCase );
|
||||
}
|
||||
|
||||
startTimer();
|
||||
startTimer( 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::slotRecalculateCompletionType()
|
||||
void RiaCompletionTypeCalculationScheduler::clearCompletionTypeResultsInAllCases()
|
||||
{
|
||||
if ( caf::ProgressState::isActive() )
|
||||
{
|
||||
startTimer();
|
||||
return;
|
||||
}
|
||||
std::vector<RimEclipseCase*> eclipseCases =
|
||||
RimProject::current()->activeOilField()->analysisModels->cases().children();
|
||||
|
||||
clearCompletionTypeResults( eclipseCases );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::clearCompletionTypeResults( const std::vector<RimEclipseCase*>& eclipseCases )
|
||||
{
|
||||
for ( RimEclipseCase* eclipseCase : eclipseCases )
|
||||
{
|
||||
if ( !eclipseCase || !eclipseCase->eclipseCaseData() ) continue;
|
||||
|
||||
eclipseCase->eclipseCaseData()
|
||||
->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
|
||||
->clearScalarResult( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::completionTypeResultName() );
|
||||
|
||||
// Delete virtual perforation transmissibilities, as these are the basis for the computation of completion type
|
||||
eclipseCase->eclipseCaseData()->setVirtualPerforationTransmissibilities( nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::performScheduledUpdates()
|
||||
{
|
||||
std::set<RimEclipseCase*> uniqueCases( m_eclipseCasesToRecalculate.begin(), m_eclipseCasesToRecalculate.end() );
|
||||
|
||||
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
@ -149,28 +161,11 @@ void RiaCompletionTypeCalculationScheduler::slotRecalculateCompletionType()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaCompletionTypeCalculationScheduler::~RiaCompletionTypeCalculationScheduler()
|
||||
{
|
||||
delete m_recalculateCompletionTypeTimer;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaCompletionTypeCalculationScheduler::RiaCompletionTypeCalculationScheduler()
|
||||
: m_recalculateCompletionTypeTimer( nullptr )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::startTimer()
|
||||
{
|
||||
if ( !m_recalculateCompletionTypeTimer )
|
||||
{
|
||||
m_recalculateCompletionTypeTimer = new QTimer( this );
|
||||
m_recalculateCompletionTypeTimer->setSingleShot( true );
|
||||
connect( m_recalculateCompletionTypeTimer, SIGNAL( timeout() ), this, SLOT( slotRecalculateCompletionType() ) );
|
||||
}
|
||||
|
||||
m_recalculateCompletionTypeTimer->start( 1500 );
|
||||
}
|
||||
|
@ -18,29 +18,30 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
#include "RiaScheduler.h"
|
||||
|
||||
#include <QObject>
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class QTimer;
|
||||
class RimEclipseCase;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RiaCompletionTypeCalculationScheduler : public QObject
|
||||
class RiaCompletionTypeCalculationScheduler : public RiaScheduler
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
static RiaCompletionTypeCalculationScheduler* instance();
|
||||
void scheduleRecalculateCompletionTypeAndRedrawAllViews();
|
||||
void scheduleRecalculateCompletionTypeAndRedrawAllViews( RimEclipseCase* eclipseCase );
|
||||
void clearCompletionTypeResultsInAllCases();
|
||||
|
||||
private slots:
|
||||
void slotRecalculateCompletionType();
|
||||
void scheduleRecalculateCompletionTypeAndRedrawAllViews( RimEclipseCase* eclipseCase );
|
||||
void clearCompletionTypeResults( const std::vector<RimEclipseCase*>& eclipseCases );
|
||||
|
||||
void performScheduledUpdates() override;
|
||||
|
||||
private:
|
||||
RiaCompletionTypeCalculationScheduler();
|
||||
@ -51,9 +52,6 @@ private:
|
||||
|
||||
void scheduleRecalculateCompletionTypeAndRedrawAllViews( const std::vector<RimEclipseCase*>& eclipseCases );
|
||||
|
||||
void startTimer();
|
||||
|
||||
private:
|
||||
std::vector<caf::PdmPointer<RimEclipseCase>> m_eclipseCasesToRecalculate;
|
||||
QTimer* m_recalculateCompletionTypeTimer;
|
||||
};
|
||||
|
60
ApplicationLibCode/Application/RiaDateTimeDefines.cpp
Normal file
@ -0,0 +1,60 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiaDateTimeDefines.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::DateFormatComponents>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::DateFormatComponents::DATE_FORMAT_NONE, "NO_DATE", "No Date" );
|
||||
addItem( RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR, "YEAR", "Year Only" );
|
||||
addItem( RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH, "YEAR_MONTH", "Year and Month" );
|
||||
addItem( RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY, "YEAR_MONTH_DAY", "Year, Month and Day" );
|
||||
setDefault( RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::TimeFormatComponents>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_NONE, "NO_TIME", "No Time of Day" );
|
||||
addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR, "HOUR", "Hour Only" );
|
||||
addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE, "HOUR_MINUTE", "Hour and Minute" );
|
||||
addItem( RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND,
|
||||
"HOUR_MINUTE_SECONDS",
|
||||
"Hour, Minutes and Seconds" );
|
||||
setDefault( RiaDefines::TimeFormatComponents::TIME_FORMAT_NONE );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::DateTimePeriod>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::DateTimePeriod::NONE, "NONE", "None" );
|
||||
addItem( RiaDefines::DateTimePeriod::DAY, "DAY", "Day" );
|
||||
addItem( RiaDefines::DateTimePeriod::WEEK, "WEEK", "Week" );
|
||||
addItem( RiaDefines::DateTimePeriod::MONTH, "MONTH", "Month" );
|
||||
addItem( RiaDefines::DateTimePeriod::QUARTER, "QUARTER", "Quarter" );
|
||||
addItem( RiaDefines::DateTimePeriod::HALFYEAR, "HALFYEAR", "Half Year" );
|
||||
addItem( RiaDefines::DateTimePeriod::YEAR, "YEAR", "Year" );
|
||||
addItem( RiaDefines::DateTimePeriod::DECADE, "DECADE", "Decade" );
|
||||
setDefault( RiaDefines::DateTimePeriod::NONE );
|
||||
}
|
||||
} // namespace caf
|
59
ApplicationLibCode/Application/RiaDateTimeDefines.h
Normal file
@ -0,0 +1,59 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cafAppEnum.h"
|
||||
|
||||
namespace RiaDefines
|
||||
{
|
||||
enum class DateFormatComponents
|
||||
{
|
||||
DATE_FORMAT_UNSPECIFIED = -2,
|
||||
DATE_FORMAT_NONE = -1,
|
||||
DATE_FORMAT_YEAR = 0,
|
||||
DATE_FORMAT_YEAR_MONTH,
|
||||
DATE_FORMAT_YEAR_MONTH_DAY,
|
||||
};
|
||||
|
||||
enum class TimeFormatComponents
|
||||
{
|
||||
TIME_FORMAT_UNSPECIFIED = -2,
|
||||
TIME_FORMAT_NONE = -1,
|
||||
TIME_FORMAT_HOUR,
|
||||
TIME_FORMAT_HOUR_MINUTE,
|
||||
TIME_FORMAT_HOUR_MINUTE_SECOND,
|
||||
TIME_FORMAT_HOUR_MINUTE_SECOND_MILLISECOND,
|
||||
TIME_FORMAT_SIZE
|
||||
};
|
||||
|
||||
enum class DateTimePeriod
|
||||
{
|
||||
NONE = -1,
|
||||
DAY,
|
||||
WEEK,
|
||||
MONTH,
|
||||
QUARTER,
|
||||
HALFYEAR,
|
||||
YEAR,
|
||||
DECADE
|
||||
};
|
||||
|
||||
using DateTimePeriodEnum = caf::AppEnum<RiaDefines::DateTimePeriod>;
|
||||
|
||||
}; // namespace RiaDefines
|
@ -72,15 +72,6 @@ void caf::AppEnum<RiaDefines::DepthTypeEnum>::setUp()
|
||||
setDefault( RiaDefines::DepthTypeEnum::MEASURED_DEPTH );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::PlotAxis>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::PlotAxis::PLOT_AXIS_LEFT, "PLOT_AXIS_LEFT", "Left" );
|
||||
addItem( RiaDefines::PlotAxis::PLOT_AXIS_RIGHT, "PLOT_AXIS_RIGHT", "Right" );
|
||||
|
||||
setDefault( RiaDefines::PlotAxis::PLOT_AXIS_LEFT );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::PhaseType>::setUp()
|
||||
{
|
||||
@ -146,6 +137,26 @@ void AppEnum<RiaDefines::RINavigationPolicy>::setUp()
|
||||
setDefault( RiaDefines::RINavigationPolicy::NAVIGATION_POLICY_RMS );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::ColumnCount>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::ColumnCount::COLUMNS_1, "1", "1 Column" );
|
||||
addItem( RiaDefines::ColumnCount::COLUMNS_2, "2", "2 Columns" );
|
||||
addItem( RiaDefines::ColumnCount::COLUMNS_3, "3", "3 Columns" );
|
||||
addItem( RiaDefines::ColumnCount::COLUMNS_4, "4", "4 Columns" );
|
||||
setDefault( RiaDefines::ColumnCount::COLUMNS_2 );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::RowCount>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::RowCount::ROWS_1, "1", "1 Row" );
|
||||
addItem( RiaDefines::RowCount::ROWS_2, "2", "2 Rows" );
|
||||
addItem( RiaDefines::RowCount::ROWS_3, "3", "3 Rows" );
|
||||
addItem( RiaDefines::RowCount::ROWS_4, "4", "4 Rows" );
|
||||
setDefault( RiaDefines::RowCount::ROWS_2 );
|
||||
}
|
||||
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -243,30 +254,6 @@ RiaDefines::EclipseUnitSystem RiaDefines::fromDepthUnit( DepthUnitType depthUnit
|
||||
return RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaDefines::minimumDefaultValuePlot()
|
||||
{
|
||||
return -10.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaDefines::minimumDefaultLogValuePlot()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaDefines::maximumDefaultValuePlot()
|
||||
{
|
||||
return 100.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -350,3 +337,11 @@ bool RiaDefines::isInjector( WellProductionType wellProductionType )
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::stringListSeparator()
|
||||
{
|
||||
return "|";
|
||||
}
|
||||
|
@ -107,18 +107,6 @@ enum class DepthTypeEnum
|
||||
TRUE_VERTICAL_DEPTH_RKB
|
||||
};
|
||||
|
||||
// Defines relate to plotting
|
||||
enum class PlotAxis
|
||||
{
|
||||
PLOT_AXIS_LEFT,
|
||||
PLOT_AXIS_RIGHT,
|
||||
PLOT_AXIS_BOTTOM
|
||||
};
|
||||
|
||||
double minimumDefaultValuePlot();
|
||||
double minimumDefaultLogValuePlot();
|
||||
double maximumDefaultValuePlot();
|
||||
|
||||
enum class PhaseType
|
||||
{
|
||||
OIL_PHASE,
|
||||
@ -197,4 +185,44 @@ enum class WellProductionType : short
|
||||
|
||||
bool isInjector( WellProductionType wellProductionType );
|
||||
|
||||
QString stringListSeparator();
|
||||
|
||||
enum class ColumnCount
|
||||
{
|
||||
COLUMNS_1 = 1,
|
||||
COLUMNS_2 = 2,
|
||||
COLUMNS_3 = 3,
|
||||
COLUMNS_4 = 4,
|
||||
COLUMNS_UNLIMITED = 1000,
|
||||
};
|
||||
|
||||
enum class RowCount
|
||||
{
|
||||
ROWS_1 = 1,
|
||||
ROWS_2 = 2,
|
||||
ROWS_3 = 3,
|
||||
ROWS_4 = 4,
|
||||
};
|
||||
|
||||
enum class MultiPlotPageUpdateType : uint32_t
|
||||
{
|
||||
NONE = 0b00000000,
|
||||
LEGEND = 0b00000001,
|
||||
PLOT = 0b00000010,
|
||||
TITLE = 0b00000100,
|
||||
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 ) );
|
||||
}
|
||||
|
||||
}; // namespace RiaDefines
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "RiaArgumentParser.h"
|
||||
#include "RiaBaseDefs.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaFontCache.h"
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
@ -78,7 +79,6 @@
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimTextAnnotation.h"
|
||||
#include "RimTextAnnotationInView.h"
|
||||
#include "RimViewLinker.h"
|
||||
@ -100,6 +100,7 @@
|
||||
#include "RiuMdiMaximizeWindowGuard.h"
|
||||
#include "RiuMessagePanel.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
#include "RiuProcessMonitor.h"
|
||||
#include "RiuRecentFileActionProvider.h"
|
||||
#include "RiuViewer.h"
|
||||
@ -124,6 +125,7 @@
|
||||
#include <QDir>
|
||||
#include <QErrorMessage>
|
||||
#include <QGridLayout>
|
||||
#include <QKeyEvent>
|
||||
#include <QMdiSubWindow>
|
||||
#include <QMessageBox>
|
||||
#include <QProcessEnvironment>
|
||||
@ -188,8 +190,7 @@ RiaGuiApplication::RiaGuiApplication( int& argc, char** argv )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaGuiApplication::~RiaGuiApplication()
|
||||
{
|
||||
deleteMainPlotWindow();
|
||||
deleteMainWindow();
|
||||
m_mainWindow.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -294,39 +295,46 @@ bool RiaGuiApplication::saveProjectAs( const QString& fileName )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGuiApplication::storeTreeViewState()
|
||||
{
|
||||
if ( m_mainWindow )
|
||||
{
|
||||
if ( mainPlotWindow() && mainPlotWindow()->projectTreeView() )
|
||||
QStringList treeStates;
|
||||
QStringList treeIndexes;
|
||||
|
||||
for ( auto& tv : m_mainWindow->projectTreeViews() )
|
||||
{
|
||||
caf::PdmUiTreeView* projectTreeView = mainPlotWindow()->projectTreeView();
|
||||
|
||||
QString treeViewState;
|
||||
caf::QTreeViewStateSerializer::storeTreeViewStateToString( projectTreeView->treeView(), treeViewState );
|
||||
tv->storeTreeViewStateToString( treeViewState );
|
||||
treeStates.append( treeViewState );
|
||||
|
||||
QModelIndex mi = projectTreeView->treeView()->currentIndex();
|
||||
|
||||
QString encodedModelIndexString;
|
||||
QModelIndex mi = tv->treeView()->currentIndex();
|
||||
QString encodedModelIndexString;
|
||||
caf::QTreeViewStateSerializer::encodeStringFromModelIndex( mi, encodedModelIndexString );
|
||||
|
||||
project()->plotWindowTreeViewState = treeViewState;
|
||||
project()->plotWindowCurrentModelIndexPath = encodedModelIndexString;
|
||||
treeIndexes.append( encodedModelIndexString );
|
||||
}
|
||||
|
||||
project()->mainWindowTreeViewStates = treeStates.join( RiaDefines::stringListSeparator() );
|
||||
project()->mainWindowCurrentModelIndexPaths = treeIndexes.join( RiaDefines::stringListSeparator() );
|
||||
}
|
||||
|
||||
if ( m_mainPlotWindow )
|
||||
{
|
||||
caf::PdmUiTreeView* projectTreeView = m_mainWindow->projectTreeView();
|
||||
if ( projectTreeView )
|
||||
QStringList treeStates;
|
||||
QStringList treeIndexes;
|
||||
|
||||
for ( auto& tv : mainPlotWindow()->projectTreeViews() )
|
||||
{
|
||||
QString treeViewState;
|
||||
caf::QTreeViewStateSerializer::storeTreeViewStateToString( projectTreeView->treeView(), treeViewState );
|
||||
tv->storeTreeViewStateToString( treeViewState );
|
||||
treeStates.append( treeViewState );
|
||||
|
||||
QModelIndex mi = projectTreeView->treeView()->currentIndex();
|
||||
|
||||
QString encodedModelIndexString;
|
||||
QModelIndex mi = tv->treeView()->currentIndex();
|
||||
QString encodedModelIndexString;
|
||||
caf::QTreeViewStateSerializer::encodeStringFromModelIndex( mi, encodedModelIndexString );
|
||||
|
||||
project()->mainWindowTreeViewState = treeViewState;
|
||||
project()->mainWindowCurrentModelIndexPath = encodedModelIndexString;
|
||||
treeIndexes.append( encodedModelIndexString );
|
||||
}
|
||||
|
||||
project()->plotWindowTreeViewStates = treeStates.join( RiaDefines::stringListSeparator() );
|
||||
project()->plotWindowCurrentModelIndexPaths = treeIndexes.join( RiaDefines::stringListSeparator() );
|
||||
}
|
||||
}
|
||||
|
||||
@ -562,6 +570,12 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
|
||||
RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( cvfqt::Utils::toQStringList( o.values() ) );
|
||||
}
|
||||
|
||||
if ( cvf::Option o = progOpt->option( "openplotwindow" ) )
|
||||
{
|
||||
if ( m_mainWindow ) m_mainWindow->hide();
|
||||
getOrCreateAndShowMainPlotWindow();
|
||||
}
|
||||
|
||||
QString projectFileName;
|
||||
|
||||
if ( progOpt->hasOption( "last" ) )
|
||||
@ -775,7 +789,7 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
|
||||
mainPlotWnd->loadWinGeoAndDockToolBarLayout();
|
||||
}
|
||||
|
||||
RiuMainWindow::instance()->loadWinGeoAndDockToolBarLayout();
|
||||
if ( RiuMainWindow::instance() ) RiuMainWindow::instance()->loadWinGeoAndDockToolBarLayout();
|
||||
|
||||
return ApplicationStatus::EXIT_COMPLETED;
|
||||
}
|
||||
@ -909,6 +923,7 @@ RiuMainWindow* RiaGuiApplication::getOrCreateAndShowMainWindow()
|
||||
else
|
||||
{
|
||||
m_mainWindow->loadWinGeoAndDockToolBarLayout();
|
||||
m_mainWindow->show();
|
||||
}
|
||||
|
||||
return m_mainWindow;
|
||||
@ -933,7 +948,7 @@ RiuPlotMainWindow* RiaGuiApplication::getOrCreateMainPlotWindow()
|
||||
m_mainPlotWindow->initializeGuiNewProjectLoaded();
|
||||
loadAndUpdatePlotData();
|
||||
}
|
||||
return m_mainPlotWindow;
|
||||
return m_mainPlotWindow.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -958,18 +973,6 @@ void RiaGuiApplication::createMainWindow()
|
||||
m_mainWindow->showWindow();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGuiApplication::deleteMainWindow()
|
||||
{
|
||||
if ( m_mainWindow )
|
||||
{
|
||||
delete m_mainWindow;
|
||||
m_mainWindow = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -982,26 +985,13 @@ void RiaGuiApplication::createMainPlotWindow()
|
||||
caf::CmdExecCommandManager::instance()->enableUndoCommandSystem( true );
|
||||
}
|
||||
|
||||
m_mainPlotWindow = new RiuPlotMainWindow;
|
||||
m_mainPlotWindow = std::make_unique<RiuPlotMainWindow>();
|
||||
m_mainPlotWindow->setWindowTitle( "Plots - ResInsight" );
|
||||
m_mainPlotWindow->setDefaultWindowSize();
|
||||
m_mainPlotWindow->loadWinGeoAndDockToolBarLayout();
|
||||
m_mainPlotWindow->hideAllDockWidgets();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGuiApplication::deleteMainPlotWindow()
|
||||
{
|
||||
if ( m_mainPlotWindow )
|
||||
{
|
||||
m_mainPlotWindow->setParent( nullptr );
|
||||
delete m_mainPlotWindow;
|
||||
m_mainPlotWindow = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1038,7 +1028,7 @@ RiuPlotMainWindow* RiaGuiApplication::getOrCreateAndShowMainPlotWindow()
|
||||
m_mainPlotWindow->restoreDockWidgetVisibilities();
|
||||
}
|
||||
|
||||
return m_mainPlotWindow;
|
||||
return m_mainPlotWindow.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1046,7 +1036,7 @@ RiuPlotMainWindow* RiaGuiApplication::getOrCreateAndShowMainPlotWindow()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotMainWindow* RiaGuiApplication::mainPlotWindow()
|
||||
{
|
||||
return m_mainPlotWindow;
|
||||
return m_mainPlotWindow.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1057,7 +1047,7 @@ RiuMainWindowBase* RiaGuiApplication::mainWindowByID( int mainWindowID )
|
||||
if ( mainWindowID == 0 )
|
||||
return m_mainWindow;
|
||||
else if ( mainWindowID == 1 )
|
||||
return m_mainPlotWindow;
|
||||
return m_mainPlotWindow.get();
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
@ -1152,7 +1142,7 @@ void RiaGuiApplication::clearAllSelections()
|
||||
void RiaGuiApplication::showFormattedTextInMessageBoxOrConsole( const QString& text )
|
||||
{
|
||||
// Create a message dialog with cut/paste friendly text
|
||||
QDialog dlg( RiuMainWindow::instance() );
|
||||
QDialog dlg;
|
||||
dlg.setModal( true );
|
||||
|
||||
QGridLayout* layout = new QGridLayout;
|
||||
@ -1235,7 +1225,7 @@ void RiaGuiApplication::onProjectBeingOpened()
|
||||
void RiaGuiApplication::onProjectOpeningError( const QString& errMsg )
|
||||
{
|
||||
RiaLogging::errorInMessageBox( nullptr, "Error when opening project file", errMsg );
|
||||
m_mainWindow->setPdmRoot( nullptr );
|
||||
if ( m_mainWindow ) m_mainWindow->setPdmRoot( nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1245,11 +1235,11 @@ void RiaGuiApplication::onProjectOpened()
|
||||
{
|
||||
if ( m_project->show3DWindow() )
|
||||
{
|
||||
m_mainWindow->show();
|
||||
getOrCreateAndShowMainWindow();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mainWindow->hide();
|
||||
if ( m_mainWindow ) m_mainWindow->hide();
|
||||
}
|
||||
|
||||
if ( m_project->showPlotWindow() )
|
||||
@ -1288,6 +1278,9 @@ void RiaGuiApplication::onProjectOpened()
|
||||
m_maximizeWindowGuard.reset();
|
||||
|
||||
processEvents();
|
||||
|
||||
// Make sure to process events before this function to avoid strange Qt crash
|
||||
RiuPlotMainWindowTools::refreshToolbars();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1303,12 +1296,8 @@ void RiaGuiApplication::onProjectBeingClosed()
|
||||
|
||||
RiaGuiApplication::clearAllSelections();
|
||||
|
||||
m_mainWindow->cleanupGuiBeforeProjectClose();
|
||||
|
||||
if ( m_mainPlotWindow )
|
||||
{
|
||||
m_mainPlotWindow->cleanupGuiBeforeProjectClose();
|
||||
}
|
||||
if ( m_mainWindow ) m_mainWindow->cleanupGuiBeforeProjectClose();
|
||||
if ( m_mainPlotWindow ) m_mainPlotWindow->cleanupGuiBeforeProjectClose();
|
||||
|
||||
caf::EffectGenerator::clearEffectCache();
|
||||
}
|
||||
@ -1318,14 +1307,8 @@ void RiaGuiApplication::onProjectBeingClosed()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGuiApplication::onProjectClosed()
|
||||
{
|
||||
if ( m_mainWindow )
|
||||
{
|
||||
m_mainWindow->initializeGuiNewProjectLoaded();
|
||||
}
|
||||
if ( m_mainPlotWindow )
|
||||
{
|
||||
m_mainPlotWindow->initializeGuiNewProjectLoaded();
|
||||
}
|
||||
if ( m_mainWindow ) m_mainWindow->initializeGuiNewProjectLoaded();
|
||||
if ( m_mainPlotWindow ) m_mainPlotWindow->initializeGuiNewProjectLoaded();
|
||||
|
||||
setWindowCaptionFromAppState();
|
||||
|
||||
@ -1374,13 +1357,19 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
|
||||
caf::EffectGenerator::setRenderingMode( caf::EffectGenerator::FIXED_FUNCTION );
|
||||
}
|
||||
|
||||
if ( m_mainWindow && m_mainWindow->projectTreeView() )
|
||||
if ( m_mainWindow )
|
||||
{
|
||||
m_mainWindow->projectTreeView()->enableAppendOfClassNameToUiItemText(
|
||||
RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
if ( mainPlotWindow() )
|
||||
mainPlotWindow()->projectTreeView()->enableAppendOfClassNameToUiItemText(
|
||||
RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
for ( auto& tv : m_mainWindow->projectTreeViews() )
|
||||
{
|
||||
tv->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
}
|
||||
}
|
||||
if ( mainPlotWindow() )
|
||||
{
|
||||
for ( auto& tv : mainPlotWindow()->projectTreeViews() )
|
||||
{
|
||||
tv->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto fontObject : defaultFontObjects )
|
||||
@ -1494,7 +1483,7 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
|
||||
rim3dView->updateScaling();
|
||||
if ( rim3dView == activeViewWindow() )
|
||||
{
|
||||
RiuMainWindow::instance()->updateScaleValue();
|
||||
if ( RiuMainWindow::instance() ) RiuMainWindow::instance()->updateScaleValue();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1567,6 +1556,7 @@ int RiaGuiApplication::applicationResolution()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGuiApplication::startMonitoringWorkProgress( caf::UiProcess* uiProcess )
|
||||
{
|
||||
CAF_ASSERT( m_mainWindow );
|
||||
m_mainWindow->processMonitor()->startMonitorWorkProcess( uiProcess );
|
||||
}
|
||||
|
||||
@ -1575,6 +1565,7 @@ void RiaGuiApplication::startMonitoringWorkProgress( caf::UiProcess* uiProcess )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGuiApplication::stopMonitoringWorkProgress()
|
||||
{
|
||||
CAF_ASSERT( m_mainWindow );
|
||||
m_mainWindow->processMonitor()->stopMonitorWorkProcess();
|
||||
}
|
||||
|
||||
@ -1583,6 +1574,8 @@ void RiaGuiApplication::stopMonitoringWorkProgress()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGuiApplication::slotWorkerProcessFinished( int exitCode, QProcess::ExitStatus exitStatus )
|
||||
{
|
||||
CAF_ASSERT( m_mainWindow );
|
||||
|
||||
m_mainWindow->processMonitor()->stopMonitorWorkProcess();
|
||||
|
||||
QProcessEnvironment processEnvironment = m_workerProcess->processEnvironment();
|
||||
@ -1688,13 +1681,35 @@ bool RiaGuiApplication::notify( QObject* receiver, QEvent* event )
|
||||
"unstable and will probably crash soon." );
|
||||
}
|
||||
|
||||
bool done = true;
|
||||
bool done = false;
|
||||
try
|
||||
{
|
||||
done = QApplication::notify( receiver, event );
|
||||
if ( event->type() == QEvent::KeyPress )
|
||||
{
|
||||
if ( activeWindow() != mainWindow() )
|
||||
{
|
||||
QKeyEvent* keyEvent = static_cast<QKeyEvent*>( event );
|
||||
RimPlotWindow* plot = dynamic_cast<RimPlotWindow*>( activePlotWindow() );
|
||||
if ( plot ) done = plot->handleGlobalKeyEvent( keyEvent );
|
||||
}
|
||||
}
|
||||
else if ( event->type() == QEvent::Wheel )
|
||||
{
|
||||
if ( activeWindow() != mainWindow() )
|
||||
{
|
||||
QWheelEvent* wheelEvent = static_cast<QWheelEvent*>( event );
|
||||
RimPlotWindow* plot = dynamic_cast<RimPlotWindow*>( activePlotWindow() );
|
||||
if ( plot ) done = plot->handleGlobalWheelEvent( wheelEvent );
|
||||
}
|
||||
}
|
||||
if ( !done )
|
||||
{
|
||||
done = QApplication::notify( receiver, event );
|
||||
}
|
||||
}
|
||||
catch ( const std::bad_alloc& )
|
||||
{
|
||||
done = true;
|
||||
if ( memoryExhaustedBox ) memoryExhaustedBox->exec();
|
||||
std::cout << "ResInsight: Memory is Exhausted!\n ResInsight could not allocate the memory needed, and is now "
|
||||
"unstable "
|
||||
|
@ -134,6 +134,8 @@ public:
|
||||
void showFormattedTextInMessageBoxOrConsole( const QString& errMsg ) override;
|
||||
|
||||
protected:
|
||||
bool notify( QObject* receiver, QEvent* event ) override;
|
||||
|
||||
// Protected RiaApplication overrides
|
||||
void invokeProcessEvents( QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents ) override;
|
||||
void onFileSuccessfullyLoaded( const QString& fileName, RiaDefines::ImportFileType fileType ) override;
|
||||
@ -155,21 +157,17 @@ private:
|
||||
void setWindowCaptionFromAppState();
|
||||
|
||||
void createMainWindow();
|
||||
void deleteMainWindow();
|
||||
void createMainPlotWindow();
|
||||
void deleteMainPlotWindow();
|
||||
|
||||
void storeTreeViewState();
|
||||
|
||||
bool notify( QObject*, QEvent* ) override;
|
||||
|
||||
private slots:
|
||||
void slotWorkerProcessFinished( int exitCode, QProcess::ExitStatus exitStatus );
|
||||
void onLastWindowClosed();
|
||||
|
||||
private:
|
||||
QPointer<RiuMainWindow> m_mainWindow;
|
||||
QPointer<RiuPlotMainWindow> m_mainPlotWindow;
|
||||
QPointer<RiuMainWindow> m_mainWindow;
|
||||
std::unique_ptr<RiuPlotMainWindow> m_mainPlotWindow;
|
||||
|
||||
std::unique_ptr<RiuRecentFileActionProvider> m_recentFileActionProvider;
|
||||
|
||||
|
@ -47,14 +47,14 @@ CAF_PDM_SOURCE_INIT( RiaMemoryCleanup, "RiaMemoryCleanup" );
|
||||
RiaMemoryCleanup::RiaMemoryCleanup()
|
||||
{
|
||||
// clang-format off
|
||||
CAF_PDM_InitFieldNoDefault(&m_case, "DataCase", "Case", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_case, "DataCase", "Case");
|
||||
m_case = nullptr;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_resultsToDelete, "ResultsToDelete", "Results In Memory", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_resultsToDelete, "ResultsToDelete", "Results In Memory");
|
||||
m_resultsToDelete.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||
m_resultsToDelete.uiCapability()->setUiEditorTypeName(caf::PdmUiTreeSelectionEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_performDelete, "ClearSelectedData", "", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_performDelete, "ClearSelectedData", "");
|
||||
caf::PdmUiPushButtonEditor::configureEditorForField(&m_performDelete);
|
||||
// clang-format on
|
||||
}
|
||||
@ -215,8 +215,7 @@ void RiaMemoryCleanup::fieldChangedByUi( const caf::PdmFieldHandle* changedField
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RiaMemoryCleanup::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly )
|
||||
QList<caf::PdmOptionItemInfo> RiaMemoryCleanup::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
if ( fieldNeedingOptions == &m_case )
|
||||
|
@ -48,8 +48,7 @@ private:
|
||||
std::set<RigFemResultAddress> findGeoMechCaseResultsInUse() const;
|
||||
std::set<RigEclipseResultAddress> findEclipseResultsInUse() const;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
@ -61,4 +60,4 @@ private:
|
||||
std::vector<RigFemResultAddress> m_geomResultAddresses;
|
||||
std::vector<RigEclipseResultAddress> m_eclipseResultAddresses;
|
||||
caf::PdmField<bool> m_performDelete;
|
||||
};
|
||||
};
|
||||
|
@ -0,0 +1,73 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiaPlotCollectionScheduler.h"
|
||||
|
||||
#include "RimAbstractPlotCollection.h"
|
||||
#include "RimViewWindow.h"
|
||||
|
||||
#include "cafProgressState.h"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPlotCollectionScheduler::RiaPlotCollectionScheduler()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPlotCollectionScheduler::~RiaPlotCollectionScheduler()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPlotCollectionScheduler* RiaPlotCollectionScheduler::instance()
|
||||
{
|
||||
static RiaPlotCollectionScheduler theInstance;
|
||||
|
||||
return &theInstance;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotCollectionScheduler::schedulePlotCollectionUpdate( const std::vector<RimPlotCollection*> plotCollections )
|
||||
{
|
||||
m_plotCollectionsToUpdate.insert( m_plotCollectionsToUpdate.end(), plotCollections.begin(), plotCollections.end() );
|
||||
|
||||
startTimer( 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotCollectionScheduler::performScheduledUpdates()
|
||||
{
|
||||
for ( auto p : m_plotCollectionsToUpdate )
|
||||
{
|
||||
if ( p == nullptr ) continue;
|
||||
|
||||
p->loadDataAndUpdateAllPlots();
|
||||
}
|
||||
}
|
42
ApplicationLibCode/Application/RiaPlotCollectionScheduler.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 "RiaScheduler.h"
|
||||
|
||||
class RimPlotCollection;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RiaPlotCollectionScheduler : public RiaScheduler
|
||||
{
|
||||
public:
|
||||
RiaPlotCollectionScheduler();
|
||||
~RiaPlotCollectionScheduler() override;
|
||||
|
||||
static RiaPlotCollectionScheduler* instance();
|
||||
|
||||
void schedulePlotCollectionUpdate( const std::vector<RimPlotCollection*> plotCollections );
|
||||
|
||||
void performScheduledUpdates() override;
|
||||
|
||||
private:
|
||||
std::vector<RimPlotCollection*> m_plotCollectionsToUpdate;
|
||||
};
|
95
ApplicationLibCode/Application/RiaPlotDefines.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 "RiaPlotDefines.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaPreferencesSystem.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::PlotAxis>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::PlotAxis::PLOT_AXIS_LEFT, "PLOT_AXIS_LEFT", "Left" );
|
||||
addItem( RiaDefines::PlotAxis::PLOT_AXIS_RIGHT, "PLOT_AXIS_RIGHT", "Right" );
|
||||
addItem( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM, "PLOT_AXIS_BOTTOM", "Bottom" );
|
||||
addItem( RiaDefines::PlotAxis::PLOT_AXIS_TOP, "PLOT_AXIS_TOP", "Top" );
|
||||
|
||||
setDefault( RiaDefines::PlotAxis::PLOT_AXIS_LEFT );
|
||||
}
|
||||
}; // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaDefines::minimumDefaultValuePlot()
|
||||
{
|
||||
return -10.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaDefines::minimumDefaultLogValuePlot()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaDefines::maximumDefaultValuePlot()
|
||||
{
|
||||
return 100.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaDefines::isHorizontal( RiaDefines::PlotAxis axis )
|
||||
{
|
||||
return !isVertical( axis );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaDefines::isVertical( RiaDefines::PlotAxis axis )
|
||||
{
|
||||
return ( axis == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || axis == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaDefines::scalingFactor( QPaintDevice* paintDevice )
|
||||
{
|
||||
auto scalingFactor = RiaPreferencesSystem::current()->exportPdfScalingFactor();
|
||||
|
||||
if ( scalingFactor > 0.0 ) return scalingFactor;
|
||||
|
||||
if ( !paintDevice ) return 1.0;
|
||||
|
||||
int resolution = paintDevice->logicalDpiX();
|
||||
double scaling = resolution / static_cast<double>( RiaGuiApplication::applicationResolution() );
|
||||
|
||||
return scaling;
|
||||
}
|
43
ApplicationLibCode/Application/RiaPlotDefines.h
Normal file
@ -0,0 +1,43 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
|
||||
class QPaintDevice;
|
||||
|
||||
// Defines relate to plotting
|
||||
namespace RiaDefines
|
||||
{
|
||||
enum class PlotAxis
|
||||
{
|
||||
PLOT_AXIS_LEFT,
|
||||
PLOT_AXIS_RIGHT,
|
||||
PLOT_AXIS_BOTTOM,
|
||||
PLOT_AXIS_TOP
|
||||
};
|
||||
|
||||
double minimumDefaultValuePlot();
|
||||
double minimumDefaultLogValuePlot();
|
||||
double maximumDefaultValuePlot();
|
||||
|
||||
bool isHorizontal( PlotAxis axis );
|
||||
bool isVertical( PlotAxis axis );
|
||||
|
||||
double scalingFactor( QPaintDevice* paintDevice );
|
||||
|
||||
}; // namespace RiaDefines
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include "RiuMultiPlotBook.h"
|
||||
#include "RiuMultiPlotPage.h"
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
#include "RiuPlotWidget.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
@ -41,9 +41,17 @@ RiaPlotWindowRedrawScheduler* RiaPlotWindowRedrawScheduler::instance()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotWindowRedrawScheduler::scheduleMultiPlotWindowUpdate( RiuMultiPlotBook* plotWindow )
|
||||
void RiaPlotWindowRedrawScheduler::scheduleMultiPlotBookUpdate( RiuMultiPlotBook* plotBook,
|
||||
RiaDefines::MultiPlotPageUpdateType updateType )
|
||||
{
|
||||
m_plotWindowsToUpdate.push_back( plotWindow );
|
||||
if ( m_plotBooksToUpdate.count( plotBook ) == 0 )
|
||||
{
|
||||
m_plotBooksToUpdate[plotBook] = updateType;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotBooksToUpdate[plotBook] = m_plotBooksToUpdate[plotBook] | updateType;
|
||||
}
|
||||
|
||||
startTimer( 0 );
|
||||
}
|
||||
@ -51,9 +59,17 @@ void RiaPlotWindowRedrawScheduler::scheduleMultiPlotWindowUpdate( RiuMultiPlotBo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotWindowRedrawScheduler::scheduleMultiPlotPageUpdate( RiuMultiPlotPage* plotPage )
|
||||
void RiaPlotWindowRedrawScheduler::scheduleMultiPlotPageUpdate( RiuMultiPlotPage* plotPage,
|
||||
RiaDefines::MultiPlotPageUpdateType updateType )
|
||||
{
|
||||
m_plotPagesToUpdate.push_back( plotPage );
|
||||
if ( m_plotPagesToUpdate.count( plotPage ) == 0 )
|
||||
{
|
||||
m_plotPagesToUpdate[plotPage] = updateType;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotPagesToUpdate[plotPage] = m_plotPagesToUpdate[plotPage] | updateType;
|
||||
}
|
||||
|
||||
startTimer( 0 );
|
||||
}
|
||||
@ -61,9 +77,9 @@ void RiaPlotWindowRedrawScheduler::scheduleMultiPlotPageUpdate( RiuMultiPlotPage
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotWindowRedrawScheduler::schedulePlotWidgetReplot( RiuQwtPlotWidget* plotWidget )
|
||||
void RiaPlotWindowRedrawScheduler::schedulePlotWidgetReplot( RiuPlotWidget* plotWidget )
|
||||
{
|
||||
m_plotWidgetsToReplot.push_back( plotWidget );
|
||||
m_plotWidgetsToReplot.insert( plotWidget );
|
||||
|
||||
startTimer( 0 );
|
||||
}
|
||||
@ -82,7 +98,7 @@ void RiaPlotWindowRedrawScheduler::clearAllScheduledUpdates()
|
||||
}
|
||||
m_plotWidgetsToReplot.clear();
|
||||
m_plotPagesToUpdate.clear();
|
||||
m_plotWindowsToUpdate.clear();
|
||||
m_plotBooksToUpdate.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -90,49 +106,44 @@ void RiaPlotWindowRedrawScheduler::clearAllScheduledUpdates()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotWindowRedrawScheduler::performScheduledUpdatesAndReplots()
|
||||
{
|
||||
std::vector<QPointer<RiuMultiPlotBook>> plotWindowsToUpdate;
|
||||
std::vector<QPointer<RiuMultiPlotPage>> plotPagesToUpdate;
|
||||
std::vector<QPointer<RiuQwtPlotWidget>> plotWidgetsToReplot;
|
||||
std::map<QPointer<RiuMultiPlotBook>, RiaDefines::MultiPlotPageUpdateType> plotBooksToUpdate;
|
||||
std::map<QPointer<RiuMultiPlotPage>, RiaDefines::MultiPlotPageUpdateType> pagesToUpdate;
|
||||
|
||||
plotWindowsToUpdate.swap( m_plotWindowsToUpdate );
|
||||
plotPagesToUpdate.swap( m_plotPagesToUpdate );
|
||||
pagesToUpdate.swap( m_plotPagesToUpdate );
|
||||
plotBooksToUpdate.swap( m_plotBooksToUpdate );
|
||||
|
||||
for ( auto& [plotBook, updateType] : plotBooksToUpdate )
|
||||
{
|
||||
if ( plotBook.isNull() ) continue;
|
||||
|
||||
if ( ( updateType & RiaDefines::MultiPlotPageUpdateType::PLOT ) == RiaDefines::MultiPlotPageUpdateType::PLOT )
|
||||
{
|
||||
for ( RiuMultiPlotPage* page : plotBook->pages() )
|
||||
{
|
||||
if ( pagesToUpdate.count( page ) > 0 ) pagesToUpdate.erase( page );
|
||||
}
|
||||
}
|
||||
plotBook->performUpdate( updateType );
|
||||
}
|
||||
|
||||
for ( auto& [page, updateType] : pagesToUpdate )
|
||||
{
|
||||
if ( page.isNull() ) continue;
|
||||
|
||||
page->performUpdate( updateType );
|
||||
}
|
||||
|
||||
// PERFORMANCE NOTE
|
||||
// As the book and page updates can trigger widget updates, make sure to get the list of widgets to replot after
|
||||
// these updates
|
||||
std::set<QPointer<RiuPlotWidget>> plotWidgetsToReplot;
|
||||
plotWidgetsToReplot.swap( m_plotWidgetsToReplot );
|
||||
|
||||
std::set<QPointer<RiuQwtPlotWidget>> updatedPlots;
|
||||
std::set<QPointer<RiuMultiPlotBook>> updatedPlotWindows;
|
||||
std::set<QPointer<RiuMultiPlotPage>> updatedPlotPages;
|
||||
|
||||
for ( QPointer<RiuMultiPlotBook> plotWindow : plotWindowsToUpdate )
|
||||
for ( const QPointer<RiuPlotWidget>& plot : plotWidgetsToReplot )
|
||||
{
|
||||
if ( !plotWindow.isNull() && !updatedPlotWindows.count( plotWindow ) )
|
||||
{
|
||||
for ( RiuMultiPlotPage* page : plotWindow->pages() )
|
||||
{
|
||||
plotPagesToUpdate.erase( std::remove( plotPagesToUpdate.begin(), plotPagesToUpdate.end(), page ),
|
||||
plotPagesToUpdate.end() );
|
||||
}
|
||||
|
||||
plotWindow->performUpdate();
|
||||
updatedPlotWindows.insert( plotWindow );
|
||||
}
|
||||
}
|
||||
|
||||
for ( QPointer<RiuMultiPlotPage> plotPage : plotPagesToUpdate )
|
||||
{
|
||||
if ( !plotPage.isNull() && !updatedPlotPages.count( plotPage ) )
|
||||
{
|
||||
plotPage->performUpdate();
|
||||
updatedPlotPages.insert( plotPage );
|
||||
}
|
||||
}
|
||||
|
||||
// Perform update and replot. Make sure we handle legend update
|
||||
for ( QPointer<RiuQwtPlotWidget> plot : plotWidgetsToReplot )
|
||||
{
|
||||
if ( !plot.isNull() && !updatedPlots.count( plot ) )
|
||||
if ( !plot.isNull() )
|
||||
{
|
||||
plot->replot();
|
||||
updatedPlots.insert( plot );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,16 +19,19 @@
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
#include <QScopedPointer>
|
||||
#include <QTimer>
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class RiuMultiPlotPage;
|
||||
class RiuMultiPlotBook;
|
||||
class RiuQwtPlotWidget;
|
||||
class RiuPlotWidget;
|
||||
|
||||
class RiaPlotWindowRedrawScheduler : public QObject
|
||||
{
|
||||
@ -36,24 +39,31 @@ class RiaPlotWindowRedrawScheduler : public QObject
|
||||
|
||||
public:
|
||||
static RiaPlotWindowRedrawScheduler* instance();
|
||||
void scheduleMultiPlotWindowUpdate( RiuMultiPlotBook* plotWindow );
|
||||
void scheduleMultiPlotPageUpdate( RiuMultiPlotPage* plotWindow );
|
||||
void schedulePlotWidgetReplot( RiuQwtPlotWidget* plotWidget );
|
||||
void clearAllScheduledUpdates();
|
||||
void performScheduledUpdatesAndReplots();
|
||||
|
||||
void scheduleMultiPlotBookUpdate(
|
||||
RiuMultiPlotBook* plotWindow,
|
||||
RiaDefines::MultiPlotPageUpdateType updateType = RiaDefines::MultiPlotPageUpdateType::ALL );
|
||||
void scheduleMultiPlotPageUpdate(
|
||||
RiuMultiPlotPage* plotWindow,
|
||||
RiaDefines::MultiPlotPageUpdateType updateType = RiaDefines::MultiPlotPageUpdateType::ALL );
|
||||
void schedulePlotWidgetReplot( RiuPlotWidget* plotWidget );
|
||||
void clearAllScheduledUpdates();
|
||||
void performScheduledUpdatesAndReplots();
|
||||
|
||||
private slots:
|
||||
void slotUpdateAndReplotScheduledItemsWhenReady();
|
||||
|
||||
private:
|
||||
RiaPlotWindowRedrawScheduler() = default;
|
||||
RiaPlotWindowRedrawScheduler() = default;
|
||||
~RiaPlotWindowRedrawScheduler() override = default;
|
||||
|
||||
void startTimer( int msecs );
|
||||
|
||||
private:
|
||||
std::vector<QPointer<RiuQwtPlotWidget>> m_plotWidgetsToReplot;
|
||||
std::vector<QPointer<RiuMultiPlotBook>> m_plotWindowsToUpdate;
|
||||
std::vector<QPointer<RiuMultiPlotPage>> m_plotPagesToUpdate;
|
||||
QScopedPointer<QTimer> m_plotWindowUpdateTimer;
|
||||
std::map<QPointer<RiuMultiPlotPage>, RiaDefines::MultiPlotPageUpdateType> m_plotPagesToUpdate;
|
||||
std::map<QPointer<RiuMultiPlotBook>, RiaDefines::MultiPlotPageUpdateType> m_plotBooksToUpdate;
|
||||
|
||||
std::set<QPointer<RiuPlotWidget>> m_plotWidgetsToReplot;
|
||||
|
||||
QScopedPointer<QTimer> m_plotWindowUpdateTimer;
|
||||
};
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "RiaPreferencesGeoMech.h"
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "RiaPreferencesSystem.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaValidRegExpValidator.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
@ -81,10 +82,7 @@ RiaPreferences::RiaPreferences()
|
||||
CAF_PDM_InitField( &m_navigationPolicy,
|
||||
"navigationPolicy",
|
||||
caf::AppEnum<RiaDefines::RINavigationPolicy>( RiaDefines::RINavigationPolicy::NAVIGATION_POLICY_RMS ),
|
||||
"Navigation Mode",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Navigation Mode" );
|
||||
|
||||
CAF_PDM_InitField( &enableGrpcServer,
|
||||
"enableGrpcServer",
|
||||
@ -93,9 +91,9 @@ RiaPreferences::RiaPreferences()
|
||||
"",
|
||||
"Remote Procedure Call Scripting Engine",
|
||||
"" );
|
||||
CAF_PDM_InitField( &defaultGrpcPortNumber, "defaultGrpcPort", 50051, "Default Python Script Server Port", "", "", "" );
|
||||
CAF_PDM_InitField( &defaultGrpcPortNumber, "defaultGrpcPort", 50051, "Default Python Script Server Port" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &scriptDirectories, "scriptDirectory", "Shared Script Folder(s)", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &scriptDirectories, "scriptDirectory", "Shared Script Folder(s)" );
|
||||
scriptDirectories.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
|
||||
// TODO: This only currently works for installed ResInsight.
|
||||
@ -112,45 +110,35 @@ RiaPreferences::RiaPreferences()
|
||||
}
|
||||
#endif
|
||||
|
||||
CAF_PDM_InitField( &scriptEditorExecutable, "scriptEditorExecutable", defaultTextEditor, "Script Editor", "", "", "" );
|
||||
CAF_PDM_InitField( &scriptEditorExecutable, "scriptEditorExecutable", defaultTextEditor, "Script Editor" );
|
||||
scriptEditorExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_octaveExecutable, "octaveExecutable", QString( "octave" ), "Octave Executable Location", "", "", "" );
|
||||
CAF_PDM_InitField( &m_maxScriptFoldersDepth, "MaxScriptFoldersDepth", 2, "Maximum Scripts Folder Search Depth" );
|
||||
|
||||
CAF_PDM_InitField( &m_octaveExecutable, "octaveExecutable", QString( "octave" ), "Octave Executable Location" );
|
||||
m_octaveExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_octaveExecutable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
CAF_PDM_InitField( &octaveShowHeaderInfoWhenExecutingScripts,
|
||||
"octaveShowHeaderInfoWhenExecutingScripts",
|
||||
false,
|
||||
"Show Text Header When Executing Scripts",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Show Text Header When Executing Scripts" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &octaveShowHeaderInfoWhenExecutingScripts );
|
||||
|
||||
CAF_PDM_InitField( &m_pythonExecutable, "pythonExecutable", QString( "python" ), "Python Executable Location", "", "", "" );
|
||||
CAF_PDM_InitField( &m_pythonExecutable, "pythonExecutable", QString( "python" ), "Python Executable Location" );
|
||||
m_pythonExecutable.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_pythonExecutable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
CAF_PDM_InitField( &showPythonDebugInfo, "pythonDebugInfo", false, "Show Python Debug Info", "", "", "" );
|
||||
CAF_PDM_InitField( &showPythonDebugInfo, "pythonDebugInfo", false, "Show Python Debug Info" );
|
||||
|
||||
CAF_PDM_InitField( &ssihubAddress, "ssihubAddress", QString( "http://" ), "SSIHUB Address", "", "", "" );
|
||||
CAF_PDM_InitField( &ssihubAddress, "ssihubAddress", QString( "http://" ), "SSIHUB Address" );
|
||||
ssihubAddress.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_defaultMeshModeType, "defaultMeshModeType", "Show Grid Lines", "", "", "" );
|
||||
CAF_PDM_InitField( &defaultGridLineColors,
|
||||
"defaultGridLineColors",
|
||||
RiaColorTables::defaultGridLineColor(),
|
||||
"Mesh Color",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_defaultMeshModeType, "defaultMeshModeType", "Show Grid Lines" );
|
||||
CAF_PDM_InitField( &defaultGridLineColors, "defaultGridLineColors", RiaColorTables::defaultGridLineColor(), "Mesh Color" );
|
||||
CAF_PDM_InitField( &defaultFaultGridLineColors,
|
||||
"defaultFaultGridLineColors",
|
||||
RiaColorTables::defaultFaultLineColor(),
|
||||
"Mesh Color Along Faults",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Mesh Color Along Faults" );
|
||||
CAF_PDM_InitField( &defaultWellLabelColor,
|
||||
"defaultWellLableColor",
|
||||
RiaColorTables::defaultWellLabelColor(),
|
||||
@ -167,26 +155,26 @@ RiaPreferences::RiaPreferences()
|
||||
"The viewer background color for new views",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitField( &m_defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Default Z Scale Factor", "", "", "" );
|
||||
CAF_PDM_InitField( &m_defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Default Z Scale Factor" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &defaultSceneFontSize, "defaultSceneFontSizePt", "Viewer Font Size", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &defaultAnnotationFontSize, "defaultAnnotationFontSizePt", "Annotation Font Size", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &defaultWellLabelFontSize, "defaultWellLabelFontSizePt", "Well Label Font Size", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &defaultPlotFontSize, "defaultPlotFontSizePt", "Plot Font Size", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &defaultSceneFontSize, "defaultSceneFontSizePt", "Viewer Font Size" );
|
||||
CAF_PDM_InitFieldNoDefault( &defaultAnnotationFontSize, "defaultAnnotationFontSizePt", "Annotation Font Size" );
|
||||
CAF_PDM_InitFieldNoDefault( &defaultWellLabelFontSize, "defaultWellLabelFontSizePt", "Well Label Font Size" );
|
||||
CAF_PDM_InitFieldNoDefault( &defaultPlotFontSize, "defaultPlotFontSizePt", "Plot Font Size" );
|
||||
|
||||
CAF_PDM_InitField( &m_showLegendBackground, "showLegendBackground", true, "Show Box around Legends", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showLegendBackground, "showLegendBackground", true, "Show Box around Legends" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showLegendBackground );
|
||||
|
||||
CAF_PDM_InitField( &m_enableFaultsByDefault, "enableFaultsByDefault", true, "Enable Faults By Default", "", "", "" );
|
||||
CAF_PDM_InitField( &m_enableFaultsByDefault, "enableFaultsByDefault", true, "Enable Faults By Default" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_enableFaultsByDefault );
|
||||
|
||||
CAF_PDM_InitField( &m_showInfoBox, "showInfoBox", true, "Show Info Box in New Projects", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showInfoBox, "showInfoBox", true, "Show Info Box in New Projects" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showInfoBox );
|
||||
|
||||
CAF_PDM_InitField( &m_showGridBox, "showGridBox", true, "Show Grid Box in New Projects", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showGridBox, "showGridBox", true, "Show Grid Box in New Projects" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showGridBox );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &lastUsedProjectFileName, "lastUsedProjectFileName", "Last Used Project File", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &lastUsedProjectFileName, "lastUsedProjectFileName", "Last Used Project File" );
|
||||
lastUsedProjectFileName.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &autocomputeDepthRelatedProperties,
|
||||
@ -198,62 +186,55 @@ RiaPreferences::RiaPreferences()
|
||||
"" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &autocomputeDepthRelatedProperties );
|
||||
|
||||
CAF_PDM_InitField( &loadAndShowSoil, "loadAndShowSoil", true, "Load and Show SOIL", "", "", "" );
|
||||
CAF_PDM_InitField( &loadAndShowSoil, "loadAndShowSoil", true, "Load and Show SOIL" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &loadAndShowSoil );
|
||||
|
||||
CAF_PDM_InitField( &holoLensDisableCertificateVerification,
|
||||
"holoLensDisableCertificateVerification",
|
||||
false,
|
||||
"Disable SSL Certificate Verification (HoloLens)",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Disable SSL Certificate Verification (HoloLens)" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &holoLensDisableCertificateVerification );
|
||||
|
||||
CAF_PDM_InitField( &csvTextExportFieldSeparator,
|
||||
"csvTextExportFieldSeparator",
|
||||
QString( "," ),
|
||||
"CSV Text Export Field Separator",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"CSV Text Export Field Separator" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_readerSettings, "readerSettings", "Reader Settings", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_readerSettings, "readerSettings", "Reader Settings" );
|
||||
m_readerSettings = new RifReaderSettings;
|
||||
CAF_PDM_InitFieldNoDefault( &m_dateFormat, "dateFormat", "Date Format", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_dateFormat, "dateFormat", "Date Format" );
|
||||
m_dateFormat.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() );
|
||||
m_dateFormat = RiaQDateTimeTools::supportedDateFormats().front();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_timeFormat, "timeFormat", "Time Format", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_timeFormat, "timeFormat", "Time Format" );
|
||||
m_timeFormat.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() );
|
||||
m_timeFormat = RiaQDateTimeTools::supportedTimeFormats().front();
|
||||
|
||||
CAF_PDM_InitField( &m_useUndoRedo, "useUndoRedo", true, "Enable Undo/Redo for Property Editor changes", "", "", "" );
|
||||
CAF_PDM_InitField( &m_useUndoRedo, "useUndoRedo", false, "Enable Undo/Redo for Property Editor changes" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_useUndoRedo );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_plotTemplateFolders, "plotTemplateFolders", "Plot Template Folder(s)", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_plotTemplateFolders, "plotTemplateFolders", "Plot Template Folder(s)" );
|
||||
m_plotTemplateFolders.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
CAF_PDM_InitField( &m_searchPlotTemplateFoldersRecursively,
|
||||
"SearchPlotTemplateFoldersRecursively",
|
||||
true,
|
||||
"Search Plot Templates Recursively",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_searchPlotTemplateFoldersRecursively );
|
||||
CAF_PDM_InitField( &m_maxPlotTemplateFoldersDepth,
|
||||
"MaxPlotTemplateFoldersDepth",
|
||||
2,
|
||||
"Maximum Plot Template Folder Search Depth" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_defaultPlotTemplate, "defaultPlotTemplate", "Default Plot Template", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_lastUsedPlotTemplate, "defaultPlotTemplate", "Default Plot Template" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_pageSize, "pageSize", "Page Size", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_pageOrientation, "pageOrientation", "Page Orientation", "", "", "" );
|
||||
CAF_PDM_InitField( &m_pageLeftMargin, "pageLeftMargin", defaultMarginSize( m_pageSize() ), "Left Margin", "", "", "" );
|
||||
CAF_PDM_InitField( &m_pageTopMargin, "pageTopMargin", defaultMarginSize( m_pageSize() ), "Top Margin", "", "", "" );
|
||||
CAF_PDM_InitField( &m_pageRightMargin, "pageRightMargin", defaultMarginSize( m_pageSize() ), "Right Margin", "", "", "" );
|
||||
CAF_PDM_InitField( &m_pageBottomMargin, "pageBottomMargin", defaultMarginSize( m_pageSize() ), "Bottom Margin", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_pageSize, "pageSize", "Page Size" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_pageOrientation, "pageOrientation", "Page Orientation" );
|
||||
CAF_PDM_InitField( &m_pageLeftMargin, "pageLeftMargin", defaultMarginSize( m_pageSize() ), "Left Margin" );
|
||||
CAF_PDM_InitField( &m_pageTopMargin, "pageTopMargin", defaultMarginSize( m_pageSize() ), "Top Margin" );
|
||||
CAF_PDM_InitField( &m_pageRightMargin, "pageRightMargin", defaultMarginSize( m_pageSize() ), "Right Margin" );
|
||||
CAF_PDM_InitField( &m_pageBottomMargin, "pageBottomMargin", defaultMarginSize( m_pageSize() ), "Bottom Margin" );
|
||||
|
||||
CAF_PDM_InitField( &m_openExportedPdfInViewer, "openExportedPdfInViewer", false, "Open Exported PDF in Viewer", "", "", "" );
|
||||
CAF_PDM_InitField( &m_openExportedPdfInViewer, "openExportedPdfInViewer", false, "Open Exported PDF in Viewer" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_openExportedPdfInViewer );
|
||||
|
||||
CAF_PDM_InitField( &m_useQtChartsPlotByDefault, "useQtChartsPlotByDefault", false, "Use QtChart as Default Plot Type" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_useQtChartsPlotByDefault );
|
||||
|
||||
CAF_PDM_InitField( &m_surfaceImportResamplingDistance,
|
||||
"SurfaceImportResamplingDistance",
|
||||
100.0,
|
||||
@ -272,15 +253,15 @@ RiaPreferences::RiaPreferences()
|
||||
"" );
|
||||
m_multiLateralWellPattern.uiCapability()->setUiEditorTypeName( caf::PdmUiLineEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_guiTheme, "guiTheme", "GUI theme", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_guiTheme, "guiTheme", "GUI theme" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_summaryPreferences, "summaryPreferences", "summaryPreferences", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_summaryPreferences, "summaryPreferences", "summaryPreferences" );
|
||||
m_summaryPreferences = new RiaPreferencesSummary;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_geoMechPreferences, "geoMechPreferences", "geoMechPreferences", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_geoMechPreferences, "geoMechPreferences", "geoMechPreferences" );
|
||||
m_geoMechPreferences = new RiaPreferencesGeoMech;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_systemPreferences, "systemPreferences", "systemPreferences", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_systemPreferences, "systemPreferences", "systemPreferences" );
|
||||
m_systemPreferences = new RiaPreferencesSystem;
|
||||
}
|
||||
|
||||
@ -308,6 +289,7 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
m_readerSettings->defineEditorAttribute( field, uiConfigName, attribute );
|
||||
m_summaryPreferences->defineEditorAttribute( field, uiConfigName, attribute );
|
||||
|
||||
{
|
||||
caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
|
||||
@ -376,7 +358,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
otherGroup->add( &holoLensDisableCertificateVerification );
|
||||
otherGroup->add( &m_useUndoRedo );
|
||||
}
|
||||
else if ( uiConfigName == RiaPreferences::tabNameEclipseGrid() )
|
||||
else if ( uiConfigName == RiaPreferences::tabNameGrid() )
|
||||
{
|
||||
caf::PdmUiGroup* newCaseBehaviourGroup = uiOrdering.addNewGroup( "Behavior When Loading Data" );
|
||||
newCaseBehaviourGroup->add( &autocomputeDepthRelatedProperties );
|
||||
@ -384,7 +366,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
|
||||
m_readerSettings->uiOrdering( uiConfigName, *newCaseBehaviourGroup );
|
||||
}
|
||||
else if ( uiConfigName == RiaPreferences::tabNameEclipseSummary() )
|
||||
else if ( uiConfigName == RiaPreferences::tabNameSummary() )
|
||||
{
|
||||
m_summaryPreferences->appendRestartFileGroup( uiOrdering );
|
||||
|
||||
@ -396,16 +378,20 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
}
|
||||
else if ( uiConfigName == RiaPreferences::tabNamePlotting() )
|
||||
{
|
||||
uiOrdering.add( &m_dateFormat );
|
||||
uiOrdering.add( &m_timeFormat );
|
||||
caf::PdmUiGroup* summaryGrp = uiOrdering.addNewGroup( "Summary Plots" );
|
||||
|
||||
summaryPreferences()->appendItemsToPlottingGroup( uiOrdering );
|
||||
summaryPreferences()->appendItemsToPlottingGroup( *summaryGrp );
|
||||
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Plot Templates" );
|
||||
caf::PdmUiGroup* group = summaryGrp->addNewGroup( "Plot Templates" );
|
||||
group->add( &m_plotTemplateFolders );
|
||||
group->add( &m_searchPlotTemplateFoldersRecursively );
|
||||
group->add( &m_maxPlotTemplateFoldersDepth );
|
||||
|
||||
caf::PdmUiGroup* pageSetup = uiOrdering.addNewGroup( "Page Setup" );
|
||||
caf::PdmUiGroup* generalGrp = uiOrdering.addNewGroup( "General" );
|
||||
|
||||
generalGrp->add( &m_dateFormat );
|
||||
generalGrp->add( &m_timeFormat );
|
||||
|
||||
caf::PdmUiGroup* pageSetup = generalGrp->addNewGroup( "Page Setup" );
|
||||
pageSetup->add( &m_pageSize );
|
||||
pageSetup->add( &m_pageOrientation, false );
|
||||
pageSetup->add( &m_pageLeftMargin );
|
||||
@ -413,6 +399,9 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
pageSetup->add( &m_pageTopMargin );
|
||||
pageSetup->add( &m_pageBottomMargin, false );
|
||||
|
||||
generalGrp->add( &m_useQtChartsPlotByDefault );
|
||||
m_useQtChartsPlotByDefault.uiCapability()->setUiHidden( true );
|
||||
|
||||
QString unitLabel = " [mm]";
|
||||
if ( QPageSize( m_pageSize() ).definitionUnits() == QPageSize::Inch )
|
||||
{
|
||||
@ -439,6 +428,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
#endif
|
||||
caf::PdmUiGroup* scriptGroup = uiOrdering.addNewGroup( "Script files" );
|
||||
scriptGroup->add( &scriptDirectories );
|
||||
scriptGroup->add( &m_maxScriptFoldersDepth );
|
||||
scriptGroup->add( &scriptEditorExecutable );
|
||||
}
|
||||
#ifdef USE_ODB_API
|
||||
@ -447,15 +437,15 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
m_geoMechPreferences()->appendItems( uiOrdering );
|
||||
}
|
||||
#endif
|
||||
else if ( uiConfigName == RiaPreferences::tabNameExport() )
|
||||
else if ( uiConfigName == RiaPreferences::tabNameImportExport() )
|
||||
{
|
||||
uiOrdering.add( &csvTextExportFieldSeparator );
|
||||
uiOrdering.add( &m_openExportedPdfInViewer );
|
||||
}
|
||||
else if ( uiConfigName == RiaPreferences::tabNameImport() )
|
||||
{
|
||||
uiOrdering.add( &m_surfaceImportResamplingDistance );
|
||||
uiOrdering.add( &m_multiLateralWellPattern );
|
||||
caf::PdmUiGroup* importGroup = uiOrdering.addNewGroup( "Import" );
|
||||
importGroup->add( &m_surfaceImportResamplingDistance );
|
||||
importGroup->add( &m_multiLateralWellPattern );
|
||||
|
||||
caf::PdmUiGroup* exportGroup = uiOrdering.addNewGroup( "Export" );
|
||||
exportGroup->add( &csvTextExportFieldSeparator );
|
||||
exportGroup->add( &m_openExportedPdfInViewer );
|
||||
}
|
||||
else if ( RiaApplication::enableDevelopmentFeatures() && uiConfigName == RiaPreferences::tabNameSystem() )
|
||||
{
|
||||
@ -468,11 +458,9 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RiaPreferences::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly )
|
||||
QList<caf::PdmOptionItemInfo> RiaPreferences::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
*useOptionsOnly = true;
|
||||
|
||||
if ( fieldNeedingOptions == &m_dateFormat )
|
||||
{
|
||||
@ -480,7 +468,8 @@ QList<caf::PdmOptionItemInfo> RiaPreferences::calculateValueOptions( const caf::
|
||||
{
|
||||
QDate exampleDate = QDate( 2019, 8, 16 );
|
||||
QString fullDateFormat =
|
||||
RiaQDateTimeTools::dateFormatString( dateFormat, RiaQDateTimeTools::DATE_FORMAT_YEAR_MONTH_DAY );
|
||||
RiaQDateTimeTools::dateFormatString( dateFormat,
|
||||
RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY );
|
||||
QString uiText = QString( "%1 (%2)" ).arg( fullDateFormat ).arg( exampleDate.toString( fullDateFormat ) );
|
||||
uiText.replace( "AP", "AM/PM" );
|
||||
options.push_back( caf::PdmOptionItemInfo( uiText, QVariant::fromValue( dateFormat ) ) );
|
||||
@ -493,7 +482,7 @@ QList<caf::PdmOptionItemInfo> RiaPreferences::calculateValueOptions( const caf::
|
||||
QTime exampleTime = QTime( 15, 48, 22 );
|
||||
QString timeFormatString =
|
||||
RiaQDateTimeTools::timeFormatString( timeFormat,
|
||||
RiaQDateTimeTools::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND );
|
||||
RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND );
|
||||
QString uiText = QString( "%1 (%2)" ).arg( timeFormatString ).arg( exampleTime.toString( timeFormatString ) );
|
||||
uiText.replace( "AP", "AM/PM" );
|
||||
options.push_back( caf::PdmOptionItemInfo( uiText, QVariant::fromValue( timeFormat ) ) );
|
||||
@ -524,11 +513,14 @@ void RiaPreferences::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
m_pageTopMargin = defaultMarginSize( m_pageSize() );
|
||||
m_pageBottomMargin = defaultMarginSize( m_pageSize() );
|
||||
}
|
||||
|
||||
if ( changedField == &m_guiTheme )
|
||||
else if ( changedField == &m_guiTheme )
|
||||
{
|
||||
RiuGuiTheme::updateGuiTheme( m_guiTheme() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_summaryPreferences->fieldChangedByUi( changedField, oldValue, newValue );
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -541,17 +533,17 @@ QString RiaPreferences::tabNameGeneral()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::tabNameEclipseGrid()
|
||||
QString RiaPreferences::tabNameGrid()
|
||||
{
|
||||
return "Eclipse Grid";
|
||||
return "Grid";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::tabNameEclipseSummary()
|
||||
QString RiaPreferences::tabNameSummary()
|
||||
{
|
||||
return "Eclipse Summary";
|
||||
return "Summary";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -578,14 +570,6 @@ QString RiaPreferences::tabNameScripting()
|
||||
return "Scripting";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::tabNameExport()
|
||||
{
|
||||
return "Export";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -597,9 +581,9 @@ QString RiaPreferences::tabNameSystem()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::tabNameImport()
|
||||
QString RiaPreferences::tabNameImportExport()
|
||||
{
|
||||
return "Import";
|
||||
return "Import/Export";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -626,15 +610,14 @@ QStringList RiaPreferences::tabNames()
|
||||
QStringList names;
|
||||
|
||||
names << tabNameGeneral();
|
||||
names << tabNameEclipseGrid();
|
||||
names << tabNameEclipseSummary();
|
||||
names << tabNameGrid();
|
||||
names << tabNameSummary();
|
||||
names << tabNamePlotting();
|
||||
names << tabNameScripting();
|
||||
#ifdef USE_ODB_API
|
||||
names << tabNameGeomech();
|
||||
#endif
|
||||
names << tabNameExport();
|
||||
names << tabNameImport();
|
||||
names << tabNameImportExport();
|
||||
|
||||
if ( RiaApplication::enableDevelopmentFeatures() )
|
||||
{
|
||||
@ -679,7 +662,8 @@ const QString& RiaPreferences::timeFormat() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::dateTimeFormat( DateFormatComponents dateComponents, TimeFormatComponents timeComponents ) const
|
||||
QString RiaPreferences::dateTimeFormat( RiaDefines::DateFormatComponents dateComponents,
|
||||
RiaDefines::TimeFormatComponents timeComponents ) const
|
||||
{
|
||||
return QString( "%1 %2" )
|
||||
.arg( RiaQDateTimeTools::dateFormatString( m_dateFormat(), dateComponents ) )
|
||||
@ -689,9 +673,17 @@ QString RiaPreferences::dateTimeFormat( DateFormatComponents dateComponents, Tim
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::searchPlotTemplateFoldersRecursively() const
|
||||
int RiaPreferences::maxScriptFoldersDepth() const
|
||||
{
|
||||
return m_searchPlotTemplateFoldersRecursively();
|
||||
return m_maxScriptFoldersDepth();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiaPreferences::maxPlotTemplateFoldersDepth() const
|
||||
{
|
||||
return m_maxPlotTemplateFoldersDepth();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -732,17 +724,17 @@ void RiaPreferences::appendPlotTemplateFolders( const QString& folder )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::defaultPlotTemplateAbsolutePath() const
|
||||
QString RiaPreferences::lastUsedPlotTemplateAbsolutePath() const
|
||||
{
|
||||
return m_defaultPlotTemplate().path();
|
||||
return m_lastUsedPlotTemplate().path();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferences::setDefaultPlotTemplatePath( const QString& templatePath )
|
||||
void RiaPreferences::setLastUsedPlotTemplatePath( const QString& templatePath )
|
||||
{
|
||||
m_defaultPlotTemplate = templatePath;
|
||||
m_lastUsedPlotTemplate = templatePath;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -753,6 +745,14 @@ bool RiaPreferences::openExportedPdfInViewer() const
|
||||
return m_openExportedPdfInViewer;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::useQtChartsAsDefaultPlotType() const
|
||||
{
|
||||
return m_useQtChartsPlotByDefault;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -21,9 +21,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDateTimeDefines.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaFontCache.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildField.h"
|
||||
@ -52,9 +52,6 @@ class RiaPreferences : public caf::PdmObject
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
using DateFormatComponents = RiaQDateTimeTools::DateFormatComponents;
|
||||
using TimeFormatComponents = RiaQDateTimeTools::TimeFormatComponents;
|
||||
|
||||
using FontSizeEnum = RiaFontCache::FontSizeEnum;
|
||||
using PageSizeEnum = caf::AppEnum<QPageSize::PageSizeId>;
|
||||
using PageOrientationEnum = caf::AppEnum<QPageLayout::Orientation>;
|
||||
@ -75,15 +72,19 @@ public:
|
||||
|
||||
const QString& dateFormat() const;
|
||||
const QString& timeFormat() const;
|
||||
QString dateTimeFormat( DateFormatComponents dateComponents = DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY,
|
||||
TimeFormatComponents timeComponents = TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND ) const;
|
||||
QString dateTimeFormat(
|
||||
RiaDefines::DateFormatComponents dateComponents = RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY,
|
||||
RiaDefines::TimeFormatComponents timeComponents = RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND ) const;
|
||||
|
||||
int maxScriptFoldersDepth() const;
|
||||
int maxPlotTemplateFoldersDepth() const;
|
||||
|
||||
bool searchPlotTemplateFoldersRecursively() const;
|
||||
QStringList plotTemplateFolders() const;
|
||||
void appendPlotTemplateFolders( const QString& folder );
|
||||
QString defaultPlotTemplateAbsolutePath() const;
|
||||
void setDefaultPlotTemplatePath( const QString& templatePath );
|
||||
QString lastUsedPlotTemplateAbsolutePath() const;
|
||||
void setLastUsedPlotTemplatePath( const QString& templatePath );
|
||||
bool openExportedPdfInViewer() const;
|
||||
bool useQtChartsAsDefaultPlotType() const;
|
||||
|
||||
RiaDefines::ThemeEnum guiTheme() const;
|
||||
|
||||
@ -148,21 +149,19 @@ protected:
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
void initAfterRead() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
private:
|
||||
static QString tabNameGeneral();
|
||||
static QString tabNameEclipseGrid();
|
||||
static QString tabNameEclipseSummary();
|
||||
static QString tabNameGrid();
|
||||
static QString tabNameSummary();
|
||||
static QString tabNameGeomech();
|
||||
static QString tabNamePlotting();
|
||||
static QString tabNameScripting();
|
||||
static QString tabNameExport();
|
||||
static QString tabNameSystem();
|
||||
static QString tabNameImport();
|
||||
static QString tabNameImportExport();
|
||||
|
||||
static double defaultMarginSize( QPageSize::PageSizeId pageSizeId );
|
||||
|
||||
@ -176,6 +175,8 @@ private:
|
||||
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::ThemeEnum>> m_guiTheme;
|
||||
|
||||
caf::PdmField<int> m_maxScriptFoldersDepth;
|
||||
|
||||
caf::PdmField<PageSizeEnum> m_pageSize;
|
||||
caf::PdmField<PageOrientationEnum> m_pageOrientation;
|
||||
caf::PdmField<double> m_pageLeftMargin;
|
||||
@ -185,8 +186,9 @@ private:
|
||||
caf::PdmField<bool> m_openExportedPdfInViewer;
|
||||
|
||||
caf::PdmField<QString> m_plotTemplateFolders;
|
||||
caf::PdmField<bool> m_searchPlotTemplateFoldersRecursively;
|
||||
caf::PdmField<caf::FilePath> m_defaultPlotTemplate;
|
||||
caf::PdmField<int> m_maxPlotTemplateFoldersDepth;
|
||||
caf::PdmField<caf::FilePath> m_lastUsedPlotTemplate;
|
||||
caf::PdmField<bool> m_useQtChartsPlotByDefault;
|
||||
|
||||
// Script paths
|
||||
caf::PdmField<QString> m_octaveExecutable;
|
||||
|
@ -34,41 +34,33 @@ CAF_PDM_SOURCE_INIT( RiaPreferencesGeoMech, "RiaPreferencesGeoMech" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferencesGeoMech::RiaPreferencesGeoMech()
|
||||
{
|
||||
CAF_PDM_InitFieldNoDefault( &m_geomechFRAPreprocCommand, "geomechFRAPreprocCommand", "Pre-Processing Command", "", "", "" );
|
||||
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", "", "", "" );
|
||||
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", "", "", "" );
|
||||
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",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
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",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"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", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_geomechWIADefaultXML, "geomechWIADefaultXML", "Default Parameter XML File" );
|
||||
m_geomechWIADefaultXML.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_geomechWIADefaultXML.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_geomechWIACommand, "geomechWIACommand", "Command to run", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_geomechWIACommand, "geomechWIACommand", "Command to run" );
|
||||
m_geomechWIACommand.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
m_geomechWIACommand.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
|
||||
|
@ -18,12 +18,21 @@
|
||||
|
||||
#include "RiaPreferencesSummary.h"
|
||||
|
||||
#include "PlotTemplateCommands/RicSummaryPlotTemplateTools.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "PlotTemplates/RimPlotTemplateFileItem.h"
|
||||
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiListEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@ -55,6 +64,16 @@ void RiaPreferencesSummary::SummaryReaderModeType::setUp()
|
||||
addItem( RiaPreferencesSummary::SummaryReaderMode::OPM_COMMON, "OPM_COMMON", "ESMRY (opm-common)" );
|
||||
setDefault( RiaPreferencesSummary::SummaryReaderMode::HDF5_OPM_COMMON );
|
||||
}
|
||||
|
||||
template <>
|
||||
void RiaPreferencesSummary::DefaultSummaryPlotEnum::setUp()
|
||||
{
|
||||
addItem( RiaPreferencesSummary::DefaultSummaryPlotType::NONE, "NONE", "No Plots" );
|
||||
addItem( RiaPreferencesSummary::DefaultSummaryPlotType::DATA_VECTORS, "DATA_VECTORS", "Use Data Vector Names" );
|
||||
addItem( RiaPreferencesSummary::DefaultSummaryPlotType::PLOT_TEMPLATES, "PLOT_TEMPLATES", "Use Plot Templates" );
|
||||
setDefault( RiaPreferencesSummary::DefaultSummaryPlotType::DATA_VECTORS );
|
||||
}
|
||||
|
||||
} // namespace caf
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RiaPreferencesSummary, "RiaPreferencesSummary" );
|
||||
@ -66,42 +85,27 @@ RiaPreferencesSummary::RiaPreferencesSummary()
|
||||
{
|
||||
CAF_PDM_InitFieldNoDefault( &m_summaryRestartFilesShowImportDialog,
|
||||
"summaryRestartFilesShowImportDialog",
|
||||
"Show Import Dialog",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Show Import Dialog" );
|
||||
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_summaryRestartFilesShowImportDialog );
|
||||
|
||||
CAF_PDM_InitField( &m_summaryImportMode,
|
||||
"summaryImportMode",
|
||||
SummaryRestartFilesImportModeType( RiaPreferencesSummary::SummaryRestartFilesImportMode::IMPORT ),
|
||||
"Default Summary Import Option",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Default Summary Import Option" );
|
||||
CAF_PDM_InitField( &m_gridImportMode,
|
||||
"gridImportMode",
|
||||
SummaryRestartFilesImportModeType( RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT ),
|
||||
"Default Grid Import Option",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Default Grid Import Option" );
|
||||
CAF_PDM_InitField( &m_summaryEnsembleImportMode,
|
||||
"summaryEnsembleImportMode",
|
||||
SummaryRestartFilesImportModeType( RiaPreferencesSummary::SummaryRestartFilesImportMode::IMPORT ),
|
||||
"Default Ensemble Summary Import Option",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Default Ensemble Summary Import Option" );
|
||||
|
||||
CAF_PDM_InitField( &m_defaultSummaryHistoryCurveStyle,
|
||||
"defaultSummaryHistoryCurveStyle",
|
||||
SummaryHistoryCurveStyleModeType( RiaPreferencesSummary::SummaryHistoryCurveStyleMode::SYMBOLS ),
|
||||
"Default Curve Style for History Vectors",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Default Curve Style for History Vectors" );
|
||||
CAF_PDM_InitField( &m_defaultSummaryCurvesTextFilter,
|
||||
"defaultSummaryCurvesTextFilter",
|
||||
QString( "FOPT" ),
|
||||
@ -109,6 +113,16 @@ RiaPreferencesSummary::RiaPreferencesSummary()
|
||||
"",
|
||||
"Semicolon separated list of filters used to create curves in new summary plots",
|
||||
"" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_defaultSummaryPlot, "defaultSummaryPlot", "Create Plot On Summary Data Import" );
|
||||
|
||||
CAF_PDM_InitField( &m_selectDefaultTemplates, "selectDefaultTemplate", false, "", "", "Select Default Templates" );
|
||||
m_selectDefaultTemplates.xmlCapability()->disableIO();
|
||||
m_selectDefaultTemplates.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_selectedDefaultTemplates, "defaultSummaryTemplates", "Select Summary Plot Templates" );
|
||||
m_selectedDefaultTemplates.uiCapability()->setUiReadOnly( true );
|
||||
m_selectedDefaultTemplates.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() );
|
||||
m_selectedDefaultTemplates.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
|
||||
CAF_PDM_InitField( &m_createEnhancedSummaryDataFile,
|
||||
"createEnhancedSummaryDataFile_v01",
|
||||
@ -137,33 +151,43 @@ RiaPreferencesSummary::RiaPreferencesSummary()
|
||||
"" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_createH5SummaryDataFile );
|
||||
|
||||
CAF_PDM_InitField( &m_createH5SummaryFileThreadCount,
|
||||
"createH5SummaryFileThreadCount",
|
||||
1,
|
||||
"h5 Summary Export Thread Count",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitField( &m_createH5SummaryFileThreadCount, "createH5SummaryFileThreadCount", 1, "h5 Summary Export Thread Count" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_summaryReader, "summaryReaderType_v01", "File Format", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_summaryReader, "summaryReaderType_v01", "File Format" );
|
||||
|
||||
CAF_PDM_InitField( &m_showSummaryTimeAsLongString,
|
||||
"showSummaryTimeAsLongString",
|
||||
false,
|
||||
"Show resample time text as long time text (2010-11-21 23:15:00)",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Show resample time text as long time text (2010-11-21 23:15:00)" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showSummaryTimeAsLongString );
|
||||
|
||||
CAF_PDM_InitField( &m_useMultipleThreadsWhenLoadingSummaryCases,
|
||||
"useMultipleThreadsWhenLoadingSummaryCases",
|
||||
true,
|
||||
"Use Multiple Threads for Import of Summary Files",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Use Multiple Threads for Import of Summary Files" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_useMultipleThreadsWhenLoadingSummaryCases );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_defaultColumnCount, "DefaultNumberOfColumns", "Columns" );
|
||||
m_defaultColumnCount = RiaDefines::ColumnCount::COLUMNS_2;
|
||||
CAF_PDM_InitFieldNoDefault( &m_defaultRowsPerPage, "DefaultRowsPerPage", "Rows per Page" );
|
||||
m_defaultRowsPerPage = RiaDefines::RowCount::ROWS_2;
|
||||
|
||||
CAF_PDM_InitField( &m_curveColorByPhase, "curveColorByPhase", true, "Curve Color By Phase" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_curveColorByPhase );
|
||||
|
||||
CAF_PDM_InitField( &m_appendHistoryVectors,
|
||||
"appendHistoryVectorForDragDrop",
|
||||
false,
|
||||
"Append History Vectors",
|
||||
"",
|
||||
"When a simulated summary vector is inserted into a plot, also include the corresponding "
|
||||
"history vector" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_appendHistoryVectors );
|
||||
|
||||
CAF_PDM_InitField( &m_historyCurveContrastColor,
|
||||
"historyCurveContrastColor",
|
||||
RiaColorTables::historyCurveContrastColor(),
|
||||
"History Curve Color" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -245,9 +269,36 @@ void RiaPreferencesSummary::appendRestartFileGroup( caf::PdmUiOrdering& uiOrderi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferencesSummary::appendItemsToPlottingGroup( caf::PdmUiOrdering& uiOrdering ) const
|
||||
{
|
||||
uiOrdering.add( &m_defaultSummaryCurvesTextFilter );
|
||||
uiOrdering.add( &m_defaultSummaryHistoryCurveStyle );
|
||||
uiOrdering.add( &m_defaultSummaryPlot );
|
||||
|
||||
switch ( m_defaultSummaryPlot() )
|
||||
{
|
||||
case RiaPreferencesSummary::DefaultSummaryPlotType::DATA_VECTORS:
|
||||
uiOrdering.add( &m_defaultSummaryCurvesTextFilter );
|
||||
break;
|
||||
|
||||
case RiaPreferencesSummary::DefaultSummaryPlotType::PLOT_TEMPLATES:
|
||||
uiOrdering.add( &m_selectedDefaultTemplates );
|
||||
uiOrdering.add( &m_selectDefaultTemplates );
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
auto historyCurveGroup = uiOrdering.addNewGroup( "History Vectors" );
|
||||
|
||||
historyCurveGroup->add( &m_defaultSummaryHistoryCurveStyle );
|
||||
historyCurveGroup->add( &m_historyCurveContrastColor );
|
||||
historyCurveGroup->add( &m_appendHistoryVectors );
|
||||
|
||||
uiOrdering.add( &m_curveColorByPhase );
|
||||
uiOrdering.add( &m_showSummaryTimeAsLongString );
|
||||
|
||||
auto multiGroup = uiOrdering.addNewGroup( "Multi Plot Defaults" );
|
||||
|
||||
multiGroup->add( &m_defaultColumnCount );
|
||||
multiGroup->add( &m_defaultRowsPerPage );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -306,6 +357,22 @@ QString RiaPreferencesSummary::defaultSummaryCurvesTextFilter() const
|
||||
return m_defaultSummaryCurvesTextFilter;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesSummary::colorCurvesByPhase() const
|
||||
{
|
||||
return m_curveColorByPhase();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesSummary::appendHistoryVectors() const
|
||||
{
|
||||
return m_appendHistoryVectors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -346,11 +413,42 @@ void RiaPreferencesSummary::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo>
|
||||
RiaPreferencesSummary::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly )
|
||||
void RiaPreferencesSummary::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
if ( field == &m_defaultRowsPerPage || field == &m_defaultColumnCount )
|
||||
{
|
||||
auto myattr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
|
||||
if ( myattr )
|
||||
{
|
||||
myattr->iconSize = QSize( 24, 16 );
|
||||
}
|
||||
}
|
||||
else if ( field == &m_selectDefaultTemplates )
|
||||
{
|
||||
auto attrib = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute );
|
||||
if ( attrib )
|
||||
{
|
||||
attrib->m_buttonText = "Select Default Templates";
|
||||
}
|
||||
}
|
||||
else if ( field == &m_selectedDefaultTemplates )
|
||||
{
|
||||
auto attrib = dynamic_cast<caf::PdmUiListEditorAttribute*>( attribute );
|
||||
if ( attrib )
|
||||
{
|
||||
attrib->m_heightHint = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RiaPreferencesSummary::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
*useOptionsOnly = true;
|
||||
|
||||
if ( fieldNeedingOptions == &m_summaryReader )
|
||||
{
|
||||
@ -389,6 +487,144 @@ QList<caf::PdmOptionItemInfo>
|
||||
options.push_back( caf::PdmOptionItemInfo( allowImport.uiText(),
|
||||
RiaPreferencesSummary::SummaryRestartFilesImportMode::IMPORT ) );
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_defaultColumnCount )
|
||||
{
|
||||
for ( size_t i = 0; i < ColumnCountEnum::size(); ++i )
|
||||
{
|
||||
RiaDefines::ColumnCount enumVal = ColumnCountEnum::fromIndex( i );
|
||||
QString columnCountString = ( enumVal == RiaDefines::ColumnCount::COLUMNS_UNLIMITED )
|
||||
? "Unlimited"
|
||||
: QString( "%1" ).arg( static_cast<int>( enumVal ) );
|
||||
QString iconPath = QString( ":/Columns%1.png" ).arg( columnCountString );
|
||||
options.push_back( caf::PdmOptionItemInfo( ColumnCountEnum::uiText( enumVal ),
|
||||
enumVal,
|
||||
false,
|
||||
caf::IconProvider( iconPath, QSize( 24, 16 ) ) ) );
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_defaultRowsPerPage )
|
||||
{
|
||||
for ( size_t i = 0; i < RowCountEnum::size(); ++i )
|
||||
{
|
||||
RiaDefines::RowCount enumVal = RowCountEnum::fromIndex( i );
|
||||
QString iconPath = QString( ":/Rows%1.png" ).arg( static_cast<int>( enumVal ) );
|
||||
options.push_back( caf::PdmOptionItemInfo( RowCountEnum::uiText( enumVal ),
|
||||
enumVal,
|
||||
false,
|
||||
caf::IconProvider( iconPath, QSize( 24, 16 ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::ColumnCount RiaPreferencesSummary::defaultMultiPlotColumnCount() const
|
||||
{
|
||||
return m_defaultColumnCount();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::RowCount RiaPreferencesSummary::defaultMultiPlotRowCount() const
|
||||
{
|
||||
return m_defaultRowsPerPage();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RiaPreferencesSummary::historyCurveContrastColor() const
|
||||
{
|
||||
return m_historyCurveContrastColor();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferencesSummary::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
if ( changedField == &m_selectDefaultTemplates )
|
||||
{
|
||||
m_selectDefaultTemplates = false;
|
||||
|
||||
auto selection = RicSummaryPlotTemplateTools::selectDefaultPlotTemplates( m_selectedDefaultTemplates() );
|
||||
if ( selection.empty() ) return;
|
||||
|
||||
m_selectedDefaultTemplates = selection;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferencesSummary::DefaultSummaryPlotType RiaPreferencesSummary::defaultSummaryPlotType() const
|
||||
{
|
||||
return m_defaultSummaryPlot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RiaPreferencesSummary::defaultSummaryPlotTemplates( bool returnEnsembleTemplates ) const
|
||||
{
|
||||
std::vector<QString> templatesToUse;
|
||||
for ( auto& fileName : m_selectedDefaultTemplates() )
|
||||
{
|
||||
bool singleTemplate = fileName.toLower().endsWith( ".rpt" );
|
||||
if ( singleTemplate && returnEnsembleTemplates ) continue;
|
||||
if ( !singleTemplate && !returnEnsembleTemplates ) continue;
|
||||
|
||||
if ( std::count( templatesToUse.begin(), templatesToUse.end(), fileName ) == 0 )
|
||||
templatesToUse.push_back( fileName );
|
||||
}
|
||||
|
||||
return templatesToUse;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesSummary::isDefaultSummaryPlotTemplate( QString filename ) const
|
||||
{
|
||||
int count = std::count( m_selectedDefaultTemplates().begin(), m_selectedDefaultTemplates().end(), filename );
|
||||
return ( count > 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferencesSummary::addToDefaultPlotTemplates( QString filename )
|
||||
{
|
||||
if ( isDefaultSummaryPlotTemplate( filename ) ) return;
|
||||
|
||||
std::vector<QString> newlist;
|
||||
newlist.insert( newlist.end(), m_selectedDefaultTemplates().begin(), m_selectedDefaultTemplates().end() );
|
||||
newlist.push_back( filename );
|
||||
m_selectedDefaultTemplates = newlist;
|
||||
|
||||
RiaPreferences::current()->writePreferencesToApplicationStore();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferencesSummary::removeFromDefaultPlotTemplates( QString filename )
|
||||
{
|
||||
if ( !isDefaultSummaryPlotTemplate( filename ) ) return;
|
||||
|
||||
std::vector<QString> newlist;
|
||||
|
||||
for ( auto& item : m_selectedDefaultTemplates() )
|
||||
{
|
||||
if ( item != filename ) newlist.push_back( item );
|
||||
}
|
||||
m_selectedDefaultTemplates = newlist;
|
||||
|
||||
RiaPreferences::current()->writePreferencesToApplicationStore();
|
||||
}
|
||||
|
@ -19,9 +19,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
// Include to make Pdm work for cvf::Color
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -54,6 +64,17 @@ public:
|
||||
};
|
||||
using SummaryHistoryCurveStyleModeType = caf::AppEnum<SummaryHistoryCurveStyleMode>;
|
||||
|
||||
enum class DefaultSummaryPlotType
|
||||
{
|
||||
NONE,
|
||||
DATA_VECTORS,
|
||||
PLOT_TEMPLATES
|
||||
};
|
||||
using DefaultSummaryPlotEnum = caf::AppEnum<DefaultSummaryPlotType>;
|
||||
|
||||
using ColumnCountEnum = caf::AppEnum<RiaDefines::ColumnCount>;
|
||||
using RowCountEnum = caf::AppEnum<RiaDefines::RowCount>;
|
||||
|
||||
public:
|
||||
RiaPreferencesSummary();
|
||||
|
||||
@ -66,6 +87,12 @@ public:
|
||||
bool createH5SummaryDataFiles() const;
|
||||
int createH5SummaryDataThreadCount() const;
|
||||
|
||||
DefaultSummaryPlotType defaultSummaryPlotType() const;
|
||||
std::vector<QString> defaultSummaryPlotTemplates( bool returnEnsembleTemplates ) const;
|
||||
bool isDefaultSummaryPlotTemplate( QString filename ) const;
|
||||
void addToDefaultPlotTemplates( QString filename );
|
||||
void removeFromDefaultPlotTemplates( QString filename );
|
||||
|
||||
void appendRestartFileGroup( caf::PdmUiOrdering& uiOrdering ) const;
|
||||
void appendItemsToPlottingGroup( caf::PdmUiOrdering& uiOrdering ) const;
|
||||
|
||||
@ -77,15 +104,30 @@ public:
|
||||
SummaryRestartFilesImportMode gridImportMode() const;
|
||||
SummaryRestartFilesImportMode summaryEnsembleImportMode() const;
|
||||
QString defaultSummaryCurvesTextFilter() const;
|
||||
bool colorCurvesByPhase() const;
|
||||
bool appendHistoryVectors() const;
|
||||
|
||||
SummaryHistoryCurveStyleMode defaultSummaryHistoryCurveStyle() const;
|
||||
|
||||
RiaDefines::ColumnCount defaultMultiPlotColumnCount() const;
|
||||
RiaDefines::RowCount defaultMultiPlotRowCount() const;
|
||||
|
||||
cvf::Color3f historyCurveContrastColor() const;
|
||||
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<DefaultSummaryPlotEnum> m_defaultSummaryPlot;
|
||||
caf::PdmField<bool> m_selectDefaultTemplates;
|
||||
caf::PdmField<std::vector<QString>> m_selectedDefaultTemplates;
|
||||
|
||||
caf::PdmField<bool> m_summaryRestartFilesShowImportDialog;
|
||||
caf::PdmField<SummaryRestartFilesImportModeType> m_summaryImportMode;
|
||||
caf::PdmField<SummaryRestartFilesImportModeType> m_gridImportMode;
|
||||
@ -93,6 +135,8 @@ private:
|
||||
|
||||
caf::PdmField<QString> m_defaultSummaryCurvesTextFilter;
|
||||
caf::PdmField<SummaryHistoryCurveStyleModeType> m_defaultSummaryHistoryCurveStyle;
|
||||
caf::PdmField<bool> m_curveColorByPhase;
|
||||
caf::PdmField<bool> m_appendHistoryVectors;
|
||||
|
||||
caf::PdmField<bool> m_showSummaryTimeAsLongString;
|
||||
caf::PdmField<bool> m_useMultipleThreadsWhenLoadingSummaryCases;
|
||||
@ -104,4 +148,9 @@ private:
|
||||
caf::PdmField<int> m_createH5SummaryFileThreadCount;
|
||||
|
||||
caf::PdmField<SummaryReaderModeType> m_summaryReader;
|
||||
|
||||
caf::PdmField<ColumnCountEnum> m_defaultColumnCount;
|
||||
caf::PdmField<RowCountEnum> m_defaultRowsPerPage;
|
||||
|
||||
caf::PdmField<cvf::Color3f> m_historyCurveContrastColor;
|
||||
};
|
||||
|
@ -46,62 +46,51 @@ CAF_PDM_SOURCE_INIT( RiaPreferencesSystem, "RiaPreferencesSystem" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferencesSystem::RiaPreferencesSystem()
|
||||
{
|
||||
CAF_PDM_InitField( &m_useShaders, "useShaders", true, "Use Shaders", "", "", "" );
|
||||
CAF_PDM_InitField( &m_useShaders, "useShaders", true, "Use Shaders" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_useShaders );
|
||||
CAF_PDM_InitField( &m_showHud, "showHud", false, "Show 3D Information", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showHud, "showHud", false, "Show 3D Information" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showHud );
|
||||
CAF_PDM_InitField( &m_appendClassNameToUiText, "appendClassNameToUiText", false, "Show Class Names", "", "", "" );
|
||||
CAF_PDM_InitField( &m_appendClassNameToUiText, "appendClassNameToUiText", false, "Show Class Names" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_appendClassNameToUiText );
|
||||
|
||||
CAF_PDM_InitField( &m_appendFieldKeywordToToolTipText,
|
||||
"appendFieldKeywordToToolTipText",
|
||||
false,
|
||||
"Show Field Keyword in ToolTip",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Show Field Keyword in ToolTip" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_appendFieldKeywordToToolTipText );
|
||||
|
||||
CAF_PDM_InitField( &m_showViewIdInProjectTree, "showViewIdInTree", false, "Show View Id in Project Tree", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showViewIdInProjectTree, "showViewIdInTree", false, "Show View Id in Project Tree" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showViewIdInProjectTree );
|
||||
|
||||
CAF_PDM_InitField( &m_showTestToolbar, "showTestToolbar", false, "Enable Test Toolbar", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showTestToolbar, "showTestToolbar", false, "Enable Test Toolbar" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showTestToolbar );
|
||||
|
||||
CAF_PDM_InitField( &m_includeFractureDebugInfoFile,
|
||||
"includeFractureDebugInfoFile",
|
||||
false,
|
||||
"Include Fracture Debug Info for Completion Export",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Include Fracture Debug Info for Completion Export" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_includeFractureDebugInfoFile );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_holoLensExportFolder, "holoLensExportFolder", "HoloLens Export Folder", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_holoLensExportFolder, "holoLensExportFolder", "HoloLens Export Folder" );
|
||||
m_holoLensExportFolder.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
m_holoLensExportFolder.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_showProjectChangedDialog,
|
||||
"showProjectChangedDialog",
|
||||
true,
|
||||
"Show 'Project has changed' dialog",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitField( &m_showProjectChangedDialog, "showProjectChangedDialog", true, "Show 'Project has changed' dialog" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showProjectChangedDialog );
|
||||
|
||||
CAF_PDM_InitField( &m_showProgressBar, "showProgressBar", true, "Show Progress Bar", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showProgressBar, "showProgressBar", true, "Show Progress Bar" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showProgressBar );
|
||||
|
||||
CAF_PDM_InitField( &m_gtestFilter, "gtestFilter", QString(), "Unit Test Filter (gtest)", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showPdfExportDialog, "showPdfExportDialog", true, "Show PDF Export Dialog" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showPdfExportDialog );
|
||||
|
||||
CAF_PDM_InitField( &m_gtestFilter, "gtestFilter", QString(), "Unit Test Filter (gtest)" );
|
||||
CAF_PDM_InitField( &m_exportScalingFactor, "exportScalingFactor", -1.0, "Export Scaling Factor (<0 disable)" );
|
||||
|
||||
CAF_PDM_InitField( &m_eclipseReaderMode,
|
||||
"eclipseReaderMode",
|
||||
EclipseTextFileReaderModeType( RiaPreferencesSystem::EclipseTextFileReaderMode::FILE ),
|
||||
"Eclipse Text File Import mode (GRDECL)",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
"Eclipse Text File Import mode (GRDECL)" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -112,6 +101,14 @@ RiaPreferencesSystem* RiaPreferencesSystem::current()
|
||||
return RiaApplication::instance()->preferences()->systemPreferences();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferencesSystem::setAppendClassNameToUiText( bool enable )
|
||||
{
|
||||
m_appendClassNameToUiText = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -210,6 +207,22 @@ bool RiaPreferencesSystem::showProgressBar() const
|
||||
return m_showProgressBar();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesSystem::showPdfExportDialog() const
|
||||
{
|
||||
return m_showPdfExportDialog();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaPreferencesSystem::exportPdfScalingFactor() const
|
||||
{
|
||||
return m_exportScalingFactor();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -242,16 +255,17 @@ void RiaPreferencesSystem::defineUiOrdering( QString uiConfigName, caf::PdmUiOrd
|
||||
uiOrdering.add( &m_includeFractureDebugInfoFile );
|
||||
uiOrdering.add( &m_holoLensExportFolder );
|
||||
uiOrdering.add( &m_showProgressBar );
|
||||
|
||||
uiOrdering.add( &m_showPdfExportDialog );
|
||||
uiOrdering.add( &m_exportScalingFactor );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo>
|
||||
RiaPreferencesSystem::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly )
|
||||
QList<caf::PdmOptionItemInfo> RiaPreferencesSystem::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
*useOptionsOnly = true;
|
||||
|
||||
return options;
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
|
||||
static RiaPreferencesSystem* current();
|
||||
|
||||
void setAppendClassNameToUiText( bool enable );
|
||||
bool appendClassNameToUiText() const;
|
||||
bool appendFieldKeywordToToolTipText() const;
|
||||
bool showViewIdInProjectTree() const;
|
||||
@ -53,13 +54,14 @@ public:
|
||||
bool show3dInformation() const;
|
||||
QString gtestFilter() const;
|
||||
bool showProgressBar() const;
|
||||
bool showPdfExportDialog() const;
|
||||
double exportPdfScalingFactor() const;
|
||||
|
||||
EclipseTextFileReaderMode eclipseTextFileReaderMode() const;
|
||||
|
||||
protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
@ -77,6 +79,9 @@ private:
|
||||
caf::PdmField<bool> m_includeFractureDebugInfoFile;
|
||||
caf::PdmField<QString> m_holoLensExportFolder;
|
||||
|
||||
caf::PdmField<bool> m_showPdfExportDialog;
|
||||
caf::PdmField<double> m_exportScalingFactor;
|
||||
|
||||
caf::PdmField<bool> m_showProgressBar;
|
||||
caf::PdmField<QString> m_gtestFilter;
|
||||
|
||||
|
@ -84,6 +84,17 @@ bool RiaResultNames::isLogarithmicResult( const QString& resultName )
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaResultNames::isFlowResultWithBothPosAndNegValues( const QString& resultName )
|
||||
{
|
||||
if ( resultName.startsWith( "FLR", Qt::CaseInsensitive ) ) return true;
|
||||
if ( resultName.startsWith( "FLO", Qt::CaseInsensitive ) ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -350,6 +361,30 @@ QString RiaResultNames::indexKResultName()
|
||||
return "INDEX_K";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaResultNames::soil()
|
||||
{
|
||||
return "SOIL";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaResultNames::sgas()
|
||||
{
|
||||
return "SGAS";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaResultNames::swat()
|
||||
{
|
||||
return "SWAT";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -28,6 +28,7 @@ namespace RiaResultNames
|
||||
{
|
||||
bool isPerCellFaceResult( const QString& resultName );
|
||||
bool isLogarithmicResult( const QString& resultName );
|
||||
bool isFlowResultWithBothPosAndNegValues( const QString& resultName );
|
||||
|
||||
QString undefinedResultName();
|
||||
QString undefinedGridFaultName();
|
||||
@ -69,6 +70,10 @@ QString indexIResultName();
|
||||
QString indexJResultName();
|
||||
QString indexKResultName();
|
||||
|
||||
QString soil();
|
||||
QString sgas();
|
||||
QString swat();
|
||||
|
||||
// Well path derived results
|
||||
QString wbsAzimuthResult();
|
||||
QString wbsInclinationResult();
|
||||
|
67
ApplicationLibCode/Application/RiaRftDefines.cpp
Normal file
@ -0,0 +1,67 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiaRftDefines.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::segmentStartDepthResultName()
|
||||
{
|
||||
return "SEGLENST";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::segmentEndDepthResultName()
|
||||
{
|
||||
return "SEGLENEN";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::segmentTvdDepthResultName()
|
||||
{
|
||||
return "SEGDEPTH";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::segmentNumberResultName()
|
||||
{
|
||||
return "SEGMENTNUMBER";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::allBranches()
|
||||
{
|
||||
return "All";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::segmentBranchNumberResultName()
|
||||
{
|
||||
return "SegmenBranchNumber";
|
||||
}
|
41
ApplicationLibCode/Application/RiaRftDefines.h
Normal file
@ -0,0 +1,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 segmentStartDepthResultName();
|
||||
QString segmentEndDepthResultName();
|
||||
QString segmentTvdDepthResultName();
|
||||
QString segmentNumberResultName();
|
||||
|
||||
QString allBranches();
|
||||
QString segmentBranchNumberResultName();
|
||||
|
||||
enum class RftBranchType
|
||||
{
|
||||
RFT_TUBING,
|
||||
RFT_ANNULAR,
|
||||
RFT_DEVICE,
|
||||
RFT_UNKNOWN
|
||||
};
|
||||
|
||||
}; // namespace RiaDefines
|
83
ApplicationLibCode/Application/RiaScheduler.cpp
Normal file
@ -0,0 +1,83 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiaScheduler.h"
|
||||
|
||||
#include "cafProgressState.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaScheduler::RiaScheduler()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaScheduler::~RiaScheduler()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaScheduler::slotUpdateScheduledItemsWhenReady()
|
||||
{
|
||||
if ( caf::ProgressState::isActive() )
|
||||
{
|
||||
startTimer( 100 );
|
||||
return;
|
||||
}
|
||||
|
||||
performScheduledUpdates();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaScheduler::startTimer( int msecs )
|
||||
{
|
||||
if ( !m_updateTimer )
|
||||
{
|
||||
m_updateTimer.reset( new QTimer( this ) );
|
||||
connect( m_updateTimer.data(), SIGNAL( timeout() ), this, SLOT( slotUpdateScheduledItemsWhenReady() ) );
|
||||
}
|
||||
|
||||
if ( !m_updateTimer->isActive() )
|
||||
{
|
||||
m_updateTimer->setSingleShot( true );
|
||||
m_updateTimer->start( msecs );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaScheduler::waitUntilWorkIsDone()
|
||||
{
|
||||
if ( m_updateTimer )
|
||||
{
|
||||
while ( m_updateTimer->isActive() )
|
||||
{
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
}
|
||||
}
|
47
ApplicationLibCode/Application/RiaScheduler.h
Normal file
@ -0,0 +1,47 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 <QObject>
|
||||
#include <QScopedPointer>
|
||||
#include <QTimer>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RiaScheduler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RiaScheduler();
|
||||
~RiaScheduler() override;
|
||||
|
||||
virtual void performScheduledUpdates() = 0;
|
||||
|
||||
protected:
|
||||
void startTimer( int msecs );
|
||||
void waitUntilWorkIsDone();
|
||||
|
||||
private slots:
|
||||
void slotUpdateScheduledItemsWhenReady();
|
||||
|
||||
private:
|
||||
QScopedPointer<QTimer> m_updateTimer;
|
||||
};
|
@ -42,14 +42,9 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase*
|
||||
bool isEnsembleCurve )
|
||||
: m_summaryCase( summaryCase )
|
||||
, m_summaryAddress( summaryAddress )
|
||||
, m_ensemble( nullptr )
|
||||
, m_isEnsembleCurve( isEnsembleCurve )
|
||||
{
|
||||
if ( summaryCase )
|
||||
{
|
||||
RimSummaryCaseCollection* ensemble = nullptr;
|
||||
summaryCase->firstAncestorOfType( ensemble );
|
||||
m_ensemble = ensemble;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -96,6 +91,14 @@ bool RiaSummaryCurveDefinition::isEnsembleCurve() const
|
||||
return m_isEnsembleCurve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveDefinition::setSummaryAddress( const RifEclipseSummaryAddress& address )
|
||||
{
|
||||
m_summaryAddress = address;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -226,7 +229,7 @@ void RiaSummaryCurveDefinitionAnalyser::setCurveDefinitions( const std::vector<R
|
||||
{
|
||||
m_singleSummaryCases.clear();
|
||||
m_ensembles.clear();
|
||||
m_quantityNames.clear();
|
||||
m_vectorNames.clear();
|
||||
m_summaryAdresses.clear();
|
||||
|
||||
for ( const auto& curveDef : curveDefs )
|
||||
@ -252,7 +255,7 @@ void RiaSummaryCurveDefinitionAnalyser::setCurveDefinitions( const std::vector<R
|
||||
{
|
||||
const RifEclipseSummaryAddress& address = curveDef.summaryAddress();
|
||||
|
||||
m_quantityNames.insert( address.quantityName() );
|
||||
m_vectorNames.insert( address.vectorName() );
|
||||
m_summaryAdresses.insert( address );
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ public:
|
||||
const RifEclipseSummaryAddress& summaryAddress() const;
|
||||
RimSummaryCaseCollection* ensemble() const;
|
||||
bool isEnsembleCurve() const;
|
||||
void setSummaryAddress( const RifEclipseSummaryAddress& address );
|
||||
|
||||
bool operator<( const RiaSummaryCurveDefinition& other ) const;
|
||||
|
||||
@ -74,5 +75,5 @@ public:
|
||||
std::set<RimSummaryCaseCollection*> m_ensembles; // All the ensembles referenced by the summary cases
|
||||
|
||||
std::set<RifEclipseSummaryAddress> m_summaryAdresses;
|
||||
std::set<std::string> m_quantityNames; // Quantity names from the addresses
|
||||
std::set<std::string> m_vectorNames;
|
||||
};
|
||||
|
@ -17,14 +17,25 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaViewRedrawScheduler.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
|
||||
#include "cafProgressState.h"
|
||||
#include <set>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaViewRedrawScheduler::RiaViewRedrawScheduler()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaViewRedrawScheduler::~RiaViewRedrawScheduler()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -51,13 +62,8 @@ void RiaViewRedrawScheduler::scheduleDisplayModelUpdateAndRedraw( Rim3dView* res
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaViewRedrawScheduler::clearViewsScheduledForUpdate()
|
||||
{
|
||||
if ( m_resViewUpdateTimer )
|
||||
{
|
||||
while ( m_resViewUpdateTimer->isActive() )
|
||||
{
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
}
|
||||
waitUntilWorkIsDone();
|
||||
|
||||
m_resViewsToUpdate.clear();
|
||||
}
|
||||
|
||||
@ -105,39 +111,7 @@ void RiaViewRedrawScheduler::updateAndRedrawScheduledViews()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaViewRedrawScheduler::slotUpdateAndRedrawScheduledViewsWhenReady()
|
||||
void RiaViewRedrawScheduler::performScheduledUpdates()
|
||||
{
|
||||
if ( caf::ProgressState::isActive() )
|
||||
{
|
||||
startTimer( 100 );
|
||||
return;
|
||||
}
|
||||
|
||||
updateAndRedrawScheduledViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaViewRedrawScheduler::startTimer( int msecs )
|
||||
{
|
||||
if ( !m_resViewUpdateTimer )
|
||||
{
|
||||
m_resViewUpdateTimer = new QTimer( this );
|
||||
connect( m_resViewUpdateTimer, SIGNAL( timeout() ), this, SLOT( slotUpdateAndRedrawScheduledViewsWhenReady() ) );
|
||||
}
|
||||
|
||||
if ( !m_resViewUpdateTimer->isActive() )
|
||||
{
|
||||
m_resViewUpdateTimer->setSingleShot( true );
|
||||
m_resViewUpdateTimer->start( msecs );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaViewRedrawScheduler::~RiaViewRedrawScheduler()
|
||||
{
|
||||
delete m_resViewUpdateTimer;
|
||||
}
|
||||
|
@ -18,38 +18,28 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaScheduler.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
#include <QObject>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class QTimer;
|
||||
class Rim3dView;
|
||||
|
||||
class RiaViewRedrawScheduler : public QObject
|
||||
class RiaViewRedrawScheduler : public RiaScheduler
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
static RiaViewRedrawScheduler* instance();
|
||||
void scheduleDisplayModelUpdateAndRedraw( Rim3dView* resViewToUpdate );
|
||||
void clearViewsScheduledForUpdate();
|
||||
void updateAndRedrawScheduledViews();
|
||||
|
||||
private slots:
|
||||
void slotUpdateAndRedrawScheduledViewsWhenReady();
|
||||
|
||||
private:
|
||||
void startTimer( int msecs );
|
||||
|
||||
RiaViewRedrawScheduler()
|
||||
: m_resViewUpdateTimer( nullptr )
|
||||
{
|
||||
}
|
||||
RiaViewRedrawScheduler();
|
||||
~RiaViewRedrawScheduler() override;
|
||||
|
||||
RiaViewRedrawScheduler( const RiaViewRedrawScheduler& o ) = delete;
|
||||
void operator=( const RiaViewRedrawScheduler& o ) = delete;
|
||||
static RiaViewRedrawScheduler* instance();
|
||||
|
||||
void scheduleDisplayModelUpdateAndRedraw( Rim3dView* resViewToUpdate );
|
||||
void clearViewsScheduledForUpdate();
|
||||
void updateAndRedrawScheduledViews();
|
||||
|
||||
void performScheduledUpdates() override;
|
||||
|
||||
private:
|
||||
std::vector<caf::PdmPointer<Rim3dView>> m_resViewsToUpdate;
|
||||
QTimer* m_resViewUpdateTimer;
|
||||
};
|
||||
|
@ -16,7 +16,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryAddressAnalyzer.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.h
|
||||
@ -48,6 +48,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaVec3Tools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryStringTools.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -68,7 +69,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryAddressAnalyzer.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.cpp
|
||||
@ -93,6 +94,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaVec3Tools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryStringTools.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES})
|
||||
|
@ -143,6 +143,7 @@ bool RiaArgumentParser::parseArguments( cvf::ProgramOptions* progOpt )
|
||||
progOpt->registerOption( "generate", "[<outputFile>]", "Generate code or documentation", cvf::ProgramOptions::SINGLE_VALUE );
|
||||
progOpt->registerOption( "ignoreArgs", "", "System command. Ignore all arguments. Mostly for testing purposes" );
|
||||
progOpt->registerOption( "version", "", "Display the application version string" );
|
||||
progOpt->registerOption( "openplotwindow", "", "Open the 2D plot window. By default, the 3D window is displayed." );
|
||||
|
||||
progOpt->setOptionPrefix( cvf::ProgramOptions::DOUBLE_DASH );
|
||||
|
||||
|
@ -682,6 +682,16 @@ cvf::Color3f RiaColorTables::phaseColor( RiaDefines::PhaseType phase )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RiaColorTables::historyCurveContrastColor()
|
||||
{
|
||||
auto unsignedColor = cvf::Color3ub( 248, 0, 170 ); // Magenta
|
||||
|
||||
return cvf::Color3f( unsignedColor );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -81,6 +81,8 @@ public:
|
||||
static std::map<RiaDefines::PhaseType, caf::ColorTable> phaseColors();
|
||||
static cvf::Color3f phaseColor( RiaDefines::PhaseType phase );
|
||||
|
||||
static cvf::Color3f historyCurveContrastColor();
|
||||
|
||||
private:
|
||||
static std::vector<cvf::Color3ub> categoryColors();
|
||||
static std::vector<cvf::Color3ub> contrastCategoryColors();
|
||||
|
@ -184,6 +184,26 @@ QColor RiaColorTools::blendQColors( const QColor& color1, const QColor& color2,
|
||||
( color1.blue() * weight1 + color2.blue() * weight2 ) / weightsum );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RiaColorTools::makeLighter( const cvf::Color3f& color, float normalizedScalingFactor )
|
||||
{
|
||||
auto qColor = toQColor( color );
|
||||
|
||||
double h = 0.0;
|
||||
double s = 0.0;
|
||||
double l = 0.0;
|
||||
qColor.getHslF( &h, &s, &l );
|
||||
|
||||
l = l + ( 1.0 - l ) * normalizedScalingFactor;
|
||||
l = std::min( 1.0, l );
|
||||
|
||||
qColor.setHslF( h, s, l );
|
||||
|
||||
return fromQColorTo3f( qColor );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -49,6 +49,8 @@ public:
|
||||
blendCvfColors( const cvf::Color3f& color1, const cvf::Color3f& color2, int weight1 = 1, int weight2 = 1 );
|
||||
static QColor blendQColors( const QColor& color1, const QColor& color2, int weight1 = 1, int weight2 = 1 );
|
||||
|
||||
static cvf::Color3f makeLighter( const cvf::Color3f& color1, float normalizedScalingFactor );
|
||||
|
||||
// Factor > 1 increases saturation, a factor < 1 decreases saturation
|
||||
static QColor modifySaturation( const QColor& color, double factor );
|
||||
|
||||
|
@ -22,6 +22,9 @@
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
#include "RimCaseDisplayNameTools.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
@ -131,6 +134,54 @@ std::vector<QStringList> RiaEnsembleNameTools::groupFilesByEnsemble( const QStri
|
||||
return groupedByIteration;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaEnsembleNameTools::uniqueShortNameForEnsembleCase( RimSummaryCase* summaryCase )
|
||||
{
|
||||
CAF_ASSERT( summaryCase && summaryCase->ensemble() );
|
||||
|
||||
auto ensembleCaseName = summaryCase->nativeCaseName();
|
||||
auto ensemble = summaryCase->ensemble();
|
||||
auto summaryCases = ensemble->allSummaryCases();
|
||||
|
||||
QStringList summaryFilePaths;
|
||||
summaryFilePaths.push_back( summaryCase->summaryHeaderFilename() );
|
||||
|
||||
for ( auto otherSummaryCase : summaryCases )
|
||||
{
|
||||
if ( otherSummaryCase != summaryCase )
|
||||
{
|
||||
summaryFilePaths.push_back( otherSummaryCase->summaryHeaderFilename() );
|
||||
}
|
||||
}
|
||||
|
||||
return RiaEnsembleNameTools::uniqueShortName( summaryCase->summaryHeaderFilename(), summaryFilePaths, ensembleCaseName );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaEnsembleNameTools::uniqueShortNameForSummaryCase( RimSummaryCase* summaryCase )
|
||||
{
|
||||
std::set<QString> allAutoShortNames;
|
||||
|
||||
std::vector<RimSummaryCase*> allCases;
|
||||
RimProject::current()->descendantsOfType( allCases );
|
||||
|
||||
for ( auto sumCase : allCases )
|
||||
{
|
||||
if ( sumCase && sumCase != summaryCase )
|
||||
{
|
||||
allAutoShortNames.insert( sumCase->displayCaseName() );
|
||||
}
|
||||
}
|
||||
|
||||
return RimCaseDisplayNameTools::uniqueShortName( summaryCase->nativeCaseName(),
|
||||
allAutoShortNames,
|
||||
RimCaseDisplayNameTools::CASE_SHORT_NAME_LENGTH );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -19,9 +19,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class RimSummaryCase;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
@ -49,6 +52,9 @@ public:
|
||||
|
||||
static std::vector<QStringList> groupFilesByEnsemble( const QStringList& fileNames, EnsembleGroupingMode groupingMode );
|
||||
|
||||
static QString uniqueShortNameForEnsembleCase( RimSummaryCase* summaryCase );
|
||||
static QString uniqueShortNameForSummaryCase( RimSummaryCase* summaryCase );
|
||||
|
||||
private:
|
||||
static QStringList findUniqueEnsembleNames( const QStringList& fileNames,
|
||||
const std::vector<QStringList>& fileNameComponents,
|
||||
|
@ -30,7 +30,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaFieldhandleTools::disableWriteAndSetFieldHidden( caf::PdmFieldHandle* fieldHandle )
|
||||
void RiaFieldHandleTools::disableWriteAndSetFieldHidden( caf::PdmFieldHandle* fieldHandle )
|
||||
{
|
||||
CVF_ASSERT( fieldHandle );
|
||||
|
||||
@ -48,3 +48,19 @@ void RiaFieldhandleTools::disableWriteAndSetFieldHidden( caf::PdmFieldHandle* fi
|
||||
fieldHandle->xmlCapability()->setIOWritable( false );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaFieldHandleTools::updateOverrideStateAndLabel( caf::PdmFieldHandle* fieldHandle,
|
||||
bool isOverridden,
|
||||
const QString& toolTip )
|
||||
{
|
||||
// Get the label text as given by the init_field macro
|
||||
QString labelText = fieldHandle->uiCapability()->uiName( fieldHandle->uiCapability()->uiConfigNameForStaticData() );
|
||||
|
||||
if ( isOverridden ) labelText += " (overridden)";
|
||||
fieldHandle->uiCapability()->setUiToolTip( toolTip );
|
||||
fieldHandle->uiCapability()->setUiName( labelText );
|
||||
fieldHandle->uiCapability()->setUiReadOnly( isOverridden );
|
||||
}
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class PdmFieldHandle;
|
||||
@ -27,8 +29,9 @@ class PdmFieldHandle;
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiaFieldhandleTools
|
||||
class RiaFieldHandleTools
|
||||
{
|
||||
public:
|
||||
static void disableWriteAndSetFieldHidden( caf::PdmFieldHandle* fieldHandle );
|
||||
static void updateOverrideStateAndLabel( caf::PdmFieldHandle* fieldHandle, bool isOverridden, const QString& toolTip );
|
||||
};
|
||||
|
@ -23,6 +23,10 @@
|
||||
#include <QDir>
|
||||
#include <QProcess>
|
||||
|
||||
// Disable deprecation warning for QProcess::start()
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -19,6 +19,11 @@
|
||||
#include "RiaImageFileCompare.h"
|
||||
#include <QtCore/QProcess>
|
||||
|
||||
// Disable deprecation warning for QProcess::start()
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
|
@ -20,8 +20,8 @@
|
||||
|
||||
#include "ApplicationCommands/RicShowMainWindowFeature.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "SummaryPlotCommands/RicNewSummaryCurveFeature.h"
|
||||
#include "SummaryPlotCommands/RicNewSummaryPlotFeature.h"
|
||||
#include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
@ -52,9 +52,7 @@
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryCurveFilter.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimWellLogRftCurve.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
@ -197,10 +195,7 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList&
|
||||
|
||||
if ( !newSumCases.empty() )
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotColl = project->mainPlotCollection()->summaryPlotCollection();
|
||||
|
||||
RicSummaryPlotFeatureImpl::ensureAtLeastOnePlot( summaryPlotColl, newSumCases.front() );
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendDefaultSummaryMultiPlot( { newSumCases.front() }, {} );
|
||||
RiuPlotMainWindowTools::setExpanded( newSumCases.front() );
|
||||
}
|
||||
}
|
||||
@ -372,7 +367,7 @@ int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QStr
|
||||
|
||||
if ( RiaGuiApplication::isRunning() )
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( riv->cellResult() );
|
||||
if ( RiuMainWindow::instance() ) RiuMainWindow::instance()->selectAsCurrentItem( riv->cellResult() );
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -484,7 +479,8 @@ bool RiaImportEclipseCaseTools::addEclipseCases( const QStringList& fil
|
||||
|
||||
if ( RiaGuiApplication::isRunning() && gridCaseGroup && !gridCaseGroup->statisticsCaseCollection()->reservoirs.empty() )
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( gridCaseGroup->statisticsCaseCollection()->reservoirs[0] );
|
||||
if ( RiuMainWindow::instance() )
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( gridCaseGroup->statisticsCaseCollection()->reservoirs[0] );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -90,7 +90,7 @@ caf::PdmOptionItemInfo
|
||||
case RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION:
|
||||
iconText = ":/summary/components/images/region-region.svg";
|
||||
break;
|
||||
case RifEclipseSummaryAddress::SUMMARY_WELL_GROUP:
|
||||
case RifEclipseSummaryAddress::SUMMARY_GROUP:
|
||||
iconText = ":/summary/components/images/group.svg";
|
||||
break;
|
||||
case RifEclipseSummaryAddress::SUMMARY_WELL:
|
||||
|
@ -169,7 +169,7 @@ void RiaProjectModifier::replaceSourceCases( RimProject* project )
|
||||
if ( groupIdToReplace == caseGroup->groupId() )
|
||||
{
|
||||
RimCaseCollection* caseCollection = caseGroup->caseCollection;
|
||||
caseCollection->reservoirs.deleteAllChildObjects();
|
||||
caseCollection->reservoirs.deleteChildren();
|
||||
|
||||
for ( QString fileName : item.second )
|
||||
{
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include <QLocale>
|
||||
#include <QString>
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmUiItem.h"
|
||||
|
||||
#include <cvfAssert.h>
|
||||
@ -41,47 +40,6 @@ const DateTimeSpan RiaQDateTimeTools::TIMESPAN_HALFYEAR = DateTimeSpan( 0, 6, 0
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_YEAR = DateTimeSpan( 1, 0, 0 );
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_DECADE = DateTimeSpan( 10, 0, 0 );
|
||||
|
||||
namespace caf
|
||||
{
|
||||
// clang-format off
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaQDateTimeTools::DateFormatComponents>::setUp()
|
||||
{
|
||||
addItem( RiaQDateTimeTools::DATE_FORMAT_NONE, "NO_DATE", "No Date" );
|
||||
addItem( RiaQDateTimeTools::DATE_FORMAT_YEAR, "YEAR", "Year Only" );
|
||||
addItem( RiaQDateTimeTools::DATE_FORMAT_YEAR_MONTH, "YEAR_MONTH", "Year and Month" );
|
||||
addItem( RiaQDateTimeTools::DATE_FORMAT_YEAR_MONTH_DAY, "YEAR_MONTH_DAY", "Year, Month and Day" );
|
||||
setDefault( RiaQDateTimeTools::DATE_FORMAT_YEAR_MONTH_DAY );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaQDateTimeTools::TimeFormatComponents>::setUp()
|
||||
{
|
||||
addItem( RiaQDateTimeTools::TimeFormatComponents::TIME_FORMAT_NONE, "NO_TIME", "No Time of Day" );
|
||||
addItem( RiaQDateTimeTools::TimeFormatComponents::TIME_FORMAT_HOUR, "HOUR", "Hour Only" );
|
||||
addItem( RiaQDateTimeTools::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE, "HOUR_MINUTE", "Hour and Minute" );
|
||||
addItem( RiaQDateTimeTools::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND, "HOUR_MINUTE_SECONDS", "Hour, Minutes and Seconds" );
|
||||
setDefault( RiaQDateTimeTools::TimeFormatComponents::TIME_FORMAT_NONE );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaQDateTimeTools::DateTimePeriod>::setUp()
|
||||
{
|
||||
addItem( RiaQDateTimeTools::DateTimePeriod::NONE, "NONE", "None" );
|
||||
addItem( RiaQDateTimeTools::DateTimePeriod::DAY, "DAY", "Day" );
|
||||
addItem( RiaQDateTimeTools::DateTimePeriod::WEEK, "WEEK", "Week" );
|
||||
addItem( RiaQDateTimeTools::DateTimePeriod::MONTH, "MONTH", "Month" );
|
||||
addItem( RiaQDateTimeTools::DateTimePeriod::QUARTER, "QUARTER", "Quarter" );
|
||||
addItem( RiaQDateTimeTools::DateTimePeriod::HALFYEAR, "HALFYEAR", "Half Year" );
|
||||
addItem( RiaQDateTimeTools::DateTimePeriod::YEAR, "YEAR", "Year" );
|
||||
addItem( RiaQDateTimeTools::DateTimePeriod::DECADE, "DECADE", "Decade" );
|
||||
setDefault( RiaQDateTimeTools::DateTimePeriod::NONE );
|
||||
}
|
||||
|
||||
// clang-format on
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -198,7 +156,7 @@ QDateTime RiaQDateTimeTools::subtractSpan( const QDateTime& dt, DateTimeSpan spa
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::addPeriod( const QDateTime& dt, RiaQDateTimeTools::DateTimePeriod period )
|
||||
QDateTime RiaQDateTimeTools::addPeriod( const QDateTime& dt, RiaDefines::DateTimePeriod period )
|
||||
{
|
||||
return addSpan( dt, timeSpan( period ) );
|
||||
}
|
||||
@ -206,11 +164,23 @@ QDateTime RiaQDateTimeTools::addPeriod( const QDateTime& dt, RiaQDateTimeTools::
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::subtractPeriod( const QDateTime& dt, RiaQDateTimeTools::DateTimePeriod period )
|
||||
QDateTime RiaQDateTimeTools::subtractPeriod( const QDateTime& dt, RiaDefines::DateTimePeriod period )
|
||||
{
|
||||
return subtractSpan( dt, timeSpan( period ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::createDateTime( const QDate& date )
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
||||
return date.startOfDay();
|
||||
#else
|
||||
return QDateTime( date, QTime( 0, 0 ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -240,7 +210,7 @@ QDateTime RiaQDateTimeTools::createUtcDateTime()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::createUtcDateTime( const QDate& date )
|
||||
{
|
||||
auto qdt = QDateTime( date );
|
||||
auto qdt = createDateTime( date );
|
||||
qdt.setTimeSpec( currentTimeSpec() );
|
||||
return qdt;
|
||||
}
|
||||
@ -276,23 +246,23 @@ bool RiaQDateTimeTools::lessThan( const QDateTime& dt1, const QDateTime& dt2 )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const DateTimeSpan RiaQDateTimeTools::timeSpan( RiaQDateTimeTools::DateTimePeriod period )
|
||||
const DateTimeSpan RiaQDateTimeTools::timeSpan( RiaDefines::DateTimePeriod period )
|
||||
{
|
||||
switch ( period )
|
||||
{
|
||||
case RiaQDateTimeTools::DateTimePeriod::DAY:
|
||||
case RiaDefines::DateTimePeriod::DAY:
|
||||
return TIMESPAN_DAY;
|
||||
case RiaQDateTimeTools::DateTimePeriod::WEEK:
|
||||
case RiaDefines::DateTimePeriod::WEEK:
|
||||
return TIMESPAN_WEEK;
|
||||
case RiaQDateTimeTools::DateTimePeriod::MONTH:
|
||||
case RiaDefines::DateTimePeriod::MONTH:
|
||||
return TIMESPAN_MONTH;
|
||||
case RiaQDateTimeTools::DateTimePeriod::QUARTER:
|
||||
case RiaDefines::DateTimePeriod::QUARTER:
|
||||
return TIMESPAN_QUARTER;
|
||||
case RiaQDateTimeTools::DateTimePeriod::HALFYEAR:
|
||||
case RiaDefines::DateTimePeriod::HALFYEAR:
|
||||
return TIMESPAN_HALFYEAR;
|
||||
case RiaQDateTimeTools::DateTimePeriod::YEAR:
|
||||
case RiaDefines::DateTimePeriod::YEAR:
|
||||
return TIMESPAN_YEAR;
|
||||
case RiaQDateTimeTools::DateTimePeriod::DECADE:
|
||||
case RiaDefines::DateTimePeriod::DECADE:
|
||||
return TIMESPAN_DECADE;
|
||||
}
|
||||
CVF_ASSERT( false );
|
||||
@ -302,7 +272,7 @@ const DateTimeSpan RiaQDateTimeTools::timeSpan( RiaQDateTimeTools::DateTimePerio
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::truncateTime( const QDateTime& dt, RiaQDateTimeTools::DateTimePeriod period )
|
||||
QDateTime RiaQDateTimeTools::truncateTime( const QDateTime& dt, RiaDefines::DateTimePeriod period )
|
||||
{
|
||||
int y = dt.date().year();
|
||||
int m = dt.date().month();
|
||||
@ -311,19 +281,19 @@ QDateTime RiaQDateTimeTools::truncateTime( const QDateTime& dt, RiaQDateTimeTool
|
||||
|
||||
switch ( period )
|
||||
{
|
||||
case RiaQDateTimeTools::DateTimePeriod::DAY:
|
||||
case RiaDefines::DateTimePeriod::DAY:
|
||||
return createUtcDateTime( QDate( y, m, d ) );
|
||||
case RiaQDateTimeTools::DateTimePeriod::WEEK:
|
||||
case RiaDefines::DateTimePeriod::WEEK:
|
||||
return createUtcDateTime( QDate( y, m, d ).addDays( -dow + 1 ) );
|
||||
case RiaQDateTimeTools::DateTimePeriod::MONTH:
|
||||
case RiaDefines::DateTimePeriod::MONTH:
|
||||
return createUtcDateTime( QDate( y, m, 1 ) );
|
||||
case RiaQDateTimeTools::DateTimePeriod::QUARTER:
|
||||
case RiaDefines::DateTimePeriod::QUARTER:
|
||||
return createUtcDateTime( QDate( y, ( ( m - 1 ) / 3 ) * 3 + 1, 1 ) );
|
||||
case RiaQDateTimeTools::DateTimePeriod::HALFYEAR:
|
||||
case RiaDefines::DateTimePeriod::HALFYEAR:
|
||||
return createUtcDateTime( QDate( y, ( ( m - 1 ) / 6 ) * 6 + 1, 1 ) );
|
||||
case RiaQDateTimeTools::DateTimePeriod::YEAR:
|
||||
case RiaDefines::DateTimePeriod::YEAR:
|
||||
return createUtcDateTime( QDate( y, 1, 1 ) );
|
||||
case RiaQDateTimeTools::DateTimePeriod::DECADE:
|
||||
case RiaDefines::DateTimePeriod::DECADE:
|
||||
return createUtcDateTime( QDate( ( y / 10 ) * 10, 1, 1 ) );
|
||||
}
|
||||
CVF_ASSERT( false );
|
||||
@ -333,13 +303,13 @@ QDateTime RiaQDateTimeTools::truncateTime( const QDateTime& dt, RiaQDateTimeTool
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RiaQDateTimeTools::DateTimePeriod> RiaQDateTimeTools::dateTimePeriods()
|
||||
std::vector<RiaDefines::DateTimePeriod> RiaQDateTimeTools::dateTimePeriods()
|
||||
{
|
||||
std::vector<DateTimePeriod> allPeriods;
|
||||
std::vector<RiaDefines::DateTimePeriod> allPeriods;
|
||||
|
||||
for ( size_t i = 0; i < DateTimePeriodEnum::size(); i++ )
|
||||
for ( size_t i = 0; i < RiaDefines::DateTimePeriodEnum::size(); i++ )
|
||||
{
|
||||
allPeriods.push_back( DateTimePeriodEnum::fromIndex( i ) );
|
||||
allPeriods.push_back( RiaDefines::DateTimePeriodEnum::fromIndex( i ) );
|
||||
}
|
||||
|
||||
return allPeriods;
|
||||
@ -348,9 +318,9 @@ std::vector<RiaQDateTimeTools::DateTimePeriod> RiaQDateTimeTools::dateTimePeriod
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaQDateTimeTools::dateTimePeriodName( RiaQDateTimeTools::DateTimePeriod period )
|
||||
QString RiaQDateTimeTools::dateTimePeriodName( RiaDefines::DateTimePeriod period )
|
||||
{
|
||||
return DateTimePeriodEnum::uiText( period );
|
||||
return RiaDefines::DateTimePeriodEnum::uiText( period );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -471,14 +441,17 @@ std::vector<QString> RiaQDateTimeTools::supportedTimeFormats()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaQDateTimeTools::dateFormatString( const QString& fullDateFormat, DateFormatComponents dateComponents )
|
||||
QString RiaQDateTimeTools::dateFormatString( const QString& fullDateFormat, RiaDefines::DateFormatComponents dateComponents )
|
||||
{
|
||||
if ( dateComponents == DATE_FORMAT_NONE ) return "";
|
||||
if ( dateComponents == RiaDefines::DateFormatComponents::DATE_FORMAT_NONE ) return "";
|
||||
|
||||
auto enumValue = static_cast<std::underlying_type<RiaDefines::DateFormatComponents>::type>( dateComponents );
|
||||
if ( enumValue < 0 ) return "";
|
||||
|
||||
QStringList allVariants = fullDateFormat.split( ";" );
|
||||
if ( static_cast<int>( dateComponents ) < allVariants.size() )
|
||||
if ( enumValue < allVariants.size() )
|
||||
{
|
||||
return allVariants[dateComponents];
|
||||
return allVariants[enumValue];
|
||||
}
|
||||
CVF_ASSERT( false && "Date format string is malformed" );
|
||||
return "";
|
||||
@ -487,9 +460,9 @@ QString RiaQDateTimeTools::dateFormatString( const QString& fullDateFormat, Date
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaQDateTimeTools::timeFormatString( const QString& fullTimeFormat, TimeFormatComponents timeComponents )
|
||||
QString RiaQDateTimeTools::timeFormatString( const QString& fullTimeFormat, RiaDefines::TimeFormatComponents timeComponents )
|
||||
{
|
||||
if ( timeComponents == TimeFormatComponents::TIME_FORMAT_NONE ) return "";
|
||||
if ( timeComponents == RiaDefines::TimeFormatComponents::TIME_FORMAT_NONE ) return "";
|
||||
|
||||
QStringList allVariants = fullTimeFormat.split( ";" );
|
||||
if ( static_cast<int>( timeComponents ) < allVariants.size() )
|
||||
|
@ -18,17 +18,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDateTimeDefines.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
#include <qglobal.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QTextStream>
|
||||
#include <QVariant>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -47,49 +42,7 @@ class PdmOptionItemInfo;
|
||||
//==================================================================================================
|
||||
class RiaQDateTimeTools
|
||||
{
|
||||
static const DateTimeSpan TIMESPAN_DAY;
|
||||
static const DateTimeSpan TIMESPAN_WEEK;
|
||||
static const DateTimeSpan TIMESPAN_MONTH;
|
||||
static const DateTimeSpan TIMESPAN_QUARTER;
|
||||
static const DateTimeSpan TIMESPAN_HALFYEAR;
|
||||
static const DateTimeSpan TIMESPAN_YEAR;
|
||||
static const DateTimeSpan TIMESPAN_DECADE;
|
||||
|
||||
public:
|
||||
enum DateFormatComponents
|
||||
{
|
||||
DATE_FORMAT_UNSPECIFIED = -2,
|
||||
DATE_FORMAT_NONE = -1,
|
||||
DATE_FORMAT_YEAR = 0,
|
||||
DATE_FORMAT_YEAR_MONTH,
|
||||
DATE_FORMAT_YEAR_MONTH_DAY,
|
||||
DATE_FORMAT_SIZE
|
||||
};
|
||||
|
||||
enum class TimeFormatComponents
|
||||
{
|
||||
TIME_FORMAT_UNSPECIFIED = -2,
|
||||
TIME_FORMAT_NONE = -1,
|
||||
TIME_FORMAT_HOUR,
|
||||
TIME_FORMAT_HOUR_MINUTE,
|
||||
TIME_FORMAT_HOUR_MINUTE_SECOND,
|
||||
TIME_FORMAT_HOUR_MINUTE_SECOND_MILLISECOND,
|
||||
TIME_FORMAT_SIZE
|
||||
};
|
||||
|
||||
enum class DateTimePeriod
|
||||
{
|
||||
NONE = -1,
|
||||
DAY,
|
||||
WEEK,
|
||||
MONTH,
|
||||
QUARTER,
|
||||
HALFYEAR,
|
||||
YEAR,
|
||||
DECADE
|
||||
};
|
||||
using DateTimePeriodEnum = caf::AppEnum<DateTimePeriod>;
|
||||
|
||||
static Qt::TimeSpec currentTimeSpec();
|
||||
|
||||
static QDateTime fromString( const QString& dateString, const QString& format );
|
||||
@ -101,8 +54,10 @@ public:
|
||||
static QDateTime addYears( const QDateTime& dt, double years );
|
||||
static QDateTime addSpan( const QDateTime& dt, DateTimeSpan span );
|
||||
static QDateTime subtractSpan( const QDateTime& dt, DateTimeSpan span );
|
||||
static QDateTime addPeriod( const QDateTime& dt, RiaQDateTimeTools::DateTimePeriod period );
|
||||
static QDateTime subtractPeriod( const QDateTime& dt, RiaQDateTimeTools::DateTimePeriod period );
|
||||
static QDateTime addPeriod( const QDateTime& dt, RiaDefines::DateTimePeriod period );
|
||||
static QDateTime subtractPeriod( const QDateTime& dt, RiaDefines::DateTimePeriod period );
|
||||
|
||||
static QDateTime createDateTime( const QDate& date );
|
||||
|
||||
static QDateTime epoch();
|
||||
|
||||
@ -113,11 +68,11 @@ public:
|
||||
|
||||
static bool lessThan( const QDateTime& dt1, const QDateTime& dt2 );
|
||||
|
||||
static const DateTimeSpan timeSpan( RiaQDateTimeTools::DateTimePeriod period );
|
||||
static QDateTime truncateTime( const QDateTime& dt, RiaQDateTimeTools::DateTimePeriod period );
|
||||
static const DateTimeSpan timeSpan( RiaDefines::DateTimePeriod period );
|
||||
static QDateTime truncateTime( const QDateTime& dt, RiaDefines::DateTimePeriod period );
|
||||
|
||||
static std::vector<RiaQDateTimeTools::DateTimePeriod> dateTimePeriods();
|
||||
static QString dateTimePeriodName( RiaQDateTimeTools::DateTimePeriod period );
|
||||
static std::vector<RiaDefines::DateTimePeriod> dateTimePeriods();
|
||||
static QString dateTimePeriodName( RiaDefines::DateTimePeriod period );
|
||||
|
||||
// This function uses C locale to make sure the text representation of a date is stable, independent of the locale
|
||||
// settings on local machine. Required for stable regression testing.
|
||||
@ -129,16 +84,24 @@ public:
|
||||
static std::vector<QString> supportedDateFormats();
|
||||
static std::vector<QString> supportedTimeFormats();
|
||||
|
||||
static QString
|
||||
dateFormatString( const QString& fullDateFormat,
|
||||
DateFormatComponents dateComponents = DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY );
|
||||
static QString
|
||||
timeFormatString( const QString& fullTimeFormat,
|
||||
TimeFormatComponents timeComponents = TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND );
|
||||
static QString dateFormatString(
|
||||
const QString& fullDateFormat,
|
||||
RiaDefines::DateFormatComponents dateComponents = RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY );
|
||||
static QString timeFormatString( const QString& fullTimeFormat,
|
||||
RiaDefines::TimeFormatComponents timeComponents =
|
||||
RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND );
|
||||
|
||||
static QList<caf::PdmOptionItemInfo> createOptionItems( const std::vector<time_t>& timeSteps );
|
||||
|
||||
private:
|
||||
static const DateTimeSpan TIMESPAN_DAY;
|
||||
static const DateTimeSpan TIMESPAN_WEEK;
|
||||
static const DateTimeSpan TIMESPAN_MONTH;
|
||||
static const DateTimeSpan TIMESPAN_QUARTER;
|
||||
static const DateTimeSpan TIMESPAN_HALFYEAR;
|
||||
static const DateTimeSpan TIMESPAN_YEAR;
|
||||
static const DateTimeSpan TIMESPAN_DECADE;
|
||||
|
||||
static quint64 secondsInDay();
|
||||
static quint64 secondsInYear();
|
||||
};
|
||||
|
@ -22,12 +22,21 @@
|
||||
#include "cafPdmUiFilePathEditor.h"
|
||||
#include "cafPdmUiTextEditor.h"
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaRegressionTest::PlotEngine>::setUp()
|
||||
{
|
||||
addItem( RiaRegressionTest::PlotEngine::USE_QWT, "USE_QWT", "Use Qwt" );
|
||||
addItem( RiaRegressionTest::PlotEngine::USER_QTCHARTS, "USER_QTCHARTS", "Use QtCharts" );
|
||||
addItem( RiaRegressionTest::PlotEngine::NONE, "NONE", "None" );
|
||||
setDefault( RiaRegressionTest::PlotEngine::NONE );
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RiaRegressionTest, "RiaRegressionTest" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaRegressionTest::RiaRegressionTest( void )
|
||||
RiaRegressionTest::RiaRegressionTest()
|
||||
{
|
||||
CAF_PDM_InitFieldNoDefault( &folderContainingCompareTool,
|
||||
"workingFolder",
|
||||
@ -53,19 +62,13 @@ RiaRegressionTest::RiaRegressionTest( void )
|
||||
"" );
|
||||
folderContainingGitTool.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( ®ressionTestFolder, "regressionTestFolder", "Regression Test Folder", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( ®ressionTestFolder, "regressionTestFolder", "Regression Test Folder" );
|
||||
regressionTestFolder.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &showInteractiveDiffImages, "showInteractiveDiffImages", false, "Interactive Diff Images", "", "", "" );
|
||||
CAF_PDM_InitField( &useOpenMPForGeometryCreation,
|
||||
"useOpenMPForGeometryCreation",
|
||||
true,
|
||||
"Use OpenMP For Geometry Creation",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitField( &showInteractiveDiffImages, "showInteractiveDiffImages", false, "Interactive Diff Images" );
|
||||
CAF_PDM_InitField( &useOpenMPForGeometryCreation, "useOpenMPForGeometryCreation", true, "Use OpenMP For Geometry Creation" );
|
||||
|
||||
CAF_PDM_InitField( &openReportInBrowser, "openReportInBrowser", false, "Open Generated Report in Browser", "", "", "" );
|
||||
CAF_PDM_InitField( &openReportInBrowser, "openReportInBrowser", false, "Open Generated Report in Browser" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &testFilter,
|
||||
"testFilter",
|
||||
@ -76,27 +79,16 @@ RiaRegressionTest::RiaRegressionTest( void )
|
||||
"" );
|
||||
testFilter.uiCapability()->setUiEditorTypeName( caf::PdmUiTextEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &appendTestsAfterTestFilter,
|
||||
"appendTestsAfterTestFilter",
|
||||
false,
|
||||
"Append All Tests After Test Filter",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitField( &appendTestsAfterTestFilter, "appendTestsAfterTestFilter", false, "Append All Tests After Test Filter" );
|
||||
|
||||
CAF_PDM_InitField( &invalidateExternalFilePaths,
|
||||
"invalidateExternalFilePaths",
|
||||
false,
|
||||
"Invalidate External File Paths",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitField( &invalidateExternalFilePaths, "invalidateExternalFilePaths", false, "Invalidate External File Paths" );
|
||||
CAF_PDM_InitFieldNoDefault( &overridePlotEngine, "forcePlotEngine", "Force Plot Engine" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaRegressionTest::~RiaRegressionTest( void )
|
||||
RiaRegressionTest::~RiaRegressionTest()
|
||||
{
|
||||
}
|
||||
|
||||
@ -126,7 +118,7 @@ void RiaRegressionTest::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
if ( field == &folderContainingDiffTool || field == &folderContainingCompareTool ||
|
||||
field == ®ressionTestFolder || field == &folderContainingGitTool )
|
||||
{
|
||||
caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
|
||||
auto* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
|
||||
if ( myAttr )
|
||||
{
|
||||
myAttr->m_selectDirectory = true;
|
||||
|
@ -27,8 +27,16 @@ class RiaRegressionTest : public caf::PdmObject
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RiaRegressionTest( void );
|
||||
~RiaRegressionTest( void ) override;
|
||||
enum class PlotEngine
|
||||
{
|
||||
USE_QWT,
|
||||
USER_QTCHARTS,
|
||||
NONE
|
||||
};
|
||||
|
||||
public:
|
||||
RiaRegressionTest();
|
||||
~RiaRegressionTest() override;
|
||||
|
||||
void writeSettingsToApplicationStore() const;
|
||||
void readSettingsFromApplicationStore();
|
||||
@ -45,6 +53,8 @@ public:
|
||||
caf::PdmField<bool> appendTestsAfterTestFilter;
|
||||
caf::PdmField<bool> invalidateExternalFilePaths;
|
||||
|
||||
caf::PdmField<caf::AppEnum<PlotEngine>> overridePlotEngine;
|
||||
|
||||
protected:
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "RiaProjectModifier.h"
|
||||
#include "RiaRegressionTest.h"
|
||||
#include "RiaTextFileCompare.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
#include "RicfCommandFileExecutor.h"
|
||||
|
||||
@ -42,6 +43,7 @@
|
||||
#include "ExportCommands/RicSnapshotAllPlotsToFileFeature.h"
|
||||
#include "ExportCommands/RicSnapshotAllViewsToFileFeature.h"
|
||||
|
||||
#include "cafMemoryInspector.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QDateTime>
|
||||
@ -69,6 +71,8 @@ const QString reportFileName = "ResInsightRegressionTestReport.html";
|
||||
const QString commandFileFilter = "commandfile-*";
|
||||
}; // namespace RegTestNames
|
||||
|
||||
RiaRegressionTestRunner* RiaRegressionTestRunner::sm_singleton = nullptr;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -79,6 +83,7 @@ void logInfoTextWithTimeInSeconds( const QElapsedTimer& time, const QString& msg
|
||||
QString timeText = QString( "(%1 s) " ).arg( timeRunning, 0, 'f', 1 );
|
||||
|
||||
RiaLogging::info( timeText + msg );
|
||||
QApplication::processEvents();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -95,8 +100,25 @@ RiaRegressionTestRunner::RiaRegressionTestRunner()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaRegressionTestRunner* RiaRegressionTestRunner::instance()
|
||||
{
|
||||
static RiaRegressionTestRunner* singleton = new RiaRegressionTestRunner;
|
||||
return singleton;
|
||||
CAF_ASSERT( sm_singleton );
|
||||
return sm_singleton;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaRegressionTestRunner::createSingleton()
|
||||
{
|
||||
if ( !sm_singleton ) sm_singleton = new RiaRegressionTestRunner;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaRegressionTestRunner::deleteSingleton()
|
||||
{
|
||||
if ( sm_singleton ) delete sm_singleton;
|
||||
sm_singleton = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -108,6 +130,8 @@ void RiaRegressionTestRunner::runRegressionTest()
|
||||
|
||||
QString currentApplicationPath = QDir::currentPath();
|
||||
|
||||
std::vector<std::tuple<QString, double, uint64_t, uint64_t>> memoryUsagePerTest;
|
||||
|
||||
RiaRegressionTest regressionTestConfig;
|
||||
regressionTestConfig.readSettingsFromApplicationStore();
|
||||
if ( !regressionTestConfig.folderContainingCompareTool().isEmpty() )
|
||||
@ -195,6 +219,9 @@ void RiaRegressionTestRunner::runRegressionTest()
|
||||
|
||||
if ( !projectFileName.isEmpty() )
|
||||
{
|
||||
QElapsedTimer timerForOneTest;
|
||||
timerForOneTest.start();
|
||||
|
||||
cvf::ref<RiaProjectModifier> projectModifier;
|
||||
if ( regressionTestConfig.invalidateExternalFilePaths )
|
||||
{
|
||||
@ -220,7 +247,18 @@ void RiaRegressionTestRunner::runRegressionTest()
|
||||
|
||||
RicSnapshotAllPlotsToFileFeature::exportSnapshotOfPlotsIntoFolder( fullPathGeneratedFolder );
|
||||
|
||||
uint64_t usedMemoryBeforeClose = caf::MemoryInspector::getApplicationPhysicalMemoryUsageMiB();
|
||||
|
||||
app->closeProject();
|
||||
|
||||
QApplication::processEvents();
|
||||
|
||||
auto testDuration = timerForOneTest.elapsed() / 1000.0;
|
||||
|
||||
uint64_t usedMemoryAfterClose = caf::MemoryInspector::getApplicationPhysicalMemoryUsageMiB();
|
||||
|
||||
auto folderName = folderFileInfo.baseName();
|
||||
memoryUsagePerTest.push_back( { folderName, testDuration, usedMemoryBeforeClose, usedMemoryAfterClose } );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -255,6 +293,15 @@ void RiaRegressionTestRunner::runRegressionTest()
|
||||
logInfoTextWithTimeInSeconds( timeStamp, "Completed test :" + testCaseFolder.absolutePath() );
|
||||
}
|
||||
|
||||
// Profiling logging
|
||||
RiaLogging::info( "| Duration [sec] | Before Close [MB] | After Close [MB] | Name " );
|
||||
for ( const auto& [name, testDuration, beforeMemory, afterMemory] : memoryUsagePerTest )
|
||||
{
|
||||
auto timeText = QString( "(%1 s) " ).arg( testDuration, 5, 'f', 1 );
|
||||
auto logInfo = QString( "%1 %2 %3 %4" ).arg( timeText ).arg( beforeMemory ).arg( afterMemory ).arg( name );
|
||||
RiaLogging::info( logInfo );
|
||||
}
|
||||
|
||||
// Invoke git diff
|
||||
|
||||
{
|
||||
@ -519,7 +566,7 @@ QString RiaRegressionTestRunner::diff2htmlHeaderText( const QString& testRootPat
|
||||
QString html;
|
||||
|
||||
QString oldProjPath = QDir::fromNativeSeparators( testRootPath );
|
||||
QStringList pathFolders = oldProjPath.split( "/", QString::KeepEmptyParts );
|
||||
QStringList pathFolders = oldProjPath.split( "/" );
|
||||
|
||||
QString path;
|
||||
for ( const auto& f : pathFolders )
|
||||
@ -592,7 +639,7 @@ void RiaRegressionTestRunner::executeRegressionTests()
|
||||
testConfig.readSettingsFromApplicationStore();
|
||||
|
||||
QString testPath = testConfig.regressionTestFolder();
|
||||
QStringList testFilter = testConfig.testFilter().split( ";", QString::SkipEmptyParts );
|
||||
QStringList testFilter = RiaTextStringTools::splitSkipEmptyParts( testConfig.testFilter(), ";" );
|
||||
|
||||
if ( testConfig.appendTestsAfterTestFilter )
|
||||
{
|
||||
@ -643,6 +690,14 @@ bool RiaRegressionTestRunner::useOpenMPForGeometryCreation() const
|
||||
return m_regressionTestSettings.useOpenMPForGeometryCreation;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaRegressionTest::PlotEngine RiaRegressionTestRunner::overridePlotEngine() const
|
||||
{
|
||||
return m_regressionTestSettings.overridePlotEngine();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include <QStringList>
|
||||
|
||||
class QDir;
|
||||
class RiaRegressionTest;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
@ -35,12 +34,17 @@ class RiaRegressionTestRunner
|
||||
public:
|
||||
static RiaRegressionTestRunner* instance();
|
||||
|
||||
static void createSingleton();
|
||||
static void deleteSingleton();
|
||||
|
||||
void executeRegressionTests( const QString& regressionTestPath, const QStringList& testFilter );
|
||||
void executeRegressionTests();
|
||||
|
||||
bool isRunningRegressionTests() const;
|
||||
bool useOpenMPForGeometryCreation() const;
|
||||
|
||||
RiaRegressionTest::PlotEngine overridePlotEngine() const;
|
||||
|
||||
static void updateRegressionTest( const QString& testRootPath );
|
||||
|
||||
static void setDefaultSnapshotSizeFor3dViews();
|
||||
@ -72,4 +76,6 @@ private:
|
||||
bool m_appendAllTestsAfterLastItemInFilter;
|
||||
bool m_runningRegressionTests;
|
||||
RiaRegressionTest m_regressionTestSettings;
|
||||
|
||||
static RiaRegressionTestRunner* sm_singleton;
|
||||
};
|
||||
|
@ -18,12 +18,10 @@
|
||||
|
||||
#include "RiaSimWellBranchTools.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimEclipseCaseTools.h"
|
||||
#include "RimWellPlotTools.h"
|
||||
|
||||
#include "cafPdmUiOrdering.h"
|
||||
@ -34,12 +32,7 @@
|
||||
std::vector<const RigWellPath*> RiaSimWellBranchTools::simulationWellBranches( const QString& simWellName,
|
||||
bool useAutoDetectionOfBranches )
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* proj = app->project();
|
||||
|
||||
// Find first case containing the specified simulation well
|
||||
std::vector<RimEclipseCase*> simCases;
|
||||
proj->descendantsIncludingThisOfType( simCases );
|
||||
std::vector<RimEclipseCase*> simCases = RimEclipseCaseTools::eclipseCases();
|
||||
|
||||
auto caseItr = std::find_if( simCases.begin(), simCases.end(), [&simWellName]( const RimEclipseCase* eclCase ) {
|
||||
const auto& eclData = eclCase->eclipseCaseData();
|
||||
|
@ -16,7 +16,7 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaSummaryCurveAnalyzer.h"
|
||||
#include "RiaSummaryAddressAnalyzer.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
@ -29,14 +29,14 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaSummaryCurveAnalyzer::RiaSummaryCurveAnalyzer()
|
||||
RiaSummaryAddressAnalyzer::RiaSummaryAddressAnalyzer()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveAnalyzer::appendAddresses( const std::vector<RifEclipseSummaryAddress>& allAddresses )
|
||||
void RiaSummaryAddressAnalyzer::appendAddresses( const std::vector<RifEclipseSummaryAddress>& allAddresses )
|
||||
{
|
||||
for ( const auto& adr : allAddresses )
|
||||
{
|
||||
@ -47,7 +47,7 @@ void RiaSummaryCurveAnalyzer::appendAddresses( const std::vector<RifEclipseSumma
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveAnalyzer::appendAddresses( const std::set<RifEclipseSummaryAddress>& allAddresses )
|
||||
void RiaSummaryAddressAnalyzer::appendAddresses( const std::set<RifEclipseSummaryAddress>& allAddresses )
|
||||
{
|
||||
for ( const auto& adr : allAddresses )
|
||||
{
|
||||
@ -58,7 +58,7 @@ void RiaSummaryCurveAnalyzer::appendAddresses( const std::set<RifEclipseSummaryA
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryCurveAnalyzer::quantities() const
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::quantities() const
|
||||
{
|
||||
return m_quantities;
|
||||
}
|
||||
@ -66,7 +66,7 @@ std::set<std::string> RiaSummaryCurveAnalyzer::quantities() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryCurveAnalyzer::quantityNamesWithHistory() const
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::quantityNamesWithHistory() const
|
||||
{
|
||||
assignCategoryToQuantities();
|
||||
|
||||
@ -76,7 +76,7 @@ std::set<std::string> RiaSummaryCurveAnalyzer::quantityNamesWithHistory() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryCurveAnalyzer::quantityNamesNoHistory() const
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::quantityNamesNoHistory() const
|
||||
{
|
||||
assignCategoryToQuantities();
|
||||
|
||||
@ -86,49 +86,49 @@ std::set<std::string> RiaSummaryCurveAnalyzer::quantityNamesNoHistory() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RiaSummaryCurveAnalyzer::quantityNameForTitle() const
|
||||
std::string RiaSummaryAddressAnalyzer::quantityNameForTitle() const
|
||||
{
|
||||
if ( quantityNamesWithHistory().size() == 1 && quantityNamesNoHistory().empty() )
|
||||
if ( quantities().size() == 1 )
|
||||
{
|
||||
return *quantities().begin();
|
||||
}
|
||||
|
||||
if ( quantities().size() == 2 && quantityNamesWithHistory().size() == 1 )
|
||||
{
|
||||
return *quantityNamesWithHistory().begin();
|
||||
}
|
||||
|
||||
if ( quantityNamesNoHistory().size() == 1 && quantityNamesWithHistory().empty() )
|
||||
{
|
||||
return *quantityNamesNoHistory().begin();
|
||||
}
|
||||
|
||||
return std::string();
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryCurveAnalyzer::wellNames() const
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::wellNames() const
|
||||
{
|
||||
return m_wellNames;
|
||||
return keysInMap( m_wellNames );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryCurveAnalyzer::wellGroupNames() const
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::groupNames() const
|
||||
{
|
||||
return m_wellGroupNames;
|
||||
return keysInMap( m_groupNames );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<int> RiaSummaryCurveAnalyzer::regionNumbers() const
|
||||
std::set<int> RiaSummaryAddressAnalyzer::regionNumbers() const
|
||||
{
|
||||
return m_regionNumbers;
|
||||
return keysInMap( m_regionNumbers );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryCurveAnalyzer::wellCompletions( const std::string& wellName ) const
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::wellCompletions( const std::string& wellName ) const
|
||||
{
|
||||
std::set<std::string> connections;
|
||||
|
||||
@ -146,7 +146,7 @@ std::set<std::string> RiaSummaryCurveAnalyzer::wellCompletions( const std::strin
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<int> RiaSummaryCurveAnalyzer::wellSegmentNumbers( const std::string& wellName ) const
|
||||
std::set<int> RiaSummaryAddressAnalyzer::wellSegmentNumbers( const std::string& wellName ) const
|
||||
{
|
||||
std::set<int> segmentNumberForWell;
|
||||
|
||||
@ -164,61 +164,88 @@ std::set<int> RiaSummaryCurveAnalyzer::wellSegmentNumbers( const std::string& we
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryCurveAnalyzer::blocks() const
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::blocks() const
|
||||
{
|
||||
return m_blocks;
|
||||
return keysInMap( m_blocks );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<int> RiaSummaryCurveAnalyzer::aquifers() const
|
||||
std::set<int> RiaSummaryAddressAnalyzer::aquifers() const
|
||||
{
|
||||
return m_aquifers;
|
||||
return keysInMap( m_aquifers );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> RiaSummaryCurveAnalyzer::categories() const
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> RiaSummaryAddressAnalyzer::categories() const
|
||||
{
|
||||
return m_categories;
|
||||
return keysInMap( m_categories );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RiaSummaryCurveAnalyzer::identifierTexts( RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||
const std::string& secondaryIdentifier ) const
|
||||
std::vector<std::vector<RifEclipseSummaryAddress>> RiaSummaryAddressAnalyzer::addressesGroupedByObject() const
|
||||
{
|
||||
auto wellAdr = valuesInMap( m_wellNames );
|
||||
auto groupAdr = valuesInMap( m_groupNames );
|
||||
auto regionAdr = valuesInMap( m_regionNumbers );
|
||||
auto blockAdr = valuesInMap( m_blocks );
|
||||
auto aquiferAdr = valuesInMap( m_aquifers );
|
||||
|
||||
std::vector<std::vector<RifEclipseSummaryAddress>> groupedByObject;
|
||||
groupedByObject.insert( groupedByObject.end(), wellAdr.begin(), wellAdr.end() );
|
||||
groupedByObject.insert( groupedByObject.end(), groupAdr.begin(), groupAdr.end() );
|
||||
groupedByObject.insert( groupedByObject.end(), regionAdr.begin(), regionAdr.end() );
|
||||
groupedByObject.insert( groupedByObject.end(), blockAdr.begin(), blockAdr.end() );
|
||||
groupedByObject.insert( groupedByObject.end(), aquiferAdr.begin(), aquiferAdr.end() );
|
||||
|
||||
groupedByObject.push_back( m_otherCategory );
|
||||
|
||||
return groupedByObject;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||
const std::string& secondaryIdentifier ) const
|
||||
{
|
||||
std::vector<QString> identifierStrings;
|
||||
|
||||
if ( category == RifEclipseSummaryAddress::SUMMARY_REGION )
|
||||
{
|
||||
for ( const auto& regionNumber : m_regionNumbers )
|
||||
auto keys = keysInMap( m_regionNumbers );
|
||||
for ( const auto& key : keys )
|
||||
{
|
||||
identifierStrings.push_back( QString::number( regionNumber ) );
|
||||
identifierStrings.push_back( QString::number( key ) );
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL )
|
||||
{
|
||||
for ( const auto& wellName : m_wellNames )
|
||||
auto keys = keysInMap( m_wellNames );
|
||||
for ( const auto& key : keys )
|
||||
{
|
||||
identifierStrings.push_back( QString::fromStdString( wellName ) );
|
||||
identifierStrings.push_back( QString::fromStdString( key ) );
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP )
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_GROUP )
|
||||
{
|
||||
for ( const auto& wellGroupName : m_wellGroupNames )
|
||||
auto keys = keysInMap( m_groupNames );
|
||||
for ( const auto& key : keys )
|
||||
{
|
||||
identifierStrings.push_back( QString::fromStdString( wellGroupName ) );
|
||||
identifierStrings.push_back( QString::fromStdString( key ) );
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_BLOCK )
|
||||
{
|
||||
for ( const auto& ijkBlock : m_blocks )
|
||||
auto keys = keysInMap( m_blocks );
|
||||
for ( const auto& key : keys )
|
||||
{
|
||||
identifierStrings.push_back( QString::fromStdString( ijkBlock ) );
|
||||
identifierStrings.push_back( QString::fromStdString( key ) );
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT )
|
||||
@ -239,9 +266,10 @@ std::vector<QString> RiaSummaryCurveAnalyzer::identifierTexts( RifEclipseSummary
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_AQUIFER )
|
||||
{
|
||||
for ( const auto& aquifer : m_aquifers )
|
||||
auto keys = keysInMap( m_aquifers );
|
||||
for ( const auto& key : keys )
|
||||
{
|
||||
identifierStrings.push_back( QString::number( aquifer ) );
|
||||
identifierStrings.push_back( QString::number( key ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,8 +280,8 @@ std::vector<QString> RiaSummaryCurveAnalyzer::identifierTexts( RifEclipseSummary
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RifEclipseSummaryAddress>
|
||||
RiaSummaryCurveAnalyzer::addressesForCategory( const std::set<RifEclipseSummaryAddress>& addresses,
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category )
|
||||
RiaSummaryAddressAnalyzer::addressesForCategory( const std::set<RifEclipseSummaryAddress>& addresses,
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category )
|
||||
{
|
||||
std::vector<RifEclipseSummaryAddress> filteredAddresses;
|
||||
|
||||
@ -271,7 +299,7 @@ std::vector<RifEclipseSummaryAddress>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName( const std::string& curveName )
|
||||
std::string RiaSummaryAddressAnalyzer::correspondingHistorySummaryCurveName( const std::string& curveName )
|
||||
{
|
||||
static std::string historyIdentifier = "H";
|
||||
|
||||
@ -280,20 +308,30 @@ std::string RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName( const
|
||||
std::string candidate = curveName.substr( 0, curveName.size() - 1 );
|
||||
return candidate;
|
||||
}
|
||||
else
|
||||
{
|
||||
return curveName + historyIdentifier;
|
||||
}
|
||||
|
||||
return curveName + historyIdentifier;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveAnalyzer::clear()
|
||||
std::set<std::string>
|
||||
RiaSummaryAddressAnalyzer::vectorNamesForCategory( RifEclipseSummaryAddress::SummaryVarCategory category )
|
||||
{
|
||||
auto it = m_categories.find( category );
|
||||
if ( it != m_categories.end() ) return it->second;
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryAddressAnalyzer::clear()
|
||||
{
|
||||
m_quantities.clear();
|
||||
m_wellNames.clear();
|
||||
m_wellGroupNames.clear();
|
||||
m_groupNames.clear();
|
||||
m_regionNumbers.clear();
|
||||
m_categories.clear();
|
||||
m_wellCompletions.clear();
|
||||
@ -308,7 +346,7 @@ void RiaSummaryCurveAnalyzer::clear()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveAnalyzer::assignCategoryToQuantities() const
|
||||
void RiaSummaryAddressAnalyzer::assignCategoryToQuantities() const
|
||||
{
|
||||
if ( !m_quantities.empty() )
|
||||
{
|
||||
@ -322,7 +360,7 @@ void RiaSummaryCurveAnalyzer::assignCategoryToQuantities() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveAnalyzer::computeQuantityNamesWithHistory() const
|
||||
void RiaSummaryAddressAnalyzer::computeQuantityNamesWithHistory() const
|
||||
{
|
||||
m_quantitiesNoMatchingHistory.clear();
|
||||
m_quantitiesWithMatchingHistory.clear();
|
||||
@ -355,28 +393,28 @@ void RiaSummaryCurveAnalyzer::computeQuantityNamesWithHistory() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAddress& address )
|
||||
void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAddress& address )
|
||||
{
|
||||
const std::string& wellName = address.wellName();
|
||||
|
||||
if ( !wellName.empty() )
|
||||
{
|
||||
m_wellNames.insert( wellName );
|
||||
m_wellNames.insert( { wellName, address } );
|
||||
}
|
||||
|
||||
if ( !address.quantityName().empty() )
|
||||
if ( !address.vectorName().empty() )
|
||||
{
|
||||
m_quantities.insert( address.quantityName() );
|
||||
m_quantities.insert( address.vectorName() );
|
||||
}
|
||||
|
||||
if ( !address.wellGroupName().empty() )
|
||||
if ( !address.groupName().empty() )
|
||||
{
|
||||
m_wellGroupNames.insert( address.wellGroupName() );
|
||||
m_groupNames.insert( { address.groupName(), address } );
|
||||
}
|
||||
|
||||
if ( address.regionNumber() != -1 )
|
||||
{
|
||||
m_regionNumbers.insert( address.regionNumber() );
|
||||
m_regionNumbers.insert( { address.regionNumber(), address } );
|
||||
}
|
||||
|
||||
if ( address.category() == RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION )
|
||||
@ -392,15 +430,114 @@ void RiaSummaryCurveAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAddre
|
||||
else if ( address.category() == RifEclipseSummaryAddress::SUMMARY_BLOCK )
|
||||
{
|
||||
auto text = address.blockAsString();
|
||||
m_blocks.insert( text );
|
||||
|
||||
m_blocks.insert( { text, address } );
|
||||
}
|
||||
else if ( address.category() == RifEclipseSummaryAddress::SUMMARY_AQUIFER )
|
||||
{
|
||||
m_aquifers.insert( address.aquiferNumber() );
|
||||
m_aquifers.insert( { address.aquiferNumber(), address } );
|
||||
}
|
||||
else if ( address.category() == RifEclipseSummaryAddress::SUMMARY_FIELD ||
|
||||
address.category() == RifEclipseSummaryAddress::SUMMARY_MISC )
|
||||
{
|
||||
m_otherCategory.push_back( address );
|
||||
}
|
||||
|
||||
if ( address.category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
||||
{
|
||||
m_categories.insert( address.category() );
|
||||
if ( m_categories.count( address.category() ) == 0 )
|
||||
{
|
||||
m_categories[address.category()] = { address.vectorName() };
|
||||
}
|
||||
else
|
||||
m_categories[address.category()].insert( address.vectorName() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::keysInMap( const std::multimap<std::string, RifEclipseSummaryAddress>& map )
|
||||
{
|
||||
std::set<std::string> keys;
|
||||
for ( const auto& [key, value] : map )
|
||||
{
|
||||
keys.insert( key );
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<int> RiaSummaryAddressAnalyzer::keysInMap( const std::multimap<int, RifEclipseSummaryAddress>& map )
|
||||
{
|
||||
std::set<int> keys;
|
||||
for ( const auto& [key, value] : map )
|
||||
{
|
||||
keys.insert( key );
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> RiaSummaryAddressAnalyzer::keysInMap(
|
||||
const std::map<RifEclipseSummaryAddress::SummaryVarCategory, std::set<std::string>>& map )
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> keys;
|
||||
for ( const auto& [key, value] : map )
|
||||
{
|
||||
keys.insert( key );
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::vector<RifEclipseSummaryAddress>>
|
||||
RiaSummaryAddressAnalyzer::valuesInMap( const std::multimap<std::string, RifEclipseSummaryAddress>& map )
|
||||
{
|
||||
std::vector<std::vector<RifEclipseSummaryAddress>> groupedAddresses;
|
||||
|
||||
auto uniqueKeys = keysInMap( map );
|
||||
for ( const auto& key : uniqueKeys )
|
||||
{
|
||||
auto range = map.equal_range( key );
|
||||
|
||||
std::vector<RifEclipseSummaryAddress> addresses;
|
||||
for ( auto i = range.first; i != range.second; ++i )
|
||||
{
|
||||
addresses.push_back( i->second );
|
||||
}
|
||||
groupedAddresses.push_back( addresses );
|
||||
}
|
||||
|
||||
return groupedAddresses;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::vector<RifEclipseSummaryAddress>>
|
||||
RiaSummaryAddressAnalyzer::valuesInMap( const std::multimap<int, RifEclipseSummaryAddress>& map )
|
||||
{
|
||||
std::vector<std::vector<RifEclipseSummaryAddress>> groupedAddresses;
|
||||
|
||||
auto uniqueKeys = keysInMap( map );
|
||||
for ( const auto& key : uniqueKeys )
|
||||
{
|
||||
auto range = map.equal_range( key );
|
||||
|
||||
std::vector<RifEclipseSummaryAddress> addresses;
|
||||
for ( auto i = range.first; i != range.second; ++i )
|
||||
{
|
||||
addresses.push_back( i->second );
|
||||
}
|
||||
groupedAddresses.push_back( addresses );
|
||||
}
|
||||
|
||||
return groupedAddresses;
|
||||
}
|
@ -32,10 +32,10 @@ class QString;
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiaSummaryCurveAnalyzer
|
||||
class RiaSummaryAddressAnalyzer
|
||||
{
|
||||
public:
|
||||
RiaSummaryCurveAnalyzer();
|
||||
RiaSummaryAddressAnalyzer();
|
||||
|
||||
void appendAddresses( const std::set<RifEclipseSummaryAddress>& allAddresses );
|
||||
void appendAddresses( const std::vector<RifEclipseSummaryAddress>& allAddresses );
|
||||
@ -49,7 +49,7 @@ public:
|
||||
std::string quantityNameForTitle() const;
|
||||
|
||||
std::set<std::string> wellNames() const;
|
||||
std::set<std::string> wellGroupNames() const;
|
||||
std::set<std::string> groupNames() const;
|
||||
std::set<int> regionNumbers() const;
|
||||
|
||||
std::set<std::string> wellCompletions( const std::string& wellName ) const;
|
||||
@ -58,6 +58,7 @@ public:
|
||||
std::set<int> aquifers() const;
|
||||
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> categories() const;
|
||||
std::vector<std::vector<RifEclipseSummaryAddress>> addressesGroupedByObject() const;
|
||||
|
||||
std::vector<QString> identifierTexts( RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||
const std::string& secondaryIdentifier ) const;
|
||||
@ -68,24 +69,38 @@ public:
|
||||
|
||||
static std::string correspondingHistorySummaryCurveName( const std::string& curveName );
|
||||
|
||||
std::set<std::string> vectorNamesForCategory( RifEclipseSummaryAddress::SummaryVarCategory category );
|
||||
|
||||
private:
|
||||
void assignCategoryToQuantities() const;
|
||||
void computeQuantityNamesWithHistory() const;
|
||||
|
||||
void analyzeSingleAddress( const RifEclipseSummaryAddress& address );
|
||||
|
||||
static std::set<std::string> keysInMap( const std::multimap<std::string, RifEclipseSummaryAddress>& map );
|
||||
static std::set<int> keysInMap( const std::multimap<int, RifEclipseSummaryAddress>& map );
|
||||
static std::set<RifEclipseSummaryAddress::SummaryVarCategory>
|
||||
keysInMap( const std::map<RifEclipseSummaryAddress::SummaryVarCategory, std::set<std::string>>& map );
|
||||
|
||||
static std::vector<std::vector<RifEclipseSummaryAddress>>
|
||||
valuesInMap( const std::multimap<std::string, RifEclipseSummaryAddress>& map );
|
||||
|
||||
static std::vector<std::vector<RifEclipseSummaryAddress>>
|
||||
valuesInMap( const std::multimap<int, RifEclipseSummaryAddress>& map );
|
||||
|
||||
private:
|
||||
std::set<std::string> m_quantities;
|
||||
mutable std::set<std::string> m_quantitiesWithMatchingHistory;
|
||||
mutable std::set<std::string> m_quantitiesNoMatchingHistory;
|
||||
|
||||
std::set<std::string> m_wellNames;
|
||||
std::set<std::string> m_wellGroupNames;
|
||||
std::set<int> m_regionNumbers;
|
||||
std::set<std::pair<std::string, std::string>> m_wellCompletions;
|
||||
std::set<std::pair<std::string, int>> m_wellSegmentNumbers;
|
||||
std::set<std::string> m_blocks;
|
||||
std::set<int> m_aquifers;
|
||||
std::vector<RifEclipseSummaryAddress> m_otherCategory;
|
||||
std::multimap<std::string, RifEclipseSummaryAddress> m_wellNames;
|
||||
std::multimap<std::string, RifEclipseSummaryAddress> m_groupNames;
|
||||
std::multimap<int, RifEclipseSummaryAddress> m_regionNumbers;
|
||||
std::set<std::pair<std::string, std::string>> m_wellCompletions;
|
||||
std::set<std::pair<std::string, int>> m_wellSegmentNumbers;
|
||||
std::multimap<std::string, RifEclipseSummaryAddress> m_blocks;
|
||||
std::multimap<int, RifEclipseSummaryAddress> m_aquifers;
|
||||
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> m_categories;
|
||||
std::map<RifEclipseSummaryAddress::SummaryVarCategory, std::set<std::string>> m_categories;
|
||||
};
|
271
ApplicationLibCode/Application/Tools/RiaSummaryStringTools.cpp
Normal file
@ -0,0 +1,271 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiaSummaryStringTools.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
|
||||
#include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryStringTools::splitAddressFiltersInGridAndSummary( RimSummaryCase* summaryCase,
|
||||
const QStringList& addressFilters,
|
||||
QStringList* summaryAddressFilters,
|
||||
QStringList* gridResultAddressFilters )
|
||||
{
|
||||
if ( summaryCase )
|
||||
{
|
||||
const std::set<RifEclipseSummaryAddress>& addrs = summaryCase->summaryReader()->allResultAddresses();
|
||||
|
||||
QRegularExpression gridAddressPattern( "^[A-Z]+:[0-9]+,[0-9]+,[0-9]+$" );
|
||||
|
||||
for ( int filterIdx = 0; filterIdx < addressFilters.size(); ++filterIdx )
|
||||
{
|
||||
const QString& address = addressFilters[filterIdx];
|
||||
if ( hasFilterAnyMatch( address, addrs ) )
|
||||
{
|
||||
summaryAddressFilters->push_back( address );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( gridAddressPattern.match( address ).hasMatch() )
|
||||
{
|
||||
gridResultAddressFilters->push_back( address );
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::warning( "No summary or restart vectors matched \"" + address + "\"" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<QStringList, QStringList> RiaSummaryStringTools::splitIntoAddressAndDataSourceFilters( const QString& filter )
|
||||
{
|
||||
auto words = RiaSummaryStringTools::splitIntoWords( filter );
|
||||
auto [summaryCases, ensembles] = RiaSummaryStringTools::allDataSourcesInProject();
|
||||
auto dataSourceNames = RiaSummaryStringTools::dataSourceNames( summaryCases, ensembles );
|
||||
|
||||
QStringList addressFilters;
|
||||
QStringList dataSourceFilters;
|
||||
|
||||
RiaSummaryStringTools::splitUsingDataSourceNames( words, dataSourceNames, addressFilters, dataSourceFilters );
|
||||
|
||||
// If no filter on data source is specified, use wildcard to match all
|
||||
if ( dataSourceFilters.empty() ) dataSourceFilters.push_back( "*" );
|
||||
|
||||
return { addressFilters, dataSourceFilters };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaSummaryStringTools::hasFilterAnyMatch( const QString& curveFilter,
|
||||
const std::set<RifEclipseSummaryAddress>& summaryAddresses )
|
||||
{
|
||||
for ( const auto& addr : summaryAddresses )
|
||||
{
|
||||
if ( addr.isUiTextMatchingFilterText( curveFilter ) ) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Sort filters into curve and data source filters
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryStringTools::splitUsingDataSourceNames( const QStringList& filters,
|
||||
const QStringList& dataSourceNames,
|
||||
QStringList& addressFilters,
|
||||
QStringList& dataSourceFilters )
|
||||
{
|
||||
for ( const auto& s : filters )
|
||||
{
|
||||
// Strip off realization filter from ensemble search string
|
||||
|
||||
QString pureDataSourceCandidate = s.left( s.indexOf( ':' ) );
|
||||
|
||||
bool foundDataSource = false;
|
||||
|
||||
QRegExp searcher( pureDataSourceCandidate, Qt::CaseInsensitive, QRegExp::WildcardUnix );
|
||||
|
||||
for ( const auto& ds : dataSourceNames )
|
||||
{
|
||||
if ( !foundDataSource && searcher.exactMatch( ds ) )
|
||||
{
|
||||
dataSourceFilters.push_back( s );
|
||||
foundDataSource = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !foundDataSource )
|
||||
{
|
||||
addressFilters.push_back( s );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryCaseCollection*>>
|
||||
RiaSummaryStringTools::allDataSourcesInProject()
|
||||
{
|
||||
auto sumCaseMainColl = RiaSummaryTools::summaryCaseMainCollection();
|
||||
if ( !sumCaseMainColl ) return { {}, {} };
|
||||
|
||||
auto summaryCases = sumCaseMainColl->topLevelSummaryCases();
|
||||
auto ensembles = sumCaseMainColl->summaryCaseCollections();
|
||||
|
||||
return { summaryCases, ensembles };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryCaseCollection*>>
|
||||
RiaSummaryStringTools::dataSourcesMatchingFilters( const QStringList& dataSourceFilters )
|
||||
{
|
||||
std::vector<RimSummaryCase*> matchingSummaryCases;
|
||||
std::vector<RimSummaryCaseCollection*> matchingEnsembles;
|
||||
|
||||
auto [allSummaryCases, allEnsembles] = allDataSourcesInProject();
|
||||
|
||||
for ( const auto& dsFilter : dataSourceFilters )
|
||||
{
|
||||
QString searchString = dsFilter.left( dsFilter.indexOf( ':' ) );
|
||||
QRegExp searcher( searchString, Qt::CaseInsensitive, QRegExp::WildcardUnix );
|
||||
|
||||
for ( const auto& ensemble : allEnsembles )
|
||||
{
|
||||
auto ensembleName = ensemble->name();
|
||||
if ( searcher.exactMatch( ensembleName ) )
|
||||
{
|
||||
if ( searchString == dsFilter )
|
||||
{
|
||||
// Match on ensemble name without realization filter
|
||||
|
||||
matchingEnsembles.push_back( ensemble );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Match on subset of realisations in ensemble
|
||||
|
||||
QString realizationSearchString = dsFilter.right( dsFilter.size() - dsFilter.indexOf( ':' ) - 1 );
|
||||
QRegExp realizationSearcher( realizationSearchString, Qt::CaseInsensitive, QRegExp::WildcardUnix );
|
||||
|
||||
for ( const auto& summaryCase : ensemble->allSummaryCases() )
|
||||
{
|
||||
auto realizationName = summaryCase->displayCaseName();
|
||||
if ( realizationSearcher.exactMatch( realizationName ) )
|
||||
{
|
||||
matchingSummaryCases.push_back( summaryCase );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( const auto& summaryCase : allSummaryCases )
|
||||
{
|
||||
auto summaryCaseName = summaryCase->displayCaseName();
|
||||
if ( searcher.exactMatch( summaryCaseName ) )
|
||||
{
|
||||
matchingSummaryCases.push_back( summaryCase );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { matchingSummaryCases, matchingEnsembles };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RiaSummaryStringTools::splitIntoWords( const QString& text )
|
||||
{
|
||||
return RiaTextStringTools::splitSkipEmptyParts( text, QRegExp( "\\s+" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RiaSummaryStringTools::dataSourceNames( const std::vector<RimSummaryCase*>& summaryCases,
|
||||
const std::vector<RimSummaryCaseCollection*>& ensembles )
|
||||
{
|
||||
QStringList names;
|
||||
for ( const auto& summaryCase : summaryCases )
|
||||
{
|
||||
names.push_back( summaryCase->displayCaseName() );
|
||||
}
|
||||
|
||||
for ( const auto& ensemble : ensembles )
|
||||
{
|
||||
names.push_back( ensemble->name() );
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RifEclipseSummaryAddress>
|
||||
RiaSummaryStringTools::computeFilteredAddresses( const QStringList& textFilters,
|
||||
const std::set<RifEclipseSummaryAddress>& sourceAddresses,
|
||||
bool includeDiffCurves )
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress> addresses;
|
||||
|
||||
std::vector<bool> usedFilters;
|
||||
RicSummaryPlotFeatureImpl::insertFilteredAddressesInSet( textFilters, sourceAddresses, &addresses, &usedFilters );
|
||||
|
||||
if ( includeDiffCurves ) return addresses;
|
||||
|
||||
const auto diffText = RifReaderEclipseSummary::differenceIdentifier();
|
||||
|
||||
std::set<RifEclipseSummaryAddress> addressesWithoutDiffVectors;
|
||||
for ( const auto& adr : addresses )
|
||||
{
|
||||
if ( RiaStdStringTools::endsWith( adr.vectorName(), diffText ) ) continue;
|
||||
|
||||
addressesWithoutDiffVectors.insert( adr );
|
||||
}
|
||||
|
||||
return addressesWithoutDiffVectors;
|
||||
}
|
66
ApplicationLibCode/Application/Tools/RiaSummaryStringTools.h
Normal file
@ -0,0 +1,66 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 <set>
|
||||
#include <vector>
|
||||
|
||||
class RimSummaryCase;
|
||||
class RifEclipseSummaryAddress;
|
||||
class RimSummaryCaseCollection;
|
||||
|
||||
class QString;
|
||||
class QStringList;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiaSummaryStringTools
|
||||
{
|
||||
public:
|
||||
static void splitAddressFiltersInGridAndSummary( RimSummaryCase* summaryCase,
|
||||
const QStringList& addressFilters,
|
||||
QStringList* summaryAddressFilters,
|
||||
QStringList* gridResultAddressFilters );
|
||||
|
||||
static std::pair<QStringList, QStringList> splitIntoAddressAndDataSourceFilters( const QString& filter );
|
||||
|
||||
static std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryCaseCollection*>> allDataSourcesInProject();
|
||||
static std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryCaseCollection*>>
|
||||
dataSourcesMatchingFilters( const QStringList& dataSourceFilters );
|
||||
|
||||
static QStringList splitIntoWords( const QString& text );
|
||||
|
||||
static QStringList dataSourceNames( const std::vector<RimSummaryCase*>& summaryCases,
|
||||
const std::vector<RimSummaryCaseCollection*>& ensembles );
|
||||
|
||||
static std::set<RifEclipseSummaryAddress>
|
||||
computeFilteredAddresses( const QStringList& textFilters,
|
||||
const std::set<RifEclipseSummaryAddress>& sourceAddresses,
|
||||
bool includeDiffCurves );
|
||||
|
||||
// Consider private, set public to be able to test
|
||||
static void splitUsingDataSourceNames( const QStringList& filters,
|
||||
const QStringList& dataSourceNames,
|
||||
QStringList& addressFilters,
|
||||
QStringList& dataSourceFilters );
|
||||
|
||||
private:
|
||||
static bool hasFilterAnyMatch( const QString& curveFilter, const std::set<RifEclipseSummaryAddress>& summaryAddresses );
|
||||
};
|
@ -30,12 +30,15 @@
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
#include "RimSummaryCalculationVariable.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
@ -44,11 +47,11 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlotCollection* RiaSummaryTools::summaryPlotCollection()
|
||||
RimSummaryMultiPlotCollection* RiaSummaryTools::summaryMultiPlotCollection()
|
||||
{
|
||||
RimProject* project = RimProject::current();
|
||||
|
||||
return project->mainPlotCollection()->summaryPlotCollection();
|
||||
return project->mainPlotCollection()->summaryMultiPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -77,18 +80,21 @@ RimSummaryCaseMainCollection* RiaSummaryTools::summaryCaseMainCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryTools::notifyCalculatedCurveNameHasChanged( int calculationId, const QString& currentCurveName )
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotColl = RiaSummaryTools::summaryPlotCollection();
|
||||
RimSummaryMultiPlotCollection* summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
|
||||
|
||||
for ( RimSummaryPlot* plot : summaryPlotColl->plots() )
|
||||
for ( RimSummaryMultiPlot* multiPlot : summaryPlotColl->multiPlots() )
|
||||
{
|
||||
for ( RimSummaryCurve* curve : plot->summaryCurves() )
|
||||
for ( RimSummaryPlot* plot : multiPlot->summaryPlots() )
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
if ( adr.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED && adr.id() == calculationId )
|
||||
for ( RimSummaryCurve* curve : plot->summaryCurves() )
|
||||
{
|
||||
RifEclipseSummaryAddress updatedAdr =
|
||||
RifEclipseSummaryAddress::calculatedAddress( currentCurveName.toStdString(), calculationId );
|
||||
curve->setSummaryAddressYAndApplyInterpolation( updatedAdr );
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
if ( adr.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED && adr.id() == calculationId )
|
||||
{
|
||||
RifEclipseSummaryAddress updatedAdr =
|
||||
RifEclipseSummaryAddress::calculatedAddress( currentCurveName.toStdString(), calculationId );
|
||||
curve->setSummaryAddressYAndApplyInterpolation( updatedAdr );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -117,9 +123,9 @@ RimSummaryPlot* RiaSummaryTools::parentSummaryPlot( caf::PdmObject* object )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlotCollection* RiaSummaryTools::parentSummaryPlotCollection( caf::PdmObject* object )
|
||||
RimSummaryMultiPlotCollection* RiaSummaryTools::parentSummaryPlotCollection( caf::PdmObject* object )
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotColl = nullptr;
|
||||
RimSummaryMultiPlotCollection* summaryPlotColl = nullptr;
|
||||
|
||||
if ( object )
|
||||
{
|
||||
@ -129,6 +135,21 @@ RimSummaryPlotCollection* RiaSummaryTools::parentSummaryPlotCollection( caf::Pdm
|
||||
return summaryPlotColl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryMultiPlot* RiaSummaryTools::parentSummaryMultiPlot( caf::PdmObject* object )
|
||||
{
|
||||
RimSummaryMultiPlot* multiPlot = nullptr;
|
||||
|
||||
if ( object )
|
||||
{
|
||||
object->firstAncestorOrThisOfType( multiPlot );
|
||||
}
|
||||
|
||||
return multiPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -205,13 +226,17 @@ void RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( int
|
||||
RimSummaryCalculationCollection* calculationColl = proj->calculationCollection();
|
||||
if ( !calculationColl ) return;
|
||||
|
||||
RimSummaryCalculation* calculation = calculationColl->findCalculationById( id );
|
||||
RimUserDefinedCalculation* calculation = calculationColl->findCalculationById( id );
|
||||
if ( !calculation ) return;
|
||||
|
||||
for ( RimSummaryCalculationVariable* v : calculation->allVariables() )
|
||||
for ( RimUserDefinedCalculationVariable* v : calculation->allVariables() )
|
||||
{
|
||||
cases.push_back( v->summaryCase() );
|
||||
addresses.push_back( v->summaryAddress()->address() );
|
||||
RimSummaryCalculationVariable* scv = dynamic_cast<RimSummaryCalculationVariable*>( v );
|
||||
if ( scv )
|
||||
{
|
||||
cases.push_back( scv->summaryCase() );
|
||||
addresses.push_back( scv->summaryAddress()->address() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,10 +244,10 @@ void RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( int
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<std::vector<time_t>, std::vector<double>>
|
||||
RiaSummaryTools::resampledValuesForPeriod( const RifEclipseSummaryAddress& address,
|
||||
const std::vector<time_t>& timeSteps,
|
||||
std::vector<double>& values,
|
||||
RiaQDateTimeTools::DateTimePeriod period )
|
||||
RiaSummaryTools::resampledValuesForPeriod( const RifEclipseSummaryAddress& address,
|
||||
const std::vector<time_t>& timeSteps,
|
||||
std::vector<double>& values,
|
||||
RiaDefines::DateTimePeriod period )
|
||||
{
|
||||
RiaTimeHistoryCurveResampler resampler;
|
||||
resampler.setCurveData( values, timeSteps );
|
||||
@ -238,3 +263,62 @@ std::pair<std::vector<time_t>, std::vector<double>>
|
||||
|
||||
return { resampler.resampledTimeSteps(), resampler.resampledValues() };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCase* RiaSummaryTools::summaryCaseById( int caseId )
|
||||
{
|
||||
auto summaryCases = RimProject::current()->allSummaryCases();
|
||||
|
||||
for ( auto summaryCase : summaryCases )
|
||||
{
|
||||
if ( summaryCase->caseId() == caseId )
|
||||
{
|
||||
return summaryCase;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCaseCollection* RiaSummaryTools::ensembleById( int ensembleId )
|
||||
{
|
||||
auto ensembles = RimProject::current()->summaryGroups();
|
||||
|
||||
for ( auto ensemble : ensembles )
|
||||
{
|
||||
if ( ensemble->ensembleId() == ensembleId )
|
||||
{
|
||||
return ensemble;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RiaSummaryTools::optionsForAllSummaryCases()
|
||||
{
|
||||
return optionsForSummaryCases( RimProject::current()->allSummaryCases() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RiaSummaryTools::optionsForSummaryCases( const std::vector<RimSummaryCase*>& cases )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
for ( RimSummaryCase* c : cases )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( c->displayCaseName(), c, false, c->uiIconProvider() ) );
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|