X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Futils%2FComponentUtils.java;h=15ee7918ca1709501eab1bc076054a1459df479f;hb=3d5276c8b4b0ec8f440994f17b20bec34e6cc3fe;hp=cc19260b41bf719ddda3df07a7460f3c4b62f8ee;hpb=6f6aa87201058478da5a0253118f2be10d946982;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java b/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java index cc19260b..15ee7918 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java @@ -516,7 +516,7 @@ public class ComponentUtils { requiresReverse = true; } PipeRun other = endCP.getPipeRun(); - boolean mergeRuns = pipeRun.equalSpecs(other); + boolean mergeRuns = other == null ? true : pipeRun.equalSpecs(other); if (requiresReverse) { // Pipe line must be traversible with next/previous relations without direction change. @@ -526,8 +526,15 @@ public class ComponentUtils { } if (mergeRuns) { // Runs have compatible specs and must be merged - if (pipeRun != other) // FIXME: temporary workaround. + if (other != null && pipeRun != other) PipingRules.merge(pipeRun, other); + else if (other == null) { + if (!(endTo instanceof Nozzle)) { + pipeRun.addChild(endTo); + } else { + endTo.setPipeRun(pipeRun); + } + } if (!reversed) { currentCP.setNext(endCP); endCP.setPrevious(currentCP);