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

draft

parent 8d8e66c8
No related branches found
No related tags found
No related merge requests found
...@@ -216,7 +216,12 @@ is divided into following sections: ...@@ -216,7 +216,12 @@ is divided into following sections:
</not> </not>
</and> </and>
</condition> </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" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/> <property name="jar.index.metainf" value="${jar.index}"/>
<property name="copylibs.rebase" value="true"/> <property name="copylibs.rebase" value="true"/>
...@@ -242,6 +247,7 @@ is divided into following sections: ...@@ -242,6 +247,7 @@ is divided into following sections:
<condition else="" property="testng.debug.mode" value="-mixed"> <condition else="" property="testng.debug.mode" value="-mixed">
<istrue value="${junit+testng.available}"/> <istrue value="${junit+testng.available}"/>
</condition> </condition>
<property name="java.failonerror" value="true"/>
</target> </target>
<target name="-post-init"> <target name="-post-init">
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
...@@ -718,7 +724,7 @@ is divided into following sections: ...@@ -718,7 +724,7 @@ is divided into following sections:
<sequential> <sequential>
<property environment="env"/> <property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/> <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 line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/> <jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/> <jvmarg line="${profiler.info.jvmargs}"/>
...@@ -793,7 +799,7 @@ is divided into following sections: ...@@ -793,7 +799,7 @@ is divided into following sections:
<attribute default="${debug.classpath}" name="classpath"/> <attribute default="${debug.classpath}" name="classpath"/>
<element name="customize" optional="true"/> <element name="customize" optional="true"/>
<sequential> <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="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg line="${debug-args-line}"/> <jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
...@@ -820,7 +826,7 @@ is divided into following sections: ...@@ -820,7 +826,7 @@ is divided into following sections:
<attribute default="jvm" name="jvm"/> <attribute default="jvm" name="jvm"/>
<element name="customize" optional="true"/> <element name="customize" optional="true"/>
<sequential> <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="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/> <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
......
...@@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45 ...@@ -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. # 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. # 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.data.CRC32=25a416f2
nbproject/build-impl.xml.script.CRC32=534d1876 nbproject/build-impl.xml.script.CRC32=b7e1fd77
nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.74.1.48 nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
...@@ -53,8 +53,8 @@ abstract class EpilogCutter extends LaserCutter ...@@ -53,8 +53,8 @@ abstract class EpilogCutter extends LaserCutter
private String hostname = "10.0.0.1"; private String hostname = "10.0.0.1";
private int port = 515; private int port = 515;
private boolean autofocus = false; private boolean autofocus = false;
private transient InputStream in; transient InputStream in;
private transient OutputStream out; transient OutputStream out;
private int mm2focus(float mm) private int mm2focus(float mm)
{ {
......
/**
* 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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment