From 78e1bf3e94e9ffe1dbf414f8f1407089329ef135 Mon Sep 17 00:00:00 2001 From: jonjenssen <69144954+jonjenssen@users.noreply.github.com> Date: Thu, 1 Sep 2022 11:01:47 +0200 Subject: [PATCH] Refresh data source tree when a grid calculation is updated (#9255) --- .../ProjectDataModel/RimEclipseCase.cpp | 13 +++++++++++-- .../ProjectDataModel/RimEclipseCase.h | 4 +++- .../ProjectDataModel/RimGridCalculation.cpp | 2 ++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseCase.cpp index 9ca620eea4..2adbad2e9c 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseCase.cpp @@ -581,7 +581,7 @@ void RimEclipseCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin } else if ( uiConfigName == "MainWindow.DataSources" ) { - if ( m_resultAddressCollections.empty() ) buildChildNodes(); + if ( m_resultAddressCollections.empty() ) buildResultChildNodes(); uiTreeOrdering.add( &m_resultAddressCollections ); } @@ -591,7 +591,7 @@ void RimEclipseCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEclipseCase::buildChildNodes() +void RimEclipseCase::buildResultChildNodes() { m_resultAddressCollections.deleteChildren(); @@ -1163,3 +1163,12 @@ void RimEclipseCase::setReaderSettings( std::shared_ptr reade { m_readerSettings = readerSettings; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseCase::updateResultAddressCollection() +{ + m_resultAddressCollections.deleteChildren(); + updateConnectedEditors(); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseCase.h b/ApplicationLibCode/ProjectDataModel/RimEclipseCase.h index d7b08daa5e..166bec3c01 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseCase.h @@ -124,6 +124,8 @@ public: void setReaderSettings( std::shared_ptr readerSettings ); + void updateResultAddressCollection(); + protected: void initAfterRead() override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; @@ -140,7 +142,7 @@ protected: private: void createTimeStepFormatString(); std::vector allSpecialViews() const override; - void buildChildNodes(); + void buildResultChildNodes(); protected: caf::PdmField m_flipXAxis; diff --git a/ApplicationLibCode/ProjectDataModel/RimGridCalculation.cpp b/ApplicationLibCode/ProjectDataModel/RimGridCalculation.cpp index fbea9d7dee..4682e4a2f3 100644 --- a/ApplicationLibCode/ProjectDataModel/RimGridCalculation.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimGridCalculation.cpp @@ -143,6 +143,8 @@ bool RimGridCalculation::calculate() } } + eclipseCase->updateResultAddressCollection(); + return true; }