Commit Graph
18740 Commits
Author SHA1 Message Date
Magne Sjaastad bb17083e5e Update AppEnum QVariant conversion to use string values
AppEnum fields now convert to and from QVariant using their string (text) representation instead of integer values. This improves clarity and supports enum class types. Added a unit test to verify that QVariant conversion uses the enum's text name and that round-trip conversion restores the correct enum value.
2026-01-29 13:08:12 +01:00
Magne Sjaastad 91d84f5abd Bump to version 2025.12.1-dev.05 2026-01-29 11:31:17 +01:00
Magne Sjaastad d9c26c2c6d Improve cleanup and signal disconnection on teardown
Add explicit disconnection of signals and abort pending network replies in destructors and shutdown methods to prevent unwanted callbacks and threading issues during object destruction or shutdown. This enhances robustness and safety, especially in asynchronous and multi-threaded contexts.
2026-01-29 11:16:22 +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
jonjenssen 538cbd097c Update test data 2026-01-29 07:21:29 +01:00
jonjenssen 415ad7869e Make sure optional parameters with 0 values are treated as default values in welspecs keyword export 2026-01-29 07:21:29 +01:00
Magne Sjaastad 4ddace05fb Replaces push buttons with new UI ordering
Removes the usage of `cafPdmUiPushButtonEditor` and implements the same functionality using the `addNewButton` method in `cafPdmUiOrdering`.

This change provides a more flexible and consistent way to add buttons to the UI and simplifies the code by removing the need for a dedicated editor class.
2026-01-27 13:37:37 +01:00
Magne Sjaastad 5be1a4feb7 Replaces push buttons with addNewButton
Removes the explicit usage of PdmUiPushButtonEditor and associated fields.

Replaces these with the more flexible addNewButton function in PdmUiOrdering.
This provides a more streamlined way to add buttons to the UI.
2026-01-27 13:37:37 +01:00
Magne Sjaastad de3758cf60 Set PdmUiButton default alignment to right
Removed manual setAlignment(Qt::AlignRight) calls for UI buttons,
as PdmUiButton now defaults to right alignment. Also removed
unused cafPdmUiButton.h includes from several files.
2026-01-27 13:37:26 +01:00
Magne Sjaastad caaf799229 Refactors PdmUiFieldSpecialization implementation
* Simplifies PdmUiFieldSpecialization implementation.

Refactors the PdmUiFieldSpecialization implementation to reduce code duplication.

Introduces a base class `PdmUiFieldSpecializationForValueSpec` that delegates to `PdmValueFieldSpecialization`, avoiding boilerplate code for common types.

The primary template now inherits from the new base class, providing default behavior for types with custom `PdmValueFieldSpecialization`.

* Improve AppEnum subset handling to avoid key collisions

Refactored AppEnum to use a unique key combining owner class name and field keyword for enum subset storage, preventing collisions when different object types use the same field keyword. Updated setEnumSubset and enumSubset to accept PdmFieldHandle pointers. Added tests to verify correct and independent subset behavior across object types and handle edge cases.

* Refactor PdmValueFieldSpecialization with base helpers

Introduce base classes for default isEqual and QVariant conversion. Update specializations to inherit from these helpers, removing redundant code and centralizing default behaviors.
2026-01-26 16:53:53 +01:00
Magne Sjaastad ac594eb54e Add SurfaceColorMode setting to control surface visualization
Add a Color Mode dropdown to surfaces and surface collections that
controls how surfaces are rendered:
- Both: Show surface color and cell result colors
- Surface Color: Show only the uniform surface color
- Cell Result Colors: Show only cell results mapped to surface

Individual surfaces default to inherit from their parent collection but can override with their own setting.
2026-01-26 11:36:26 +01:00
Magne Sjaastad c6dbdf0c79 Improve organization of agent documents 2026-01-23 16:20:29 +01:00
Magne Sjaastad 30793beef2 Add --loglevel argument for command line log level control
Introduce support for setting the application's log level via a new --loglevel command line argument.
Log level is parsed early in initialization and can be set to DISABLED, ERROR, WARNING, INFO, or DEBUG (case-insensitive).
The RILogLevel enum now includes a DISABLED value.
Logger initialization in both console and GUI applications now respects the command line log level if provided, otherwise defaults to preference-based settings.

