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

LAOS: Focus also has to be explicitely enabled in the driver. Fixes t-oster/VisiCut#73

parent 645ee4b3
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,19 @@ public class LaosCutter extends LaserCutter
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 static final String SETTING_SUPPORTS_FOCUS = "Supports focus (Z-axis movement)";
private boolean supportsFocus = false;
public boolean isSupportsFocus()
{
return supportsFocus;
}
public void setSupportsFocus(boolean supportsFocus)
{
this.supportsFocus = supportsFocus;
}
private boolean supportsPurge = false;
......@@ -96,19 +109,19 @@ public class LaosCutter extends LaserCutter
@Override
public LaosCutterProperty getLaserPropertyForVectorPart()
{
return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation);
return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation, !this.supportsFocus);
}
@Override
public LaosCutterProperty getLaserPropertyForRasterPart()
{
return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation);
return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation, !this.supportsFocus);
}
@Override
public LaosCutterProperty getLaserPropertyForRaster3dPart()
{
return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation);
return new LaosCutterProperty(!this.supportsPurge, !this.supportsVentilation, !this.supportsFocus);
}
public void setEngraveUnidirectional(boolean uni)
......@@ -389,7 +402,10 @@ public class LaosCutter extends LaserCutter
if (p instanceof LaosCutterProperty)
{
LaosCutterProperty prop = (LaosCutterProperty) p;
setFocus(out, prop.getFocus());
if (this.supportsFocus)
{
setFocus(out, prop.getFocus());
}
if (this.supportsVentilation)
{
setVentilation(out, prop.getVentilation());
......@@ -783,6 +799,7 @@ public class LaosCutter extends LaserCutter
//SETTING_MMPERSTEP,
SETTING_SUPPORTS_VENTILATION,
SETTING_SUPPORTS_PURGE,
SETTING_SUPPORTS_FOCUS,
SETTING_TFTP,
SETTING_RASTER_WHITESPACE,
SETTING_DEBUGFILE
......@@ -813,6 +830,10 @@ public class LaosCutter extends LaserCutter
{
return (Boolean) this.supportsVentilation;
}
else if (SETTING_SUPPORTS_FOCUS.equals(attribute))
{
return (Boolean) this.supportsFocus;
}
else if (SETTING_UNIDIR.equals(attribute))
{
return (Boolean) this.isEngraveUnidirectional();
......@@ -859,18 +880,22 @@ public class LaosCutter extends LaserCutter
{
this.debugFilename = value != null ? (String) value : "";
}
if (SETTING_RASTER_WHITESPACE.equals(attribute))
else if (SETTING_RASTER_WHITESPACE.equals(attribute))
{
this.setAddSpacePerRasterLine((Double) value);
}
if (SETTING_SUPPORTS_PURGE.equals(attribute))
else if (SETTING_SUPPORTS_PURGE.equals(attribute))
{
this.setSupportsPurge((Boolean) value);
}
if (SETTING_SUPPORTS_VENTILATION.equals(attribute))
else if (SETTING_SUPPORTS_VENTILATION.equals(attribute))
{
this.setSupportsVentilation((Boolean) value);
}
else if (SETTING_SUPPORTS_FOCUS.equals(attribute))
{
this.setSupportsFocus((Boolean) value);
}
else if (SETTING_UNIDIR.endsWith(attribute))
{
this.setEngraveUnidirectional((Boolean) value);
......@@ -926,6 +951,7 @@ public class LaosCutter extends LaserCutter
clone.unidir = unidir;
clone.supportsPurge = supportsPurge;
clone.supportsVentilation = supportsVentilation;
clone.supportsFocus = supportsFocus;
return clone;
}
......
......@@ -19,6 +19,8 @@
package com.t_oster.liblasercut.drivers;
import com.t_oster.liblasercut.FloatPowerSpeedFocusFrequencyProperty;
import java.util.Arrays;
import java.util.LinkedList;
/**
*
......@@ -28,18 +30,20 @@ public class LaosCutterProperty extends FloatPowerSpeedFocusFrequencyProperty {
private boolean hidePurge = false;
private boolean hideVentilation = false;
private boolean hideFocus = false;
private boolean ventilation = true;
public LaosCutterProperty(boolean hidePurge, boolean hideVentilation)
public LaosCutterProperty(boolean hidePurge, boolean hideVentilation, boolean hideFocus)
{
this.hidePurge = hidePurge;
this.hideVentilation = hideVentilation;
this.hideFocus = hideFocus;
}
public LaosCutterProperty()
{
this(false, false);
this(false, false, false);
}
/**
......@@ -86,23 +90,21 @@ public class LaosCutterProperty extends FloatPowerSpeedFocusFrequencyProperty {
@Override
public String[] getPropertyKeys()
{
String[] s = super.getPropertyKeys();
if (this.hidePurge && this.hideVentilation)
LinkedList<String> result = new LinkedList<String>();
result.addAll(Arrays.asList(super.getPropertyKeys()));
if (this.hideFocus)
{
return s;
result.remove("focus");
}
String[] result = new String[s.length+ (this.hidePurge ? 0 : 1) + (this.hideVentilation ? 0 : 1)];
System.arraycopy(s, 0, result, 0, s.length);
int i = s.length;
if (!this.hideVentilation)
{
result[i++] = "ventilation";
result.add("ventilation");
}
if (!this.hidePurge)
{
result[i++] = "purge";
result.add("purge");
}
return result;
return result.toArray(new String[0]);
}
@Override
......
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