Commit Graph
240 Commits
Author SHA1 Message Date
Magne Sjaastad 064ac45da0 ResInsight: Migrate project data model to attribute map 2026-10-17 13:23:22 +02:00
magnesj 36f649b8ad Fixes by clang-format 2026-10-15 18:05:59 +02:00
Magne Sjaastad 3fea49441d Use consistent formation colors in RFT plots based on formations file order
Palette colors for formations missing from the legend were assigned by position in the per-well zone list, so the same formation could get different colors for different wells. Assign them by order of first appearance in the formations file instead.
2026-10-15 18:01:46 +02:00
Magne Sjaastad c57864df51 #14889: RFT Ensemble: Additional UI fixes
* #14889: Do not change main window when importing well picks
* #14889: Fix clipped bottom of plots in dock windows
* #14889: Add Create RFT Correlation Report to Ensemble Correlation Plots menu
* #14889: Show imported observed FMU RFT data as table
* #14889: Use time step from source RFT plot in RFT correlation report
* #14889: Show observed data in RFT cross plot when no RFT samples are available
* #14889: Keep RFT plot zoom when toggling formation in RFT correlation report
* #14889: Do not change main window when importing formations
* #14889: Use general delete for observed data and improve FMU RFT data name
2026-10-12 18:50:57 +02:00
Magne Sjaastad 41735344c0 #14897: Fix crash when updating track annotations before the plot widget exists
RimWellRftPlot::updateFormationsOnPlot() runs during project load, before the track widgets are created. Skip the annotation update until the widget exists; onLoadDataAndUpdate() draws them later.

Fixes #14897.
2026-10-12 12:16:10 +02:00
Magne Sjaastad 5812826db6 #14880: RFT correlation plot formation workflow
* Add Add Well Picks button to well log formation settings
* Expose formation zone colors and shading alpha from RFT track
* Average observed pressures per formation with full min/max range
* Show formation-colored observed pressure and depth filter in RFT correlation plots
* Default new RFT correlation plots to formation filter and ensemble parameter coloring
* Move Qwt code out of RFT correlation Rim classes
* Align RFT correlation depth filter bars and click zones with displayed track formations
2026-10-08 17:32:23 +02:00
Magne Sjaastad bc62af3bb5 #14878: Fix stale well picks, import errors and overlapping zones 2026-10-08 12:44:14 +02:00
Magne Sjaastad 029759f548 #14878: Guard against deleted formations collection and missing geometry 2026-10-08 12:44:14 +02:00
Magne Sjaastad 45814555b5 #14878: Add Well Picks (no trajectory) formation source for well log tracks and RFT
New Zonation/Formation Names source WELL_PICKS_NO_TRAJECTORY resolves zone
depths directly from a well-picks file + well name, for tracks without a well
path (e.g. RFT plots without a trajectory). Kept strictly separate from the
existing WELL_PICK_FILTER (well-path-based) source so neither falls back into
the other's resolution path. RFT plots automatically select this source when
no well path exists but a matching well-picks file is found.

Also avoids including RiaWellLogTrackDefines.h from header files; the affected
headers now use opaque enum forward declarations, with the real definitions
included only in the .cpp files that need the enumerator values.
2026-10-08 12:44:14 +02:00
Magne Sjaastad cf36012cd2 Modernize well pick reader and RigWellPathFormations, add tests
Return values instead of out-parameters, and move the error dialog
from the reader to the importer so the reader can be unit tested.
Fix crash in level detection when erasing while iterating.
2026-10-07 13:37:23 +02:00
Magne Sjaastad 91e2e4d575 Make RigWellPathFormations a value type
The object is immutable after construction and small, so reference
counting via cvf::Object adds nothing. Store it by value and use
std::optional where it may be absent.
2026-10-07 13:37:23 +02:00
Magne Sjaastad b35b481ff1 Extract RFT cross plot static helpers into RimRftCrossPlotTools, add unit tests
- Move depthTypeAbbreviation(), computePressureSamplesPerCase() and
  computeMeanPressurePerCase() out of RimParameterRftCrossPlot into a new
  standalone RimRftCrossPlotTools namespace, shared by RimParameterRftCrossPlot
  and RimRftTornadoPlot (removing duplicated code in the latter).
