pre-proto - Update of stimPlanCells when changing facture color property or stimPlanFracTemplate activeTimeStep

This commit is contained in:
astridkbjorke 2017-04-07 12:46:09 +02:00
parent 4295928af6
commit 51e9ef67b8
2 changed files with 25 additions and 2 deletions

View File

@ -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<RimStimPlanFractureTemplate*> stimPlanFracTemplates;
proj->descendantsIncludingThisOfType(stimPlanFracTemplates);
for (RimStimPlanFractureTemplate* stimPlanFracTemplate : stimPlanFracTemplates)
{
stimPlanFracTemplate->setupStimPlanCells();
}
proj->createDisplayModelAndRedrawAllViews();
}
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -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(&parameterForPolygon);
polygonGroup->add(&activeTimeStepIndex);
}
//--------------------------------------------------------------------------------------------------