Fixes by clang-format
2026-01-23 13:31:58 +01:00
Magne Sjaastad fde113259a Use Fwk base classes for named objects and checked objects 2026-01-23 13:31:47 +01:00
Magne Sjaastad 5c9438ab04 Remove references to cafPdmUiActionPushButtonEditor 2026-01-23 13:31:34 +01:00
Magne Sjaastad b4cefd6382 Remove unused action push button 2026-01-23 13:31:34 +01:00
Magne Sjaastad c98777e9bb Lower log level for config and service init messages
Changed logging from info to debug for config imports, CAF logging, socket server, and gRPC server startup. OpenTelemetry initialization now only runs if enabled, with results logged at debug level.
2026-01-22 12:49:34 +01:00
Kristian Bendiksen 414cf1df04 #13466 Allow display of intersection bands and curves without intersection geometry
Add a "Show Intersection Geometry" checkbox to RimExtrudedCurveIntersection that
controls visibility of intersection faces and mesh lines independently from the
surface intersection bands and curves.

When unchecked, the intersection geometry is hidden but bands and curves continue
to display based on their individual checked states.

Fixes #13466.
2026-01-22 07:17:46 +01:00
Kristian Bendiksen fff6c7d64a MainWindow: hide "Ready ..." message after 5 seconds. 2026-01-22 07:17:46 +01:00
Kristian Bendiksen b77749be91 Surface Band: Fix generated surface name. 2026-01-22 07:17:46 +01:00
JJ 3e06a61ed5 Popup window placement improvements (#13464)
* Improve parent settings for message boxes and progress info
2026-01-21 19:11:41 +01:00
Jon Jenssen ef3ced9b8a Limit well path length to 100 km to avoid excessive memory usage in certain corner cases. 2026-01-21 19:10:56 +01:00
Kristian Bendiksen c368b51061 #1958 Remove unused cafPdmUiListView
Fixes #1958.
2026-01-21 12:57:42 +01:00
Kristian Bendiksen 8b13dbcef1 #12940 Fix empty vector parsing and ReadPastEnd handling for Python GRPC
- Handle empty arrays [] in std::vector<cvf::Vec3d> parser
- Only treat ReadCorruptData as error in generic template (ReadPastEnd
  is expected for types like caf::FilePath that consume all input)
- Use strict mode (allowExtraCharacters=false) for Python GRPC parsing
2026-01-21 08:41:09 +01:00
Kristian Bendiksen 6a1c74bdfc #12940 Add option to only parse in strict mode used from python 2026-01-21 08:41:09 +01:00
Kristian Bendiksen 89bfaa7fd9 #12940 Fix optional field handling for empty input in PDM scripting
Fixes cafPdmScripting_UnitTests::PdmFieldSerialization.OptionalValues test
failure where empty input for std::optional<int> and std::optional<double>
fields was incorrectly set to default values (0) instead of remaining unset.

Problem:
- Optional handler used error count to determine parsing success
- Empty stream reads set value to 0 but didn't add errors (only checked ReadCorruptData)
- Result: optional fields set to 0 instead of remaining unset

Solution:
- Modified optional handler to check for empty input before parsing
- Empty input now correctly leaves optional field unset (no error)
- Maintains strict validation for invalid input (adds error, resets optional)

Changes:
- PdmFieldScriptingCapabilityIOHandler<std::optional<T>>: Check atEnd() before parsing
- int/double handlers: Only call checkForExtraCharactersAfterValue() on success

Testing:
- All cafPdmScripting_UnitTests pass (8/8)
- All test_pdmobject_validation.py tests pass (10/10)
- Optional double fields no longer generate spurious validation errors
2026-01-21 08:41:09 +01:00
Kristian Bendiksen 4ea32ba563 #12940 Add automatic rollback on validation failure for Python GRPC
Implements automatic state restoration when field validation fails during
update(). The Python object now maintains consistency with the server state
by rolling back to the last known valid values.

- Store protobuf snapshot before update attempt
- Restore both protobuf object and Python attributes on validation failure
- Add test_validation_rollback() to verify rollback behavior
- Update bool validation test to assert automatic rollback
- Provides transaction-like semantics for field updates
2026-01-21 08:41:09 +01:00
Kristian Bendiksen d06280cca8 #12940 Strict type validation and improved Enum error handling for Python GRPC
- Implemented strict parsing in 'writeToField' handlers to reject values with trailing garbage (e.g. '100.5test' for double, '0.99' for int/enum).
- Improved 'AppEnum' validation error message to list all valid options when an invalid value is provided.
- Added new test file 'test_validation_types_issue_12940.py' verifying strict type validation for double, int, and enum fields.
2026-01-21 08:41:09 +01:00
Kristian Bendiksen 71fa7d2c26 #12940 Add validation for Python GRPC field updates with atomic rollback
Implements comprehensive type and range validation to prevent invalid data
from being set via Python GRPC interface. Invalid values are rejected with
clear error messages. Uses two-phase commit pattern to ensure atomic updates
where either all fields update or none do.

Validation Features:
- Type validation: Ensures field value types match (parsing errors caught)
- Range validation: Checks values against min/max constraints defined with
  setRange(), setMinValue(), setMaxValue()
- Object validation: Validates cross-field constraints via validate() override
- Atomic updates: Two-phase commit ensures all-or-nothing semantics
- Rollback on error: Failed validation leaves ALL fields at previous values
- Clear error messages: Aggregates and returns all validation failures

Implementation:
- Use std::expected<void, QString> for type-safe error handling (C++23)
- assignFieldValue(): Validates after parsing, rolls back individual field on error
- copyPdmObjectFromRipsToCaf(): Two-phase commit pattern
  - Phase 1: Validate all fields and collect changes (defer UI notifications)
  - Phase 2: If any validation fails, rollback all fields; otherwise commit all
- UpdateExistingPdmObject(): Returns grpc::INVALID_ARGUMENT with validation details

Testing:
- Comprehensive Python tests demonstrating validation behavior
- Test atomic rollback: multiple fields rolled back when one fails
- No regression in existing functionality

Documentation:
- Added validation documentation to CLAUDE.md with examples
- Explains how to set field ranges and handle validation errors in Python

Built on validation infrastructure from commit f342ca77 (PdmFieldHandle and
PdmObjectHandle validation support).
2026-01-21 08:41:09 +01:00
Magne Sjaastad 980fde7c23 Bump to 2025.12.1-dev.04 2026-01-20 18:37:53 +01:00
Magne Sjaastad 4b9f94efb8 Refactor depth property handling for regular surfaces
- Introduce RimRegularFileSurface::propertyName() as canonical property key for file-based surfaces.
- Change RimRegularSurface::setPropertyAsDepth() to void and remove existence check; error handling is now in updateSurfaceData().
- Update all usages to match new setPropertyAsDepth() behavior.
- Log and handle missing depth property in updateSurfaceData().
- Update tests to reflect new error handling approach.
- Minor includes and logging improvements.
2026-01-20 18:21:56 +01:00
Magne Sjaastad a6ce2b3a65 Use range-based for loop 2026-01-20 18:21:56 +01:00
Magne Sjaastad 2a129e3700 Call base addSurface explicitly in RimEnsembleSurface ctor
Explicitly invoke RimSurfaceCollection::addSurface when adding
statistic surfaces in RimEnsembleSurface's constructor. This
clarifies method resolution and ensures the correct base class
implementation is used.
2026-01-20 18:21:56 +01:00
Magne Sjaastad 5041dffb4d Refactor MSW segment scaling to use named constants
Replaced hardcoded scaling factors for MSW segment radius, marker length, and marker radius with named constants. This improves code readability and maintainability by centralizing visualization parameters for MSW segments and boundary markers.
2026-01-20 14:13:22 +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 cb9f3eb07a Add visualization and picking for MSW segments in well path
Introduce support for rendering MSW (Multi-Stage Well) segments in well path visualizations, including alternating color cylinders and boundary markers. Integrate MSW segment display into both regular and flattened geometry builders. Add picking support in the viewer: when an MSW segment is selected, display its properties (segment number, branch, MD range, diameter) and select it in the UI. Also, increase perforation visualization radius for improved clarity.
2026-01-20 14:13:22 +01:00
Magne Sjaastad 4b3ebd2a95 Add MSW segment support to well path completions/collection
Introduce MSW segment collection to RimWellPathCompletions, including UI tree integration and completion list updates. Add MSW Eclipse case and show bands fields to RimWellPathCollection, with new UI controls and update logic. Implement segment update and visualization methods, option calculation for Eclipse case selection, and update headers and includes accordingly.
2026-01-20 14:13:22 +01:00
Magne Sjaastad 0aec220869 Added note to always use parentheses when accessing field values for proper type management. 2026-01-20 14:13:22 +01:00
Magne Sjaastad d53f71ae45 Add MSW segment support for WELSEGS-based visualization
Introduce RimMswSegment and RimMswSegmentCollection classes to manage and visualize Multi-Segment Well (MSW) segments from Eclipse WELSEGS data. Update WelsegsRow to include source well name for correct segment grouping. Integrate new classes into the build system and UI, enabling accurate 3D well path representation and improved segment management in ResInsight.
2026-01-20 14:13:22 +01:00
JJ b87579961b Add support for using alias names for result names (#13453)
* Add alias editing to UI
* Enable result aliases for both eclipse and roff results
* Update python script to work on Windows
* Add Python interface for result aliases
* Add python test
2026-01-20 14:12:27 +01:00
Magne Sjaastad 303c781341 Remove cell result data API from RimEclipseView
Deleted m_cellResultData field and related methods from RimEclipseView, including UI handling and scriptable access. Also removed cell_result_data.py, eliminating direct scripting access to cell result data.

These functions are supported on a case in functions set_grid_property() and grid_property()
2026-01-20 13:50:27 +01:00
magnesj 4966a179cb Fixes by clang-format 2026-01-20 13:44:06 +01:00
Magne Sjaastad ed759bf39a Adds telemetry for gRPC command and PDM calls
Improves observability by adding telemetry events for gRPC command executions and PDM object method calls.

These events include details such as command names, status, errors,
warnings, and the class of PDM objects involved. This enhances the ability
to monitor and diagnose issues within the gRPC services.
2026-01-20 13:44:06 +01:00
Magne Sjaastad 71a90a8cb9 Enhances telemetry data with user info
Adds username hashing for privacy-preserving telemetry and includes full username for crash reports to aid debugging.
Also incorporates OS information into crash reports for better diagnostics.
2026-01-20 13:44:06 +01:00
Kristian Bendiksen d00d3f20b1 #13282 Histogram Plots: Add option for Logarithmic axis scale
Fixes #13282.
2026-01-20 11:44:01 +01:00
Kristian Bendiksen 75371d3471 #13326 Ensemble Well Target Mapping: Make polygons visible in Contour Map
Fixes #13326.
2026-01-19 18:56:39 +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
Magne Sjaastad d4a64b4033 #13402 Fixes parsing of well names with colons
Improves the parsing logic for well names in Eclipse
summary addresses, allowing well names to contain colons.

Previously, the parsing would incorrectly split well names
at colons.

Adds a unit test to verify correct parsing of well names with
colons.
2026-01-19 16:08:59 +01:00
magnesj 5ea1a34c53 Python code linting changes detected by black 2026-01-18 21:46:02 +01:00
Magne Sjaastad 50fc65c5fb #13055 Skip error data export for ensemble curves in Show Plot Data 2026-01-15 12:15:35 +01:00