- Extract pure, reader-independent helpers filterPressuresByDepthRange() and
  computeMean() so the depth filtering and averaging logic can be unit tested
  without RFT reader/ensemble mocks.
- Add RimRftCrossPlotTools-Test.cpp with gtest cases covering depth range
  filtering (disabled, inclusive bounds, out-of-range, mismatched sizes) and
  mean computation (empty/normal), plus depth type abbreviation.

Move RimWellLogRftCurve::rftCurveDepthValues into RimRftCrossPlotTools

This static helper's only caller was already RimRftCrossPlotTools::computePressureSamplesPerCase, so move it alongside the other RFT cross plot/tornado plot helpers for consistency.
2026-10-06 11:18:06 +02:00
Magne Sjaastad 07b82a52a9 Support MD and TVD depth filtering in RFT cross plot and tornado plot
Propagates the Depth Unit selection from RimRftCorrelationReportPlot to the parameter cross plot and tornado plot depth-range filters, not just the RFT pressure profile sub-plot.

- RimWellLogRftCurve::rftCurveDepthValues now takes a RiaDefines::DepthType parameter and fetches the TVD channel directly when TVD is requested (falling back to MD if unavailable), instead of always preferring MD.
- RimParameterRftCrossPlot and RimRftTornadoPlot gain a depth type field (driven by the parent report plot, hidden in their own UI) and computeMeanPressurePerCase() takes the depth type so the depth-range filter operates on the selected unit.
- Axis labels, group titles, and auto-generated plot titles now show MD/TVD instead of being hardcoded to MD.

Stop silently substituting TVD for MD (or vice versa) in RFT correlation depth filter

rftCurveDepthValues() previously fell back to the other depth type when the requested one (MD or TVD) had no data, causing MD and TVD selections to silently produce identical results. Now it strictly returns only the requested depth type, returning an empty vector if unavailable. This naturally excludes such cases from the correlation cross plot and tornado plot, showing a blank plot instead of misleading data.
2026-10-06 11:18:06 +02:00
Magne Sjaastad 3437cf9b94 #14778 Fix crashes from unguarded pointer and index accesses
* Skip deleted plot widgets in RiuMultiPlotBook::visiblePlotWidgets
* Guard missing calculation in detectCyclicCalculation
* Guard invalid node index in RigFemPart node lookups
* Guard null well path in RimWellLogExtractionCurve::extractGeomData
* Guard unopened case in RimGridCalculation::removeDependentObjects
* Guard empty subset in createLateralAtMeasuredDepth
2026-09-22 08:23:00 +02:00
Magne Sjaastad 1c4c304064 #14476 ApplicationLibCode: Remove unused cvf includes
Remove 95 cvf include lines that the including file does not use. Found by
extracting the symbols declared by every VizFwk header, including symbols they
re-export, and flagging includes where none of those symbols appear anywhere in
the file. Each removal is verified by a full build.

Most of them are cvfVector3.h and cvfObject.h, left behind as the files they
were once needed by changed.

pch.h is left untouched. It includes cvfObject.h and cvfVector3.h on purpose, so
that the files using the precompiled header do not have to.

Note that a clean build after removing an include does not prove the include was
unnecessary, only that the declarations still arrive some other way. That path
can differ between platforms and with RESINSIGHT_ENABLE_UNITY_BUILD, so this
needs a CI round on Linux as well.
2026-08-07 15:05:57 +02:00
Magne Sjaastad 56e98ba1c4 #14476 ApplicationLibCode: Replace CVF_ASSERT with CAF_ASSERT
Migrate all assert macros in ApplicationLibCode to CAF_ASSERT and remove every
use of cvfAssert.h.

