P3D.HasPipeDiameter <R G3D.hasNonTransformation
L0.HasRange L0.Double
+P3D.HasPipeThickness <R G3D.hasNonTransformation
+ L0.HasRange L0.Double
P3D.HasRotationAngle <R G3D.hasTransformation
L0.HasRange L0.Double
P3D.HasLength <R G3D.hasNonTransformation
public final Resource HasPipeDiameter;
public final Resource HasPipeDiameter_Inverse;
public final Resource HasPipeRun;
+ public final Resource HasPipeThickness;
+ public final Resource HasPipeThickness_Inverse;
public final Resource HasPrevious;
public final Resource HasRotationAngle;
public final Resource HasRotationAngle_Inverse;
public static final String HasPipeDiameter = "http://www.simantics.org/Plant3D-0.1/HasPipeDiameter";
public static final String HasPipeDiameter_Inverse = "http://www.simantics.org/Plant3D-0.1/HasPipeDiameter/Inverse";
public static final String HasPipeRun = "http://www.simantics.org/Plant3D-0.1/HasPipeRun";
+ public static final String HasPipeThickness = "http://www.simantics.org/Plant3D-0.1/HasPipeThickness";
+ public static final String HasPipeThickness_Inverse = "http://www.simantics.org/Plant3D-0.1/HasPipeThickness/Inverse";
public static final String HasPrevious = "http://www.simantics.org/Plant3D-0.1/HasPrevious";
public static final String HasRotationAngle = "http://www.simantics.org/Plant3D-0.1/HasRotationAngle";
public static final String HasRotationAngle_Inverse = "http://www.simantics.org/Plant3D-0.1/HasRotationAngle/Inverse";
HasPipeDiameter = getResourceOrNull(graph, URIs.HasPipeDiameter);
HasPipeDiameter_Inverse = getResourceOrNull(graph, URIs.HasPipeDiameter_Inverse);
HasPipeRun = getResourceOrNull(graph, URIs.HasPipeRun);
+ HasPipeThickness = getResourceOrNull(graph, URIs.HasPipeThickness);
+ HasPipeThickness_Inverse = getResourceOrNull(graph, URIs.HasPipeThickness_Inverse);
HasPrevious = getResourceOrNull(graph, URIs.HasPrevious);
HasRotationAngle = getResourceOrNull(graph, URIs.HasRotationAngle);
HasRotationAngle_Inverse = getResourceOrNull(graph, URIs.HasRotationAngle_Inverse);
private Double angle;
private Double rotationAngle;
private Double diameter;
+ private Double thickness;
private Double turnRadius;
@Override
this.angle = dialog.getAngle();
this.rotationAngle = dialog.getRotationAngle();
this.diameter = dialog.getDiameter();
+ this.thickness = dialog.getThickness();
this.turnRadius = dialog.getTurnRadius();
allowed = dialog.filterAllowed();
gizmo.setComponent(component, allowed);
inst.name = name;
inst.angle = angle != null ? MathTools.degToRad(angle) : null;
inst.diameter = diameter;
+ inst.thickness = thickness;
inst.length = length;
inst.turnRadius = turnRadius;
inst.insertPosition = insertPosition;
// Input for new PipeRun
private Double diameter;
+ private Double thickness;
private Double turnRadius;
private Text diameterText;
+ private Text thicknessText;
private Text turnRadiusText;
// Position selection
label.setText("Diameter");
diameterText = new Text(composite, SWT.SINGLE | SWT.BORDER);
label = new Label(composite, SWT.NONE);
- label.setText("Turn Radius");
+ label.setText("Wall thickness");
+ thicknessText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ label = new Label(composite, SWT.NONE);
+ label.setText("Turn radius");
turnRadiusText = new Text(composite, SWT.SINGLE | SWT.BORDER);
lengthText.setEnabled(false);
rotationAngleText.setEnabled(false);
turnRadiusText.setEnabled(false);
diameterText.setEnabled(false);
+ thicknessText.setEnabled(false);
nameText.addKeyListener(new KeyAdapter() {
@Override
validate();
}
});
+
+ thicknessText.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ try {
+ thickness = Double.parseDouble(thicknessText.getText()) / lengthFactor;
+ } catch (NumberFormatException err) {
+ thickness = null;
+ }
+ validate();
+ }
+ });
turnRadiusText.addKeyListener(new KeyAdapter() {
@Override
horizFillData.applyTo(angleText);
horizFillData.applyTo(rotationAngleText);
horizFillData.applyTo(diameterText);
+ horizFillData.applyTo(thicknessText);
horizFillData.applyTo(turnRadiusText);
if (!allowed.contains(PositionType.NEXT) && !allowed.contains(PositionType.PREVIOUS)) {
if (selected.isSizeChange()) {
turnRadiusText.setEnabled(true);
diameterText.setEnabled(true);
- if (diameter == null || turnRadius == null)
+ thicknessText.setEnabled(true);
+ if (diameter == null || turnRadius == null || thickness == null)
ok = false;
} else {
turnRadiusText.setEnabled(false);
return lenghtAdjustable;
}
+ public Double getThickness() {
+ return thickness;
+ }
+
}
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
import org.simantics.g3d.math.MathTools;
import org.simantics.g3d.property.annotations.GetPropertyValue;
public class PipeRun extends P3DParentNode<IP3DNode> {
private double pipeDiameter = 0.1;
+ private double pipeThickness = 0.0;
private double[] turnRadius = new double[] {0.2};
@Override
@RelatedSetValue(Plant3D.URIs.HasPipeDiameter)
@SetPropertyValue(Plant3D.URIs.HasPipeDiameter)
public void setPipeDiameter(double pipeDiameter) {
- if (Objects.equals(this.pipeDiameter, pipeDiameter))
+ if (this.pipeDiameter == pipeDiameter)
return;
this.pipeDiameter = pipeDiameter;
firePropertyChanged(Plant3D.URIs.HasPipeDiameter);
}
+ @RelatedGetValue(Plant3D.URIs.HasPipeThickness)
+ @GetPropertyValue(value=Plant3D.URIs.HasPipeThickness, name = "Wall Thickness")
+ public double getPipeThickness() {
+ return pipeThickness;
+ }
+
+ @RelatedSetValue(Plant3D.URIs.HasPipeThickness)
+ @SetPropertyValue(Plant3D.URIs.HasPipeThickness)
+ public void setPipeThickness(double pipeThickness) {
+ if (this.pipeThickness == pipeThickness)
+ return;
+
+ this.pipeThickness = pipeThickness;
+ firePropertyChanged(Plant3D.URIs.HasPipeThickness);
+ }
+
@RelatedElementsAdd(Plant3D.URIs.children)
public void addChild(PipelineComponent node) {
addNode(Plant3D.URIs.children,node);
PipeRun previousRun = previous.getPipeRun();
nextPipeRun.setPipeDiameter(previousRun.getPipeDiameter());
+ nextPipeRun.setPipeThickness(previousRun.getPipeThickness());
nextPipeRun.setTurnRadiusArray(previousRun.getTurnRadiusArray());
PipelineComponent n = next.getPipelineComponent();
// Reducer requires pipe specs
public Double diameter;
+ public Double thickness;
public Double turnRadius;
// Variable length
public void setDiameter(Double diameter) {
this.diameter = diameter;
}
+
+ public double getThickness() {
+ return thickness;
+ }
+
+ public void setThickness(double thickness) {
+ this.thickness = thickness;
+ }
public Double getTurnRadius() {
return turnRadius;
String n = root.getUniqueName("PipeRun");
other.setName(n);
other.setPipeDiameter(inst.diameter);
+ other.setPipeThickness(inst.thickness);
other.setTurnRadius(inst.turnRadius);
root.addChild(other);