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

The Startpoint-Property of a job is now considered to be mm and should work (UNTESTED!)

parent f0d71bf3
No related branches found
No related tags found
No related merge requests found
......@@ -2,17 +2,17 @@
* This file is part of VisiCut.
* Copyright (C) 2012 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
*
* VisiCut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* VisiCut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with VisiCut. If not, see <http://www.gnu.org/licenses/>.
**/
......@@ -22,6 +22,8 @@
*/
package com.t_oster.liblasercut;
import com.sun.java_cup.internal.runtime.virtual_parse_stack;
import com.t_oster.liblasercut.platform.Util;
import java.util.LinkedList;
import java.util.List;
......@@ -35,8 +37,8 @@ public class LaserJob
private String title;
private String name;
private String user;
private int startX = 0;
private int startY = 0;
private double startX = 0;
private double startY = 0;
private List<JobPart> parts = new LinkedList<JobPart>();
public LaserJob(String title, String name, String user)
......@@ -46,18 +48,26 @@ public class LaserJob
this.user = user;
}
public void setStartPoint(int x, int y)
/**
* Sets a custom offset on the job. The values are considered to be in
* mm and measured from the top-left corner of the laserbed.
* As a result, all coordinates cx,cy in the job will be corrected
* to cx-x,cy-y
* @param x
* @param y
*/
public void setStartPoint(double x, double y)
{
startX = x;
startY = y;
}
public int getStartX()
public double getStartX()
{
return startX;
}
public int getStartY()
public double getStartY()
{
return startY;
}
......@@ -81,14 +91,55 @@ public class LaserJob
{
this.parts.add(p);
}
public void removePart(JobPart p)
{
this.parts.remove(p);
}
public List<JobPart> getParts()
{
return parts;
}
/**
* This mehtod will substract the start-point coordinates
* from all parts of the job (in the corresponding resolution)
* and then set the start-point to 0,0. This way multiple calls
* to this method won't result in corrupted jobs.
*/
public void applyStartPoint()
{
if (startX != 0 || startY != 0)
{
for (JobPart p : this.getParts())
{
if (p instanceof VectorPart)
{
for (VectorCommand c : ((VectorPart) p).getCommandList())
{
if (c.getType().equals(VectorCommand.CmdType.LINETO) || c.getType().equals(VectorCommand.CmdType.MOVETO))
{
c.setX((int) (c.getX() - Util.mm2inch(startX)*p.getDPI()));
c.setY((int) (c.getY() - Util.mm2inch(startY)*p.getDPI()));
}
}
}
else if (p instanceof RasterPart)
{
RasterPart rp = (RasterPart) p;
rp.start.x -= (int) (Util.mm2inch(startX)*p.getDPI());
rp.start.y -= (int) (Util.mm2inch(startY)*p.getDPI());
}
else if (p instanceof Raster3dPart)
{
Raster3dPart rp = (Raster3dPart) p;
rp.start.x -= (int) (Util.mm2inch(startX)*p.getDPI());
rp.start.y -= (int) (Util.mm2inch(startY)*p.getDPI());
}
}
startX = 0;
startY = 0;
}
}
}
......@@ -16,10 +16,6 @@
* along with VisiCut. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.t_oster.liblasercut;
import com.t_oster.liblasercut.platform.Point;
......@@ -35,7 +31,7 @@ public class Raster3dPart extends JobPart
private GreyscaleRaster image = null;
private LaserProperty property = null;
private Point start = null;
protected Point start = null;
private double resolution = 500;
public Raster3dPart(GreyscaleRaster image, LaserProperty laserProperty, Point offset, double resolution)
......@@ -51,7 +47,7 @@ public class Raster3dPart extends JobPart
{
return resolution;
}
@Override
public int getMinX()
{
......@@ -69,7 +65,7 @@ public class Raster3dPart extends JobPart
{
return start.y;
}
@Override
public int getMaxY()
{
......
......@@ -2,24 +2,20 @@
* This file is part of VisiCut.
* Copyright (C) 2012 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
*
* VisiCut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* VisiCut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with VisiCut. If not, see <http://www.gnu.org/licenses/>.
**/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.t_oster.liblasercut;
import com.t_oster.liblasercut.platform.Point;
......@@ -51,13 +47,13 @@ public class RasterPart extends JobPart
{
return resolution;
}
@Override
public int getMinX()
{
return this.start.x;
}
@Override
public int getMaxX()
{
......@@ -69,7 +65,7 @@ public class RasterPart extends JobPart
{
return start.y;
}
@Override
public int getMaxY()
{
......@@ -79,7 +75,7 @@ public class RasterPart extends JobPart
/**
* Returns the upper left point of the given raster
* @param raster the raster which upper left corner is to determine
* @return
* @return
*/
public Point getRasterStart()
{
......@@ -92,7 +88,7 @@ public class RasterPart extends JobPart
* 1 when black or 0 when white
* @param raster
* @param line
* @return
* @return
*/
public List<Byte> getRasterLine(int line)
{
......@@ -108,7 +104,7 @@ public class RasterPart extends JobPart
{
return this.image.isBlack(x, y);
}
public int getRasterWidth()
{
return this.image.getWidth();
......@@ -123,5 +119,5 @@ public class RasterPart extends JobPart
{
return this.property;
}
}
......@@ -2,17 +2,17 @@
* This file is part of VisiCut.
* Copyright (C) 2012 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
*
* VisiCut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* VisiCut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with VisiCut. If not, see <http://www.gnu.org/licenses/>.
**/
......@@ -29,6 +29,30 @@ package com.t_oster.liblasercut;
public class VectorCommand
{
void setX(int d)
{
if (this.type == CmdType.MOVETO || this.type == CmdType.LINETO)
{
operands[0] = d;
}
else
{
throw new UnsupportedOperationException("setX not supported for " + type.toString());
}
}
void setY(int d)
{
if (this.type == CmdType.MOVETO || this.type == CmdType.LINETO)
{
operands[1] = d;
}
else
{
throw new UnsupportedOperationException("setY not supported for " + type.toString());
}
}
public static enum CmdType
{
......@@ -40,7 +64,7 @@ public class VectorCommand
private int[] operands;
private float foperand;
private LaserProperty property;
public VectorCommand(CmdType type, int x, int y)
{
if (type == CmdType.MOVETO || type == CmdType.LINETO)
......@@ -56,7 +80,7 @@ public class VectorCommand
throw new IllegalArgumentException("Wrong number of Parameters for " + type.toString());
}
}
public VectorCommand(CmdType type, LaserProperty p)
{
if (type == CmdType.SETPROPERTY)
......@@ -92,7 +116,7 @@ public class VectorCommand
}
throw new UnsupportedOperationException("getX not supported for " + type.toString());
}
public LaserProperty getProperty()
{
if (this.type == CmdType.SETPROPERTY)
......@@ -104,5 +128,5 @@ public class VectorCommand
throw new UnsupportedOperationException("Only valid for PROPERTY");
}
}
}
......@@ -2,24 +2,20 @@
* This file is part of VisiCut.
* Copyright (C) 2012 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
*
* VisiCut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* VisiCut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with VisiCut. If not, see <http://www.gnu.org/licenses/>.
**/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.t_oster.liblasercut;
import java.util.LinkedList;
......@@ -50,7 +46,7 @@ public class VectorPart extends JobPart
commands = new LinkedList<VectorCommand>();
this.currentCuttingProperty = initialProperty;
commands.add(new VectorCommand(VectorCommand.CmdType.SETPROPERTY, initialProperty));
}
@Override
......@@ -58,7 +54,7 @@ public class VectorPart extends JobPart
{
return resolution;
}
public LaserProperty getCurrentCuttingProperty()
{
return currentCuttingProperty;
......@@ -118,7 +114,7 @@ public class VectorPart extends JobPart
{
return minX;
}
@Override
public int getMaxX()
{
......@@ -130,7 +126,7 @@ public class VectorPart extends JobPart
{
return minY;
}
@Override
public int getMaxY()
{
......
......@@ -26,7 +26,7 @@ import java.util.*;
/**
* This class implements a dummy driver that accepts laserjobs and prints debug information about them.
* You can use it to test the VisiCut GUI without having a real lasercutter.
*
*
* @author Max Gaukler <development@maxgaukler.de>, based on the LAOS driver by Thomas Oster <thomas.oster@rwth-aachen.de>
*/
public class Dummy extends LaserCutter {
......@@ -45,6 +45,7 @@ public class Dummy extends LaserCutter {
BufferedOutputStream out;
pl.taskChanged(this, "checking job");
checkJob(job);
job.applyStartPoint();
pl.taskChanged(this, "sending");
pl.taskChanged(this, "sent.");
System.out.println("dummy-driver got LaserJob: ");
......@@ -90,7 +91,7 @@ public class Dummy extends LaserCutter {
System.out.println("end of job.");
pl.progressChanged(this, 100);
}
@Override
public int estimateJobDuration(LaserJob job)
{
......@@ -99,12 +100,12 @@ public class Dummy extends LaserCutter {
if (!canEstimateJobDuration()) {
throw new RuntimeException("cannot estimate job duration (dummy driver: fake runtime is set to negative value)");
}
// return bogus value to test codepaths of GUI
// return bogus value to test codepaths of GUI
return fakeRunTime;
}
private List<Double> resolutions;
protected int fakeRunTime = -1;
@Override
public boolean canEstimateJobDuration() {
......@@ -192,7 +193,7 @@ public class Dummy extends LaserCutter {
} else if (SETTING_RUNTIME.equals(attribute)) {
this.fakeRunTime=Integer.parseInt(value.toString());
}
}
@Override
......
......@@ -2,17 +2,17 @@
* This file is part of VisiCut.
* Copyright (C) 2012 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
*
* VisiCut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* VisiCut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with VisiCut. If not, see <http://www.gnu.org/licenses/>.
**/
......@@ -45,7 +45,7 @@ abstract class EpilogCutter extends LaserCutter
public static boolean SIMULATE_COMMUNICATION = false;
public static final int NETWORK_TIMEOUT = 3000;
/* Resolutions in DPI */
private static final int MINFOCUS = -500;//Minimal focus value (not mm)
private static final int MAXFOCUS = 500;//Maximal focus value (not mm)
private static final double FOCUSWIDTH = 0.0252;//How much mm/unit the focus values are
......@@ -90,12 +90,12 @@ abstract class EpilogCutter extends LaserCutter
{
return this.autofocus;
}
public void setAutoFocus(boolean af)
{
this.autofocus = af;
}
private void waitForResponse(int expected) throws IOException, Exception
{
waitForResponse(expected, 3);
......@@ -143,12 +143,12 @@ abstract class EpilogCutter extends LaserCutter
if (this.isAutoFocus())
{
/* Set autofocus on. */
out.printf("\033&y1A");
out.printf("\033&y1A");
}
else
{
/* Set autofocus off. */
out.printf("\033&y0A");
out.printf("\033&y0A");
}
/* Set focus to 0. */
out.printf("\033&y0C");
......@@ -303,6 +303,7 @@ abstract class EpilogCutter extends LaserCutter
public void realSendJob(LaserJob job, ProgressListener pl, int number, int count) throws UnsupportedEncodingException, IOException, UnknownHostException, Exception
{
job.applyStartPoint();
String nb = count > 1 ? "("+number+"/"+count+")" : "";
pl.taskChanged(this, "generating"+nb);
//Generate all the data
......@@ -319,7 +320,7 @@ abstract class EpilogCutter extends LaserCutter
//disconnect
disconnect();
}
@Override
public void sendJob(LaserJob job, ProgressListener pl) throws IllegalJobException, SocketTimeoutException, UnsupportedEncodingException, IOException, UnknownHostException, Exception
{
......@@ -362,6 +363,7 @@ abstract class EpilogCutter extends LaserCutter
{
number++;
LaserJob j = new LaserJob((size > 1 ? "("+number+"/"+size+")" : "" )+job.getTitle(), job.getName(), job.getUser());
j.setStartPoint(job.getStartX(), job.getStartY());
for (JobPart p:current)
{
j.addPart(p);
......@@ -541,7 +543,7 @@ abstract class EpilogCutter extends LaserCutter
out.printf("\033*rC"); // end raster
return result.toByteArray();
}
private byte[] generateRasterPCL(RasterPart rp) throws UnsupportedEncodingException, IOException
{
PowerSpeedFocusProperty prop = (PowerSpeedFocusProperty) rp.getLaserProperty();
......@@ -646,7 +648,7 @@ abstract class EpilogCutter extends LaserCutter
out.printf("WF%d;", 0);
return result.toByteArray();
}
private byte[] generateVectorPCL(VectorPart vp) throws UnsupportedEncodingException
{
//TODO: Test if the resolution settings have an effect
......@@ -662,8 +664,6 @@ abstract class EpilogCutter extends LaserCutter
Integer currentSpeed = null;
Integer currentFrequency = null;
Float currentFocus = null;
int sx = 0;
int sy = 0;
VectorCommand.CmdType lastType = null;
for (VectorCommand cmd : vp.getCommandList())
{
......@@ -700,18 +700,18 @@ abstract class EpilogCutter extends LaserCutter
}
case MOVETO:
{
out.printf("PU%d,%d;", cmd.getX() - sx, cmd.getY() - sy);
out.printf("PU%d,%d;", cmd.getX(), cmd.getY());
break;
}
case LINETO:
{
if (lastType == null || lastType != VectorCommand.CmdType.LINETO)
{
out.printf("PD%d,%d", cmd.getX() - sx, cmd.getY() - sy);
out.printf("PD%d,%d", cmd.getX(), cmd.getY());
}
else
{
out.printf(",%d,%d", cmd.getX() - sx, cmd.getY() - sy);
out.printf(",%d,%d", cmd.getX(), cmd.getY());
}
break;
}
......@@ -884,7 +884,7 @@ abstract class EpilogCutter extends LaserCutter
{
return true;
}
@Override
public int estimateJobDuration(LaserJob job)
{
......@@ -995,5 +995,5 @@ abstract class EpilogCutter extends LaserCutter
{
return Math.sqrt(Math.pow(p.x - x, 2) + Math.pow(p.y - y, 2));
}
}
......@@ -2,17 +2,17 @@
* This file is part of VisiCut.
* Copyright (C) 2012 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
*
* VisiCut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* VisiCut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with VisiCut. If not, see <http://www.gnu.org/licenses/>.
**/
......@@ -46,7 +46,7 @@ import org.apache.commons.net.tftp.TFTPClient;
* This class implements a driver for the LAOS Lasercutter board.
* Currently it supports the simple code and the G-Code, which may be used in
* the future.
*
*
* @author Thomas Oster <thomas.oster@rwth-aachen.de>
*/
public class LaosCutter extends LaserCutter
......@@ -62,37 +62,37 @@ public class LaosCutter extends LaserCutter
private static final String SETTING_TFTP = "Use TFTP instead of TCP";
private static final String SETTING_RASTER_WHITESPACE = "Additional space per Raster line";
private static final String SETTING_UNIDIR = "Engrave unidirectional";
private boolean unidir = false;
@Override
public LaosCutterProperty getLaserPropertyForVectorPart()
{
return new LaosCutterProperty();
}
@Override
public LaosCutterProperty getLaserPropertyForRasterPart()
{
return new LaosCutterProperty();
}
@Override
public LaosCutterProperty getLaserPropertyForRaster3dPart()
{
return new LaosCutterProperty();
}
public void setEngraveUnidirectional(boolean uni)
{
this.unidir = uni;
}
public boolean isEngraveUnidirectional()
{
return this.unidir;
}
private double addSpacePerRasterLine = 5;
/**
......@@ -117,7 +117,7 @@ public class LaosCutter extends LaserCutter
this.addSpacePerRasterLine = addSpacePerRasterLine;
}
@Override
public String getModelName()
{
......@@ -165,7 +165,7 @@ public class LaosCutter extends LaserCutter
{
this.flipXaxis = flipXaxis;
}
protected boolean flipYaxis = true;
/**
......@@ -187,7 +187,7 @@ public class LaosCutter extends LaserCutter
{
this.flipYaxis = flipYaxis;
}
protected String hostname = "192.168.123.111";
/**
......@@ -285,7 +285,7 @@ public class LaosCutter extends LaserCutter
{
out.printf("0 %d %d\n", px2steps(isFlipXaxis() ? Util.mm2px(bedWidth, resolution) - x : x, resolution), px2steps(isFlipYaxis() ? Util.mm2px(bedHeight, resolution) - y : y, resolution));
}
private void loadBitmapLine(PrintStream out, List<Long> dwords)
{
out.printf("9 %s %s ", "1", ""+(dwords.size()*32));
......@@ -295,7 +295,7 @@ public class LaosCutter extends LaserCutter
}
out.printf("\n");
}
private float currentPower = -1;
private void setPower(PrintStream out, float power)
{
......@@ -305,7 +305,7 @@ public class LaosCutter extends LaserCutter
currentPower = power;
}
}
private float currentSpeed = -1;
private void setSpeed(PrintStream out, float speed)
{
......@@ -315,7 +315,7 @@ public class LaosCutter extends LaserCutter
currentSpeed = speed;
}
}
private int currentFrequency = -1;
private void setFrequency(PrintStream out, int frequency)
{
......@@ -325,7 +325,7 @@ public class LaosCutter extends LaserCutter
currentFrequency = frequency;
}
}
private float currentFocus = 0;
private void setFocus(PrintStream out, float focus)
{
......@@ -335,7 +335,7 @@ public class LaosCutter extends LaserCutter
currentFocus = focus;
}
}
private Boolean currentVentilation = null;
private void setVentilation(PrintStream out, boolean ventilation)
{
......@@ -345,7 +345,7 @@ public class LaosCutter extends LaserCutter
currentVentilation = ventilation;
}
}
private Boolean currentPurge = null;
private void setPurge(PrintStream out, boolean purge)
{
......@@ -355,7 +355,7 @@ public class LaosCutter extends LaserCutter
currentPurge = purge;
}
}
private void setCurrentProperty(PrintStream out, LaserProperty p)
{
if (p instanceof LaosCutterProperty)
......@@ -371,9 +371,9 @@ public class LaosCutter extends LaserCutter
else
{
throw new RuntimeException("The Laos driver only accepts LaosCutter properties (was "+p.getClass().toString()+")");
}
}
}
private void line(PrintStream out, float x, float y, double resolution)
{
out.printf("1 %d %d\n", px2steps(isFlipXaxis() ? Util.mm2px(bedWidth, resolution) - x : x, resolution), px2steps(isFlipYaxis() ? Util.mm2px(bedHeight, resolution) - y : y, resolution));
......@@ -467,7 +467,7 @@ public class LaosCutter extends LaserCutter
}
/**
* This Method takes a raster-line represented by a list of bytes,
* This Method takes a raster-line represented by a list of bytes,
* where: byte0 ist the left-most byte, in one byte, the MSB is the
* left-most bit, 0 representing laser off, 1 representing laser on.
* The Output List of longs, where each value is the unsigned dword
......@@ -479,7 +479,7 @@ public class LaosCutter extends LaserCutter
* rightmost bit
* @param line
* @param outputLeftToRight
* @return
* @return
*/
public List<Long> byteLineToDwords(List<Byte> line, boolean outputLeftToRight)
{
......@@ -492,7 +492,7 @@ public class LaosCutter extends LaserCutter
for(int i=0; i<s; i+=4)
{
result.add(
(((long) (i+3 < s ? 0xFF&line.get(i+3) : 0))<<24)
(((long) (i+3 < s ? 0xFF&line.get(i+3) : 0))<<24)
+ (((long) (i+2 < s ? 0xFF&line.get(i+2) : 0))<<16)
+ (((long) (i+1 < s ? 0xFF&line.get(i+1) : 0))<<8)
+ ((long) (0xFF&line.get(i)))
......@@ -502,13 +502,13 @@ public class LaosCutter extends LaserCutter
{
Collections.reverse(result);
for(int i=0;i<result.size();i++)
{
{
result.set(i, Long.reverse(result.get(i)) >>> 32);
}
}
return result;
}
private byte[] generateLaosRasterCode(RasterPart rp, double resolution) throws UnsupportedEncodingException, IOException
{
ByteArrayOutputStream result = new ByteArrayOutputStream();
......@@ -549,11 +549,11 @@ public class LaosCutter extends LaserCutter
{
bytes.add((byte) 0);
space -= 8;
}
}
if (dirRight)
{
//move to the first point of the line
move(out, lineStart.x, lineStart.y, resolution);
move(out, lineStart.x, lineStart.y, resolution);
List<Long> dwords = this.byteLineToDwords(bytes, true);
loadBitmapLine(out, dwords);
line(out, lineStart.x + (dwords.size()*32), lineStart.y, resolution);
......@@ -562,9 +562,9 @@ public class LaosCutter extends LaserCutter
{
//move to the first point of the line
List<Long> dwords = this.byteLineToDwords(bytes, false);
move(out, lineStart.x+(dwords.size()*32), lineStart.y, resolution);
move(out, lineStart.x+(dwords.size()*32), lineStart.y, resolution);
loadBitmapLine(out, dwords);
line(out, lineStart.x, lineStart.y, resolution);
line(out, lineStart.x, lineStart.y, resolution);
}
}
if (!this.isEngraveUnidirectional())
......@@ -574,7 +574,7 @@ public class LaosCutter extends LaserCutter
}
return result.toByteArray();
}
private byte[] generateInitializationCode() throws UnsupportedEncodingException
{
ByteArrayOutputStream result = new ByteArrayOutputStream();
......@@ -618,7 +618,7 @@ public class LaosCutter extends LaserCutter
out.write(this.generateShutdownCode());
out.close();
}
@Override
public void sendJob(LaserJob job, ProgressListener pl) throws IllegalJobException, Exception
{
......@@ -627,6 +627,7 @@ public class LaosCutter extends LaserCutter
ByteArrayOutputStream buffer = null;
pl.taskChanged(this, "checking job");
checkJob(job);
job.applyStartPoint();
if (!useTftp)
{
pl.taskChanged(this, "connecting");
......
......@@ -371,6 +371,7 @@ public class Lasersaur extends LaserCutter {
BufferedOutputStream out;
pl.taskChanged(this, "checking job");
checkJob(job);
job.applyStartPoint();
pl.taskChanged(this, "connecting");
CommPortIdentifier cpi = null;
//since the CommPortIdentifier.getPortIdentifier(String name) method
......
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