P3D.FixedLengthInlineComponent <R P3D.PipelineComponentTag
L0.HasDescription "Inline component that has fixed length" : L0.String
- //[HasRotationAngle card "1"]
+P3D.AdjustableLengthInlineComponent <R P3D.PipelineComponentTag
+ L0.HasDescription "Inline component whose length can be changed manually" : L0.String
P3D.VariableLengthInlineComponent <R P3D.PipelineComponentTag
- L0.HasDescription "Inline component whose length can be changed" : L0.String
+ L0.HasDescription "Inline component whose length can be changed automatically" : L0.String
P3D.FixedAngleTurnComponent <R P3D.PipelineComponentTag
L0.HasDescription "Turn Component that has specific turning angle that cannot be changed" : L0.String
- //[HasRotationAngle card "1"]
P3D.VariableAngleTurnComponent <R P3D.PipelineComponentTag
L0.HasDescription "Turn Component whose turning angle can be modified Contains always one control point (there are no contradictory cases / how to calculate?)" : L0.String
- //[HasTurnRadius card "1"]
P3D.SizeChangeComponent <R P3D.PipelineComponentTag
L0.HasDescription "Component that changes pipe run along main pipeline. (Spec change)" : L0.String
P3D.OffsetComponent<R P3D.PipelineComponentTag
} else if (selected.isCode()) {// TODO : instead of disabling the button, we should filter the content.
ok = false;
} else {
- lenghtAdjustable = ((selected.getType() == Type.INLINE) && selected.isVariable());
+ lenghtAdjustable = ((selected.getType() == Type.INLINE) && (selected.isVariable() || selected.isModifiable()));
if (insertAdjustable) {
switch (selected.getType()) {
case END:
middleButton.setEnabled(false);
endButton.setEnabled(true);
}
- if (selected.isVariable()) {
+ if (selected.isVariable() || selected.isModifiable()) {
if (selected.getType() == Type.INLINE) {
filterAllowed.add(PositionType.NEXT);
filterAllowed.add(PositionType.PREVIOUS);
return !controlPoint.isFixed();
}
+ public boolean isModifialble() {
+ return controlPoint.isMod();
+ }
+
public boolean isSizeChange() {
return controlPoint.isSizeChange();
}
}
setParameterMap(parameters);
}
+
+ public void setParameter(String name, Object value) {
+ Map<String, Object> parameters = new HashMap<>(getParameterMap());
+ parameters.put(name, value);
+ setParameterMap(parameters);
+ }
public abstract void setType(String typeURI) throws Exception;
PipeControlPoint pcp = new PipeControlPoint(component);
pcp.setType(inst.type);
pcp.setFixed(inst.fixed);
+ pcp.setMod(inst.mod);
pcp.setRotate(inst.isRotate);
pcp.setReverse(inst.isReverse);
switch(inst.type) {
sub.parent = pcp;
sub.setType(inst.type);
sub.setFixed(inst.fixed);
+ sub.setMod(inst.mod);
sub.setSub(true);
sub.setDeletable(false);
if (inst.isOffset)
private static class Instruction {
PointType type;
boolean fixed;
+ boolean mod;
boolean isOffset;
boolean isSizeChange;
boolean isRotate;
i.isRotate = false;
i.isReverse = false;
i.type = PointType.INLINE;
+ i.mod = false;
if (graph.isInheritedFrom(res, p3d.Nozzle)) {
i.fixed = true;
i.isOffset = false;
i.fixed = false;
} else if (graph.hasStatement(res,p3d.FixedLengthInlineComponent)) {
i.fixed = true;
+ } else if (graph.hasStatement(res,p3d.AdjustableLengthInlineComponent)) {
+ i.fixed = true;
+ i.mod = true;
+ } else {
+ throw new DatabaseException("Inline component type " + res + " does not have length configuration.");
}
if (graph.hasStatement(res,p3d.SizeChangeComponent)) {
i.fixed = false;
} else if (graph.hasStatement(res,p3d.FixedAngleTurnComponent)) {
i.fixed = true;
+ } else {
+ throw new DatabaseException("Turn component type " + res + " does not have angle configuration.");
}
} else if (graph.isInheritedFrom(res, p3d.EndComponent)) {
i.fixed = false;
private PointType type;
private boolean isFixed = true; // In-line: fixed-length Turn: fixed-angle
+ private boolean isMod = false; // Can user modify fixed value manually
private boolean isRotate = false; // rotates around path leg axis.
private boolean isReverse = false; // definition direction can be swapped
private boolean isDeletable = true; // can be removed by rules
public void setFixed(boolean fixed) {
this.isFixed = fixed;
}
+
+ @GetPropertyValue(name="Mod",tabId="Debug",value="mod")
+ public boolean isMod() {
+ return isMod;
+ }
+
+ public void setMod(boolean isMod) {
+ this.isMod = isMod;
+ }
@GetPropertyValue(name="Rotate",tabId="Debug",value="rotate")
public boolean isRotate() {
PositionType insertPosition = inst.insertPosition;
boolean lengthAdjustable = false;
if (newComponent instanceof InlineComponent) {
- lengthAdjustable = ((InlineComponent)newComponent).isVariableLength();
+ lengthAdjustable = ((InlineComponent)newComponent).isVariableLength() || ((InlineComponent)newComponent).isModifialble();
}
boolean insertAdjustable = false;
if (component instanceof InlineComponent) {
newComponent.setName(name);
pipeRun.addChild(newComponent);
- // TODO: these options are not stored into DB. Should they?!
- if (newComponent instanceof InlineComponent && ((InlineComponent)newComponent).isVariableLength()) {
+
+ if (newComponent instanceof InlineComponent && ((InlineComponent)newComponent).isVariableLength() ||((InlineComponent)newComponent).isModifialble()) {
newPcp.setLength(inst.length);
+ newComponent.setParameter("length", inst.length);
} else if (newComponent instanceof TurnComponent && ((TurnComponent)newComponent).isVariableAngle()) {
newPcp.setTurnAngle(inst.angle);
+ newComponent.setParameter("turnAngle", inst.angle);
}
newComponent.updateParameters();
private Type type;
private boolean code = false;
private boolean variable = false;
+ private boolean modifiable = false;
private boolean sizeChange = false;
this.variable = variable;
}
+ public boolean isModifiable() {
+ return modifiable;
+ }
+
+ public void setModifiable(boolean modifiable) {
+ this.modifiable = modifiable;
+ }
+
public boolean isSizeChange() {
return sizeChange;
}
if (graph.hasStatement(r, p3d.VariableAngleTurnComponent) ||
graph.hasStatement(r, p3d.VariableLengthInlineComponent))
item.setVariable(true);
+ if (graph.hasStatement(r, p3d.AdjustableLengthInlineComponent))
+ item.setModifiable(true);
if (graph.hasStatement(r, p3d.SizeChangeComponent))
item.setSizeChange(true);
return item;