From 51e9ef67b8260995e8c05ae3bcd65a75a1cfbf4c Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Fri, 7 Apr 2017 12:46:09 +0200 Subject: [PATCH] pre-proto - Update of stimPlanCells when changing facture color property or stimPlanFracTemplate activeTimeStep --- .../ProjectDataModel/RimStimPlanColors.cpp | 21 +++++++++++++++++++ .../RimStimPlanFractureTemplate.cpp | 6 ++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp b/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp index ec339a0087..7f0b2047c5 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp +++ b/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp @@ -23,6 +23,7 @@ #include "RimLegendConfig.h" #include "RimOilField.h" #include "RimProject.h" +#include "RimStimPlanFractureTemplate.h" #include "cafPdmUiDoubleSliderEditor.h" #include "cafPdmUiItem.h" @@ -166,6 +167,26 @@ void RimStimPlanColors::fieldChangedByUi(const caf::PdmFieldHandle* changedField { sourceView->scheduleCreateDisplayModelAndRedraw(); } + + if (changedField == &m_resultNameAndUnit) + { + //Get all frac templates and re-generate stimplan cells + RimProject* proj; + this->firstAncestorOrThisOfType(proj); + if (proj) + { + std::vector stimPlanFracTemplates; + proj->descendantsIncludingThisOfType(stimPlanFracTemplates); + for (RimStimPlanFractureTemplate* stimPlanFracTemplate : stimPlanFracTemplates) + { + stimPlanFracTemplate->setupStimPlanCells(); + } + proj->createDisplayModelAndRedrawAllViews(); + } + + + + } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp index 69d6ba1ffd..83fdaea2c1 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp @@ -90,6 +90,8 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch if (&activeTimeStepIndex == changedField) { + setupStimPlanCells(); + //Changes to this parameters should change all fractures with this fracture template attached. RimProject* proj; this->firstAncestorOrThisOfType(proj); @@ -1067,8 +1069,9 @@ void RimStimPlanFractureTemplate::defineUiOrdering(QString uiConfigName, caf::Pd uiOrdering.add(&name); uiOrdering.add(&showStimPlanMesh); - caf::PdmUiGroup* fileGroup = uiOrdering.addNewGroup("File"); + caf::PdmUiGroup* fileGroup = uiOrdering.addNewGroup("Input"); fileGroup->add(&m_stimPlanFileName); + fileGroup->add(&activeTimeStepIndex); fileGroup->add(&wellPathDepthAtFracture); caf::PdmUiGroup* geometryGroup = uiOrdering.addNewGroup("Geometry"); @@ -1081,7 +1084,6 @@ void RimStimPlanFractureTemplate::defineUiOrdering(QString uiConfigName, caf::Pd caf::PdmUiGroup* polygonGroup = uiOrdering.addNewGroup("Fracture Polygon Basis"); polygonGroup->add(¶meterForPolygon); - polygonGroup->add(&activeTimeStepIndex); } //--------------------------------------------------------------------------------------------------