Make sure changes to valves and perforation interval visibility is reflected in track.

This commit is contained in:
Gaute Lindkvist 2018-12-05 09:11:53 +01:00
parent 4591d9f20e
commit e67a9ef12a
3 changed files with 23 additions and 0 deletions

View File

@ -25,6 +25,7 @@
#include "RimPerforationCollection.h" #include "RimPerforationCollection.h"
#include "RimProject.h" #include "RimProject.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RimWellPathValve.h" #include "RimWellPathValve.h"
@ -233,6 +234,21 @@ std::vector<RimWellPathValve*> RimPerforationInterval::valves() const
return allValves; return allValves;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPerforationInterval::updateAllReferringTracks()
{
std::vector<RimWellLogTrack*> wellLogTracks;
this->objectsWithReferringPtrFieldsOfType(wellLogTracks);
for (RimWellLogTrack* track : wellLogTracks)
{
track->loadDataAndUpdate();
}
this->updateConnectedEditors();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -298,6 +314,8 @@ void RimPerforationInterval::fieldChangedByUi(const caf::PdmFieldHandle* changed
const QVariant& oldValue, const QVariant& oldValue,
const QVariant& newValue) const QVariant& newValue)
{ {
this->updateAllReferringTracks();
RimProject* proj = nullptr; RimProject* proj = nullptr;
this->firstAncestorOrThisOfTypeAsserted(proj); this->firstAncestorOrThisOfTypeAsserted(proj);
proj->reloadCompletionTypeResultsInAllViews(); proj->reloadCompletionTypeResultsInAllViews();

View File

@ -68,6 +68,7 @@ public:
void addValve(RimWellPathValve* valve); void addValve(RimWellPathValve* valve);
std::vector<RimWellPathValve*> valves() const; std::vector<RimWellPathValve*> valves() const;
void updateAllReferringTracks();
// RimWellPathCompletionInterface overrides // RimWellPathCompletionInterface overrides
bool isEnabled() const override; bool isEnabled() const override;

View File

@ -311,6 +311,10 @@ QList<caf::PdmOptionItemInfo> RimWellPathValve::calculateValueOptions(const caf:
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellPathValve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) void RimWellPathValve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{ {
RimPerforationInterval* perfInterval;
this->firstAncestorOrThisOfTypeAsserted(perfInterval);
perfInterval->updateAllReferringTracks();
RimProject* proj; RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted(proj); this->firstAncestorOrThisOfTypeAsserted(proj);
proj->reloadCompletionTypeResultsInAllViews(); proj->reloadCompletionTypeResultsInAllViews();