From cf15beb808507d0fe427d6b1ddc71f6eb13f651f Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Tue, 3 Dec 2019 21:14:32 +0100 Subject: [PATCH] #5110 Update well measurement plots when WBS well is changed. --- .../RimWellLogCurveCommonDataSource.cpp | 13 +++++++++++-- .../ProjectDataModel/RimWellMeasurementCurve.cpp | 16 +--------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogCurveCommonDataSource.cpp b/ApplicationCode/ProjectDataModel/RimWellLogCurveCommonDataSource.cpp index e8e7e0289a..c8480f1367 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogCurveCommonDataSource.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogCurveCommonDataSource.cpp @@ -33,6 +33,7 @@ #include "RimWellLogPlotCollection.h" #include "RimWellLogTrack.h" #include "RimWellLogWbsCurve.h" +#include "RimWellMeasurementCurve.h" #include "RimWellPath.h" #include "RimWellPathCollection.h" @@ -436,8 +437,9 @@ void RimWellLogCurveCommonDataSource::updateCurvesAndTracks( const std::vector( curve ); - RimWellLogExtractionCurve* extractionCurve = dynamic_cast( curve ); + RimWellLogFileCurve* fileCurve = dynamic_cast( curve ); + RimWellLogExtractionCurve* extractionCurve = dynamic_cast( curve ); + RimWellMeasurementCurve* measurementCurve = dynamic_cast( curve ); if ( fileCurve ) { if ( wellPathToApply() != nullptr ) @@ -525,6 +527,13 @@ void RimWellLogCurveCommonDataSource::updateCurvesAndTracks( const std::vectorupdateConnectedEditors(); } } + else if ( measurementCurve ) + { + if ( wellPathToApply() != nullptr ) + { + measurementCurve->setWellPath( wellPathToApply() ); + } + } } for ( RimWellLogTrack* track : tracks ) diff --git a/ApplicationCode/ProjectDataModel/RimWellMeasurementCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellMeasurementCurve.cpp index 6e4ff4a306..b5a225f516 100644 --- a/ApplicationCode/ProjectDataModel/RimWellMeasurementCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellMeasurementCurve.cpp @@ -251,21 +251,7 @@ QList if ( fieldNeedingOptions == &m_wellPath ) { - auto wellPathColl = RimTools::wellPathCollection(); - if ( wellPathColl ) - { - caf::PdmChildArrayField& wellPaths = wellPathColl->wellPaths; - - for ( size_t i = 0; i < wellPaths.size(); i++ ) - { - options.push_back( caf::PdmOptionItemInfo( wellPaths[i]->name(), wellPaths[i] ) ); - } - - if ( options.size() > 0 ) - { - options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) ); - } - } + RimTools::wellPathOptionItems( &options ); } return options;