From 7646b3fcf0b4b52f757368fabe2d59280cfc37f3 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Fri, 7 Apr 2017 11:02:31 +0200 Subject: [PATCH] #1410 - pre-proto - stimplan timestep set to readonly for fracture and value is taken from fracture template. --- .../RivWellFracturePartMgr.cpp | 2 -- .../ProjectDataModel/RimFracture.cpp | 5 +++-- .../RimStimPlanFractureTemplate.cpp | 22 +++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp index d44e1ad593..5549629427 100644 --- a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp @@ -284,7 +284,6 @@ void RivWellFracturePartMgr::generateStimPlanMeshPart(caf::DisplayCoordTransform //-------------------------------------------------------------------------------------------------- cvf::ref RivWellFracturePartMgr::createStimPlanMeshDrawable(RimStimPlanFractureTemplate* stimPlanFracTemplate, caf::DisplayCoordTransform* displayCoordTransform) { - //TODO: Kjør setupStimPlanCells igjen, siden parametere kan ha endre seg... stimPlanFracTemplate->setupStimPlanCells(); std::vector stimPlanCells = stimPlanFracTemplate->getStimPlanCells(); @@ -302,7 +301,6 @@ cvf::ref RivWellFracturePartMgr::createStimPlanMeshDrawable(Ri } } - cvf::Mat4f m = m_rimFracture->transformMatrix(); std::vector stimPlanMeshVerticesDisplayCoords = transfromToFractureDisplayCoords(stimPlanMeshVertices, m, displayCoordTransform); diff --git a/ApplicationCode/ProjectDataModel/RimFracture.cpp b/ApplicationCode/ProjectDataModel/RimFracture.cpp index 146f3e002f..2754e72936 100644 --- a/ApplicationCode/ProjectDataModel/RimFracture.cpp +++ b/ApplicationCode/ProjectDataModel/RimFracture.cpp @@ -186,7 +186,7 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons RimStimPlanFractureTemplate* stimPlanFracTemplate = dynamic_cast(attachedFractureDefinition()); if (stimPlanFracTemplate) { - stimPlanTimeIndexToPlot = static_cast(stimPlanFracTemplate->getStimPlanTimeValues().size() - 1); + stimPlanTimeIndexToPlot = stimPlanFracTemplate->activeTimeStepIndex; } } @@ -397,6 +397,7 @@ void RimFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiO if (dynamic_cast(fracTemplate)) { stimPlanTimeIndexToPlot.uiCapability()->setUiHidden(false); + stimPlanTimeIndexToPlot.uiCapability()->setUiReadOnly(true); } else { @@ -497,7 +498,7 @@ void RimFracture::setFractureTemplate(RimFractureTemplate* fractureTemplate) RimStimPlanFractureTemplate* stimPlanFracTemplate = dynamic_cast(attachedFractureDefinition()); if (stimPlanFracTemplate) { - stimPlanTimeIndexToPlot = static_cast(stimPlanFracTemplate->getStimPlanTimeValues().size() - 1); + stimPlanTimeIndexToPlot = stimPlanFracTemplate->activeTimeStepIndex; } this->updateAzimuthFromFractureDefinition(); diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp index 846a17d046..69d6ba1ffd 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp @@ -88,6 +88,28 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch setDefaultsBasedOnXMLfile(); } + if (&activeTimeStepIndex == changedField) + { + //Changes to this parameters should change all fractures with this fracture template attached. + RimProject* proj; + this->firstAncestorOrThisOfType(proj); + if (proj) + { + std::vector fractures; + proj->descendantsIncludingThisOfType(fractures); + for (RimFracture* fracture : fractures) + { + if (fracture->attachedFractureDefinition() == this) + { + fracture->stimPlanTimeIndexToPlot = activeTimeStepIndex; + fracture->setRecomputeGeometryFlag(); + } + } + proj->createDisplayModelAndRedrawAllViews(); + } + } + + if (&wellPathDepthAtFracture == changedField || ¶meterForPolygon == changedField || &activeTimeStepIndex == changedField || &showStimPlanMesh == changedField) { RimProject* proj;