#5389 Trigger reload of measurement curves when changing measurements

This commit is contained in:
Gaute Lindkvist
2020-02-07 13:00:48 +01:00
parent b7f16e950a
commit c397729470
3 changed files with 21 additions and 8 deletions

View File

@@ -187,7 +187,7 @@ void RimWellMeasurement::fieldChangedByUi( const caf::PdmFieldHandle* changedFie
RimWellMeasurementCollection* wellMeasurementCollection; RimWellMeasurementCollection* wellMeasurementCollection;
this->firstAncestorOrThisOfTypeAsserted( wellMeasurementCollection ); this->firstAncestorOrThisOfTypeAsserted( wellMeasurementCollection );
wellMeasurementCollection->updateAllReferringTracks(); wellMeasurementCollection->updateAllReferringTracksAndCurves();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -17,9 +17,11 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
#include "RimWellMeasurementCollection.h" #include "RimWellMeasurementCollection.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h" #include "RimProject.h"
#include "RimWellLogTrack.h" #include "RimWellLogTrack.h"
#include "RimWellMeasurement.h" #include "RimWellMeasurement.h"
#include "RimWellMeasurementCurve.h"
#include "RimWellMeasurementFilePath.h" #include "RimWellMeasurementFilePath.h"
#include "cafPdmUiTableViewEditor.h" #include "cafPdmUiTableViewEditor.h"
@@ -52,7 +54,7 @@ RimWellMeasurementCollection::~RimWellMeasurementCollection() {}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellMeasurementCollection::updateAllReferringTracks() void RimWellMeasurementCollection::updateAllReferringTracksAndCurves()
{ {
std::vector<RimWellLogTrack*> wellLogTracks; std::vector<RimWellLogTrack*> wellLogTracks;
@@ -62,6 +64,17 @@ void RimWellMeasurementCollection::updateAllReferringTracks()
track->loadDataAndUpdate(); track->loadDataAndUpdate();
} }
this->updateConnectedEditors(); this->updateConnectedEditors();
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted( proj );
RimMainPlotCollection* plotCollection = proj->mainPlotCollection();
std::vector<RimWellMeasurementCurve*> measurementCurves;
plotCollection->descendantsIncludingThisOfType( measurementCurves );
for ( auto curve : measurementCurves )
{
curve->loadDataAndUpdate( true );
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -98,7 +111,7 @@ void RimWellMeasurementCollection::insertMeasurement( RimWellMeasurement* insert
m_measurements.push_back( measurement ); m_measurements.push_back( measurement );
addFilePath( measurement->filePath() ); addFilePath( measurement->filePath() );
this->updateAllReferringTracks(); this->updateAllReferringTracksAndCurves();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -108,7 +121,7 @@ void RimWellMeasurementCollection::appendMeasurement( RimWellMeasurement* measur
{ {
m_measurements.push_back( measurement ); m_measurements.push_back( measurement );
addFilePath( measurement->filePath() ); addFilePath( measurement->filePath() );
this->updateAllReferringTracks(); this->updateAllReferringTracksAndCurves();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -119,7 +132,7 @@ void RimWellMeasurementCollection::deleteMeasurement( RimWellMeasurement* measur
m_measurements.removeChildObject( measurementToDelete ); m_measurements.removeChildObject( measurementToDelete );
delete measurementToDelete; delete measurementToDelete;
this->updateAllReferringTracks(); this->updateAllReferringTracksAndCurves();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -128,7 +141,7 @@ void RimWellMeasurementCollection::deleteMeasurement( RimWellMeasurement* measur
void RimWellMeasurementCollection::deleteAllMeasurements() void RimWellMeasurementCollection::deleteAllMeasurements()
{ {
m_measurements.deleteAllChildObjects(); m_measurements.deleteAllChildObjects();
this->updateAllReferringTracks(); this->updateAllReferringTracksAndCurves();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -234,5 +247,5 @@ void RimWellMeasurementCollection::removeMeasurementsForFilePath( RimWellMeasure
RimProject* proj; RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted( proj ); this->firstAncestorOrThisOfTypeAsserted( proj );
proj->scheduleCreateDisplayModelAndRedrawAllViews(); proj->scheduleCreateDisplayModelAndRedrawAllViews();
this->updateAllReferringTracks(); this->updateAllReferringTracksAndCurves();
} }

View File

@@ -38,7 +38,7 @@ public:
std::vector<RimWellMeasurement*> measurements() const; std::vector<RimWellMeasurement*> measurements() const;
void updateAllReferringTracks(); void updateAllReferringTracksAndCurves();
void insertMeasurement( RimWellMeasurement* insertBefore, RimWellMeasurement* measurement ); void insertMeasurement( RimWellMeasurement* insertBefore, RimWellMeasurement* measurement );
void appendMeasurement( RimWellMeasurement* measurement ); void appendMeasurement( RimWellMeasurement* measurement );
void deleteMeasurement( RimWellMeasurement* measurementToDelete ); void deleteMeasurement( RimWellMeasurement* measurementToDelete );