diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index f914dc803fe5850debc6d81ea6ace883c459b240..a714553824396f0a132d6af7eee8a6482036372a 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -216,7 +216,12 @@ is divided into following sections: </not> </and> </condition> - <property name="javac.fork" value="${jdkBug6558476}"/> + <condition else="false" property="javac.fork"> + <or> + <istrue value="${jdkBug6558476}"/> + <istrue value="${javac.external.vm}"/> + </or> + </condition> <property name="jar.index" value="false"/> <property name="jar.index.metainf" value="${jar.index}"/> <property name="copylibs.rebase" value="true"/> @@ -242,6 +247,7 @@ is divided into following sections: <condition else="" property="testng.debug.mode" value="-mixed"> <istrue value="${junit+testng.available}"/> </condition> + <property name="java.failonerror" value="true"/> </target> <target name="-post-init"> <!-- Empty placeholder for easier customization. --> @@ -718,7 +724,7 @@ is divided into following sections: <sequential> <property environment="env"/> <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/> - <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}"> + <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}"> <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> <jvmarg value="${profiler.info.jvmargs.agent}"/> <jvmarg line="${profiler.info.jvmargs}"/> @@ -793,7 +799,7 @@ is divided into following sections: <attribute default="${debug.classpath}" name="classpath"/> <element name="customize" optional="true"/> <sequential> - <java classname="@{classname}" dir="${work.dir}" fork="true"> + <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true"> <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> <jvmarg line="${debug-args-line}"/> <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> @@ -820,7 +826,7 @@ is divided into following sections: <attribute default="jvm" name="jvm"/> <element name="customize" optional="true"/> <sequential> - <java classname="@{classname}" dir="${work.dir}" fork="true"> + <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true"> <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 90d9f32ec500b4e0cddda67eacf865312797116f..8605cf4fba0bdb226315b7a0a5de7104147c986d 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=25a416f2 -nbproject/build-impl.xml.script.CRC32=534d1876 -nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.74.1.48 +nbproject/build-impl.xml.script.CRC32=b7e1fd77 +nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48 diff --git a/src/com/t_oster/liblasercut/drivers/EpilogCutter.java b/src/com/t_oster/liblasercut/drivers/EpilogCutter.java index 6aab36ffad381419402b74d43e94c266496a9c44..8b1f504d23619bda36e4cb16817e1b429a59ee07 100644 --- a/src/com/t_oster/liblasercut/drivers/EpilogCutter.java +++ b/src/com/t_oster/liblasercut/drivers/EpilogCutter.java @@ -53,8 +53,8 @@ abstract class EpilogCutter extends LaserCutter private String hostname = "10.0.0.1"; private int port = 515; private boolean autofocus = false; - private transient InputStream in; - private transient OutputStream out; + transient InputStream in; + transient OutputStream out; private int mm2focus(float mm) { diff --git a/src/com/t_oster/liblasercut/drivers/EpilogRadius.java b/src/com/t_oster/liblasercut/drivers/EpilogRadius.java new file mode 100644 index 0000000000000000000000000000000000000000..7408c9355a7c9fd9c6327f521b254137a04874d2 --- /dev/null +++ b/src/com/t_oster/liblasercut/drivers/EpilogRadius.java @@ -0,0 +1,221 @@ +/** + * This file is part of LibLaserCut. + * Copyright (C) 2011 - 2014 Thomas Oster <mail@thomas-oster.de> + * + * LibLaserCut 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. + * + * LibLaserCut 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 LibLaserCut. If not, see <http://www.gnu.org/licenses/>. + * + **/ +/** + * Known Limitations: + * - If there is Raster and Raster3d Part in one job, the speed from 3d raster + * is taken for both and eventually other side effects: + * IT IS NOT RECOMMENDED TO USE 3D-Raster and Raster in the same Job + */ + +package com.t_oster.liblasercut.drivers; + +import com.t_oster.liblasercut.LaserJob; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.io.UnsupportedEncodingException; +import java.net.SocketTimeoutException; +import java.net.UnknownHostException; +import java.util.Enumeration; +import java.util.LinkedList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import purejavacomm.CommPort; +import purejavacomm.CommPortIdentifier; +import purejavacomm.NoSuchPortException; +import purejavacomm.PortInUseException; +import purejavacomm.SerialPort; +import purejavacomm.UnsupportedCommOperationException; + +/** + * + * @author Thomas Oster <thomas.oster@rwth-aachen.de> + */ +public class EpilogRadius extends EpilogCutter +{ + + protected String portName = "LPT1"; + private CommPort comport; + + public EpilogRadius() + { + } + + public EpilogRadius(String hostname) + { + super(hostname); + } + + @Override + public String getModelName() + { + return "Epilog Radius"; + } + + private static final double[] RESOLUTIONS = new double[] + { + 75, 150, 200, 300, 400, 600, 1200 + }; + + @Override + public List<Double> getResolutions() + { + List<Double> result = new LinkedList(); + for (double r : RESOLUTIONS) + { + result.add(r); + } + return result; + } + + @Override + public EpilogRadius clone() + { + EpilogRadius result = new EpilogRadius(); + result.setHostname(this.getHostname()); + result.setPort(this.getPort()); + result.setBedHeight(this.getBedHeight()); + result.setBedWidth(this.getBedWidth()); + result.setAutoFocus(this.isAutoFocus()); + result.setPortName(portName); + return result; + } + + @Override + protected void disconnect() throws IOException + { + comport.close(); + } + + @Override + protected void connect() throws IOException, SocketTimeoutException + { + try + { + CommPortIdentifier identifier = null; + if ("auto".equals(portName)) { + Enumeration e = CommPortIdentifier.getPortIdentifiers(); + while (e.hasMoreElements()) + { + identifier = (CommPortIdentifier) e.nextElement(); + if (identifier.getPortType() == CommPortIdentifier.PORT_PARALLEL) + { + break; + } + } + } + else { + identifier = CommPortIdentifier.getPortIdentifier(portName); + } + comport = identifier.open("VisiCut", 1000); + out = comport.getOutputStream(); + in = comport.getInputStream(); + } + catch (NoSuchPortException ex) + { + Logger.getLogger(EpilogRadius.class.getName()).log(Level.SEVERE, null, ex); + } + catch (PortInUseException ex) + { + Logger.getLogger(EpilogRadius.class.getName()).log(Level.SEVERE, null, ex); + } + } + + + + @Override + protected void sendPjlJob(LaserJob job, byte[] pjlData) throws UnknownHostException, UnsupportedEncodingException, IOException, Exception + { + PrintStream out = new PrintStream(this.out, true, "US-ASCII"); + out.write(pjlData); + } + + //We need this methods for XMLEncoder to work properly + @Override + public boolean isAutoFocus() + { + return super.isAutoFocus(); + } + + public String getPortName() + { + return portName; + } + + public void setPortName(String portName) + { + this.portName = portName; + } + + @Override + public void setAutoFocus(boolean b) + { + super.setAutoFocus(b); + } + + @Override + public void setBedHeight(double bh) + { + super.setBedHeight(bh); + } + + @Override + public double getBedHeight() + { + return super.getBedHeight(); + } + + @Override + public void setBedWidth(double bh) + { + super.setBedWidth(bh); + } + + @Override + public double getBedWidth() + { + return super.getBedWidth(); + } + + @Override + public void setHostname(String host) + { + super.setHostname(host); + } + + @Override + public String getHostname() + { + return super.getHostname(); + } + + @Override + public int getPort() + { + return super.getPort(); + } + + @Override + public void setPort(int p) + { + super.setPort(p); + } +}