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
354369b8
Commit
354369b8
authored
12 years ago
by
Thomas Oster
Browse files
Options
Downloads
Patches
Plain Diff
EpliogCutter can only process parts in a fixed order, so we have to split jobs with many parts
parent
450763c5
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
+63
-12
63 additions, 12 deletions
src/com/t_oster/liblasercut/drivers/EpilogCutter.java
with
63 additions
and
12 deletions
src/com/t_oster/liblasercut/drivers/EpilogCutter.java
+
63
−
12
View file @
354369b8
...
...
@@ -310,27 +310,77 @@ abstract class EpilogCutter extends LaserCutter
}
}
@Override
public
void
sendJob
(
LaserJob
job
,
ProgressListener
pl
)
throws
IllegalJobException
,
SocketTimeoutException
,
UnsupportedEncodingException
,
IOException
,
UnknownHostException
,
Exception
public
void
realSendJob
(
LaserJob
job
,
ProgressListener
pl
,
int
number
,
int
count
)
throws
UnsupportedEncodingException
,
IOException
,
UnknownHostException
,
Exception
{
pl
.
progressChanged
(
this
,
0
);
pl
.
taskChanged
(
this
,
"checking job"
);
//Perform santiy checks
checkJob
(
job
);
pl
.
taskChanged
(
this
,
"generating data"
);
String
nb
=
count
>
1
?
"("
+
number
+
"/"
+
count
+
")"
:
""
;
pl
.
taskChanged
(
this
,
"generating"
+
nb
);
//Generate all the data
byte
[]
pjlData
=
generatePjlData
(
job
);
pl
.
progressChanged
(
this
,
40
);
pl
.
progressChanged
(
this
,
(
int
)
((
double
)
40
*
number
/
count
)
);
//connect to lasercutter
pl
.
taskChanged
(
this
,
"connecting"
);
pl
.
taskChanged
(
this
,
"connecting"
+
nb
);
connect
();
pl
.
progressChanged
(
this
,
60
);
pl
.
progressChanged
(
this
,
(
int
)
((
double
)
60
*
number
/
count
)
);
//send job
pl
.
taskChanged
(
this
,
"sending"
);
pl
.
taskChanged
(
this
,
"sending"
+
nb
);
sendPjlJob
(
job
,
pjlData
);
pl
.
progressChanged
(
this
,
90
);
pl
.
progressChanged
(
this
,
(
int
)
((
double
)
90
*
number
/
count
)
);
//disconnect
disconnect
();
}
@Override
public
void
sendJob
(
LaserJob
job
,
ProgressListener
pl
)
throws
IllegalJobException
,
SocketTimeoutException
,
UnsupportedEncodingException
,
IOException
,
UnknownHostException
,
Exception
{
pl
.
progressChanged
(
this
,
0
);
pl
.
taskChanged
(
this
,
"checking job"
);
//Perform santiy checks
checkJob
(
job
);
//split the job because epilog doesn't support many combinations
List
<
List
<
JobPart
>>
jobs
=
new
LinkedList
<
List
<
JobPart
>>();
List
<
JobPart
>
toDo
=
job
.
getParts
();
while
(!
toDo
.
isEmpty
())
{
List
<
JobPart
>
currentSplit
=
new
LinkedList
<
JobPart
>();
if
(
toDo
.
get
(
0
)
instanceof
VectorPart
)
{
//we need an empty rasterPart before
currentSplit
.
add
(
new
RasterPart
(
this
.
getLaserPropertyForRasterPart
()));
}
else
if
(
toDo
.
get
(
0
)
instanceof
RasterPart
)
{
currentSplit
.
add
(
toDo
.
get
(
0
));
toDo
.
remove
(
0
);
}
else
if
(
toDo
.
get
(
0
)
instanceof
Raster3dPart
)
{
//we need an empty raster part with the same property
currentSplit
.
add
(
new
RasterPart
(((
Raster3dPart
)
toDo
.
get
(
0
)).
getLaserProperty
(
0
)));
currentSplit
.
add
(
toDo
.
get
(
0
));
toDo
.
remove
(
0
);
//and nothing else in that part
jobs
.
add
(
currentSplit
);
continue
;
}
//add all following vector parts
while
(!
toDo
.
isEmpty
()
&&
toDo
.
get
(
0
)
instanceof
VectorPart
)
{
currentSplit
.
add
(
toDo
.
get
(
0
));
toDo
.
remove
(
0
);
}
jobs
.
add
(
currentSplit
);
}
int
number
=
0
;
int
size
=
jobs
.
size
();
for
(
List
<
JobPart
>
current
:
jobs
)
{
number
++;
LaserJob
j
=
new
LaserJob
(
"("
+
number
+
"/"
+
size
+
")"
+
job
.
getTitle
(),
job
.
getName
(),
job
.
getUser
(),
job
.
getResolution
());
for
(
JobPart
p:
current
)
{
j
.
addPart
(
p
);
}
this
.
realSendJob
(
j
,
pl
,
number
,
size
);
}
pl
.
progressChanged
(
this
,
100
);
}
...
...
@@ -708,6 +758,7 @@ abstract class EpilogCutter extends LaserCutter
PrintStream
wrt
=
new
PrintStream
(
pjlJob
,
true
,
"US-ASCII"
);
wrt
.
write
(
generatePjlHeader
(
job
));
wrt
.
write
(
generateRasterPCL
(
job
,
null
));
for
(
JobPart
p
:
job
.
getParts
())
{
if
(
p
instanceof
VectorPart
)
...
...
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