CVF_ASSERT is replaced one to one. CVF_TIGHT_ASSERT is also replaced by
CAF_ASSERT, which is semantically exact: CVF_ENABLE_TIGHT_ASSERTS is 1 only
under _DEBUG, and that is what CAF_ASSERT now does. The two CVF_FAIL_MSG sites
become CAF_ASSERT( false && "message" ), preserving the message with the idiom
already used elsewhere in the code base.

Counts before and after: CVF_ASSERT 1044 to 0, CVF_TIGHT_ASSERT 66 to 0,
CVF_FAIL_MSG 2 to 0, cvfAssert.h references 154 to 0.

Include handling: files that included cvfAssert.h directly now include
cafAssert.h instead, includes left dead by the migration are removed, and files
that were relying on cvfAssert.h transitively get an explicit cafAssert.h. Files
that reach cafAssert.h through another caf header are left unchanged; a missing
include here is a compile error, not a silently disabled assert.

ResultStatisticsCache links only LibCore and therefore had no path to
cafAssert.h. Add the cafPdmCore directory as a private include path rather than
linking the library, since cafAssert.h is header only.

Note that this stops these asserts from firing in Release and RelWithDebInfo,
where CVF_ASSERT was previously active.
2026-08-07 15:05:57 +02:00
Magne Sjaastad 2ac1948abe #14245 Remove gsl functions and ThirdParty/gsl folder 2026-06-24 18:47:04 +02:00
Kristian Bendiksen 8209bd3ecf #14230 Fix deadlock when importing wells from OSDU
The GUI thread deadlocked on a non-recursive QMutex during OSDU well
import. The download-completion slots and DataLoadController::onTaskFinished
held a mutex while triggering progress updates, which call
QApplication::processEvents(). That re-enters the event loop and dispatches
another queued parquet-download-complete event for a different well, whose
handler then blocks trying to lock the same mutex.

Release the mutex before emitting taskDone in the OSDU well path and well
log data loaders, and before calling incrementProgress() in onTaskFinished.
The map access that the mutex protects stays inside the locked scope; the
captured ProgressInfo outlives the call (kept alive by blockUntilDone) and
incrementProgress() is thread-safe via self-marshaling to the GUI thread.

Fixes #14230.
2026-06-18 07:55:04 +02:00
Magne Sjaastad 071d6cc19e #14050 CMake: Remove dead variable definitions and references
* CMake: Remove dead CODE_HEADER_FILES variable
* CMake: Remove dead COMMAND_CODE_HEADER_FILES and COMMAND_MOC_SOURCE_FILES
* CMake: Remove dead MOC_SOURCE_FILES and FORM_FILES_CPP references
* CMake: Remove dead HEADER_FILES reference
* CMake: Delete unused CustomPCH.cmake superseded by target_precompile_headers
2026-05-26 13:10:20 +02:00
Kristian Bendiksen 2fa7520b3a Refactor: forward-declare element type in collection headers
Move the element-type include from each migrated collection header into
its .cpp, leaving only a forward declaration in the header. Follows the
pattern from 9e4d79159 for RimJobCollection, made possible by the
constructor-time PdmObject base check.
2026-05-11 13:42:13 +02:00
Kristian Bendiksen 5e880ffc26 Refactor: migrate fourteen more collections to caf::PdmObjectCollection<T>
Migrated to the templated base, preserving each collection's existing XML
field keyword for project-file backward compatibility:

- RimEnsembleFractureStatisticsCollection
- RimEclipseInputPropertyCollection
- RimPlotDataFilterCollection
- RimGeoMechContourMapViewCollection
- RimIntersectionResultsDefinitionCollection
- RimCustomObjectiveFunctionCollection
- RimStimPlanModelTemplateCollection
- RimEnsembleWellLogsCollection
- RimEclipseContourMapViewCollection
- RimSeismicViewCollection
- RimGridInfoCollection
- RimEclipseStatisticsCaseCollection
- RimWellIASettingsCollection
- RimVfpDataCollection

External callers that accessed the old public/named array fields directly
(RimEclipseInputPropertyCollection::inputProperties,
RimEclipseStatisticsCaseCollection::cases) now use addItem/items() from
the base. RimCustomObjectiveFunction.h replaced its include of the
collection header with a forward declaration to break the new include
cycle introduced by the migration.
2026-05-11 13:42:13 +02:00
Kristian Bendiksen 5ffcb69acc #13126 RiaLogging: Use std::string_view instead of QString for logging 2026-05-08 10:11:09 +02:00
Magne Sjaastad 42a11da26b Correlation: Sync depth range to tornado and use RFT curve depth values for filtering 2026-04-29 10:16:24 +02:00
Magne Sjaastad 8eb225651b Remove obsolete libecl-based RifReaderEclipseRft, use RifReaderOpmRft only 2026-04-28 12:32:21 +02:00
Kristian Bendiksen 2d88be506d #13908 Python: Add API to read well log information
Expose well logs attached to a well path through the Python API. A new
`well_path.well_logs()` returns the list of well logs, and each
`WellLog` gains `channel_names()` and `well_log_data()` for reading
channel names, measured depth, optional TVD MSL/RKB, and channel
values.

The read methods are registered on the abstract `RimWellLog` base
class and use the common `RigWellLogData` interface so they work for
imported, LAS and OSDU well logs alike.
2026-04-23 19:50:05 +02:00
Magne Sjaastad bc7341bcd0 #13872 WellLog: Fix crash when deleting ensemble well log curve sets
Detach m_qwtPlotCurveForLegendText before the viewer check so it is
always detached before deletion. Add null check for curves in
detachPlotCurves, and explicitly call detachPlotCurves from
RimWellLogTrack::detachAllPlotItems to ensure curves are detached
before the track is destroyed.
2026-04-16 16:43:36 +02:00
Magne Sjaastad ba1055fbc4 #13813 Remove duplicated snapshotWindowContent overrides that replicate base class behavior 2026-03-30 17:59:01 +02:00
Magne Sjaastad 83f667cdf8 Replace RimTools::wellPathCollection() with RimWellPathCollection::instance()
Remove the redundant wrapper function and update all call sites to use RimWellPathCollection::instance() directly.
Remove unused #include "RimTools.h" from files using RimWellPathCollection::instance() directly
2026-03-18 13:41:27 +01:00
Magne Sjaastad a73067b6ea #13727 EnsembleWellLog: Detach QwtPlotCurve before delete to avoid crash on destruction 2026-03-17 20:13:26 +01:00
Magne Sjaastad f4a14c7d28 #13727 EnsembleWellLog: Refactor LAS export to use standalone curves without dummy plots
Replace temporary RimWellLogPlot/RimWellLogTrack creation with standalone
RimWellLogExtractionCurve objects that load data and export directly via
RigLasFileExporter, eliminating the need to create and delete dummy plot objects.
2026-03-17 20:13:26 +01:00
Magne Sjaastad 8c82f834cf #13727 WellLog: Remove cvf::Object from RigWellLogCurveData, use value types throughout
- RigWellLogCurveData no longer inherits from cvf::Object; calculateResampledCurveData returns by value
- RimWellLogCurve::curveData() returns const reference instead of pointer; m_curveData stored by value
- RigLasFileExporter: replace cvf::Collection with std::vector<RigWellLogCurveData>; SingleChannelData stores RigWellLogCurveData by value
- Update all callers to use dot notation instead of pointer dereference
2026-03-17 20:13:26 +01:00
Magne Sjaastad 601a3bbb78 Refactor RigFormationNames
- Rename RifColorLegendData to RifFormationNamesReader to better reflect the
class purpose of reading formation names from .lyr files.
- Remove inheritance of cvf::Object
- Improve const correctness
2026-02-27 14:17:21 +01:00
Magne Sjaastad 1cd3cf3b67 Fix zone colors to honor LYR-file specification (#13658)
* #12974 Fix zone colors to honor LYR-file specification

- Map formation colors by name instead of palette index in updateFormationNamesOnPlot()
- Map formation colors by categoryValue lookup in updateCellResultLegend(), fixing
  incorrect colors when showOnlyVisibleCategoriesInLegend filters the active set
- Add RimColorLegendCollection::createColorLegendFromFormationNames() and call it
  from readAllFormationNames() so LYR colors are available after project load
- Auto-assign formation color legend when a formation case is set on a well log track
- Rename fileNameWoPath() to shortName() and switch to baseName() (no extension)
- Remove addCustomColorLegend() from RicImportFormationNamesFeature; logic now lives
  in RimColorLegendCollection
- Set formation legend when creating new Well Log Extraction Curve track
2026-02-25 18:16:03 +01:00
Magne Sjaastad d52f595c41 Refactor: Rename RiaStatisticsTools to RigStatisticsTools
Replaced all references to RiaStatisticsTools with RigStatisticsTools across the codebase, including header includes, static method calls, and test files. Updated CMake configuration to remove RiaStatisticsTools and add RigStatisticsTools. Renamed and updated related unit tests. No changes to logic or algorithms; this is a namespace and organizational refactor for consistency. Also added ApplicationLibCode include directories as PRIVATE to relevant targets.
2026-02-18 09:22:39 +01:00
Magne Sjaastad a2b3445692 Add support for custom percentiles in ensemble statistics
Introduced custom percentile handling for ensemble statistics:
- Added "CUSTOM" statistics type and percentile field to RifEclipseSummaryAddress
- Refactored RimEnsembleStatisticsCase to store and compute arbitrary percentiles
- RimEnsembleStatistics now parses custom percentiles from UI input
- RimEnsembleCurveSet and related interfaces updated to handle custom percentile curves and labels
- Hashing and statistics calculations now include custom percentiles for cache validity
2026-02-12 14:25:48 +01:00
Magne Sjaastad 96eabcfd96 Fixes color shading for formation annotation.
Addresses an issue where color shading for formation annotations was not working as expected due to a null color legend in `RimWellLogTrack`.

Implements a fallback mechanism to use the default legend colors when the color shading legend is not available, ensuring proper visualization of formation annotations.

Related to https://github.com/OPM/ResInsight/issues/12974
2026-02-11 11:13:00 +01:00
Magne Sjaastad 93bd0b9c9d Refactor well log track settings into modular classes
* Refactor well log track settings into modular classes

Major refactoring of RimWellLogTrack to delegate property axis, formation, region annotation, and well path attribute settings to dedicated settings classes. Introduces RimWellLogPropertyAxisSettings, RimWellLogFormationSettings, RimWellLogRegionAnnotationSettings, and RimWellLogWellPathAttributeSettings, each encapsulating related fields, UI logic, and option handling. Old fields are retained for migration and backward compatibility. Updates enums and signatures for consistency.
2026-02-09 15:33:18 +01:00
JJ 94c3059fd8 Add support for SICD valves (#13496)
* Add SICD parameters
* Add wsegsicd valves to completion export
* Add python method to read template info from valve
* Update tests
2026-01-29 11:16:05 +01:00
Magne Sjaastad ae8cc0ecad Add MSW_SEGMENT well path component type and support
Introduce MSW_SEGMENT to WellPathComponentType enum, assign DARK_CYAN color, update sorting order, and add plotting logic with column features and rectangular marker for visualization.
2026-01-20 14:13:22 +01:00
Magne Sjaastad 9851afc621 #2070 AppFwk : Disable default IO for proxy fields
Proxy fields usually reads and transforms data from other sources, usually other Pdm fields. This commit disables IO for proxy fields in the constructor. If XML serialization is required, this must be set on the proxy field, like this

field.xmlCapability()->setIOWritable(true)
field.xmlCapability()->setIOReadable(true)
2026-01-19 16:10:14 +01:00
JJ 569d4dfc93 Fix build for Qt6.10.1 and add Windows build for Qt 6.10 2025-11-28 12:36:56 +01:00
Magne Sjaastad 544e9eedd9 Improve spell checker using codespell
* Configures automated spell checking with codespell
Adds GitHub workflows and configuration files for automated spell checking using `codespell`.

This includes:
- A workflow for checking pull requests and preventing new typos
- A workflow for automatically fixing typos in the main codebase
- Configuration files for `codespell` to ignore specific terms and file types
- Documentation on how to use and configure the spell checking workflows.

* Corrects minor spelling and grammar errors.
2025-11-19 10:25:32 +01:00
Kristian Bendiksen 9326da7965 Refactor: Move updateChannelsFromWellLogData to base class RimWellLog 2025-09-04 09:04:56 +02:00
Kristian Bendiksen 160cb71168 Python: Update well log import API to accept measured depth and multiple channels
- Updated Python API to accept measured_depth list and channel_data dictionary
- Modified C++ GRPC implementation to handle CSV-formatted channel mappings
- Replaced single values parameter with dictionary of channels
- Added comprehensive validation for all input parameters
- Updated parameter name from channel_keys_json to channel_keys_csv
- Enhanced tests to cover 16 different scenarios including edge cases
- Updated example to demonstrate new dictionary-based API functionality
2025-09-04 09:04:56 +02:00
Kristian Bendiksen 8089739add Python: Add API for importing well log data
Implement comprehensive Python API for importing well log data into ResInsight
well paths using lists of float values.

Core implementation:
- RigImportedWellLogData: Data storage class inheriting from RigWellLogData
- RimImportedWellLog: Scriptable model class for Python GRPC interface
- RimcWellPath_addWellLogInternal: GRPC method using key-value store for data transfer
- well_path.add_well_log(): Python API with validation and error handling

Features:
- Simple API: well_path.add_well_log(name='LogName', values=[1.0, 2.0, 3.0])
- Comprehensive input validation and type checking
- Efficient data transfer via key-value store mechanism
- Proper error handling with cleanup on failure
- Integration with existing well path functionality

Testing:
- 10 comprehensive unit tests covering all functionality
- Validation of input types, error conditions, and edge cases
- Integration testing with well path creation

Usage example included in PythonExamples directory demonstrating
import of gamma ray, porosity, and permeability log data.
2025-09-04 09:04:56 +02:00
Magne Sjaastad 4135a743fe Release preparations
* Adds a bounds check on the node index to prevent accessing invalid memory locations.
This prevents potential crashes caused by out-of-bounds access when retrieving summary variable values.
* Updates warning message for incomplete deltas
* Plot based on a single realization from a file set ensemble is not restored correctly on project load
* Populate result addresses if no addresses are present
* Adds CNV_ (convergence) result name
* Avoid include of RiaResultNames.h in header file
2025-08-27 14:22:11 +02:00
Magne Sjaastad 546edadf35 Refactors font size handling using RimFontSizeField
Replaces direct PdmField usage for font sizes with the new
RimFontSizeField. This provides a consistent way to manage font
size options across different plot types.

The RimFontSizeField encapsulates the logic for generating font size
options based on the default plot font size from preferences. This
removes redundant code in various plot classes and ensures that font
size settings are synchronized with user preferences.
2025-08-25 12:43:36 +02:00
Magne Sjaastad 5d22c7791d Adds ensemble name to summary case options 2025-08-15 13:00:48 +02:00
Magne Sjaastad 15ce1f75aa #12604 Add appearance settings for ensemble curve sets
Introduces customizable appearance settings for curve sets in RFT plots, including color, line style, and symbols.
2025-07-24 09:54:02 +02:00
Kristian Bendiksen 0f55899ba9 #12462 Well Log Import: add support for RMS well format. 2025-07-01 08:39:18 +02:00