Merge pull request #11969 from OPM/dev
19
.github/workflows/AppFwkUnitTest.yml
vendored
@ -8,12 +8,10 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
qtver: [5.12.12, 6.5.3]
|
||||
qtver: [6.5.3]
|
||||
include:
|
||||
- qtver: 6.5.3
|
||||
build_flags: -DCEE_USE_QT6=ON -DCEE_USE_QT5=OFF
|
||||
- qtver: 5.12.12
|
||||
build_flags: -DCEE_USE_QT6=OFF -DCEE_USE_QT5=ON
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@ -57,20 +55,6 @@ jobs:
|
||||
cd cmakebuild
|
||||
cmake --install . --prefix ${{github.workspace}}/cmakebuild/install
|
||||
|
||||
- name: Run Unit Tests Qt5
|
||||
if: matrix.qtver == '5.12.12'
|
||||
shell: bash
|
||||
run: |
|
||||
cmakebuild/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/cafPdmCore_UnitTests
|
||||
cmakebuild/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests/cafPdmXml_UnitTests
|
||||
cmakebuild/cafProjectDataModel/cafProjectDataModel_UnitTests/cafProjectDataModel_UnitTests
|
||||
cmakebuild/cafPdmScripting/cafPdmScripting_UnitTests/cafPdmScripting_UnitTests
|
||||
|
||||
- name: Run Unit Tests Windows Qt5 (does not work on Linux)
|
||||
if: (contains( matrix.os, 'windows') && (matrix.qtver == '5.12.12'))
|
||||
shell: bash
|
||||
run: cmakebuild/cafUserInterface/cafUserInterface_UnitTests/cafUserInterface_UnitTests
|
||||
|
||||
- name: Run Unit Tests Qt6
|
||||
if: matrix.qtver == '6.5.3'
|
||||
shell: bash
|
||||
@ -84,4 +68,3 @@ jobs:
|
||||
if: (contains( matrix.os, 'windows') && (matrix.qtver == '6.5.3'))
|
||||
shell: bash
|
||||
run: cmakebuild/install/bin/cafUserInterface_UnitTests
|
||||
|
28
.github/workflows/ResInsightWithCache.yml
vendored
@ -37,11 +37,12 @@ jobs:
|
||||
publish-to-pypi: false,
|
||||
vcpkg-bootstrap: bootstrap-vcpkg.bat,
|
||||
vcpkg-triplet: x64-windows-release,
|
||||
qt-version: 5.12.12,
|
||||
qt-version: 6.6.3,
|
||||
ri-unit-test-path: "ResInsight-tests",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu 22.04 gcc",
|
||||
os: ubuntu-22.04,
|
||||
name: "Ubuntu 24.04 gcc",
|
||||
os: ubuntu-24.04,
|
||||
cc: "gcc",
|
||||
cxx: "g++",
|
||||
build-python-module: true,
|
||||
@ -51,7 +52,8 @@ jobs:
|
||||
publish-to-pypi: true,
|
||||
vcpkg-bootstrap: bootstrap-vcpkg.sh,
|
||||
vcpkg-triplet: x64-linux-release,
|
||||
qt-version: 5.12.12,
|
||||
qt-version: 6.7.0,
|
||||
ri-unit-test-path: "ResInsight-tests",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu 22.04 clang-16",
|
||||
@ -65,7 +67,8 @@ jobs:
|
||||
publish-to-pypi: false,
|
||||
vcpkg-bootstrap: bootstrap-vcpkg.sh,
|
||||
vcpkg-triplet: x64-linux-release,
|
||||
qt-version: 5.12.12,
|
||||
qt-version: 6.7.0,
|
||||
ri-unit-test-path: "ResInsight-tests",
|
||||
}
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -95,6 +98,8 @@ jobs:
|
||||
|
||||
- name: Use CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: "~3.28.0"
|
||||
|
||||
- name: Use MSVC (Windows)
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
@ -158,11 +163,6 @@ jobs:
|
||||
sudo apt-get update --option="APT::Acquire::Retries=3"
|
||||
sudo apt-get install --option="APT::Acquire::Retries=3" libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev libhdf5-dev
|
||||
|
||||
- name: Install gcc-10
|
||||
if: contains( matrix.config.cc, 'gcc')
|
||||
run: |
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
|
||||
|
||||
- name: Install clang-16
|
||||
if: contains( matrix.config.cc, 'clang')
|
||||
run: |
|
||||
@ -178,7 +178,7 @@ jobs:
|
||||
version: ${{ matrix.config.qt-version }}
|
||||
dir: "${{ github.workspace }}/Qt/"
|
||||
cache: true
|
||||
modules: "qtnetworkauth"
|
||||
modules: "qtnetworkauth qtcharts"
|
||||
|
||||
- name: Export GitHub Actions cache environment variables
|
||||
uses: actions/github-script@v7
|
||||
@ -226,7 +226,9 @@ jobs:
|
||||
if: matrix.config.execute-unit-tests
|
||||
shell: bash
|
||||
run: |
|
||||
cmakebuild/ApplicationLibCode/UnitTests/ResInsight-tests
|
||||
echo "Content of unit test folder "
|
||||
ls cmakebuild/${{ matrix.config.ri-unit-test-path }}
|
||||
cmakebuild/${{ matrix.config.ri-unit-test-path }}
|
||||
|
||||
- name: (Python) Check types using mypy
|
||||
if: matrix.config.build-python-module
|
||||
@ -239,7 +241,7 @@ jobs:
|
||||
- name: Run pytest
|
||||
if: matrix.config.execute-pytests
|
||||
env:
|
||||
RESINSIGHT_EXECUTABLE: ${{ runner.workspace }}/ResInsight/cmakebuild/ApplicationExeCode/ResInsight
|
||||
RESINSIGHT_EXECUTABLE: ${{ runner.workspace }}/ResInsight/cmakebuild/ResInsight
|
||||
run: |
|
||||
cd GrpcInterface/Python
|
||||
python setup.py sdist
|
||||
|
4
.gitignore
vendored
@ -25,7 +25,7 @@ CMakeCache.txt
|
||||
cmake_install.cmake
|
||||
CPack*.cmake
|
||||
CTest*.cmake
|
||||
cmakebuild/
|
||||
cmakebuild*/
|
||||
|
||||
#Unit test binaries
|
||||
*_UnitTests
|
||||
@ -64,7 +64,7 @@ out
|
||||
build
|
||||
CMakeSettings.json
|
||||
enc_temp_folder
|
||||
CMakePresets.json
|
||||
CMakeUserPresets.json
|
||||
|
||||
#Visual Studio Code files
|
||||
.vscode
|
||||
|
@ -1,4 +1,4 @@
|
||||
^ApplicationLibCode/ReservoirDataModel/RigWellLogLasFile.cpp:28:aswell
|
||||
^ApplicationLibCode/ReservoirDataModel/Well/RigWellLogLasFile.cpp:28:aswell
|
||||
^ApplicationLibCode/ReservoirDataModel/RigLasFileExporter.cpp:33:aswell
|
||||
^ApplicationExeCode/Resources/EastView.svg
|
||||
^ApplicationExeCode/Resources/NorthView.svg
|
||||
|
@ -19,41 +19,36 @@ endif()
|
||||
# Open GL
|
||||
find_package(OpenGL)
|
||||
|
||||
find_package(Qt5 ${RI_QT_MINIMUM_VERSION} COMPONENTS Core)
|
||||
|
||||
if(Qt5Core_FOUND)
|
||||
find_package(
|
||||
Qt5 ${RI_QT_MINIMUM_VERSION}
|
||||
COMPONENTS Core
|
||||
Gui
|
||||
OpenGL
|
||||
Network
|
||||
NetworkAuth
|
||||
Widgets
|
||||
Xml
|
||||
Concurrent
|
||||
PrintSupport
|
||||
Svg
|
||||
Sql
|
||||
OPTIONAL_COMPONENTS Charts
|
||||
)
|
||||
set(QT_LIBRARIES
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt5::NetworkAuth
|
||||
Qt5::OpenGL
|
||||
Qt5::Widgets
|
||||
Qt5::Xml
|
||||
Qt5::Concurrent
|
||||
Qt5::PrintSupport
|
||||
Qt5::Svg
|
||||
Qt5::Sql
|
||||
)
|
||||
if(Qt5Charts_FOUND)
|
||||
list(APPEND QT_LIBRARIES Qt5::Charts)
|
||||
endif(Qt5Charts_FOUND)
|
||||
endif(Qt5Core_FOUND)
|
||||
find_package(
|
||||
Qt6
|
||||
COMPONENTS Core
|
||||
Gui
|
||||
OpenGL
|
||||
Network
|
||||
NetworkAuth
|
||||
Widgets
|
||||
Xml
|
||||
Concurrent
|
||||
PrintSupport
|
||||
Svg
|
||||
Sql
|
||||
OPTIONAL_COMPONENTS Charts
|
||||
)
|
||||
set(QT_LIBRARIES
|
||||
Qt6::Core
|
||||
Qt6::Gui
|
||||
Qt6::OpenGL
|
||||
Qt6::Network
|
||||
Qt6::NetworkAuth
|
||||
Qt6::Widgets
|
||||
Qt6::Xml
|
||||
Qt6::Concurrent
|
||||
Qt6::PrintSupport
|
||||
Qt6::Svg
|
||||
Qt6::Sql
|
||||
)
|
||||
qt_standard_project_setup()
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
if(MSVC)
|
||||
# Avoid Qt warnings about macro redefinitions for math constants
|
||||
@ -126,10 +121,6 @@ list(APPEND CPP_SOURCES ${CODE_SOURCE_FILES})
|
||||
|
||||
set(QRC_FILES ${QRC_FILES} Resources/ResInsight.qrc)
|
||||
|
||||
# Runs RCC and MOC on specified files
|
||||
qt5_add_resources(QRC_FILES_CPP ${QRC_FILES})
|
||||
qt5_wrap_cpp(MOC_SOURCE_FILES ${QT_MOC_HEADERS})
|
||||
|
||||
# Adding resource (RC) files for Windows
|
||||
if(MSVC)
|
||||
set(WIN_RESOURCE Resources/ResInsight.rc)
|
||||
@ -157,7 +148,7 @@ set(EXE_FILES
|
||||
${CPP_SOURCES}
|
||||
${MOC_SOURCE_FILES}
|
||||
${FORM_FILES_CPP}
|
||||
${QRC_FILES_CPP}
|
||||
${QRC_FILES}
|
||||
${WIN_RESOURCE}
|
||||
${HEADER_FILES}
|
||||
${REFERENCED_CMAKE_FILES}
|
||||
@ -165,7 +156,7 @@ set(EXE_FILES
|
||||
.clang-tidy
|
||||
)
|
||||
|
||||
add_executable(ResInsight ${EXE_FILES})
|
||||
qt_add_executable(ResInsight ${EXE_FILES})
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set_target_properties(
|
||||
@ -206,13 +197,6 @@ if(MSVC)
|
||||
|
||||
set(BUILD_FLAGS_FOR_MSVC "/wd4190 /wd4100 /wd4127 /wd4245 /wd4005")
|
||||
|
||||
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
|
||||
# local function has been removed
|
||||
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4505")
|
||||
endif()
|
||||
|
||||
message(STATUS "BUILD_FLAGS_FOR_MSVC ${BUILD_FLAGS_FOR_MSVC}")
|
||||
set_target_properties(
|
||||
ResInsight PROPERTIES COMPILE_FLAGS ${BUILD_FLAGS_FOR_MSVC}
|
||||
@ -288,10 +272,10 @@ if(RESINSIGHT_USE_ODB_API)
|
||||
list(APPEND LINK_LIBRARIES RifOdbReader)
|
||||
endif()
|
||||
|
||||
target_link_libraries(ResInsight ${LINK_LIBRARIES})
|
||||
target_link_libraries(ResInsight PRIVATE ${LINK_LIBRARIES})
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
target_link_libraries(ResInsight xcb)
|
||||
target_link_libraries(ResInsight PRIVATE xcb)
|
||||
endif()
|
||||
|
||||
# ##############################################################################
|
||||
@ -332,7 +316,7 @@ foreach(riFileName ${RI_FILENAMES})
|
||||
-E
|
||||
copy_if_different
|
||||
${riFileName}
|
||||
$<TARGET_FILE_DIR:ResInsightDummyTarget>
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
)
|
||||
endforeach()
|
||||
add_custom_target(PreBuildFileCopy ${copyCommands})
|
||||
@ -378,123 +362,6 @@ endif(RESINSIGHT_ENABLE_GRPC)
|
||||
|
||||
# bundle libraries together with private installation
|
||||
if(RESINSIGHT_PRIVATE_INSTALL)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
set(RESINSIGHT_INSTALL_RPATH
|
||||
""
|
||||
CACHE STRING "RPATH to be injected into binary"
|
||||
)
|
||||
mark_as_advanced(FORCE RESINSIGHT_INSTALL_RPATH)
|
||||
|
||||
# Add ORIGIN to represent the directory where the binary is located
|
||||
set(RESINSIGHT_INSTALL_RPATH ${RESINSIGHT_INSTALL_RPATH} "\$ORIGIN")
|
||||
|
||||
if(${RESINSIGHT_USE_ODB_API})
|
||||
# This is a "hack" to make ResInsight runtime find the ODB so files used
|
||||
# when compiling. statoil wanted it this way, but we should probbly make a
|
||||
# different installoptions that does things this way, and really do copy
|
||||
# them when doing PRIVATE_INSTALL
|
||||
set(RESINSIGHT_INSTALL_RPATH ${RESINSIGHT_INSTALL_RPATH}
|
||||
${RESINSIGHT_ODB_API_DIR}/lib
|
||||
)
|
||||
endif()
|
||||
|
||||
if(EXISTS ${RESINSIGHT_ERT_EXTERNAL_LIB_ROOT})
|
||||
# append the external ERT lib root
|
||||
set(RESINSIGHT_INSTALL_RPATH ${RESINSIGHT_INSTALL_RPATH}
|
||||
${RESINSIGHT_ERT_EXTERNAL_LIB_ROOT}
|
||||
)
|
||||
endif()
|
||||
|
||||
# message("RESINSIGHT_INSTALL_RPATH : " "${RESINSIGHT_INSTALL_RPATH}")
|
||||
|
||||
set_target_properties(
|
||||
ResInsight PROPERTIES INSTALL_RPATH "${RESINSIGHT_INSTALL_RPATH}"
|
||||
)
|
||||
|
||||
# bundle Qt5 libraries
|
||||
option(RESINSIGHT_QT5_BUNDLE_LIBRARIES "Bundle Qt5 libraries" OFF)
|
||||
mark_as_advanced(FORCE RESINSIGHT_QT5_BUNDLE_LIBRARIES)
|
||||
if(RESINSIGHT_QT5_BUNDLE_LIBRARIES)
|
||||
message(STATUS "Bundling of Qt5 libraries is enabled")
|
||||
|
||||
# Get root directory
|
||||
get_property(
|
||||
_filepath
|
||||
TARGET "Qt5::Core"
|
||||
PROPERTY LOCATION_RELEASE
|
||||
)
|
||||
get_filename_component(_dir ${_filepath} PATH)
|
||||
|
||||
foreach(qtlib ${QT_LIBRARIES})
|
||||
get_target_property(FILE_NAME_FULL_PATH ${qtlib} LOCATION)
|
||||
message(STATUS "${qtlib} location on disk - ${FILE_NAME_FULL_PATH}")
|
||||
get_filename_component(FILE_NAME_WE ${FILE_NAME_FULL_PATH} NAME_WE)
|
||||
message(STATUS "${FILE_NAME_WE} name without ext - ${FILE_NAME_WE}")
|
||||
|
||||
list(APPEND QT_INSTALL_FILES_WITHOUT_EXTENSION ${FILE_NAME_WE})
|
||||
endforeach()
|
||||
|
||||
# XcbQpa is used by libXcb.so required by platform plugin xcb
|
||||
list(APPEND QT_INSTALL_FILES_WITHOUT_EXTENSION libQt5XcbQpa libQt5DBus)
|
||||
|
||||
# append icu
|
||||
list(APPEND QT_INSTALL_FILES_WITHOUT_EXTENSION libicu*)
|
||||
|
||||
foreach(installfile ${QT_INSTALL_FILES_WITHOUT_EXTENSION})
|
||||
file(GLOB FILE_AND_SYMLINKS ${_dir}/${installfile}.so*)
|
||||
install(
|
||||
FILES ${FILE_AND_SYMLINKS}
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
||||
OPTIONAL
|
||||
)
|
||||
endforeach()
|
||||
|
||||
set(QT_PLUGIN_PATH "$ENV{QT_PLUGIN_PATH}")
|
||||
if(QT_PLUGIN_PATH STREQUAL "")
|
||||
set(QT_PLUGIN_PATH "${_dir}/qt5/plugins/")
|
||||
endif()
|
||||
message(STATUS "QT_PLUGIN_PATH : ${QT_PLUGIN_PATH}")
|
||||
|
||||
# include platform files
|
||||
install(FILES ${QT_PLUGIN_PATH}/platforms/libqxcb.so
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/platforms/
|
||||
)
|
||||
install(FILES ${QT_PLUGIN_PATH}/imageformats/libqsvg.so
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/imageformats/
|
||||
)
|
||||
install(FILES ${QT_PLUGIN_PATH}/iconengines/libqsvgicon.so
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/iconengines/
|
||||
)
|
||||
# Required when using --platform offscreen
|
||||
install(FILES ${QT_PLUGIN_PATH}/platforms/libqoffscreen.so
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/platforms/
|
||||
)
|
||||
|
||||
# Required by xcb module used to create OpenGL widgets
|
||||
install(
|
||||
FILES ${QT_PLUGIN_PATH}/xcbglintegrations/libqxcb-egl-integration.so
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/plugins/xcbglintegrations/
|
||||
OPTIONAL
|
||||
)
|
||||
install(
|
||||
FILES ${QT_PLUGIN_PATH}/xcbglintegrations/libqxcb-glx-integration.so
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/plugins/xcbglintegrations/
|
||||
OPTIONAL
|
||||
)
|
||||
|
||||
# Required sql driver
|
||||
install(
|
||||
FILES ${QT_PLUGIN_PATH}/sqldrivers/libqsqlite.so
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/sqldrivers/
|
||||
OPTIONAL
|
||||
)
|
||||
|
||||
install(FILES qt.conf DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/)
|
||||
|
||||
endif(RESINSIGHT_QT5_BUNDLE_LIBRARIES)
|
||||
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
# put a .exe.local file in the target directory to pick up DLLs from there
|
||||
@ -504,79 +371,6 @@ if(RESINSIGHT_PRIVATE_INSTALL)
|
||||
|
||||
set(RESINSIGHT_FILES ${RI_FILENAMES})
|
||||
|
||||
if(WIN32
|
||||
AND TARGET Qt5::qmake
|
||||
AND NOT TARGET Qt5::windeployqt
|
||||
)
|
||||
get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION)
|
||||
|
||||
execute_process(
|
||||
COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX
|
||||
RESULT_VARIABLE return_code
|
||||
OUTPUT_VARIABLE qt5_install_prefix
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
set(imported_location "${qt5_install_prefix}/bin/windeployqt.exe")
|
||||
|
||||
message(STATUS "QMAKE: ${_qt5_qmake_location}")
|
||||
message(STATUS "QTPREFIX: ${qt5_install_prefix}")
|
||||
|
||||
if(EXISTS ${imported_location})
|
||||
add_executable(Qt5::windeployqt IMPORTED)
|
||||
|
||||
set_target_properties(
|
||||
Qt5::windeployqt PROPERTIES IMPORTED_LOCATION ${imported_location}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# TODO(wjwwood): find a way to make this optional or to run without
|
||||
# "deploying" the necessary dlls and stuff to the bin folder. see:
|
||||
# https://stackoverflow.com/questions/41193584/deploy-all-qt-dependencies-when-building#41199492
|
||||
if(TARGET Qt5::windeployqt)
|
||||
# execute windeployqt in a tmp directory after build
|
||||
add_custom_command(
|
||||
TARGET ResInsight
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/windeployqt"
|
||||
COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
|
||||
COMMAND
|
||||
Qt5::windeployqt --no-compiler-runtime --no-system-d3d-compiler
|
||||
--no-quick-import --no-translations --verbose 0 --dir
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/windeployqt"
|
||||
"$<TARGET_FILE_DIR:ResInsight>/$<TARGET_FILE_NAME:ResInsight>"
|
||||
)
|
||||
|
||||
# Qt DLLs
|
||||
message(STATUS "Creating post build step for copying Qt DLLs")
|
||||
|
||||
# copy all files in the windeployqt directory to the installation
|
||||
# directory
|
||||
add_custom_command(
|
||||
TARGET ResInsight
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/windeployqt/"
|
||||
$<TARGET_FILE_DIR:ResInsight>
|
||||
)
|
||||
|
||||
# copy deployment directory during installation
|
||||
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/windeployqt/"
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
||||
)
|
||||
|
||||
# install additional DLLS not able to be found by windeployqt
|
||||
set(qt5_offscreen_name "$<IF:$<CONFIG:Debug>,qoffscreend,qoffscreen>")
|
||||
install(
|
||||
FILES ${qt5_install_prefix}/plugins/platforms/${qt5_offscreen_name}.dll
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/platforms
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
# install GRPC-related DLLs and generated_classes.py
|
||||
if(RESINSIGHT_ENABLE_GRPC)
|
||||
set(ZLIB_DLL "$<IF:$<CONFIG:Debug>,zlibd1,zlib1>")
|
||||
@ -628,9 +422,41 @@ if(RESINSIGHT_PRIVATE_INSTALL)
|
||||
endif()
|
||||
|
||||
install(TARGETS ResInsight DESTINATION ${RESINSIGHT_INSTALL_FOLDER})
|
||||
|
||||
install(FILES ${RESINSIGHT_FILES} DESTINATION ${RESINSIGHT_INSTALL_FOLDER})
|
||||
|
||||
if(WIN32 AND WINDEPLOYQT_EXECUTABLE)
|
||||
# Add a post-build command to run windeployqt. This makes it possible to
|
||||
# debug the binary from a debugger without any manual steps. This also fixes
|
||||
# an issue related to the Install() command and usage of windeployqt as part
|
||||
# of installation. The installation tried to use windeployqt on the
|
||||
# executable in the build directory, which did not find the Qt libraries.
|
||||
#
|
||||
# TODO: This command copies all required dlls, so we should probably not use
|
||||
# the Install() command to copy external dlls dependencies.
|
||||
#
|
||||
# The statements " >NUL 2>NUL" are used to suppress text output from
|
||||
# windeployqt. ">NUL" suppresses standard output. "2>NUL" suppresses
|
||||
# standard error.
|
||||
#
|
||||
add_custom_command(
|
||||
TARGET ResInsight
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
${WINDEPLOYQT_EXECUTABLE} $<TARGET_FILE:ResInsight>
|
||||
"$<IF:$<CONFIG:Debug>,--debug,--release>" --no-translations >NUL 2>NUL
|
||||
COMMENT
|
||||
"Running windeployqt to deploy Qt dependencies to the build folder, required by install()"
|
||||
)
|
||||
|
||||
# Running windeployqt to deploy Qt dependencies to the install folder"
|
||||
install(
|
||||
TARGETS ResInsight
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
||||
RUNTIME_DEPENDENCIES PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-"
|
||||
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/resinsight
|
||||
@ -668,10 +494,40 @@ else(RESINSIGHT_PRIVATE_INSTALL)
|
||||
)
|
||||
endif(RESINSIGHT_PRIVATE_INSTALL)
|
||||
|
||||
# ##############################################################################
|
||||
# Optional install of OpensSSL 3 for required platforms like RHEL8
|
||||
# ##############################################################################
|
||||
|
||||
set(CUSTOM_OPENSSL_FILES libcrypto.so libcrypto.so.3 libssl.so libssl.so.3)
|
||||
foreach(file ${CUSTOM_OPENSSL_FILES})
|
||||
if(EXISTS
|
||||
"${CMAKE_BINARY_DIR}/vcpkg_installed_custom/x64-linux-dynamic/lib/${file}"
|
||||
)
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_BINARY_DIR}/vcpkg_installed_custom/x64-linux-dynamic/lib/${file}
|
||||
DESTINATION lib64
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# ##############################################################################
|
||||
# Installation packaging
|
||||
# ##############################################################################
|
||||
|
||||
if(Qt6Widgets_VERSION VERSION_LESS 6.5.0)
|
||||
message("Detected Qt version ${Qt6Widgets_VERSION}")
|
||||
message(
|
||||
"Install target is not complete as Qt 6.5 is required to use qt_generate_deploy_app_script()"
|
||||
)
|
||||
else()
|
||||
qt_generate_deploy_app_script(
|
||||
TARGET ResInsight OUTPUT_SCRIPT deploy_script NO_UNSUPPORTED_PLATFORM_ERROR
|
||||
NO_TRANSLATIONS
|
||||
)
|
||||
install(SCRIPT ${deploy_script})
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
|
15
ApplicationExeCode/Resources/NavigationProperty.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs>
|
||||
<style>.canvas{fill: none; opacity: 0;}.light-defaultgrey-10{fill: #212121; opacity: 0.1;}.light-defaultgrey{fill: #212121; opacity: 1;}.light-blue{fill: #005dba; opacity: 1;}</style>
|
||||
</defs>
|
||||
<title>IconLightNavigationProperty</title>
|
||||
<g id="canvas">
|
||||
<path class="canvas" d="M16,0V16H0V0Z" />
|
||||
</g>
|
||||
<g id="level-1">
|
||||
<path class="light-defaultgrey-10" d="M14.5,1.5v12H9.328L6.859,11.031c.01-.033.013-.067.021-.1q.03-.123.051-.249A3.819,3.819,0,0,0,7,10,3.988,3.988,0,0,0,3.5,6.05V1.5Z" />
|
||||
<path class="light-defaultgrey" d="M9,14.586v.707L8.293,16H7.586l-3.3-3.3A2.969,2.969,0,0,1,3,13a3,3,0,0,1-3-3A2.969,2.969,0,0,1,.3,8.714l1.993,1.993L3.707,9.293,1.714,7.3A2.969,2.969,0,0,1,3,7a3,3,0,0,1,3,3,2.969,2.969,0,0,1-.3,1.286Z" />
|
||||
<path class="light-defaultgrey" d="M15,1.5v12l-.5.5H9.828l-1-1H14V2H4V6.141A3.977,3.977,0,0,0,3,6V1.5L3.5,1h11Z" />
|
||||
<path class="light-blue" d="M7.146,7.854l-2-2V5.146l2-2,.708.708L6.707,5H12V6H6.707L7.854,7.146Zm3.708-.708-.708.708L11.293,9H6.859A3.977,3.977,0,0,1,7,10h4.293l-1.147,1.146.708.708,2-2V9.146Z" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
@ -290,6 +290,13 @@
|
||||
<file>cloud-and-server.svg</file>
|
||||
<file>Cloud.svg</file>
|
||||
<file>CloudBlobs.svg</file>
|
||||
<file>arrow-swap.svg</file>
|
||||
<file>inspect.svg</file>
|
||||
<file>pin.svg</file>
|
||||
<file>pinned.svg</file>
|
||||
<file>pinned-remove.svg</file>
|
||||
<file>Select.svg</file>
|
||||
<file>NavigationProperty.svg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/Shader">
|
||||
<file>fs_CellFace.glsl</file>
|
||||
|
13
ApplicationExeCode/Resources/Select.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs>
|
||||
<style>.canvas{fill: none; opacity: 0;}.light-blue{fill: #005dba; opacity: 1;}.light-defaultgrey{fill: rgb(128, 128, 128); opacity: 1;}</style>
|
||||
</defs>
|
||||
<title>IconLightSelect</title>
|
||||
<g id="canvas" class="canvas">
|
||||
<path class="canvas" d="M16,0V16H0V0Z" />
|
||||
</g>
|
||||
<g id="level-1">
|
||||
<path class="light-blue" d="M9.575,11.361l1.15,3.163-.783.285L8.769,11.585,7,13V5.5l5,6Z" />
|
||||
<path class="light-defaultgrey" d="M4.379,2.672,5.49,3.783a2,2,0,0,0-.707.707L3.672,3.379Zm.4,3.838L3.672,7.621l.707.707L5.49,7.217A2,2,0,0,1,4.783,6.51ZM4.5,5.5A1.966,1.966,0,0,1,4.571,5H3V6H4.571A1.966,1.966,0,0,1,4.5,5.5ZM6,3.571c.063-.016.127-.031.192-.042a1.65,1.65,0,0,1,.616,0c.065.011.129.026.192.042V2H6ZM8.429,5a1.8,1.8,0,0,1,0,1H10V5Zm.192-2.328L7.51,3.783a2,2,0,0,1,.707.707L9.328,3.379Z" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 885 B |
1
ApplicationExeCode/Resources/arrow-swap.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.207 15.061L1 11.854v-.707L4.207 7.94l.707.707-2.353 2.354H15v1H2.56l2.354 2.353-.707.707zm7.586-7L15 4.854v-.707L11.793.94l-.707.707L13.439 4H1v1h12.44l-2.354 2.354.707.707z"/></svg>
|
After Width: | Height: | Size: 337 B |
1
ApplicationExeCode/Resources/inspect.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1 3l1-1h12l1 1v6h-1V3H2v8h5v1H2l-1-1V3zm14.707 9.707L9 6v9.414l2.707-2.707h4zM10 13V8.414l3.293 3.293h-2L10 13z"/></svg>
|
After Width: | Height: | Size: 273 B |
1
ApplicationExeCode/Resources/pin.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M14 5v7h-.278c-.406 0-.778-.086-1.117-.258A2.528 2.528 0 0 1 11.73 11H8.87a3.463 3.463 0 0 1-.546.828 3.685 3.685 0 0 1-.735.633c-.27.177-.565.31-.882.398a3.875 3.875 0 0 1-.985.141h-.5V9H2l-1-.5L2 8h3.222V4h.5c.339 0 .664.047.977.14.312.094.607.227.883.4A3.404 3.404 0 0 1 8.87 6h2.859a2.56 2.56 0 0 1 .875-.734c.338-.172.71-.26 1.117-.266H14zm-.778 1.086a1.222 1.222 0 0 0-.32.156 1.491 1.491 0 0 0-.43.461L12.285 7H8.183l-.117-.336a2.457 2.457 0 0 0-.711-1.047C7.027 5.331 6.427 5.09 6 5v7c.427-.088 1.027-.33 1.355-.617.328-.287.565-.636.71-1.047L8.184 10h4.102l.18.297c.057.094.122.177.195.25.073.073.153.143.242.21.088.069.195.12.32.157V6.086z"/></svg>
|
After Width: | Height: | Size: 770 B |
91
ApplicationExeCode/Resources/pinned-remove.svg
Normal file
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 16 16"
|
||||
fill="rgb(128, 128, 128)"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
sodipodi:docname="pinned-remove.svg"
|
||||
inkscape:version="1.4 (86a8ad7, 2024-10-11)"
|
||||
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="defs1">
|
||||
<linearGradient
|
||||
id="swatch3"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#2a102a;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="swatch2"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop2" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#swatch2"
|
||||
id="linearGradient2"
|
||||
x1="2.9064984"
|
||||
y1="6.9509187"
|
||||
x2="12.051001"
|
||||
y2="6.9509187"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.4185245,0,0,1.2327502,-2.2663167,-1.014592)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#swatch3"
|
||||
id="linearGradient3"
|
||||
x1="2.9064984"
|
||||
y1="6.7658353"
|
||||
x2="11.763093"
|
||||
y2="6.7658353"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:zoom="36.47"
|
||||
inkscape:cx="6.8686592"
|
||||
inkscape:cy="11.502605"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1369"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg1" />
|
||||
<path
|
||||
d="M4 2h7v.278c0 .406-.086.778-.258 1.117-.172.339-.42.63-.742.875v2.86c.307.145.583.328.828.546.245.219.456.464.633.735.177.27.31.565.398.882.089.318.136.646.141.985v.5H8V14l-.5 1-.5-1v-3.222H3v-.5c0-.339.047-.664.14-.977.094-.312.227-.607.4-.883A3.404 3.404 0 0 1 5 7.13V4.27a2.561 2.561 0 0 1-.734-.875A2.505 2.505 0 0 1 4 2.278V2zm1.086.778c.042.125.094.232.156.32a1.494 1.494 0 0 0 .461.43L6 3.715v4.102l-.336.117c-.411.146-.76.383-1.047.711C4.331 8.973 4.09 9.573 4 10h7c-.088-.427-.33-1.027-.617-1.355a2.456 2.456 0 0 0-1.047-.71L9 7.816V3.715l.297-.18c.094-.057.177-.122.25-.195a2.28 2.28 0 0 0 .21-.242.968.968 0 0 0 .157-.32H5.086z"
|
||||
id="path1" />
|
||||
<path
|
||||
style="fill:rgb(128, 128, 128);fill-opacity:1;stroke:url(#linearGradient2);stroke-width:3.368;stroke-dasharray:none"
|
||||
d="M 1.8566228,1.6050444 14.828324,13.503263"
|
||||
id="path2" />
|
||||
<path
|
||||
style="fill:rgb(128, 128, 128);fill-opacity:1;stroke-width:1.8;stroke-dasharray:none"
|
||||
d="M 2.9064985,2.1250343 11.763093,11.406636"
|
||||
id="path3" />
|
||||
<path
|
||||
style="fill:rgb(128, 128, 128);fill-opacity:1;stroke-width:1.8;stroke-dasharray:none"
|
||||
d="M 0.67178503,4.1266795 2.9476282,7.2525363"
|
||||
id="path4" />
|
||||
<path
|
||||
style="fill:rgb(128, 128, 128);fill-opacity:1;stroke:#000000;stroke-width:0.926755;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 2.5651472,1.7153576 13.371336,12.802924"
|
||||
id="path5" />
|
||||
</svg>
|
After Width: | Height: | Size: 3.4 KiB |
1
ApplicationExeCode/Resources/pinned.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M4 2h7v.278c0 .406-.086.778-.258 1.117-.172.339-.42.63-.742.875v2.86c.307.145.583.328.828.546.245.219.456.464.633.735.177.27.31.565.398.882.089.318.136.646.141.985v.5H8V14l-.5 1-.5-1v-3.222H3v-.5c0-.339.047-.664.14-.977.094-.312.227-.607.4-.883A3.404 3.404 0 0 1 5 7.13V4.27a2.561 2.561 0 0 1-.734-.875A2.505 2.505 0 0 1 4 2.278V2zm1.086.778c.042.125.094.232.156.32a1.494 1.494 0 0 0 .461.43L6 3.715v4.102l-.336.117c-.411.146-.76.383-1.047.711C4.331 8.973 4.09 9.573 4 10h7c-.088-.427-.33-1.027-.617-1.355a2.456 2.456 0 0 0-1.047-.71L9 7.816V3.715l.297-.18c.094-.057.177-.122.25-.195a2.28 2.28 0 0 0 .21-.242.968.968 0 0 0 .157-.32H5.086z"/></svg>
|
After Width: | Height: | Size: 759 B |
@ -345,6 +345,16 @@ QMenu::item:selected {
|
||||
color: $textColor;
|
||||
}
|
||||
|
||||
QMenu::icon:checked {
|
||||
background-color: $primaryColor;
|
||||
border: 1px inset $backgroundColor1;
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
left: 1px;
|
||||
}
|
||||
|
||||
QLineEdit,
|
||||
QComboBox,
|
||||
QSpinBox,
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "RiaArgumentParser.h"
|
||||
#include "RiaMainTools.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaQuantityInfoTools.h"
|
||||
|
||||
#ifdef ENABLE_GRPC
|
||||
#include "RiaGrpcConsoleApplication.h"
|
||||
@ -85,6 +86,7 @@ int main( int argc, char* argv[] )
|
||||
|
||||
// Create feature manager before the application object is created
|
||||
RiaMainTools::initializeSingletons();
|
||||
RiaQuantityInfoTools::initializeSummaryKeywords();
|
||||
|
||||
// https://www.w3.org/wiki/CSS/Properties/color/keywords
|
||||
caf::UiAppearanceSettings::instance()->setAutoValueEditorColor( "moccasin" );
|
||||
|
@ -13,7 +13,6 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesOsdu.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesSumo.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPorosityModel.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveDefinition.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaCurveSetDefinition.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaRftPltCurveDefinition.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.h
|
||||
@ -34,12 +33,11 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotCollectionScheduler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaScheduler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSeismicDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaLasDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaOsduDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaCloudDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaQuickAccessScheduler.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -57,7 +55,6 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesOsdu.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesSumo.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPorosityModel.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveDefinition.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaCurveSetDefinition.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaRftPltCurveDefinition.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.cpp
|
||||
@ -77,13 +74,12 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaDateTimeDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotCollectionScheduler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaScheduler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSeismicDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaLasDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaOsduDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaCloudDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaQuickAccessScheduler.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
@ -0,0 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/keywords">
|
||||
<file>keyword-description/keywords_eclipse.json</file>
|
||||
<file>keyword-description/keywords_6x.json</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -28,7 +28,9 @@
|
||||
#include "RiaFontCache.h"
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPlotWindowRedrawScheduler.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesOsdu.h"
|
||||
#include "RiaPreferencesSumo.h"
|
||||
#include "RiaPreferencesSystem.h"
|
||||
#include "RiaProjectModifier.h"
|
||||
@ -45,10 +47,9 @@
|
||||
|
||||
#include "PlotTemplates/RimPlotTemplateFolderItem.h"
|
||||
#include "Polygons/RimPolygonCollection.h"
|
||||
|
||||
#include "QuickAccess/RimQuickAccessCollection.h"
|
||||
#include "Rim2dIntersectionViewCollection.h"
|
||||
#include "RimCellFilterCollection.h"
|
||||
#include "RimCommandObject.h"
|
||||
#include "RimCommandRouter.h"
|
||||
#include "RimCompletionTemplateCollection.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
@ -516,6 +517,12 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
|
||||
m_project->resolveReferencesRecursively();
|
||||
m_project->initAfterReadRecursively();
|
||||
|
||||
if ( RimProject::current()->isProjectFileVersionEqualOrOlderThan( "2024.09.2" ) )
|
||||
{
|
||||
// Traverse objects recursively and add quick access fields for old projects
|
||||
RimQuickAccessCollection::instance()->addQuickAccessFieldsRecursively( m_project.get() );
|
||||
}
|
||||
|
||||
// Migrate all RimGridCases to RimFileSummaryCase
|
||||
RimGridSummaryCase_obsolete::convertGridCasesToSummaryFileCases( m_project.get() );
|
||||
|
||||
@ -789,18 +796,6 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
|
||||
// Default behavior for scripts is to use current active view for data read/write
|
||||
onProjectOpened();
|
||||
|
||||
// Loop over command objects and execute them
|
||||
for ( size_t i = 0; i < m_project->commandObjects.size(); i++ )
|
||||
{
|
||||
m_commandQueue.push_back( m_project->commandObjects[i] );
|
||||
}
|
||||
|
||||
// Lock the command queue
|
||||
m_commandQueueLock.lock();
|
||||
|
||||
// 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()->sortedGridCalculations() )
|
||||
@ -809,6 +804,8 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
|
||||
gridCalculation->updateDependentObjects();
|
||||
}
|
||||
|
||||
RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdates();
|
||||
|
||||
RiaLogging::info( QString( "Completed open of project file : '%1'" ).arg( projectFileName ) );
|
||||
|
||||
return true;
|
||||
@ -883,7 +880,6 @@ void RiaApplication::closeProject()
|
||||
onProjectBeingClosed();
|
||||
|
||||
m_project->close();
|
||||
m_commandQueue.clear();
|
||||
|
||||
RiaWellNameComparer::clearCache();
|
||||
|
||||
@ -1383,81 +1379,6 @@ void RiaApplication::executeCommandFile( const QString& commandFile )
|
||||
RicfCommandFileExecutor::instance()->executeCommands( in );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::addCommandObject( RimCommandObject* commandObject )
|
||||
{
|
||||
m_commandQueue.push_back( commandObject );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::executeCommandObjects()
|
||||
{
|
||||
{
|
||||
auto currentCommandQueue = m_commandQueue;
|
||||
for ( auto command : currentCommandQueue )
|
||||
{
|
||||
if ( !command->isAsyncronous() )
|
||||
{
|
||||
command->redo();
|
||||
m_commandQueue.remove( command );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !m_commandQueue.empty() )
|
||||
{
|
||||
auto it = m_commandQueue.begin();
|
||||
if ( it->notNull() )
|
||||
{
|
||||
RimCommandObject* first = *it;
|
||||
first->redo();
|
||||
}
|
||||
m_commandQueue.pop_front();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unlock the command queue lock when the command queue is empty
|
||||
// Required to lock the mutex before unlocking to avoid undefined behavior
|
||||
m_commandQueueLock.tryLock();
|
||||
m_commandQueueLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::waitUntilCommandObjectsHasBeenProcessed()
|
||||
{
|
||||
auto start = std::chrono::system_clock::now();
|
||||
const double timeoutThreshold = 5.0;
|
||||
|
||||
// Wait until all command objects have completed
|
||||
bool mutexLockedSuccessfully = m_commandQueueLock.tryLock();
|
||||
|
||||
while ( !mutexLockedSuccessfully )
|
||||
{
|
||||
invokeProcessEvents();
|
||||
|
||||
mutexLockedSuccessfully = m_commandQueueLock.tryLock();
|
||||
|
||||
std::chrono::duration<double> elapsed_seconds = std::chrono::system_clock::now() - start;
|
||||
if ( timeoutThreshold < elapsed_seconds.count() )
|
||||
{
|
||||
// This can happen if the octave plugins fails to execute during regression testing.
|
||||
|
||||
RiaLogging::warning(
|
||||
QString( "Timeout waiting for command objects to complete, timeout set to %1 seconds." ).arg( timeoutThreshold ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_commandQueueLock.unlock();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1557,59 +1478,6 @@ cvf::Font* RiaApplication::defaultWellLabelFont()
|
||||
return m_defaultWellLabelFont.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
auto readCloudConfigFiles = []( RiaPreferences* preferences )
|
||||
{
|
||||
if ( preferences == nullptr ) return;
|
||||
|
||||
// Check multiple locations for configuration files. The first valid configuration file is used. Currently, using Qt5 the ResInsight
|
||||
// binary file is stored at the root of the installation folder. When moving to Qt6, we will probably use sub folders /bin /lib and
|
||||
// others. Support both one and two search levels to support Qt6.
|
||||
//
|
||||
// home_folder/.resinsight/*_config.json
|
||||
// location_of_resinsight_executable/../share/cloud_services/*_config.json
|
||||
// location_of_resinsight_executable/../../share/cloud_services/*_config.json
|
||||
//
|
||||
|
||||
{
|
||||
QStringList osduFilePathCandidates;
|
||||
osduFilePathCandidates << QDir::homePath() + "/.resinsight/osdu_config.json";
|
||||
osduFilePathCandidates << QCoreApplication::applicationDirPath() + "/../share/cloud_services/osdu_config.json";
|
||||
osduFilePathCandidates << QCoreApplication::applicationDirPath() + "/../../share/cloud_services/osdu_config.json";
|
||||
|
||||
for ( const auto& osduFileCandidate : osduFilePathCandidates )
|
||||
{
|
||||
auto keyValuePairs = RiaConnectorTools::readKeyValuePairs( osduFileCandidate );
|
||||
if ( !keyValuePairs.empty() )
|
||||
{
|
||||
preferences->osduPreferences()->setData( keyValuePairs );
|
||||
preferences->osduPreferences()->setFieldsReadOnly();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QStringList sumoFilePathCandidates;
|
||||
sumoFilePathCandidates << QDir::homePath() + "/.resinsight/sumo_config.json";
|
||||
sumoFilePathCandidates << QCoreApplication::applicationDirPath() + "/../share/cloud_services/sumo_config.json";
|
||||
sumoFilePathCandidates << QCoreApplication::applicationDirPath() + "/../../share/cloud_services/sumo_config.json";
|
||||
|
||||
for ( const auto& sumoFileCandidate : sumoFilePathCandidates )
|
||||
{
|
||||
auto keyValuePairs = RiaConnectorTools::readKeyValuePairs( sumoFileCandidate );
|
||||
if ( !keyValuePairs.empty() )
|
||||
{
|
||||
preferences->sumoPreferences()->setData( keyValuePairs );
|
||||
preferences->sumoPreferences()->setFieldsReadOnly();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1628,8 +1496,6 @@ void RiaApplication::initialize()
|
||||
caf::SelectionManager::instance()->setPdmRootObject( project() );
|
||||
|
||||
initializeDataLoadController();
|
||||
|
||||
readCloudConfigFiles( m_preferences.get() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -49,7 +49,6 @@ class RiaSocketServer;
|
||||
|
||||
class RigEclipseCaseData;
|
||||
|
||||
class RimCommandObject;
|
||||
class RimCommandRouter;
|
||||
class RimEclipseCase;
|
||||
class RimEclipseView;
|
||||
@ -180,9 +179,6 @@ public:
|
||||
QVariant cacheDataObject( const QString& key ) const;
|
||||
|
||||
void executeCommandFile( const QString& commandFile );
|
||||
void addCommandObject( RimCommandObject* commandObject );
|
||||
void executeCommandObjects();
|
||||
void waitUntilCommandObjectsHasBeenProcessed();
|
||||
|
||||
const QString startDir() const;
|
||||
void setStartDir( const QString& startDir );
|
||||
@ -253,9 +249,6 @@ protected:
|
||||
QString m_commandLineHelpText;
|
||||
QMap<QString, QVariant> m_sessionCache; // Session cache used to store username/passwords per session
|
||||
|
||||
std::list<caf::PdmPointer<RimCommandObject>> m_commandQueue;
|
||||
QMutex m_commandQueueLock;
|
||||
|
||||
bool m_runningWorkerProcess;
|
||||
|
||||
private:
|
||||
|
@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RiaConsoleApplication.h"
|
||||
|
||||
#include "Cloud/RiaConnectorTools.h"
|
||||
#include "RiaArgumentParser.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
@ -109,6 +110,8 @@ void RiaConsoleApplication::initialize()
|
||||
RiaLogging::appendLoggerInstance( std::move( logger ) );
|
||||
|
||||
m_socketServer = new RiaSocketServer( this );
|
||||
|
||||
RiaConnectorTools::readCloudConfigFiles( m_preferences.get() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -18,7 +18,9 @@
|
||||
|
||||
#include "RiaEclipseFileNameTools.h"
|
||||
|
||||
#include "QFileInfo"
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
|
@ -18,8 +18,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
|
@ -23,8 +23,6 @@
|
||||
#include "cafAssert.h"
|
||||
#include "cafFixedAtlasFont.h"
|
||||
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -72,8 +70,9 @@ cvf::ref<caf::FixedAtlasFont> RiaFontCache::getFont( int pointSize )
|
||||
int currentDPI = 96;
|
||||
if ( RiaGuiApplication::isRunning() )
|
||||
{
|
||||
currentDPI = RiaGuiApplication::desktop()->logicalDpiX();
|
||||
currentDPI = RiaGuiApplication::applicationResolution();
|
||||
}
|
||||
|
||||
// the Fixed Atlas Fonts appear to be assuming a DPI of 96, so we need scaling.
|
||||
double scaling = currentDPI / 96.0;
|
||||
int scaledSize = scaling * pointSize;
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
|
||||
#include "Cloud/RiaConnectorTools.h"
|
||||
#include "RiaArgumentParser.h"
|
||||
#include "RiaBaseDefs.h"
|
||||
#include "RiaDefines.h"
|
||||
@ -35,9 +36,9 @@
|
||||
#include "RiaProjectModifier.h"
|
||||
#include "RiaRegressionTestRunner.h"
|
||||
#include "RiaSocketServer.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RiaVersionInfo.h"
|
||||
#include "RiaViewRedrawScheduler.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "ExportCommands/RicSnapshotAllPlotsToFileFeature.h"
|
||||
#include "ExportCommands/RicSnapshotAllViewsToFileFeature.h"
|
||||
@ -50,7 +51,6 @@
|
||||
#include "RimAnnotationCollection.h"
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
#include "RimAnnotationTextAppearance.h"
|
||||
#include "RimCommandObject.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFlowPlotCollection.h"
|
||||
@ -125,7 +125,6 @@
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDesktopWidget>
|
||||
#include <QDir>
|
||||
#include <QErrorMessage>
|
||||
#include <QGridLayout>
|
||||
@ -447,6 +446,8 @@ void RiaGuiApplication::initialize()
|
||||
}
|
||||
}
|
||||
m_socketServer = new RiaSocketServer( this );
|
||||
|
||||
RiaConnectorTools::readCloudConfigFiles( m_preferences.get() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -959,6 +960,9 @@ void RiaGuiApplication::createMainWindow()
|
||||
messagePanelLogger->addMessagePanel( m_mainWindow->messagePanel() );
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize OpenGL here to avoid flickering when creating the first 3D view
|
||||
QOpenGLWidget openGLWidget( m_mainWindow );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1142,8 +1146,8 @@ void RiaGuiApplication::showFormattedTextInMessageBoxOrConsole( const QString& t
|
||||
// Resize dialog to fit text etc.
|
||||
textEdit->document()->adjustSize();
|
||||
QSizeF docSize = textEdit->document()->size();
|
||||
dlg.resize( 20 + docSize.width() + 2 * layout->margin(),
|
||||
20 + docSize.height() + 2 * layout->margin() + layout->spacing() + okButton->sizeHint().height() );
|
||||
dlg.resize( 20 + docSize.width() + 2 * layout->contentsMargins().left(),
|
||||
20 + docSize.height() + 2 * layout->contentsMargins().left() + layout->spacing() + okButton->sizeHint().height() );
|
||||
|
||||
dlg.exec();
|
||||
}
|
||||
@ -1529,7 +1533,13 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiaGuiApplication::applicationResolution()
|
||||
{
|
||||
return QApplication::desktop()->logicalDpiX();
|
||||
if ( auto screen = QGuiApplication::primaryScreen() )
|
||||
{
|
||||
return screen->logicalDotsPerInchX();
|
||||
}
|
||||
|
||||
const int defaultDPI = 96;
|
||||
return defaultDPI;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1569,9 +1579,6 @@ void RiaGuiApplication::slotWorkerProcessFinished( int exitCode, QProcess::ExitS
|
||||
}
|
||||
m_workerProcess = nullptr;
|
||||
|
||||
// Always make sure the command objects are executed before any return statement
|
||||
executeCommandObjects();
|
||||
|
||||
// Either the work process crashed or was aborted by the user
|
||||
if ( exitStatus == QProcess::CrashExit )
|
||||
{
|
||||
|
@ -43,7 +43,6 @@ class RiaSocketServer;
|
||||
|
||||
class RigEclipseCaseData;
|
||||
|
||||
class RimCommandObject;
|
||||
class RimEclipseCase;
|
||||
class RimEclipseView;
|
||||
class RimGridView;
|
||||
|
@ -15,19 +15,13 @@
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaPlotWindowRedrawScheduler.h"
|
||||
|
||||
#include "RiuMultiPlotBook.h"
|
||||
#include "RiuMultiPlotPage.h"
|
||||
#include "RiuPlotWidget.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
|
||||
#include <set>
|
||||
|
||||
#include "cafProgressState.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -87,13 +81,6 @@ void RiaPlotWindowRedrawScheduler::schedulePlotWidgetReplot( RiuPlotWidget* plot
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotWindowRedrawScheduler::clearAllScheduledUpdates()
|
||||
{
|
||||
if ( m_plotWindowUpdateTimer )
|
||||
{
|
||||
while ( m_plotWindowUpdateTimer->isActive() )
|
||||
{
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
}
|
||||
m_plotWidgetsToReplot.clear();
|
||||
m_plotPagesToUpdate.clear();
|
||||
m_plotBooksToUpdate.clear();
|
||||
@ -102,7 +89,7 @@ void RiaPlotWindowRedrawScheduler::clearAllScheduledUpdates()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotWindowRedrawScheduler::performScheduledUpdatesAndReplots()
|
||||
void RiaPlotWindowRedrawScheduler::performScheduledUpdates()
|
||||
{
|
||||
std::map<QPointer<RiuMultiPlotBook>, RiaDefines::MultiPlotPageUpdateType> plotBooksToUpdate;
|
||||
std::map<QPointer<RiuMultiPlotPage>, RiaDefines::MultiPlotPageUpdateType> pagesToUpdate;
|
||||
@ -145,57 +132,3 @@ void RiaPlotWindowRedrawScheduler::performScheduledUpdatesAndReplots()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotWindowRedrawScheduler::blockScheduledUpdatesAndReplots()
|
||||
{
|
||||
m_blockScheduledUpdatesAndReplots = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotWindowRedrawScheduler::unblockScheduledUpdatesAndReplots()
|
||||
{
|
||||
m_blockScheduledUpdatesAndReplots = false;
|
||||
startTimer( 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotWindowRedrawScheduler::slotUpdateAndReplotScheduledItemsWhenReady()
|
||||
{
|
||||
if ( m_blockScheduledUpdatesAndReplots )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( caf::ProgressState::isActive() )
|
||||
{
|
||||
startTimer( 100 );
|
||||
return;
|
||||
}
|
||||
|
||||
performScheduledUpdatesAndReplots();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPlotWindowRedrawScheduler::startTimer( int msecs )
|
||||
{
|
||||
if ( !m_plotWindowUpdateTimer )
|
||||
{
|
||||
m_plotWindowUpdateTimer.reset( new QTimer( this ) );
|
||||
connect( m_plotWindowUpdateTimer.data(), SIGNAL( timeout() ), this, SLOT( slotUpdateAndReplotScheduledItemsWhenReady() ) );
|
||||
}
|
||||
|
||||
if ( !m_plotWindowUpdateTimer->isActive() )
|
||||
{
|
||||
m_plotWindowUpdateTimer->setSingleShot( true );
|
||||
m_plotWindowUpdateTimer->start( msecs );
|
||||
}
|
||||
}
|
||||
|
@ -17,23 +17,19 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaScheduler.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
#include <QScopedPointer>
|
||||
#include <QTimer>
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
class RiuMultiPlotPage;
|
||||
class RiuMultiPlotBook;
|
||||
class RiuPlotWidget;
|
||||
|
||||
class RiaPlotWindowRedrawScheduler : public QObject
|
||||
class RiaPlotWindowRedrawScheduler : public RiaScheduler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -46,26 +42,12 @@ public:
|
||||
RiaDefines::MultiPlotPageUpdateType updateType = RiaDefines::MultiPlotPageUpdateType::ALL );
|
||||
void schedulePlotWidgetReplot( RiuPlotWidget* plotWidget );
|
||||
void clearAllScheduledUpdates();
|
||||
void performScheduledUpdatesAndReplots();
|
||||
|
||||
void blockScheduledUpdatesAndReplots();
|
||||
void unblockScheduledUpdatesAndReplots();
|
||||
|
||||
private slots:
|
||||
void slotUpdateAndReplotScheduledItemsWhenReady();
|
||||
|
||||
private:
|
||||
RiaPlotWindowRedrawScheduler() = default;
|
||||
~RiaPlotWindowRedrawScheduler() override = default;
|
||||
|
||||
void startTimer( int msecs );
|
||||
void performScheduledUpdates() override;
|
||||
|
||||
private:
|
||||
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;
|
||||
bool m_blockScheduledUpdatesAndReplots = false;
|
||||
};
|
||||
|
@ -26,12 +26,16 @@
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesGeoMech.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
#include "RiaPreferencesOsdu.h"
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "RiaPreferencesSumo.h"
|
||||
#include "RiaPreferencesSystem.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaValidRegExpValidator.h"
|
||||
|
||||
#include "OsduCommands//RicDeleteOsduTokenFeature.h"
|
||||
#include "Sumo/RicDeleteSumoTokenFeature.h"
|
||||
|
||||
#include "RiuGuiTheme.h"
|
||||
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
@ -42,12 +46,12 @@
|
||||
#include "cafPdmUiFieldHandle.h"
|
||||
#include "cafPdmUiFilePathEditor.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDate>
|
||||
#include <QDir>
|
||||
#include <QLocale>
|
||||
#include <QRegExp>
|
||||
#include <QStandardPaths>
|
||||
#include <QValidator>
|
||||
|
||||
@ -271,9 +275,15 @@ RiaPreferences::RiaPreferences()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_osduPreferences, "osduPreferences", "osduPreferences" );
|
||||
m_osduPreferences = new RiaPreferencesOsdu;
|
||||
CAF_PDM_InitField( &m_deleteOsduToken, "deleteOsduToken", false, "" );
|
||||
caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_deleteOsduToken );
|
||||
m_deleteOsduToken.xmlCapability()->disableIO();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_sumoPreferences, "sumoPreferences", "sumoPreferences" );
|
||||
m_sumoPreferences = new RiaPreferencesSumo;
|
||||
CAF_PDM_InitField( &m_deleteSumoToken, "deleteSumoToken", false, "" );
|
||||
caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_deleteSumoToken );
|
||||
m_deleteSumoToken.xmlCapability()->disableIO();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -339,6 +349,14 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field, QS
|
||||
myAttr->validator = new QDoubleValidator( 0.000001, 100000.0, 6 );
|
||||
}
|
||||
}
|
||||
else if ( ( field == &m_deleteOsduToken ) || ( field == &m_deleteSumoToken ) )
|
||||
{
|
||||
auto* pbAttribute = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute );
|
||||
if ( pbAttribute )
|
||||
{
|
||||
pbAttribute->m_buttonText = "Delete Token";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -477,10 +495,12 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
caf::PdmUiGroup* osduGroup = uiOrdering.addNewGroup( "OSDU" );
|
||||
osduGroup->setCollapsedByDefault();
|
||||
m_osduPreferences()->uiOrdering( uiConfigName, *osduGroup );
|
||||
osduGroup->add( &m_deleteOsduToken );
|
||||
|
||||
caf::PdmUiGroup* sumoGroup = uiOrdering.addNewGroup( "SUMO" );
|
||||
sumoGroup->setCollapsedByDefault();
|
||||
m_sumoPreferences()->uiOrdering( uiConfigName, *sumoGroup );
|
||||
sumoGroup->add( &m_deleteSumoToken );
|
||||
}
|
||||
else if ( RiaApplication::enableDevelopmentFeatures() && uiConfigName == RiaPreferences::tabNameSystem() )
|
||||
{
|
||||
@ -548,6 +568,16 @@ void RiaPreferences::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
{
|
||||
RiuGuiTheme::updateGuiTheme( m_guiTheme() );
|
||||
}
|
||||
else if ( changedField == &m_deleteOsduToken )
|
||||
{
|
||||
RicDeleteOsduTokenFeature::deleteUserToken();
|
||||
m_deleteOsduToken = false;
|
||||
}
|
||||
else if ( changedField == &m_deleteSumoToken )
|
||||
{
|
||||
RicDeleteSumoTokenFeature::deleteUserToken();
|
||||
m_deleteSumoToken = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_summaryPreferences->fieldChangedByUi( changedField, oldValue, newValue );
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "RiaDateTimeDefines.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaFontCache.h"
|
||||
#include "RiaPreferencesOsdu.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildField.h"
|
||||
@ -237,7 +236,11 @@ private:
|
||||
|
||||
// Osdu settings
|
||||
caf::PdmChildField<RiaPreferencesOsdu*> m_osduPreferences;
|
||||
caf::PdmField<bool> m_deleteOsduToken;
|
||||
|
||||
// sumo settings
|
||||
caf::PdmChildField<RiaPreferencesSumo*> m_sumoPreferences;
|
||||
caf::PdmField<bool> m_deleteSumoToken;
|
||||
|
||||
// 3d view
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::MeshModeType>> m_defaultMeshModeType;
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
|
@ -89,7 +89,7 @@ RiaPreferencesGrid::RiaPreferencesGrid()
|
||||
CAF_PDM_InitField( &m_loadAndShowSoil, "loadAndShowSoil", true, "Load and Show SOIL" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_loadAndShowSoil );
|
||||
|
||||
CAF_PDM_InitField( &m_onlyLoadActiveCells, "onlyLoadActiveCells", false, "Only Load Active Cell Geometry (Experimental)" );
|
||||
CAF_PDM_InitField( &m_onlyLoadActiveCells, "onlyLoadActiveCells", false, "Only Load Active Cell Geometry" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_onlyLoadActiveCells );
|
||||
|
||||
CAF_PDM_InitField( &m_invalidateLongThinCells, "invalidateLongThinCells", false, "Skip Long, Thin Cells" );
|
||||
@ -128,18 +128,20 @@ void RiaPreferencesGrid::appendItems( caf::PdmUiOrdering& uiOrdering )
|
||||
wellGrp->add( &m_skipWellData );
|
||||
wellGrp->add( &m_importAdvancedMswData );
|
||||
|
||||
auto egridGrp = uiOrdering.addNewGroup( "EGRID Settings" );
|
||||
|
||||
if ( m_gridModelReaderOverride == RiaDefines::GridModelReader::NOT_SET )
|
||||
{
|
||||
auto egridGrp = uiOrdering.addNewGroup( "EGRID Settings" );
|
||||
egridGrp->add( &m_gridModelReader );
|
||||
}
|
||||
|
||||
auto resdataGrp = uiOrdering.addNewGroup( "ResData Reader Settings" );
|
||||
resdataGrp->add( &m_useResultIndexFile );
|
||||
|
||||
// TODO: Disabled for the 2024.09 release, enable after release
|
||||
// auto opmcGrp = uiOrdering.addNewGroup( "OPM Common Reader Settings" );
|
||||
// opmcGrp->add( &m_onlyLoadActiveCells );
|
||||
if ( gridModelReader() == RiaDefines::GridModelReader::OPM_COMMON )
|
||||
{
|
||||
egridGrp->add( &m_onlyLoadActiveCells );
|
||||
}
|
||||
if ( gridModelReader() == RiaDefines::GridModelReader::RESDATA )
|
||||
{
|
||||
egridGrp->add( &m_useResultIndexFile );
|
||||
}
|
||||
|
||||
const bool setFaultImportSettingsReadOnly = !importFaults();
|
||||
|
||||
@ -264,8 +266,7 @@ bool RiaPreferencesGrid::autoComputeDepthRelatedProperties() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesGrid::onlyLoadActiveCells() const
|
||||
{
|
||||
return false;
|
||||
// return m_onlyLoadActiveCells;
|
||||
return m_onlyLoadActiveCells;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
58
ApplicationLibCode/Application/RiaQuickAccessScheduler.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- 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 "RiaQuickAccessScheduler.h"
|
||||
|
||||
#include "QuickAccess/RimQuickAccessCollection.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaQuickAccessScheduler::RiaQuickAccessScheduler()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaQuickAccessScheduler* RiaQuickAccessScheduler::instance()
|
||||
{
|
||||
static RiaQuickAccessScheduler theInstance;
|
||||
|
||||
return &theInstance;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaQuickAccessScheduler::scheduleDisplayModelUpdateAndRedraw()
|
||||
{
|
||||
startTimer( 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaQuickAccessScheduler::performScheduledUpdates()
|
||||
{
|
||||
auto quickColl = RimQuickAccessCollection::instance();
|
||||
if ( quickColl )
|
||||
{
|
||||
quickColl->updateAllRequiredEditors();
|
||||
}
|
||||
}
|
33
ApplicationLibCode/Application/RiaQuickAccessScheduler.h
Normal file
@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- 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 RiaQuickAccessScheduler : public RiaScheduler
|
||||
{
|
||||
public:
|
||||
RiaQuickAccessScheduler();
|
||||
|
||||
static RiaQuickAccessScheduler* instance();
|
||||
|
||||
void scheduleDisplayModelUpdateAndRedraw();
|
||||
|
||||
void performScheduledUpdates() override;
|
||||
};
|
@ -325,6 +325,30 @@ QString RiaResultNames::riOilVolumeResultName()
|
||||
return "riOILVOLUME";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaResultNames::riPorvSoil()
|
||||
{
|
||||
return "riPORV*SOIL";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaResultNames::riPorvSgas()
|
||||
{
|
||||
return "riPORV*SGAS";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaResultNames::riPorvSoilSgas()
|
||||
{
|
||||
return "riPORV*(SOIL+SGAS)";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -67,6 +67,9 @@ QString combinedRiAreaNormTranResultName();
|
||||
QString riCellVolumeResultName();
|
||||
QString riOilVolumeResultName();
|
||||
QString mobilePoreVolumeName();
|
||||
QString riPorvSoil();
|
||||
QString riPorvSgas();
|
||||
QString riPorvSoilSgas();
|
||||
|
||||
QString faultReactAssessmentPrefix();
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaScheduler::RiaScheduler()
|
||||
: m_blockUpdate( false )
|
||||
{
|
||||
}
|
||||
|
||||
@ -36,6 +37,18 @@ RiaScheduler::~RiaScheduler()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaScheduler::blockUpdate( bool blockUpdate )
|
||||
{
|
||||
m_blockUpdate = blockUpdate;
|
||||
if ( !m_blockUpdate )
|
||||
{
|
||||
startTimer( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -47,7 +60,7 @@ void RiaScheduler::slotUpdateScheduledItemsWhenReady()
|
||||
return;
|
||||
}
|
||||
|
||||
performScheduledUpdates();
|
||||
if ( !m_blockUpdate ) performScheduledUpdates();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -67,17 +80,3 @@ void RiaScheduler::startTimer( int msecs )
|
||||
m_updateTimer->start( msecs );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaScheduler::waitUntilWorkIsDone()
|
||||
{
|
||||
if ( m_updateTimer )
|
||||
{
|
||||
while ( m_updateTimer->isActive() )
|
||||
{
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,13 +35,15 @@ public:
|
||||
|
||||
virtual void performScheduledUpdates() = 0;
|
||||
|
||||
void blockUpdate( bool blockUpdate );
|
||||
|
||||
protected:
|
||||
void startTimer( int msecs );
|
||||
void waitUntilWorkIsDone();
|
||||
|
||||
private slots:
|
||||
void slotUpdateScheduledItemsWhenReady();
|
||||
|
||||
private:
|
||||
QScopedPointer<QTimer> m_updateTimer;
|
||||
bool m_blockUpdate;
|
||||
};
|
||||
|
@ -62,8 +62,6 @@ void RiaViewRedrawScheduler::scheduleDisplayModelUpdateAndRedraw( Rim3dView* res
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaViewRedrawScheduler::clearViewsScheduledForUpdate()
|
||||
{
|
||||
waitUntilWorkIsDone();
|
||||
|
||||
m_resViewsToUpdate.clear();
|
||||
}
|
||||
|
||||
|
@ -12,11 +12,9 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTest.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaImportEclipseCaseTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaQDateTimeTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryAddressAnalyzer.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.h
|
||||
@ -48,13 +46,13 @@ 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
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNetworkTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaOpenMPTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNumericalTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTextTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFileLogger.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaProjectBackupTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaQuantityInfoTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaHashTools.h
|
||||
)
|
||||
|
||||
@ -72,11 +70,9 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTest.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaImportEclipseCaseTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaQDateTimeTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryAddressAnalyzer.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.cpp
|
||||
@ -101,13 +97,13 @@ 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
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNetworkTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaOpenMPTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNumericalTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTextTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFileLogger.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaProjectBackupTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaQuantityInfoTools.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES})
|
||||
|
@ -18,6 +18,11 @@
|
||||
|
||||
#include "RiaConnectorTools.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesOsdu.h"
|
||||
#include "RiaPreferencesSumo.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
@ -26,6 +31,8 @@
|
||||
#include <QTextStream>
|
||||
#include <QtNetworkAuth/QOAuth2AuthorizationCodeFlow>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -121,3 +128,60 @@ std::map<QString, QString> RiaConnectorTools::readKeyValuePairs( const QString&
|
||||
|
||||
return keyValuePairs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaConnectorTools::readCloudConfigFiles( RiaPreferences* preferences )
|
||||
{
|
||||
if ( preferences == nullptr ) return;
|
||||
|
||||
// Check multiple locations for configuration files. The first valid configuration file is used. Currently, using Qt5 the ResInsight
|
||||
// binary file is stored at the root of the installation folder. When moving to Qt6, we will probably use sub folders /bin /lib and
|
||||
// others. Support both one and two search levels to support Qt6.
|
||||
//
|
||||
// home_folder/.resinsight/*_config.json
|
||||
// location_of_resinsight_executable/../share/cloud_services/*_config.json
|
||||
// location_of_resinsight_executable/../../share/cloud_services/*_config.json
|
||||
//
|
||||
|
||||
{
|
||||
QStringList osduFilePathCandidates;
|
||||
osduFilePathCandidates << QDir::homePath() + "/.resinsight/osdu_config.json";
|
||||
osduFilePathCandidates << QCoreApplication::applicationDirPath() + "/../share/cloud_services/osdu_config.json";
|
||||
osduFilePathCandidates << QCoreApplication::applicationDirPath() + "/../../share/cloud_services/osdu_config.json";
|
||||
|
||||
for ( const auto& osduFileCandidate : osduFilePathCandidates )
|
||||
{
|
||||
auto keyValuePairs = RiaConnectorTools::readKeyValuePairs( osduFileCandidate );
|
||||
if ( !keyValuePairs.empty() )
|
||||
{
|
||||
RiaLogging::info( QString( "Imported OSDU configuration from : '%1'" ).arg( osduFileCandidate ) );
|
||||
|
||||
preferences->osduPreferences()->setData( keyValuePairs );
|
||||
preferences->osduPreferences()->setFieldsReadOnly();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QStringList sumoFilePathCandidates;
|
||||
sumoFilePathCandidates << QDir::homePath() + "/.resinsight/sumo_config.json";
|
||||
sumoFilePathCandidates << QCoreApplication::applicationDirPath() + "/../share/cloud_services/sumo_config.json";
|
||||
sumoFilePathCandidates << QCoreApplication::applicationDirPath() + "/../../share/cloud_services/sumo_config.json";
|
||||
|
||||
for ( const auto& sumoFileCandidate : sumoFilePathCandidates )
|
||||
{
|
||||
auto keyValuePairs = RiaConnectorTools::readKeyValuePairs( sumoFileCandidate );
|
||||
if ( !keyValuePairs.empty() )
|
||||
{
|
||||
RiaLogging::info( QString( "Imported SUMO configuration from : '%1'" ).arg( sumoFileCandidate ) );
|
||||
|
||||
preferences->sumoPreferences()->setData( keyValuePairs );
|
||||
preferences->sumoPreferences()->setFieldsReadOnly();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <map>
|
||||
|
||||
class QOAuth2AuthorizationCodeFlow;
|
||||
class RiaPreferences;
|
||||
|
||||
namespace RiaConnectorTools
|
||||
{
|
||||
@ -31,4 +32,7 @@ void writeTokenData( const QString& filePath, const QString& tokenDataJson );
|
||||
QString readStringFromFile( const QString& filePath );
|
||||
|
||||
std::map<QString, QString> readKeyValuePairs( const QString& filePath );
|
||||
|
||||
void readCloudConfigFiles( RiaPreferences* preferences );
|
||||
|
||||
} // namespace RiaConnectorTools
|
||||
|
@ -276,7 +276,7 @@ void RiaSumoConnector::parseEnsembleNames( QNetworkReply* reply, const SumoCaseI
|
||||
QJsonObject aggregationColumnsObject = aggregationsObject["iteration_names"].toObject();
|
||||
|
||||
QJsonArray bucketsArray = aggregationColumnsObject["buckets"].toArray();
|
||||
foreach ( const QJsonValue& bucket, bucketsArray )
|
||||
for ( const QJsonValue& bucket : bucketsArray )
|
||||
{
|
||||
QJsonObject bucketObj = bucket.toObject();
|
||||
auto ensembleName = bucketObj["key"].toString();
|
||||
@ -825,7 +825,7 @@ void RiaSumoConnector::parseCases( QNetworkReply* reply )
|
||||
|
||||
m_cases.clear();
|
||||
|
||||
foreach ( const QJsonValue& value, hitsObjects )
|
||||
for ( const QJsonValue& value : hitsObjects )
|
||||
{
|
||||
QJsonObject resultObj = value.toObject();
|
||||
QJsonObject sourceObj = resultObj["_source"].toObject();
|
||||
@ -931,7 +931,7 @@ void RiaSumoConnector::parseBlobIds( QNetworkReply* reply,
|
||||
QJsonObject rootHits = jsonObj["hits"].toObject();
|
||||
QJsonArray hitsObjects = rootHits["hits"].toArray();
|
||||
|
||||
foreach ( const QJsonValue& value, hitsObjects )
|
||||
for ( const QJsonValue& value : hitsObjects )
|
||||
{
|
||||
QJsonObject resultObj = value.toObject();
|
||||
QJsonObject sourceObj = resultObj["_source"].toObject();
|
||||
|
@ -207,15 +207,15 @@ cvf::Color3f RiaColorTools::makeLighter( const cvf::Color3f& color, float normal
|
||||
{
|
||||
auto qColor = toQColor( color );
|
||||
|
||||
double h = 0.0;
|
||||
double s = 0.0;
|
||||
double l = 0.0;
|
||||
float h = 0.0;
|
||||
float s = 0.0;
|
||||
float l = 0.0;
|
||||
qColor.getHslF( &h, &s, &l );
|
||||
|
||||
// A negative value will make the color darker
|
||||
l = l + ( 1.0 - l ) * normalizedScalingFactor;
|
||||
|
||||
l = std::clamp( l, 0.0, 1.0 );
|
||||
l = std::clamp( l, 0.0f, 1.0f );
|
||||
|
||||
qColor.setHslF( h, s, l );
|
||||
|
||||
@ -228,10 +228,10 @@ cvf::Color3f RiaColorTools::makeLighter( const cvf::Color3f& color, float normal
|
||||
QColor RiaColorTools::modifySaturation( const QColor& color, double factor )
|
||||
{
|
||||
auto colorSaturation( color );
|
||||
qreal h, s, v;
|
||||
float h, s, v;
|
||||
color.getHsvF( &h, &s, &v );
|
||||
|
||||
s = std::clamp( s * factor, 0.0, 1.0 );
|
||||
s = std::clamp( (float)( s * factor ), 0.0f, 1.0f );
|
||||
|
||||
colorSaturation.setHsvF( h, s, v );
|
||||
return colorSaturation;
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
void addCurveData( const std::vector<XValueType>& xValues, const std::vector<double>& yValues );
|
||||
size_t curveCount() const;
|
||||
|
||||
void computeInterpolatedValues( bool includeValuesFromPartialCurves = true );
|
||||
void computeInterpolatedValues( bool includeValuesFromPartialCurves );
|
||||
|
||||
RiaCurveDataTools::CurveIntervals validIntervalsForAllXValues() const;
|
||||
const std::vector<XValueType>& allXValues() const;
|
||||
@ -67,7 +67,8 @@ public:
|
||||
interpolatedYValue( const XValueType& xValue, const std::vector<XValueType>& curveXValues, const std::vector<double>& curveYValues );
|
||||
|
||||
private:
|
||||
void computeUnionOfXValues( bool includeValuesFromPartialCurves );
|
||||
void computeUnionOfXValues( bool includeValuesFromPartialCurves );
|
||||
static bool isMonotonicallyIncreasing( const std::vector<XValueType>& curveXValues );
|
||||
|
||||
private:
|
||||
std::vector<std::pair<std::vector<XValueType>, std::vector<double>>> m_originalValues;
|
||||
@ -76,6 +77,9 @@ private:
|
||||
|
||||
std::vector<XValueType> m_allXValues;
|
||||
std::vector<std::vector<double>> m_interpolatedValuesForAllCurves;
|
||||
|
||||
bool m_isXValuesSharedBetweenCurves;
|
||||
bool m_isXValuesMonotonicallyIncreasing;
|
||||
};
|
||||
|
||||
using RiaTimeHistoryCurveMerger = RiaCurveMerger<time_t>;
|
||||
|
@ -55,6 +55,8 @@ bool XValueComparator<XValueType>::equals( const XValueType& lhs, const XValueTy
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template <typename XValueType>
|
||||
RiaCurveMerger<XValueType>::RiaCurveMerger()
|
||||
: m_isXValuesSharedBetweenCurves( false )
|
||||
, m_isXValuesMonotonicallyIncreasing( true )
|
||||
{
|
||||
}
|
||||
|
||||
@ -68,6 +70,24 @@ void RiaCurveMerger<XValueType>::addCurveData( const std::vector<XValueType>& xV
|
||||
|
||||
if ( !xValues.empty() )
|
||||
{
|
||||
if ( m_originalValues.empty() )
|
||||
{
|
||||
m_isXValuesSharedBetweenCurves = true;
|
||||
m_isXValuesMonotonicallyIncreasing = isMonotonicallyIncreasing( xValues );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_isXValuesSharedBetweenCurves )
|
||||
{
|
||||
const auto& firstXValues = m_originalValues.front().first;
|
||||
m_isXValuesSharedBetweenCurves = std::equal( firstXValues.begin(), firstXValues.end(), xValues.begin() );
|
||||
}
|
||||
|
||||
if ( m_isXValuesMonotonicallyIncreasing )
|
||||
{
|
||||
m_isXValuesMonotonicallyIncreasing = isMonotonicallyIncreasing( xValues );
|
||||
}
|
||||
}
|
||||
m_originalValues.push_back( std::make_pair( xValues, yValues ) );
|
||||
}
|
||||
}
|
||||
@ -131,14 +151,14 @@ void RiaCurveMerger<XValueType>::computeInterpolatedValues( bool includeValuesFr
|
||||
m_allXValues.clear();
|
||||
m_interpolatedValuesForAllCurves.clear();
|
||||
|
||||
computeUnionOfXValues( includeValuesFromPartialCurves );
|
||||
|
||||
const size_t curveCount = m_originalValues.size();
|
||||
if ( curveCount == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
computeUnionOfXValues( includeValuesFromPartialCurves );
|
||||
|
||||
const size_t dataValueCount = m_allXValues.size();
|
||||
if ( dataValueCount == 0 )
|
||||
{
|
||||
@ -157,8 +177,18 @@ void RiaCurveMerger<XValueType>::computeInterpolatedValues( bool includeValuesFr
|
||||
#pragma omp parallel for
|
||||
for ( int valueIndex = 0; valueIndex < static_cast<int>( dataValueCount ); valueIndex++ )
|
||||
{
|
||||
double interpolValue =
|
||||
interpolatedYValue( m_allXValues[valueIndex], m_originalValues[curveIdx].first, m_originalValues[curveIdx].second );
|
||||
double interpolValue = 0.0;
|
||||
|
||||
if ( m_isXValuesSharedBetweenCurves )
|
||||
{
|
||||
interpolValue = m_originalValues[curveIdx].second[valueIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
interpolValue =
|
||||
interpolatedYValue( m_allXValues[valueIndex], m_originalValues[curveIdx].first, m_originalValues[curveIdx].second );
|
||||
}
|
||||
|
||||
if ( !RiaCurveDataTools::isValidValue( interpolValue, false ) )
|
||||
{
|
||||
#pragma omp critical
|
||||
@ -180,6 +210,13 @@ void RiaCurveMerger<XValueType>::computeUnionOfXValues( bool includeValuesForPar
|
||||
{
|
||||
m_allXValues.clear();
|
||||
|
||||
if ( m_isXValuesSharedBetweenCurves && !m_originalValues.empty() )
|
||||
{
|
||||
// If all curves have the same X values, use the X values from the first curve.
|
||||
m_allXValues = m_originalValues.front().first;
|
||||
return;
|
||||
}
|
||||
|
||||
std::set<XValueType, XComparator> unionOfXValues;
|
||||
|
||||
std::vector<std::pair<XValueType, XValueType>> originalXBounds;
|
||||
@ -240,17 +277,27 @@ double RiaCurveMerger<XValueType>::interpolatedYValue( const XValueType&
|
||||
if ( xValues.empty() ) return HUGE_VAL;
|
||||
if ( yValues.size() != xValues.size() ) return HUGE_VAL;
|
||||
|
||||
size_t startIndex = 0;
|
||||
|
||||
if ( isMonotonicallyIncreasing( xValues ) )
|
||||
{
|
||||
// Use lower_bound to find the first element that is not less than the interpolation value using a threshold that is larger than
|
||||
// the threshold used in XComparator::equals
|
||||
//
|
||||
// Using this method will improve the performance significantly for large datasets, as std::lower_bound is much faster than the
|
||||
// search in the loop below. One relevant use case is computation of delta summary values for large datasets. Here the time
|
||||
// steps are specified in increasing order
|
||||
//
|
||||
XValueType threshold = 1.0e-6 * xValues.back();
|
||||
auto it = std::lower_bound( xValues.begin(), xValues.end(), interpolationXValue - threshold );
|
||||
if ( it == xValues.end() ) return HUGE_VAL;
|
||||
|
||||
startIndex = it - xValues.begin();
|
||||
if ( startIndex > 0 ) startIndex--;
|
||||
}
|
||||
|
||||
const bool removeInterpolatedValues = false;
|
||||
|
||||
// Use lower_bound to find the first element that is not less than the interpolation value using a threshold that is larger than the
|
||||
// threshold used in XComparator::equals
|
||||
XValueType threshold = 1.0e-6 * xValues.back();
|
||||
auto it = std::lower_bound( xValues.begin(), xValues.end(), interpolationXValue - threshold );
|
||||
if ( it == xValues.end() ) return HUGE_VAL;
|
||||
|
||||
size_t startIndex = it - xValues.begin();
|
||||
if ( startIndex > 0 ) startIndex--;
|
||||
|
||||
for ( size_t firstI = startIndex; firstI < xValues.size(); firstI++ )
|
||||
{
|
||||
if ( XComparator::equals( xValues.at( firstI ), interpolationXValue ) )
|
||||
@ -307,3 +354,17 @@ double RiaCurveMerger<XValueType>::interpolatedYValue( const XValueType&
|
||||
|
||||
return HUGE_VAL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template <typename XValueType>
|
||||
bool RiaCurveMerger<XValueType>::isMonotonicallyIncreasing( const std::vector<XValueType>& container )
|
||||
{
|
||||
return std::adjacent_find( container.begin(),
|
||||
container.end(),
|
||||
[]( const auto& a, const auto& b )
|
||||
{
|
||||
return b < a; // Returns true if not monotonically increasing
|
||||
} ) == container.end();
|
||||
}
|
||||
|
@ -19,7 +19,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
class RiaEclipseUnitTools
|
||||
{
|
||||
|
@ -19,8 +19,8 @@
|
||||
#include "RiaEnsembleNameTools.h"
|
||||
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaSummaryDefines.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "Summary/RiaSummaryDefines.h"
|
||||
|
||||
#include "RimCaseDisplayNameTools.h"
|
||||
#include "RimProject.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "RiaSummaryDefines.h"
|
||||
#include "Summary/RiaSummaryDefines.h"
|
||||
|
||||
class RimSummaryCase;
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "RiaSimWellBranchTools.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
#include "RiaViewRedrawScheduler.h"
|
||||
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
#include "RifReaderSettings.h"
|
||||
@ -95,6 +96,10 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil
|
||||
|
||||
FileCaseIdMap openedFiles;
|
||||
|
||||
// Block updates until import of summary data is completed. QApplication::processEvents() is called during import of summary data, and
|
||||
// this will trigger redraw of the 3D views in RiaViewRedrawScheduler
|
||||
RiaViewRedrawScheduler::instance()->blockUpdate( true );
|
||||
|
||||
// Import eclipse case files
|
||||
for ( const QString& gridCaseFile : selector.gridCaseFiles() )
|
||||
{
|
||||
@ -208,6 +213,8 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil
|
||||
|
||||
project->activeOilField()->completionTemplateCollection()->setDefaultUnitSystemBasedOnLoadedCases();
|
||||
|
||||
RiaViewRedrawScheduler::instance()->blockUpdate( false );
|
||||
|
||||
if ( RiaGuiApplication::isRunning() )
|
||||
{
|
||||
if ( RiuPlotMainWindow::instance()->isVisible() ) RiuPlotMainWindowTools::refreshToolbars();
|
||||
|
@ -163,13 +163,52 @@ void RiaDefaultConsoleLogger::writeToConsole( const std::string& str )
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaLogging::setLastMessage( const QString& message )
|
||||
{
|
||||
#pragma omp critical( critical_section_logging )
|
||||
{
|
||||
sm_lastMessage = message;
|
||||
sm_lastMessageTime = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaLogging::isSameMessage( const QString& message )
|
||||
{
|
||||
bool isSame = false;
|
||||
|
||||
#pragma omp critical( critical_section_logging )
|
||||
{
|
||||
if ( message == sm_lastMessage )
|
||||
{
|
||||
auto now = std::chrono::high_resolution_clock::now();
|
||||
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>( now - sm_lastMessageTime );
|
||||
|
||||
if ( duration.count() < 1000 )
|
||||
{
|
||||
isSame = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isSame;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
|
||||
std::vector<std::unique_ptr<RiaLogger>> RiaLogging::sm_logger;
|
||||
std::vector<std::unique_ptr<RiaLogger>> RiaLogging::sm_logger;
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> RiaLogging::sm_startTime;
|
||||
QString RiaLogging::sm_lastMessage;
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> RiaLogging::sm_lastMessageTime;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -208,6 +247,8 @@ RILogLevel RiaLogging::logLevelBasedOnPreferences()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaLogging::error( const QString& message )
|
||||
{
|
||||
if ( isSameMessage( message ) ) return;
|
||||
|
||||
for ( const auto& logger : sm_logger )
|
||||
{
|
||||
if ( logger && logger->level() >= int( RILogLevel::RI_LL_ERROR ) )
|
||||
@ -216,6 +257,8 @@ void RiaLogging::error( const QString& message )
|
||||
logger->error( message.toLatin1().constData() );
|
||||
}
|
||||
}
|
||||
|
||||
setLastMessage( message );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -223,6 +266,8 @@ void RiaLogging::error( const QString& message )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaLogging::warning( const QString& message )
|
||||
{
|
||||
if ( isSameMessage( message ) ) return;
|
||||
|
||||
for ( const auto& logger : sm_logger )
|
||||
{
|
||||
if ( logger && logger->level() >= int( RILogLevel::RI_LL_WARNING ) )
|
||||
@ -231,6 +276,8 @@ void RiaLogging::warning( const QString& message )
|
||||
logger->warning( message.toLatin1().constData() );
|
||||
}
|
||||
}
|
||||
|
||||
setLastMessage( message );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -238,6 +285,8 @@ void RiaLogging::warning( const QString& message )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaLogging::info( const QString& message )
|
||||
{
|
||||
if ( isSameMessage( message ) ) return;
|
||||
|
||||
for ( const auto& logger : sm_logger )
|
||||
{
|
||||
if ( logger && logger->level() >= int( RILogLevel::RI_LL_INFO ) )
|
||||
@ -246,6 +295,8 @@ void RiaLogging::info( const QString& message )
|
||||
logger->info( message.toLatin1().constData() );
|
||||
}
|
||||
}
|
||||
|
||||
setLastMessage( message );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -253,6 +304,8 @@ void RiaLogging::info( const QString& message )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaLogging::debug( const QString& message )
|
||||
{
|
||||
if ( isSameMessage( message ) ) return;
|
||||
|
||||
for ( const auto& logger : sm_logger )
|
||||
{
|
||||
if ( logger && logger->level() >= int( RILogLevel::RI_LL_DEBUG ) )
|
||||
@ -261,6 +314,8 @@ void RiaLogging::debug( const QString& message )
|
||||
logger->debug( message.toLatin1().constData() );
|
||||
}
|
||||
}
|
||||
|
||||
setLastMessage( message );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -276,6 +331,29 @@ void RiaLogging::errorInMessageBox( QWidget* parent, const QString& title, const
|
||||
RiaLogging::error( text );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaLogging::resetTimer( const QString& message )
|
||||
{
|
||||
sm_startTime = std::chrono::high_resolution_clock::now();
|
||||
|
||||
if ( !message.isEmpty() ) RiaLogging::debug( message );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaLogging::logTimeElapsed( const QString& message )
|
||||
{
|
||||
auto end = std::chrono::high_resolution_clock::now();
|
||||
|
||||
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>( end - sm_startTime );
|
||||
auto text = message + QString( " (duration : %1 milliseconds)" ).arg( duration.count() );
|
||||
|
||||
RiaLogging::debug( text );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -72,8 +73,18 @@ public:
|
||||
|
||||
static void errorInMessageBox( QWidget* parent, const QString& title, const QString& text );
|
||||
|
||||
static void resetTimer( const QString& message );
|
||||
static void logTimeElapsed( const QString& message );
|
||||
|
||||
private:
|
||||
static std::vector<std::unique_ptr<RiaLogger>> sm_logger;
|
||||
static void setLastMessage( const QString& message );
|
||||
static bool isSameMessage( const QString& message );
|
||||
|
||||
private:
|
||||
static std::vector<std::unique_ptr<RiaLogger>> sm_logger;
|
||||
static std::chrono::time_point<std::chrono::high_resolution_clock> sm_startTime;
|
||||
static QString sm_lastMessage;
|
||||
static std::chrono::time_point<std::chrono::high_resolution_clock> sm_lastMessageTime;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
|
@ -203,11 +203,7 @@ QDateTime RiaQDateTimeTools::subtractPeriod( const QDateTime& dt, RiaDefines::Da
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::createDateTime( const QDate& date, Qt::TimeSpec timeSpec /*= Qt::LocalTime*/ )
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
||||
return date.startOfDay( timeSpec );
|
||||
#else
|
||||
return QDateTime( date, QTime( 0, 0 ), timeSpec );
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -20,8 +20,6 @@
|
||||
|
||||
#include "RiaDateTimeDefines.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <set>
|
||||
|
131
ApplicationLibCode/Application/Tools/RiaQuantityInfoTools.cpp
Normal file
@ -0,0 +1,131 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2024 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 "RiaQuantityInfoTools.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RiuSummaryQuantityNameInfoProvider.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <QString>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace RiaQuantityInfoTools
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void writeToFile( const QString& filename, const std::unordered_map<std::string, std::pair<std::string, std::string>>& map )
|
||||
{
|
||||
QJsonObject jsonObj;
|
||||
|
||||
for ( const auto& item : map )
|
||||
{
|
||||
QJsonObject itemObj;
|
||||
itemObj["category"] = QString::fromStdString( item.second.first );
|
||||
itemObj["description"] = QString::fromStdString( item.second.second );
|
||||
jsonObj[QString::fromStdString( item.first )] = itemObj;
|
||||
}
|
||||
|
||||
QJsonDocument jsonDoc( jsonObj );
|
||||
QFile file( filename );
|
||||
if ( !file.open( QIODevice::WriteOnly ) )
|
||||
{
|
||||
RiaLogging::error( "Couldn't open file : " + filename );
|
||||
return;
|
||||
}
|
||||
file.write( jsonDoc.toJson() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::unordered_map<std::string, std::pair<std::string, std::string>> importFromFile( const QString& filename )
|
||||
{
|
||||
QFile file( filename );
|
||||
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
||||
{
|
||||
RiaLogging::error( "Couldn't open file : " + filename );
|
||||
return {};
|
||||
}
|
||||
|
||||
QByteArray data = file.readAll();
|
||||
QJsonDocument jsonDoc( QJsonDocument::fromJson( data ) );
|
||||
|
||||
if ( !jsonDoc.isObject() )
|
||||
{
|
||||
RiaLogging::error( "Invalid JSON format in : " + filename );
|
||||
return {};
|
||||
}
|
||||
|
||||
std::unordered_map<std::string, std::pair<std::string, std::string>> map;
|
||||
|
||||
QJsonObject jsonObj = jsonDoc.object();
|
||||
for ( auto it = jsonObj.begin(); it != jsonObj.end(); ++it )
|
||||
{
|
||||
auto key = it.key().toStdString();
|
||||
QJsonObject value = it.value().toObject();
|
||||
|
||||
auto category = value["category"].toString().toStdString();
|
||||
auto description = value["description"].toString().toStdString();
|
||||
|
||||
map.insert( { key, { category, description } } );
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void importKeywords( const QString& keywordEclipseFilePath, const QString& keyword6XFilePath )
|
||||
{
|
||||
auto quantityInfos = internal::importFromFile( keywordEclipseFilePath );
|
||||
auto info6x = internal::importFromFile( keyword6XFilePath );
|
||||
|
||||
for ( const auto& other : info6x )
|
||||
{
|
||||
if ( !quantityInfos.contains( other.first ) )
|
||||
{
|
||||
quantityInfos.insert( other );
|
||||
}
|
||||
}
|
||||
|
||||
RiuSummaryQuantityNameInfoProvider::instance()->setQuantityInfos( quantityInfos );
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace RiaQuantityInfoTools
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaQuantityInfoTools::initializeSummaryKeywords()
|
||||
{
|
||||
QString keywordEclipseFilePath = ":keywords/keyword-description/keywords_eclipse.json";
|
||||
QString keyword6XFilePath = ":keywords/keyword-description/keywords_6x.json";
|
||||
|
||||
RiaQuantityInfoTools::internal::importKeywords( keywordEclipseFilePath, keyword6XFilePath );
|
||||
}
|
29
ApplicationLibCode/Application/Tools/RiaQuantityInfoTools.h
Normal file
@ -0,0 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2024 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 RiaQuantityInfoTools
|
||||
{
|
||||
void initializeSummaryKeywords();
|
||||
} // namespace RiaQuantityInfoTools
|
@ -240,9 +240,6 @@ void RiaRegressionTestRunner::runRegressionTest()
|
||||
|
||||
app->loadProject( testCaseFolder.filePath( projectFileName ), RiaApplication::ProjectLoadAction::PLA_NONE, projectModifier.p() );
|
||||
|
||||
// Wait until all command objects have completed
|
||||
app->waitUntilCommandObjectsHasBeenProcessed();
|
||||
|
||||
QString fullPathGeneratedFolder = testCaseFolder.absoluteFilePath( generatedFolderName );
|
||||
if ( regressionTestConfig.exportSnapshots3dViews )
|
||||
{
|
||||
|
@ -21,7 +21,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cmath>
|
||||
#include <numeric>
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
||||
//==================================================================================================
|
||||
@ -41,10 +41,37 @@ public:
|
||||
template <class NumberType>
|
||||
static bool isValidNumber( NumberType value )
|
||||
{
|
||||
if ( std::isinf( value ) ) return false;
|
||||
if ( std::isnan( value ) ) return false;
|
||||
return !std::isinf( value ) && !std::isnan( value );
|
||||
}
|
||||
|
||||
return true;
|
||||
template <class NumberType>
|
||||
static NumberType minimumValue( const std::vector<NumberType>& values )
|
||||
{
|
||||
NumberType minValue = std::numeric_limits<NumberType>::max();
|
||||
for ( NumberType value : values )
|
||||
{
|
||||
if ( RiaStatisticsTools::isValidNumber<NumberType>( value ) )
|
||||
{
|
||||
minValue = std::min( minValue, value );
|
||||
}
|
||||
}
|
||||
|
||||
return minValue;
|
||||
}
|
||||
|
||||
template <class NumberType>
|
||||
static NumberType maximumValue( const std::vector<NumberType>& values )
|
||||
{
|
||||
NumberType maxValue = -std::numeric_limits<NumberType>::max();
|
||||
for ( NumberType value : values )
|
||||
{
|
||||
if ( RiaStatisticsTools::isValidNumber<NumberType>( value ) )
|
||||
{
|
||||
maxValue = std::max( maxValue, value );
|
||||
}
|
||||
}
|
||||
|
||||
return maxValue;
|
||||
}
|
||||
|
||||
static double pearsonCorrelation( const std::vector<double>& xValues, const std::vector<double>& yValues );
|
||||
|
@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QString>
|
||||
@ -128,11 +129,33 @@ QString RiaTextStringTools::trimNonAlphaNumericCharacters( const QString& s )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RiaTextStringTools::splitSkipEmptyParts( const QString& text, const QString& sep /*= " " */ )
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
||||
return text.split( sep, Qt::SkipEmptyParts, Qt::CaseInsensitive );
|
||||
#else
|
||||
return text.split( sep, QString::SkipEmptyParts, Qt::CaseInsensitive );
|
||||
#endif
|
||||
bool skipEmptyParts = true;
|
||||
return splitString( text, sep, skipEmptyParts );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RiaTextStringTools::splitSkipEmptyParts( const QString& text, const QRegularExpression& regularExpression )
|
||||
{
|
||||
bool skipEmptyParts = true;
|
||||
return splitString( text, regularExpression, skipEmptyParts );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RiaTextStringTools::splitString( const QString& text, const QString& sep, bool skipEmptyParts )
|
||||
{
|
||||
return text.split( sep, skipEmptyParts ? Qt::SkipEmptyParts : Qt::KeepEmptyParts, Qt::CaseInsensitive );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RiaTextStringTools::splitString( const QString& text, const QRegularExpression& regularExpression, bool skipEmptyParts )
|
||||
{
|
||||
return text.split( regularExpression, skipEmptyParts ? Qt::SkipEmptyParts : Qt::KeepEmptyParts );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -159,21 +182,36 @@ QString RiaTextStringTools::replaceTemplateTextWithValues( const QString& templa
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// Qt recommends pass-by-value instead of pass-by-const-ref for QStringView
|
||||
/// https://doc.qt.io/qt-6/qstringview.html
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RiaTextStringTools::splitSkipEmptyParts( const QString& text, const QRegExp& regExp )
|
||||
bool RiaTextStringTools::isTextEqual( QStringView text, QStringView compareText )
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
||||
return text.split( regExp, Qt::SkipEmptyParts );
|
||||
#else
|
||||
return text.split( regExp, QString::SkipEmptyParts );
|
||||
#endif
|
||||
return text.compare( compareText, Qt::CaseInsensitive ) == 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaTextStringTools::isNumber( const QString& text, const QString& decimalPoint )
|
||||
{
|
||||
if ( text.isEmpty() || decimalPoint.isEmpty() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
auto stdString = text.toStdString();
|
||||
auto decimalChar = decimalPoint.toLatin1()[0];
|
||||
|
||||
return RiaStdStringTools::isNumber( stdString, decimalChar );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 8, 0 )
|
||||
std::strong_ordering operator<=>( const QString& lhs, const QString& rhs )
|
||||
{
|
||||
return lhs.compare( rhs ) <=> 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -18,8 +18,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QtGlobal>
|
||||
|
||||
#include <map>
|
||||
|
||||
@ -35,12 +37,18 @@ QString commonSuffix( const QStringList& stringList );
|
||||
QString trimNonAlphaNumericCharacters( const QString& s );
|
||||
|
||||
QStringList splitSkipEmptyParts( const QString& text, const QString& sep = " " );
|
||||
QStringList splitSkipEmptyParts( const QString& text, const QRegExp& regExp );
|
||||
QStringList splitSkipEmptyParts( const QString& text, const QRegularExpression& regularExpression );
|
||||
|
||||
QStringList splitString( const QString& text, const QString& sep, bool skipEmptyParts );
|
||||
QStringList splitString( const QString& text, const QRegularExpression& regularExpression, bool skipEmptyParts );
|
||||
|
||||
QString replaceTemplateTextWithValues( const QString& templateText, const std::map<QString, QString>& valueMap );
|
||||
bool isTextEqual( QStringView text, QStringView compareText );
|
||||
bool isNumber( const QString& text, const QString& decimalPoint );
|
||||
|
||||
} // namespace RiaTextStringTools
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 8, 0 )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Add operator<=> for QString to global scope
|
||||
@ -54,3 +62,4 @@ QString replaceTemplateTextWithValues( const QString& templateText, const std::m
|
||||
//
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::strong_ordering operator<=>( const QString& lhs, const QString& rhs );
|
||||
#endif
|
||||
|
@ -41,8 +41,10 @@ bool RiaValidRegExpValidator::isValidCharacter( const QChar& character )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QValidator::State RiaValidRegExpValidator::validate( QString& inputString, int& position ) const
|
||||
{
|
||||
QRegExp inputRe( inputString, Qt::CaseInsensitive, QRegExp::Wildcard );
|
||||
if ( inputRe.isValid() ) // A valid wildcard pattern is always acceptable
|
||||
QString regexPattern = QRegularExpression::wildcardToRegularExpression( inputString );
|
||||
QRegularExpression regex( regexPattern, QRegularExpression::CaseInsensitiveOption );
|
||||
|
||||
if ( regex.isValid() )
|
||||
{
|
||||
return QValidator::Acceptable;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include <QRegExp>
|
||||
#include <QString>
|
||||
#include <QValidator>
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
|
||||
#include "cafAssert.h"
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryAddressAnalyzer.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryAddressModifier.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveDefinition.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryStringTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryTools.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryAddressAnalyzer.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryAddressModifier.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveDefinition.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryStringTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryTools.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
||||
list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES})
|
@ -16,10 +16,10 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaSummaryAddressAnalyzer.h"
|
||||
#include "Summary/RiaSummaryAddressAnalyzer.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
#include "Summary/RiaSummaryCurveDefinition.h"
|
||||
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
@ -18,8 +18,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaSummaryCurveAddress.h"
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "Summary/RiaSummaryCurveAddress.h"
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
@ -16,7 +16,7 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimSummaryAddressModifier.h"
|
||||
#include "RiaSummaryAddressModifier.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
@ -30,7 +30,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RimSummaryAddressModifier::replaceTokenForCategory( const RifEclipseSummaryAddress& sourceAdr,
|
||||
RifEclipseSummaryAddress RiaSummaryAddressModifier::replaceTokenForCategory( const RifEclipseSummaryAddress& sourceAdr,
|
||||
const std::string& token,
|
||||
RifEclipseSummaryAddressDefines::SummaryCategory contentType )
|
||||
{
|
||||
@ -103,7 +103,7 @@ RifEclipseSummaryAddress RimSummaryAddressModifier::replaceTokenForCategory( con
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RiaSummaryCurveAddress> RimSummaryAddressModifier::curveAddresses( const std::vector<CurveAddressProvider>& curveAddressProviders )
|
||||
std::vector<RiaSummaryCurveAddress> RiaSummaryAddressModifier::curveAddresses( const std::vector<CurveAddressProvider>& curveAddressProviders )
|
||||
{
|
||||
std::vector<RiaSummaryCurveAddress> addresses;
|
||||
|
||||
@ -112,7 +112,7 @@ std::vector<RiaSummaryCurveAddress> RimSummaryAddressModifier::curveAddresses( c
|
||||
std::visit(
|
||||
[&addresses]( auto&& arg )
|
||||
{
|
||||
auto curveAdr = RimSummaryAddressModifier::curveAddress( arg );
|
||||
auto curveAdr = RiaSummaryAddressModifier::curveAddress( arg );
|
||||
addresses.push_back( curveAdr );
|
||||
},
|
||||
provider );
|
||||
@ -124,7 +124,7 @@ std::vector<RiaSummaryCurveAddress> RimSummaryAddressModifier::curveAddresses( c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddressModifier::applyAddressesToCurveAddressProviders( const std::vector<CurveAddressProvider>& curveAddressProviders,
|
||||
void RiaSummaryAddressModifier::applyAddressesToCurveAddressProviders( const std::vector<CurveAddressProvider>& curveAddressProviders,
|
||||
const std::vector<RiaSummaryCurveAddress>& addresses )
|
||||
{
|
||||
if ( curveAddressProviders.size() != addresses.size() ) return;
|
||||
@ -134,14 +134,14 @@ void RimSummaryAddressModifier::applyAddressesToCurveAddressProviders( const std
|
||||
auto provider = curveAddressProviders[i];
|
||||
const auto& address = addresses[i];
|
||||
|
||||
std::visit( [address]( auto&& arg ) { RimSummaryAddressModifier::setCurveAddress( arg, address ); }, provider );
|
||||
std::visit( [address]( auto&& arg ) { RiaSummaryAddressModifier::setCurveAddress( arg, address ); }, provider );
|
||||
};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryAddressModifier::CurveAddressProvider> RimSummaryAddressModifier::createAddressProviders( RimSummaryPlot* summaryPlot )
|
||||
std::vector<RiaSummaryAddressModifier::CurveAddressProvider> RiaSummaryAddressModifier::createAddressProviders( RimSummaryPlot* summaryPlot )
|
||||
{
|
||||
std::vector<CurveAddressProvider> providers;
|
||||
|
||||
@ -161,7 +161,7 @@ std::vector<RimSummaryAddressModifier::CurveAddressProvider> RimSummaryAddressMo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RifEclipseSummaryAddress> RimSummaryAddressModifier::allSummaryAddressesY( RimSummaryPlot* summaryPlot )
|
||||
std::vector<RifEclipseSummaryAddress> RiaSummaryAddressModifier::allSummaryAddressesY( RimSummaryPlot* summaryPlot )
|
||||
{
|
||||
std::vector<RifEclipseSummaryAddress> addresses;
|
||||
|
||||
@ -171,7 +171,7 @@ std::vector<RifEclipseSummaryAddress> RimSummaryAddressModifier::allSummaryAddre
|
||||
std::visit(
|
||||
[&addresses]( auto&& arg )
|
||||
{
|
||||
auto curveAdr = RimSummaryAddressModifier::curveAddress( arg );
|
||||
auto curveAdr = RiaSummaryAddressModifier::curveAddress( arg );
|
||||
addresses.push_back( curveAdr.summaryAddressY() );
|
||||
},
|
||||
provider );
|
||||
@ -183,7 +183,7 @@ std::vector<RifEclipseSummaryAddress> RimSummaryAddressModifier::allSummaryAddre
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddressModifier::updateAddressesByObjectName( const std::vector<CurveAddressProvider>& curveAddressProviders,
|
||||
void RiaSummaryAddressModifier::updateAddressesByObjectName( const std::vector<CurveAddressProvider>& curveAddressProviders,
|
||||
const std::string& objectName,
|
||||
RimSummaryAddressCollection::CollectionContentType contentType )
|
||||
{
|
||||
@ -194,15 +194,15 @@ void RimSummaryAddressModifier::updateAddressesByObjectName( const std::vector<C
|
||||
std::visit(
|
||||
[objectName, category]( auto&& arg )
|
||||
{
|
||||
const auto sourceAdr = RimSummaryAddressModifier::curveAddress( arg );
|
||||
const auto sourceAdr = RiaSummaryAddressModifier::curveAddress( arg );
|
||||
|
||||
const auto sourceX = sourceAdr.summaryAddressX();
|
||||
const auto sourceY = sourceAdr.summaryAddressY();
|
||||
|
||||
const auto newAdrX = RimSummaryAddressModifier::replaceTokenForCategory( sourceX, objectName, category );
|
||||
const auto newAdrY = RimSummaryAddressModifier::replaceTokenForCategory( sourceY, objectName, category );
|
||||
const auto newAdrX = RiaSummaryAddressModifier::replaceTokenForCategory( sourceX, objectName, category );
|
||||
const auto newAdrY = RiaSummaryAddressModifier::replaceTokenForCategory( sourceY, objectName, category );
|
||||
|
||||
RimSummaryAddressModifier::setCurveAddress( arg, RiaSummaryCurveAddress( newAdrX, newAdrY ) );
|
||||
RiaSummaryAddressModifier::setCurveAddress( arg, RiaSummaryCurveAddress( newAdrX, newAdrY ) );
|
||||
},
|
||||
provider );
|
||||
};
|
||||
@ -211,7 +211,7 @@ void RimSummaryAddressModifier::updateAddressesByObjectName( const std::vector<C
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaSummaryCurveAddress RimSummaryAddressModifier::curveAddress( RimEnsembleCurveSet* curveSet )
|
||||
RiaSummaryCurveAddress RiaSummaryAddressModifier::curveAddress( RimEnsembleCurveSet* curveSet )
|
||||
{
|
||||
if ( curveSet == nullptr ) return RiaSummaryCurveAddress( RifEclipseSummaryAddress() );
|
||||
return curveSet->curveAddress();
|
||||
@ -220,7 +220,7 @@ RiaSummaryCurveAddress RimSummaryAddressModifier::curveAddress( RimEnsembleCurve
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaSummaryCurveAddress RimSummaryAddressModifier::curveAddress( RimSummaryCurve* curve )
|
||||
RiaSummaryCurveAddress RiaSummaryAddressModifier::curveAddress( RimSummaryCurve* curve )
|
||||
{
|
||||
if ( curve == nullptr ) return RiaSummaryCurveAddress( RifEclipseSummaryAddress() );
|
||||
return curve->curveAddress();
|
||||
@ -229,7 +229,7 @@ RiaSummaryCurveAddress RimSummaryAddressModifier::curveAddress( RimSummaryCurve*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddressModifier::setCurveAddress( RimEnsembleCurveSet* curveSet, const RiaSummaryCurveAddress& curveAdr )
|
||||
void RiaSummaryAddressModifier::setCurveAddress( RimEnsembleCurveSet* curveSet, const RiaSummaryCurveAddress& curveAdr )
|
||||
{
|
||||
if ( curveSet )
|
||||
{
|
||||
@ -240,7 +240,7 @@ void RimSummaryAddressModifier::setCurveAddress( RimEnsembleCurveSet* curveSet,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddressModifier::setCurveAddress( RimSummaryCurve* curve, const RiaSummaryCurveAddress& curveAdr )
|
||||
void RiaSummaryAddressModifier::setCurveAddress( RimSummaryCurve* curve, const RiaSummaryCurveAddress& curveAdr )
|
||||
{
|
||||
if ( curve )
|
||||
{
|
@ -32,7 +32,7 @@ class RiaSummaryCurveAddress;
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RimSummaryAddressModifier
|
||||
class RiaSummaryAddressModifier
|
||||
{
|
||||
public:
|
||||
// Define a variant for summary curves and ensemble curve set. This way we can treat them as similar object without a
|
@ -17,12 +17,13 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RiaSummaryAddressModifier.h"
|
||||
#include "RiaSummaryCurveAddress.h"
|
||||
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RimSummaryAddressModifier.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryEnsemble.h"
|
||||
|
||||
@ -177,18 +178,18 @@ void RiaSummaryCurveDefinition::setIdentifierText( SummaryCategory category, con
|
||||
if ( RifEclipseSummaryAddress::isDependentOnWellName( category ) )
|
||||
{
|
||||
m_summaryAddressX =
|
||||
RimSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressX,
|
||||
RiaSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressX,
|
||||
name,
|
||||
RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL );
|
||||
m_summaryAddressY =
|
||||
RimSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressY,
|
||||
RiaSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressY,
|
||||
name,
|
||||
RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_summaryAddressX = RimSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressX, name, m_summaryAddressX.category() );
|
||||
m_summaryAddressY = RimSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressY, name, m_summaryAddressY.category() );
|
||||
m_summaryAddressX = RiaSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressX, name, m_summaryAddressX.category() );
|
||||
m_summaryAddressY = RiaSummaryAddressModifier::replaceTokenForCategory( m_summaryAddressY, name, m_summaryAddressY.category() );
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaSummaryDefines.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
namespace caf
|
@ -16,12 +16,12 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaSummaryStringTools.h"
|
||||
#include "Summary/RiaSummaryStringTools.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
@ -121,11 +121,12 @@ void RiaSummaryStringTools::splitUsingDataSourceNames( const QStringList& filter
|
||||
|
||||
bool foundDataSource = false;
|
||||
|
||||
QRegExp searcher( pureDataSourceCandidate, Qt::CaseInsensitive, QRegExp::WildcardUnix );
|
||||
QString regexPattern = QRegularExpression::wildcardToRegularExpression( pureDataSourceCandidate );
|
||||
QRegularExpression searcher( regexPattern, QRegularExpression::CaseInsensitiveOption );
|
||||
|
||||
for ( const auto& ds : dataSourceNames )
|
||||
{
|
||||
if ( !foundDataSource && searcher.exactMatch( ds ) )
|
||||
if ( !foundDataSource && searcher.match( ds ).hasMatch() )
|
||||
{
|
||||
dataSourceFilters.push_back( s );
|
||||
foundDataSource = true;
|
||||
@ -166,13 +167,14 @@ std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryEnsemble*>>
|
||||
|
||||
for ( const auto& dsFilter : dataSourceFilters )
|
||||
{
|
||||
QString searchString = dsFilter.left( dsFilter.indexOf( ':' ) );
|
||||
QRegExp searcher( searchString, Qt::CaseInsensitive, QRegExp::WildcardUnix );
|
||||
QString searchString = dsFilter.left( dsFilter.indexOf( ':' ) );
|
||||
QString regexPattern = QRegularExpression::wildcardToRegularExpression( searchString );
|
||||
QRegularExpression searcher( regexPattern, QRegularExpression::CaseInsensitiveOption );
|
||||
|
||||
for ( const auto& ensemble : allEnsembles )
|
||||
{
|
||||
auto ensembleName = ensemble->name();
|
||||
if ( searcher.exactMatch( ensembleName ) )
|
||||
if ( searcher.match( ensembleName ).hasMatch() )
|
||||
{
|
||||
if ( searchString == dsFilter )
|
||||
{
|
||||
@ -184,13 +186,14 @@ std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryEnsemble*>>
|
||||
{
|
||||
// Match on subset of realisations in ensemble
|
||||
|
||||
QString realizationSearchString = dsFilter.right( dsFilter.size() - dsFilter.indexOf( ':' ) - 1 );
|
||||
QRegExp realizationSearcher( realizationSearchString, Qt::CaseInsensitive, QRegExp::WildcardUnix );
|
||||
QString realizationSearchString = dsFilter.right( dsFilter.size() - dsFilter.indexOf( ':' ) - 1 );
|
||||
QString regexPattern = QRegularExpression::wildcardToRegularExpression( realizationSearchString );
|
||||
QRegularExpression realizationSearcher( regexPattern, QRegularExpression::CaseInsensitiveOption );
|
||||
|
||||
for ( const auto& summaryCase : ensemble->allSummaryCases() )
|
||||
{
|
||||
auto realizationName = summaryCase->displayCaseName();
|
||||
if ( realizationSearcher.exactMatch( realizationName ) )
|
||||
if ( realizationSearcher.match( realizationName ).hasMatch() )
|
||||
{
|
||||
matchingSummaryCases.push_back( summaryCase );
|
||||
}
|
||||
@ -202,7 +205,7 @@ std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryEnsemble*>>
|
||||
for ( const auto& summaryCase : allSummaryCases )
|
||||
{
|
||||
auto summaryCaseName = summaryCase->displayCaseName();
|
||||
if ( searcher.exactMatch( summaryCaseName ) )
|
||||
if ( searcher.match( summaryCaseName ).hasMatch() )
|
||||
{
|
||||
matchingSummaryCases.push_back( summaryCase );
|
||||
}
|
||||
@ -217,7 +220,7 @@ std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryEnsemble*>>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RiaSummaryStringTools::splitIntoWords( const QString& text )
|
||||
{
|
||||
return RiaTextStringTools::splitSkipEmptyParts( text, QRegExp( "\\s+" ) );
|
||||
return RiaTextStringTools::splitSkipEmptyParts( text );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
@ -16,7 +16,7 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaTimeHistoryCurveResampler.h"
|
||||
@ -100,7 +100,7 @@ void RiaSummaryTools::notifyCalculatedCurveNameHasChanged( int calculationId, co
|
||||
if ( adr.isCalculated() && adr.id() == calculationId )
|
||||
{
|
||||
adr.setVectorName( currentCurveName.toStdString() );
|
||||
curve->setSummaryAddressYAndApplyInterpolation( adr );
|
||||
curve->setSummaryAddressY( adr );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -430,3 +430,15 @@ void RiaSummaryTools::reloadSummaryEnsemble( RimSummaryEnsemble* ensemble )
|
||||
multiPlot->updatePlotTitles();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
time_t RiaSummaryTools::calculateTimeThreshold( const time_t& minimum, const time_t& maximum )
|
||||
{
|
||||
// The cutoff time is the time where the time step is less than 1% of the total time range
|
||||
const auto epsilon = 0.01;
|
||||
const auto timeThreshold = maximum - ( maximum - minimum ) * epsilon;
|
||||
|
||||
return timeThreshold;
|
||||
}
|
@ -97,6 +97,8 @@ public:
|
||||
static void reloadSummaryCase( RimSummaryCase* summaryCase );
|
||||
static void reloadSummaryEnsemble( RimSummaryEnsemble* ensemble );
|
||||
|
||||
static time_t calculateTimeThreshold( const time_t& minimum, const time_t& maximum );
|
||||
|
||||
private:
|
||||
static void updateRequiredCalculatedCurves( RimSummaryCase* sourceSummaryCase );
|
||||
static bool isCalculationRequired( const RimUserDefinedCalculation* summaryCalculation, const RimSummaryCase* summaryCase );
|
@ -23,41 +23,36 @@ option(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS
|
||||
"Treat warnings as errors (stops build)" OFF
|
||||
)
|
||||
|
||||
find_package(Qt5 ${RI_QT_MINIMUM_VERSION} COMPONENTS Core)
|
||||
|
||||
if(Qt5Core_FOUND)
|
||||
find_package(
|
||||
Qt5 ${RI_QT_MINIMUM_VERSION}
|
||||
COMPONENTS Core
|
||||
Gui
|
||||
OpenGL
|
||||
Network
|
||||
NetworkAuth
|
||||
Widgets
|
||||
Xml
|
||||
Concurrent
|
||||
PrintSupport
|
||||
Svg
|
||||
Sql
|
||||
OPTIONAL_COMPONENTS Charts
|
||||
)
|
||||
set(QT_LIBRARIES
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt5::NetworkAuth
|
||||
Qt5::OpenGL
|
||||
Qt5::Widgets
|
||||
Qt5::Xml
|
||||
Qt5::Concurrent
|
||||
Qt5::PrintSupport
|
||||
Qt5::Svg
|
||||
Qt5::Sql
|
||||
)
|
||||
if(Qt5Charts_FOUND)
|
||||
list(APPEND QT_LIBRARIES Qt5::Charts)
|
||||
endif(Qt5Charts_FOUND)
|
||||
endif(Qt5Core_FOUND)
|
||||
find_package(
|
||||
Qt6
|
||||
COMPONENTS Core
|
||||
Gui
|
||||
OpenGL
|
||||
Network
|
||||
NetworkAuth
|
||||
Widgets
|
||||
Xml
|
||||
Concurrent
|
||||
PrintSupport
|
||||
Svg
|
||||
Sql
|
||||
OPTIONAL_COMPONENTS Charts
|
||||
)
|
||||
set(QT_LIBRARIES
|
||||
Qt6::Core
|
||||
Qt6::Gui
|
||||
Qt6::OpenGL
|
||||
Qt6::Network
|
||||
Qt6::NetworkAuth
|
||||
Qt6::Widgets
|
||||
Qt6::Xml
|
||||
Qt6::Concurrent
|
||||
Qt6::PrintSupport
|
||||
Qt6::Svg
|
||||
Qt6::Sql
|
||||
Qt6::Charts
|
||||
)
|
||||
qt_standard_project_setup()
|
||||
|
||||
if(RESINSIGHT_GRPC_PYTHON_EXECUTABLE)
|
||||
set(Python3_EXECUTABLE ${RESINSIGHT_GRPC_PYTHON_EXECUTABLE})
|
||||
@ -94,11 +89,13 @@ list(
|
||||
Application/Tools/CMakeLists_files.cmake
|
||||
Application/Tools/WellPathTools/CMakeLists_files.cmake
|
||||
Application/Tools/Cloud/CMakeLists_files.cmake
|
||||
Application/Tools/Summary/CMakeLists_files.cmake
|
||||
ReservoirDataModel/CMakeLists_files.cmake
|
||||
ReservoirDataModel/CMakeLists_filesNotToUnitTest.cmake
|
||||
ReservoirDataModel/Completions/CMakeLists_files.cmake
|
||||
ReservoirDataModel/ResultAccessors/CMakeLists_files.cmake
|
||||
ReservoirDataModel/ResultCalculators/CMakeLists_files.cmake
|
||||
ReservoirDataModel/Well/CMakeLists_files.cmake
|
||||
FileInterface/CMakeLists_files.cmake
|
||||
ProjectDataModel/CMakeLists_files.cmake
|
||||
ProjectDataModel/AnalysisPlots/CMakeLists_files.cmake
|
||||
@ -131,6 +128,7 @@ list(
|
||||
ProjectDataModelCommands/CMakeLists_files.cmake
|
||||
ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake
|
||||
ProjectDataModel/VerticalFlowPerformance/CMakeLists_files.cmake
|
||||
ProjectDataModel/QuickAccess/CMakeLists_files.cmake
|
||||
GeoMech/GeoMechVisualization/CMakeLists_files.cmake
|
||||
ModelVisualization/CMakeLists_files.cmake
|
||||
ModelVisualization/Faults/CMakeLists_files.cmake
|
||||
@ -218,26 +216,15 @@ if(RESINSIGHT_FOUND_HDF5)
|
||||
|
||||
endif()
|
||||
|
||||
# ##############################################################################
|
||||
# Qt specifics: Moc, ui, resources
|
||||
# ##############################################################################
|
||||
|
||||
set(QT_MOC_HEADERS
|
||||
${QT_MOC_HEADERS} ProjectDataModel/RimMimeData.h
|
||||
ProjectDataModel/Intersections/RimBoxIntersection.h
|
||||
SocketInterface/RiaSocketServer.h
|
||||
)
|
||||
|
||||
qt5_wrap_cpp(MOC_SOURCE_FILES ${QT_MOC_HEADERS})
|
||||
qt5_wrap_ui(FORM_FILES_CPP ${QT_UI_FILES})
|
||||
|
||||
# ##############################################################################
|
||||
# Create source groups - see also included CMakeLists_files.cmake
|
||||
# ##############################################################################
|
||||
source_group("ModelVisualization" FILES ${MODEL_VISUALIZATION_FILES})
|
||||
|
||||
qt_add_resources(QRC_FILES Application/Resources/ApplicationLibCode.qrc)
|
||||
|
||||
list(APPEND ALL_SOURCE_FILES ${CPP_SOURCES} ${MOC_SOURCE_FILES}
|
||||
${FORM_FILES_CPP}
|
||||
${FORM_FILES_CPP} ${QRC_FILES}
|
||||
)
|
||||
|
||||
add_library(${PROJECT_NAME} OBJECT ${ALL_SOURCE_FILES})
|
||||
@ -267,6 +254,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
-Wno-call-to-pure-virtual-from-ctor-dtor
|
||||
-Wno-delete-non-abstract-non-virtual-dtor
|
||||
-Wno-ambiguous-reversed-operator
|
||||
-Wno-deprecated-declarations
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -292,13 +280,6 @@ if(MSVC)
|
||||
|
||||
message(STATUS "CMAKE_CXX_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}")
|
||||
|
||||
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
|
||||
# local function has been removed
|
||||
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4505")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 19.38)
|
||||
# https://github.com/OPM/ResInsight/issues/10844
|
||||
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4996")
|
||||
@ -411,9 +392,13 @@ set(UNITY_EXCLUDE_FILES
|
||||
qrc_cafAnimControl.cpp
|
||||
qrc_ResInsight.cpp
|
||||
qrc_cafCommandFeatures.cpp
|
||||
qrc_ApplicationLibCode.cpp
|
||||
# Exclude files including opm-common
|
||||
ProjectDataModel/RimVfpTableExtractor.cpp
|
||||
ProjectDataModel/RimVfpPlot.cpp
|
||||
# Exclude moc files as they cause template instanciation issues
|
||||
# https://cmake.org/cmake/help/latest/prop_tgt/AUTOGEN_BUILD_DIR.html
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_autogen/mocs_compilation.cpp
|
||||
ProjectDataModel/RiaOpmParserTools.cpp
|
||||
FileInterface/RifOsduWellPathReader.cpp
|
||||
FileInterface/RifOsduWellLogReader.cpp
|
||||
@ -421,6 +406,8 @@ set(UNITY_EXCLUDE_FILES
|
||||
FileInterface/RifArrowTools.cpp
|
||||
)
|
||||
|
||||
message("Files excluded from UNITY_BUILD : ${UNITY_EXCLUDE_FILES}")
|
||||
|
||||
if(RESINSIGHT_ENABLE_UNITY_BUILD)
|
||||
foreach(fileToExclude ${UNITY_EXCLUDE_FILES})
|
||||
set_source_files_properties(
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
#include "ExportCommands/RicLgrSplitType.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
class RimWellPath;
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
#include "ExportCommands/RicLgrSplitType.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
class RimWellPath;
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
#include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
//==================================================================================================
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
#include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
//==================================================================================================
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include "RicfCommandObject.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
class RimWellPath;
|
||||
|
@ -62,6 +62,12 @@ void RicExitApplicationFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
app->mainPlotWindow()->close();
|
||||
}
|
||||
|
||||
// This was required after moving to Qt6, causing the application not to shut down properly, and ghost processes remains after a forced
|
||||
// shutdown. The slot onLastWindowClosed() configured in RiaGuiApplication::RiaGuiApplication is never called. Testing with
|
||||
// processEvents() had no effect.
|
||||
app->closeProject();
|
||||
app->quit();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -6,6 +6,22 @@ if(RESINSIGHT_ENABLE_UNITY_BUILD)
|
||||
set(CMAKE_UNITY_BUILD true)
|
||||
endif()
|
||||
|
||||
set(UNITY_EXCLUDE_FILES
|
||||
# Exclude moc files as they cause template instanciation issues
|
||||
# https://cmake.org/cmake/help/latest/prop_tgt/AUTOGEN_BUILD_DIR.html
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_autogen/mocs_compilation.cpp
|
||||
)
|
||||
|
||||
message("Files excluded from UNITY_BUILD : ${UNITY_EXCLUDE_FILES}")
|
||||
|
||||
if(RESINSIGHT_ENABLE_UNITY_BUILD)
|
||||
foreach(fileToExclude ${UNITY_EXCLUDE_FILES})
|
||||
set_source_files_properties(
|
||||
${fileToExclude} PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE
|
||||
)
|
||||
endforeach(fileToExclude)
|
||||
endif()
|
||||
|
||||
set(COMMAND_REFERENCED_CMAKE_FILES
|
||||
CMakeLists_files.cmake
|
||||
AnalysisPlotCommands/CMakeLists_files.cmake
|
||||
@ -30,7 +46,7 @@ set(COMMAND_REFERENCED_CMAKE_FILES
|
||||
OctaveScriptCommands/CMakeLists_files.cmake
|
||||
OperationsUsingObjReferences/CMakeLists_files.cmake
|
||||
SummaryPlotCommands/CMakeLists_files.cmake
|
||||
OsduImportCommands/CMakeLists_files.cmake
|
||||
OsduCommands/CMakeLists_files.cmake
|
||||
StreamlineCommands/CMakeLists_files.cmake
|
||||
SurfaceCommands/CMakeLists_files.cmake
|
||||
SeismicCommands/CMakeLists_files.cmake
|
||||
@ -43,6 +59,7 @@ set(COMMAND_REFERENCED_CMAKE_FILES
|
||||
PlotBuilderCommands/CMakeLists_files.cmake
|
||||
PolygonCommands/CMakeLists_files.cmake
|
||||
Sumo/CMakeLists_files.cmake
|
||||
ToolCommands/CMakeLists_files.cmake
|
||||
)
|
||||
|
||||
# Include source file lists from *.cmake files
|
||||
@ -52,9 +69,6 @@ endforeach(referencedfile)
|
||||
|
||||
find_package(Eigen3 REQUIRED)
|
||||
|
||||
# Prefix files with COMMAND_ to avoid clash with application global lists
|
||||
qt5_wrap_cpp(COMMAND_MOC_SOURCE_FILES ${COMMAND_QT_MOC_HEADERS})
|
||||
|
||||
add_library(
|
||||
${PROJECT_NAME} OBJECT
|
||||
${COMMAND_CODE_SOURCE_FILES} ${COMMAND_CODE_HEADER_FILES}
|
||||
@ -82,9 +96,14 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
-Wno-call-to-pure-virtual-from-ctor-dtor
|
||||
-Wno-delete-non-abstract-non-virtual-dtor
|
||||
-Wno-ambiguous-reversed-operator
|
||||
-Wno-deprecated-declarations
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_compile_options(Commands PRIVATE -Wno-deprecated-declarations)
|
||||
endif()
|
||||
|
||||
if(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS)
|
||||
if(MSVC)
|
||||
target_compile_options(Commands PRIVATE /WX)
|
||||
@ -105,13 +124,6 @@ if(MSVC)
|
||||
|
||||
set(BUILD_FLAGS_FOR_MSVC "/W3 /wd4190 /wd4100 /wd4127")
|
||||
|
||||
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
|
||||
# local function has been removed
|
||||
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4505")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 19.38)
|
||||
# https://github.com/OPM/ResInsight/issues/10844
|
||||
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4996")
|
||||
|
@ -96,6 +96,8 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicImportWellLogCsvFileFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewViewForGridEnsembleFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomVfpPlotFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellTargetCandidatesGeneratorFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewStatisticsContourMapFeature.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -196,6 +198,8 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicImportWellLogOsduFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewViewForGridEnsembleFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomVfpPlotFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellTargetCandidatesGeneratorFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewStatisticsContourMapFeature.cpp
|
||||
)
|
||||
|
||||
if(RESINSIGHT_USE_QT_CHARTS)
|
||||
|
@ -37,6 +37,14 @@
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicNewPolygonFilterFeature, "RicNewPolygonFilterFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicNewPolygonFilterFeature::RicNewPolygonFilterFeature()
|
||||
: RicBasicPolygonFeature( true /*multiselect*/ )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -50,7 +58,6 @@ void RicNewPolygonFilterFeature::onActionTriggered( bool isChecked )
|
||||
}
|
||||
|
||||
auto cellFilterCollection = caf::SelectionManager::instance()->selectedItemOfType<RimCellFilterCollection>();
|
||||
|
||||
if ( !cellFilterCollection )
|
||||
{
|
||||
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
|
||||
@ -59,31 +66,40 @@ void RicNewPolygonFilterFeature::onActionTriggered( bool isChecked )
|
||||
cellFilterCollection = activeView->cellFilterCollection();
|
||||
}
|
||||
}
|
||||
|
||||
if ( !cellFilterCollection ) return;
|
||||
|
||||
if ( !polygonDataSource )
|
||||
{
|
||||
auto selectedPolygon = caf::SelectionManager::instance()->selectedItemOfType<RimPolygon>();
|
||||
if ( !selectedPolygon )
|
||||
{
|
||||
if ( auto polygonInView = caf::SelectionManager::instance()->selectedItemOfType<RimPolygonInView>() )
|
||||
{
|
||||
selectedPolygon = polygonInView->polygon();
|
||||
}
|
||||
}
|
||||
auto sourceCase = cellFilterCollection->firstAncestorOrThisOfTypeAsserted<Rim3dView>()->ownerCase();
|
||||
if ( !sourceCase ) return;
|
||||
|
||||
polygonDataSource = selectedPolygon;
|
||||
std::vector<RimPolygon*> polygons;
|
||||
|
||||
if ( polygonDataSource )
|
||||
{
|
||||
polygons.push_back( polygonDataSource );
|
||||
}
|
||||
else
|
||||
{
|
||||
polygons = selectedPolygons();
|
||||
}
|
||||
|
||||
auto sourceCase = cellFilterCollection->firstAncestorOrThisOfTypeAsserted<Rim3dView>()->ownerCase();
|
||||
if ( sourceCase )
|
||||
RimPolygonFilter* lastItem = nullptr;
|
||||
|
||||
if ( polygons.empty() )
|
||||
{
|
||||
if ( auto lastCreatedOrUpdated = cellFilterCollection->addNewPolygonFilter( sourceCase, polygonDataSource ) )
|
||||
lastItem = cellFilterCollection->addNewPolygonFilter( sourceCase, nullptr );
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( auto polygon : polygons )
|
||||
{
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( lastCreatedOrUpdated );
|
||||
lastItem = cellFilterCollection->addNewPolygonFilter( sourceCase, polygon );
|
||||
}
|
||||
}
|
||||
|
||||
if ( lastItem )
|
||||
{
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( lastItem );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -94,3 +110,11 @@ void RicNewPolygonFilterFeature::setupActionLook( QAction* actionToSetup )
|
||||
actionToSetup->setIcon( QIcon( ":/CellFilter_Polygon.png" ) );
|
||||
actionToSetup->setText( "User Defined Polygon Filter" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewPolygonFilterFeature::isCommandEnabled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -18,16 +18,20 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "PolygonCommands/RicBasicPolygonFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewPolygonFilterFeature : public caf::CmdFeature
|
||||
class RicNewPolygonFilterFeature : public RicBasicPolygonFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RicNewPolygonFilterFeature();
|
||||
|
||||
protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
bool isCommandEnabled() const override;
|
||||
};
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "ExportCommands/RicExportSelectedWellPathsFeature.h"
|
||||
#include "ExportCommands/RicExportWellPathsUi.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
|
||||
#include "RimFishbones.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimFishbones.h"
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "RimPlotCurveAppearance.h"
|
||||
#include "WellLogCommands/RicNewWellLogPlotFeatureImpl.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
|
||||
#include "RimColorLegend.h"
|
||||
#include "RimColorLegendCollection.h"
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
|
@ -23,8 +23,8 @@
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RigEclipseResultAddress.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
@ -57,12 +57,12 @@
|
||||
#include "RigFractureTransmissibilityEquations.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigSimWellData.h"
|
||||
#include "RigSimulationWellCoordsAndMD.h"
|
||||
#include "RigTransmissibilityCondenser.h"
|
||||
#include "RigTransmissibilityEquations.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathStimplanIntersector.h"
|
||||
#include "Well/RigSimWellData.h"
|
||||
#include "Well/RigSimulationWellCoordsAndMD.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
|
||||
#include "cvfGeometryTools.h"
|
||||
#include "cvfPlane.h"
|
||||
|
@ -30,9 +30,9 @@
|
||||
#include "RigCompletionData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigWellLogExtractor.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathIntersectionTools.h"
|
||||
#include "Well/RigWellLogExtractor.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
#include "Well/RigWellPathIntersectionTools.h"
|
||||
|
||||
#include "RimFishbones.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "RimMswCompletionParameters.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
|
||||
#include "RimMswCompletionParameters.h"
|
||||
#include "RimWellPath.h" // TODO: Consider adding wellnameforexport to RicMswExportInfo to avoid these includes
|
||||
|
@ -47,10 +47,10 @@
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigTransmissibilityEquations.h"
|
||||
#include "RigVirtualPerforationTransmissibilities.h"
|
||||
#include "RigWellLogExtractionTools.h"
|
||||
#include "RigWellLogExtractor.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathIntersectionTools.h"
|
||||
#include "Well/RigWellLogExtractionTools.h"
|
||||
#include "Well/RigWellLogExtractor.h"
|
||||
#include "Well/RigWellPath.h"
|
||||
#include "Well/RigWellPathIntersectionTools.h"
|
||||
|
||||
#include "RimFileWellPath.h"
|
||||
#include "RimFishbones.h"
|
||||
|