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
5e2cfd96
Commit
5e2cfd96
authored
12 years ago
by
Thomas Oster
Browse files
Options
Downloads
Patches
Plain Diff
stuff
parent
80f5a8ed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/com/t_oster/liblasercut/drivers/EpilogCutter.java
+16
-12
16 additions, 12 deletions
src/com/t_oster/liblasercut/drivers/EpilogCutter.java
with
16 additions
and
12 deletions
src/com/t_oster/liblasercut/drivers/EpilogCutter.java
+
16
−
12
View file @
5e2cfd96
...
...
@@ -368,10 +368,8 @@ abstract class EpilogCutter extends LaserCutter
pl
.
progressChanged
(
this
,
100
);
}
@Override
abstract
public
List
<
Double
>
getResolutions
();
/**
* Encodes the given line of the given image in TIFF Packbyte encoding
...
...
@@ -511,7 +509,6 @@ abstract class EpilogCutter extends LaserCutter
PowerSpeedFocusProperty
prop
=
new
PowerSpeedFocusProperty
();
ByteArrayOutputStream
result
=
new
ByteArrayOutputStream
();
PrintStream
out
=
new
PrintStream
(
result
,
true
,
"US-ASCII"
);
//TODO: Test if the resolution settings have an effect
/* PCL/RasterGraphics resolution. */
out
.
printf
(
"\033*t%dR"
,
(
int
)
jp
.
getDPI
());
/* Raster Orientation: Printed in current direction */
...
...
@@ -583,7 +580,7 @@ abstract class EpilogCutter extends LaserCutter
List
<
Byte
>
line
=
rp
.
getRasterLine
(
y
);
//Remove leading zeroes, but keep track of the offset
int
jump
=
0
;
while
(
false
&&
line
.
size
()
>
0
&&
line
.
get
(
0
)
==
0
)
while
(
line
.
size
()
>
0
&&
line
.
get
(
0
)
==
0
)
{
line
.
remove
(
0
);
jump
++;
...
...
@@ -636,20 +633,23 @@ abstract class EpilogCutter extends LaserCutter
return
result
.
toByteArray
();
}
private
byte
[]
generateDummyVector
(
double
dpi
)
throws
UnsupportedEncodingException
{
ByteArrayOutputStream
result
=
new
ByteArrayOutputStream
();
PrintStream
out
=
new
PrintStream
(
result
,
true
,
"US-ASCII"
);
out
.
printf
(
"\033%%1B"
);
// Start HLGL
out
.
printf
(
"IN;PU0,0;"
);
//Reset Focus to 0
out
.
printf
(
"WF%d;"
,
0
);
return
result
.
toByteArray
();
}
private
byte
[]
generateVectorPCL
(
VectorPart
vp
)
throws
UnsupportedEncodingException
{
//TODO: Test if the resolution settings have an effect
ByteArrayOutputStream
result
=
new
ByteArrayOutputStream
();
PrintStream
out
=
new
PrintStream
(
result
,
true
,
"US-ASCII"
);
/* Resolution of the print. Number of Units/Inch*/
out
.
printf
(
"\033&u%dD"
,
(
int
)
vp
.
getDPI
());
/* PCL/RasterGraphics resolution. */
out
.
printf
(
"\033*t%dR"
,
(
int
)
vp
.
getDPI
());
out
.
printf
(
"\033*r0F"
);
out
.
printf
(
"\033*r%dT"
,
vp
.
getMaxY
());
// if not dummy, then job.getHeight());
out
.
printf
(
"\033*r%dS"
,
vp
.
getMaxX
());
// if not dummy then job.getWidth());
out
.
printf
(
"\033*r1A"
);
out
.
printf
(
"\033*rC"
);
out
.
printf
(
"\033%%1B"
);
// Start HLGL
out
.
printf
(
"IN;PU0,0;"
);
...
...
@@ -747,6 +747,10 @@ abstract class EpilogCutter extends LaserCutter
wrt
.
write
(
generateRaster3dPCL
((
Raster3dPart
)
p
));
}
}
if
(!
(
job
.
getParts
().
get
(
job
.
getParts
().
size
()-
1
)
instanceof
VectorPart
))
{
wrt
.
write
(
generateDummyVector
(
job
.
getParts
().
get
(
job
.
getParts
().
size
()-
1
).
getDPI
()));
}
wrt
.
write
(
generatePjlFooter
());
/* Pad out the remainder of the file with 0 characters. */
for
(
int
i
=
0
;
i
<
4096
;
i
++)
...
...
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