]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/InlineComponent.java
Use inside diameter for eccentric reducer offset calculation
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / InlineComponent.java
index d3e8742c9db93019bc3fe8d087d146a8fa5c2bb8..ed4917df6717cfc78fd726afbafde98abe727423 100644 (file)
@@ -36,6 +36,9 @@ public class InlineComponent extends PipelineComponent {
        public void setType(String type) throws Exception{
                this.type = type;
                controlPoint = ControlPointFactory.create(this);
+               syncNext();
+        syncPrevious();
+        syncBranch0();
                
        }
        
@@ -54,6 +57,10 @@ public class InlineComponent extends PipelineComponent {
                return !controlPoint.isFixed();
        }
        
+       public boolean isModifialble() {
+        return controlPoint.isMod();
+    }
+       
        public boolean isSizeChange() {
                return controlPoint.isSizeChange();
        }
@@ -82,12 +89,8 @@ public class InlineComponent extends PipelineComponent {
                if (controlPoint.getRotationAngle() != null && Math.abs(controlPoint.getRotationAngle()-angle) < MathTools.NEAR_ZERO)
                        return;
                controlPoint.setRotationAngle(angle);
-               try {
-                       PipingRules.requestUpdate(getControlPoint());
-               } catch (Exception e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               }       
+               PipingRules.requestUpdate(getControlPoint());
+
        }
        
        @RelatedGetValue(Plant3D.URIs.IsReversed)
@@ -108,12 +111,7 @@ public class InlineComponent extends PipelineComponent {
                        return;
                }
                controlPoint.setReversed(reverse);
-               try {
-                       PipingRules.requestUpdate(getControlPoint());
-               } catch (Exception e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               }       
+               PipingRules.requestUpdate(getControlPoint());
        }
        
        @Override
@@ -159,7 +157,7 @@ public class InlineComponent extends PipelineComponent {
        
        private void updateOffset() {
                if (!componentCalculatedOffset && getControlPoint().isOffset()) {
-                       getControlPoint().setOffset(getPipeRun().getPipeDiameter()*0.5 - getAlternativePipeRun().getPipeDiameter()*0.5);
+                       getControlPoint().setOffset(getPipeRun().getInsideDiameter()*0.5 - getAlternativePipeRun().getInsideDiameter()*0.5);
                }
        }