Skip to content
Snippets Groups Projects
Commit 018a7e98 authored by René Bohne's avatar René Bohne Committed by Thomas Oster
Browse files

added lp support for iModela. Use printer://imodela_class in the properties

parent 1b5cec51
No related branches found
No related tags found
No related merge requests found
......@@ -282,6 +282,27 @@ public class IModelaMill extends LaserCutter
pl.taskChanged(this, "sending...");
w.write(gcode);
}
else if (hostname.startsWith("printer://"))
{
String printername = hostname.substring(10);
try
{
File tempFile = File.createTempFile(printername, ".txt");
PrintStream w = new PrintStream(new FileOutputStream(tempFile));
pl.taskChanged(this, "sending...");
w.write(gcode);
System.out.println("tempFile: "+ tempFile.getAbsolutePath());
Runtime.getRuntime().exec("/usr/bin/lp -d "+printername+" "+tempFile.getAbsolutePath());
}
catch(IOException ex)
{
System.err.println("Cannot create temp file: " + ex.getMessage());
}
}
else
{
Socket s = new Socket();
......
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