diff --git a/src/com/t_oster/liblasercut/drivers/LaosCutter.java b/src/com/t_oster/liblasercut/drivers/LaosCutter.java index 8a07575bc1854372e9b7a42b16ae3b61adb7039c..6d96295ace28b75e157d01b7f6ea35db3797b442 100644 --- a/src/com/t_oster/liblasercut/drivers/LaosCutter.java +++ b/src/com/t_oster/liblasercut/drivers/LaosCutter.java @@ -63,26 +63,52 @@ public class LaosCutter extends LaserCutter private static final String SETTING_RASTER_WHITESPACE = "Additional space per Raster line"; private static final String SETTING_UNIDIR = "Engrave unidirectional"; private static final String SETTING_DEBUGFILE = "Debug output file"; + private static final String SETTING_SUPPORTS_PURGE = "Supports purge"; + private static final String SETTING_SUPPORTS_VENTILATION = "Supports ventilation"; + private boolean supportsPurge = false; + + public boolean isSupportsPurge() + { + return supportsPurge; + } + + public void setSupportsPurge(boolean supportsPurge) + { + this.supportsPurge = supportsPurge; + } + + private boolean supportsVentilation = false; + + public boolean isSupportsVentilation() + { + return supportsVentilation; + } + + public void setSupportsVentilation(boolean supportsVentilation) + { + this.supportsVentilation = supportsVentilation; + } + private boolean unidir = false; private String debugFilename = ""; @Override public LaosCutterProperty getLaserPropertyForVectorPart() { - return new LaosCutterProperty(); + return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation); } @Override public LaosCutterProperty getLaserPropertyForRasterPart() { - return new LaosCutterProperty(); + return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation); } @Override public LaosCutterProperty getLaserPropertyForRaster3dPart() { - return new LaosCutterProperty(); + return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation); } public void setEngraveUnidirectional(boolean uni) @@ -364,8 +390,14 @@ public class LaosCutter extends LaserCutter { LaosCutterProperty prop = (LaosCutterProperty) p; setFocus(out, prop.getFocus()); - setVentilation(out, prop.getVentilation()); - setPurge(out, prop.getPurge()); + if (this.supportsVentilation) + { + setVentilation(out, prop.getVentilation()); + } + if (this.supportsPurge) + { + setPurge(out, prop.getPurge()); + } setSpeed(out, prop.getSpeed()); setPower(out, prop.getPower()); setFrequency(out, prop.getFrequency()); @@ -749,6 +781,8 @@ public class LaosCutter extends LaserCutter //SETTING_FLIPX, //SETTING_FLIPY, //SETTING_MMPERSTEP, + SETTING_SUPPORTS_VENTILATION, + SETTING_SUPPORTS_PURGE, SETTING_TFTP, SETTING_RASTER_WHITESPACE, SETTING_DEBUGFILE @@ -771,6 +805,14 @@ public class LaosCutter extends LaserCutter { return (Double) this.getAddSpacePerRasterLine(); } + else if (SETTING_SUPPORTS_PURGE.equals(attribute)) + { + return (Boolean) this.supportsPurge; + } + else if (SETTING_SUPPORTS_VENTILATION.equals(attribute)) + { + return (Boolean) this.supportsVentilation; + } else if (SETTING_UNIDIR.equals(attribute)) { return (Boolean) this.isEngraveUnidirectional(); @@ -821,6 +863,14 @@ public class LaosCutter extends LaserCutter { this.setAddSpacePerRasterLine((Double) value); } + if (SETTING_SUPPORTS_PURGE.equals(attribute)) + { + this.setSupportsPurge((Boolean) value); + } + if (SETTING_SUPPORTS_VENTILATION.equals(attribute)) + { + this.setSupportsVentilation((Boolean) value); + } else if (SETTING_UNIDIR.endsWith(attribute)) { this.setEngraveUnidirectional((Boolean) value); @@ -874,6 +924,8 @@ public class LaosCutter extends LaserCutter clone.useTftp = useTftp; clone.addSpacePerRasterLine = addSpacePerRasterLine; clone.unidir = unidir; + clone.supportsPurge = supportsPurge; + clone.supportsVentilation = supportsVentilation; return clone; } diff --git a/src/com/t_oster/liblasercut/drivers/LaosCutterProperty.java b/src/com/t_oster/liblasercut/drivers/LaosCutterProperty.java index 518e2dd9f737553bd881c4cb531a30ad35d4fc9d..a2cffb2f4bd00acff5b567689cb9c533343bdf25 100644 --- a/src/com/t_oster/liblasercut/drivers/LaosCutterProperty.java +++ b/src/com/t_oster/liblasercut/drivers/LaosCutterProperty.java @@ -26,8 +26,22 @@ import com.t_oster.liblasercut.FloatPowerSpeedFocusFrequencyProperty; */ public class LaosCutterProperty extends FloatPowerSpeedFocusFrequencyProperty { + private boolean hidePurge = false; + private boolean hideVentilation = false; + private boolean ventilation = true; + public LaosCutterProperty(boolean hidePurge, boolean hideVentilation) + { + this.hidePurge = hidePurge; + this.hideVentilation = hideVentilation; + } + + public LaosCutterProperty() + { + this(false, false); + } + /** * Get the value of ventilation * @@ -73,10 +87,21 @@ public class LaosCutterProperty extends FloatPowerSpeedFocusFrequencyProperty { public String[] getPropertyKeys() { String[] s = super.getPropertyKeys(); - String[] result = new String[s.length+2]; + if (this.hidePurge && this.hideVentilation) + { + return s; + } + String[] result = new String[s.length+ (this.hidePurge ? 0 : 1) + (this.hideVentilation ? 0 : 1)]; System.arraycopy(s, 0, result, 0, s.length); - result[s.length] = "ventilation"; - result[s.length+1] = "purge"; + int i = s.length; + if (!this.hideVentilation) + { + result[i++] = "ventilation"; + } + if (!this.hidePurge) + { + result[i++] = "purge"; + } return result; }