Skip to content
Snippets Groups Projects
Commit 645ee4b3 authored by Thomas Oster's avatar Thomas Oster
Browse files

LAOS: Ventilation and Purge have to be explicitely enabled in the driver. Fixes t-oster/VisiCut#73

parent d1412767
No related branches found
No related tags found
No related merge requests found
...@@ -63,26 +63,52 @@ public class LaosCutter extends LaserCutter ...@@ -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_RASTER_WHITESPACE = "Additional space per Raster line";
private static final String SETTING_UNIDIR = "Engrave unidirectional"; private static final String SETTING_UNIDIR = "Engrave unidirectional";
private static final String SETTING_DEBUGFILE = "Debug output file"; 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 boolean unidir = false;
private String debugFilename = ""; private String debugFilename = "";
@Override @Override
public LaosCutterProperty getLaserPropertyForVectorPart() public LaosCutterProperty getLaserPropertyForVectorPart()
{ {
return new LaosCutterProperty(); return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation);
} }
@Override @Override
public LaosCutterProperty getLaserPropertyForRasterPart() public LaosCutterProperty getLaserPropertyForRasterPart()
{ {
return new LaosCutterProperty(); return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation);
} }
@Override @Override
public LaosCutterProperty getLaserPropertyForRaster3dPart() public LaosCutterProperty getLaserPropertyForRaster3dPart()
{ {
return new LaosCutterProperty(); return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation);
} }
public void setEngraveUnidirectional(boolean uni) public void setEngraveUnidirectional(boolean uni)
...@@ -364,8 +390,14 @@ public class LaosCutter extends LaserCutter ...@@ -364,8 +390,14 @@ public class LaosCutter extends LaserCutter
{ {
LaosCutterProperty prop = (LaosCutterProperty) p; LaosCutterProperty prop = (LaosCutterProperty) p;
setFocus(out, prop.getFocus()); setFocus(out, prop.getFocus());
setVentilation(out, prop.getVentilation()); if (this.supportsVentilation)
setPurge(out, prop.getPurge()); {
setVentilation(out, prop.getVentilation());
}
if (this.supportsPurge)
{
setPurge(out, prop.getPurge());
}
setSpeed(out, prop.getSpeed()); setSpeed(out, prop.getSpeed());
setPower(out, prop.getPower()); setPower(out, prop.getPower());
setFrequency(out, prop.getFrequency()); setFrequency(out, prop.getFrequency());
...@@ -749,6 +781,8 @@ public class LaosCutter extends LaserCutter ...@@ -749,6 +781,8 @@ public class LaosCutter extends LaserCutter
//SETTING_FLIPX, //SETTING_FLIPX,
//SETTING_FLIPY, //SETTING_FLIPY,
//SETTING_MMPERSTEP, //SETTING_MMPERSTEP,
SETTING_SUPPORTS_VENTILATION,
SETTING_SUPPORTS_PURGE,
SETTING_TFTP, SETTING_TFTP,
SETTING_RASTER_WHITESPACE, SETTING_RASTER_WHITESPACE,
SETTING_DEBUGFILE SETTING_DEBUGFILE
...@@ -771,6 +805,14 @@ public class LaosCutter extends LaserCutter ...@@ -771,6 +805,14 @@ public class LaosCutter extends LaserCutter
{ {
return (Double) this.getAddSpacePerRasterLine(); 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)) else if (SETTING_UNIDIR.equals(attribute))
{ {
return (Boolean) this.isEngraveUnidirectional(); return (Boolean) this.isEngraveUnidirectional();
...@@ -821,6 +863,14 @@ public class LaosCutter extends LaserCutter ...@@ -821,6 +863,14 @@ public class LaosCutter extends LaserCutter
{ {
this.setAddSpacePerRasterLine((Double) value); 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)) else if (SETTING_UNIDIR.endsWith(attribute))
{ {
this.setEngraveUnidirectional((Boolean) value); this.setEngraveUnidirectional((Boolean) value);
...@@ -874,6 +924,8 @@ public class LaosCutter extends LaserCutter ...@@ -874,6 +924,8 @@ public class LaosCutter extends LaserCutter
clone.useTftp = useTftp; clone.useTftp = useTftp;
clone.addSpacePerRasterLine = addSpacePerRasterLine; clone.addSpacePerRasterLine = addSpacePerRasterLine;
clone.unidir = unidir; clone.unidir = unidir;
clone.supportsPurge = supportsPurge;
clone.supportsVentilation = supportsVentilation;
return clone; return clone;
} }
......
...@@ -26,8 +26,22 @@ import com.t_oster.liblasercut.FloatPowerSpeedFocusFrequencyProperty; ...@@ -26,8 +26,22 @@ import com.t_oster.liblasercut.FloatPowerSpeedFocusFrequencyProperty;
*/ */
public class LaosCutterProperty extends FloatPowerSpeedFocusFrequencyProperty { public class LaosCutterProperty extends FloatPowerSpeedFocusFrequencyProperty {
private boolean hidePurge = false;
private boolean hideVentilation = false;
private boolean ventilation = true; 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 * Get the value of ventilation
* *
...@@ -73,10 +87,21 @@ public class LaosCutterProperty extends FloatPowerSpeedFocusFrequencyProperty { ...@@ -73,10 +87,21 @@ public class LaosCutterProperty extends FloatPowerSpeedFocusFrequencyProperty {
public String[] getPropertyKeys() public String[] getPropertyKeys()
{ {
String[] s = super.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); System.arraycopy(s, 0, result, 0, s.length);
result[s.length] = "ventilation"; int i = s.length;
result[s.length+1] = "purge"; if (!this.hideVentilation)
{
result[i++] = "ventilation";
}
if (!this.hidePurge)
{
result[i++] = "purge";
}
return result; return result;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment