From: Marko Luukkainen Date: Thu, 24 Oct 2019 14:17:02 +0000 (+0300) Subject: Run piping rules for all added components when closing pipe routing X-Git-Tag: v1.43.0~169 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F3408%2F1;p=simantics%2F3d.git Run piping rules for all added components when closing pipe routing This should reduce the amount of unsynchronised changes gitlab #35 Change-Id: I5834089a3f7d0e150e46d6cb6b8f53d058ef7ec8 --- diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/actions/RoutePipeAction.java b/org.simantics.plant3d/src/org/simantics/plant3d/actions/RoutePipeAction.java index 5c787037..b40d7e0b 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/actions/RoutePipeAction.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/actions/RoutePipeAction.java @@ -114,7 +114,7 @@ public class RoutePipeAction extends vtkSwtAction { public void deattach() { deactivate(); startComponent = null; - nodeMap.commit("Route pipe"); + deattachUI(); super.deattach(); panel.refresh(); @@ -422,11 +422,23 @@ public class RoutePipeAction extends vtkSwtAction { state = ToolState.SELECTING_SPLIT; } public void deactivate() { - for (PipelineComponent component : added) { - component.getControlPoint().setDeletable(true); - } + if (added.size() > 0) { + for (PipelineComponent component : added) { + component.getControlPoint().setDeletable(true); + } + + for (PipelineComponent comp : added) { + PipingRules.requestUpdate(comp.getControlPoint()); + } + try { + PipingRules.update(); + nodeMap.commit("Route pipe"); + } catch (Exception e) { + ExceptionUtils.logAndShowError(e); + } + added.clear(); + } - added.clear(); startComponent.getControlPoint().setDeletable(startRemovable); direction = null;