Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LibLaserCut
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Elektronikföreningen Admittansen
LibLaserCut
Commits
5a3f5bea
Commit
5a3f5bea
authored
9 years ago
by
Marcel Schwittlick
Browse files
Options
Downloads
Patches
Plain Diff
exportgcode: fixing some quirks, refactoring
parent
f8cff987
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/com/t_oster/liblasercut/LaserCutter.java
+6
-1
6 additions, 1 deletion
src/com/t_oster/liblasercut/LaserCutter.java
src/com/t_oster/liblasercut/drivers/GenericGcodeDriver.java
+5
-6
5 additions, 6 deletions
src/com/t_oster/liblasercut/drivers/GenericGcodeDriver.java
with
11 additions
and
7 deletions
src/com/t_oster/liblasercut/LaserCutter.java
+
6
−
1
View file @
5a3f5bea
...
...
@@ -24,6 +24,8 @@ package com.t_oster.liblasercut;
import
com.t_oster.liblasercut.platform.Point
;
import
com.t_oster.liblasercut.platform.Util
;
import
sun.reflect.generics.reflectiveObjects.NotImplementedException
;
import
java.util.LinkedList
;
import
java.util.List
;
...
...
@@ -80,7 +82,10 @@ public abstract class LaserCutter implements Cloneable, Customizable {
*/
public
abstract
void
sendJob
(
LaserJob
job
,
ProgressListener
pl
,
List
<
String
>
warnings
)
throws
IllegalJobException
,
Exception
;
public
abstract
void
saveJob
(
LaserJob
job
)
throws
IllegalJobException
,
Exception
;
public
void
saveJob
(
java
.
io
.
PrintStream
fileOutputStream
,
LaserJob
job
)
throws
NotImplementedException
,
IllegalJobException
,
Exception
{
System
.
err
.
println
(
"Your driver does not implement saveJob(LaserJob job)"
);
throw
new
NotImplementedException
();
}
/**
* If you lasercutter supports autofocus, override this method,
...
...
This diff is collapsed.
Click to expand it.
src/com/t_oster/liblasercut/drivers/GenericGcodeDriver.java
+
5
−
6
View file @
5a3f5bea
...
...
@@ -27,6 +27,7 @@ import java.io.File;
import
java.io.InputStreamReader
;
import
java.io.PrintStream
;
import
java.io.UnsupportedEncodingException
;
import
java.lang.Exception
;
import
java.net.InetSocketAddress
;
import
java.net.Socket
;
import
java.net.URI
;
...
...
@@ -661,14 +662,12 @@ public class GenericGcodeDriver extends LaserCutter {
}
@Override
public
void
saveJob
(
LaserJob
job
)
throws
IllegalJobException
,
Exception
{
public
void
saveJob
(
java
.
io
.
PrintStream
fileOutputStream
,
LaserJob
job
)
throws
IllegalJobException
,
Exception
{
checkJob
(
job
);
String
timestamp
=
new
SimpleDateFormat
(
"yyyyMMddhhmmssSSS"
).
format
(
new
Date
(
)
);
String
filename
=
"output_"
+
timestamp
+
".gcode"
;
System
.
out
.
println
(
"Creating file "
+
filename
);
this
.
out
=
new
PrintStream
(
new
File
(
filename
));
this
.
out
=
fileOutputStream
;
boolean
wasSetWaitingForOk
=
isWaitForOKafterEachLine
();
setWaitForOKafterEachLine
(
false
);
writeInitializationCode
();
...
...
@@ -695,7 +694,7 @@ public void saveJob(LaserJob job) throws IllegalJobException, Exception {
writeShutdownCode
();
this
.
out
.
flush
();
setWaitForOKafterEachLine
(
true
);
setWaitForOKafterEachLine
(
wasSetWaitingForOk
);
}
private
List
<
Double
>
resolutions
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment