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
b9cafcbd
Commit
b9cafcbd
authored
11 years ago
by
Thomas Oster
Browse files
Options
Downloads
Patches
Plain Diff
some imodela fixes
parent
2a5e7a78
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/com/t_oster/liblasercut/drivers/IModelaMill.java
+23
-5
23 additions, 5 deletions
src/com/t_oster/liblasercut/drivers/IModelaMill.java
with
23 additions
and
5 deletions
src/com/t_oster/liblasercut/drivers/IModelaMill.java
+
23
−
5
View file @
b9cafcbd
...
...
@@ -72,6 +72,7 @@ public class IModelaMill extends LaserCutter
private
static
String
PORT
=
"port"
;
private
static
String
BED_WIDTH
=
"bed width"
;
private
static
String
BED_HEIGHT
=
"bed height"
;
private
static
String
FLIP_YAXIS
=
"flip y axis"
;
private
static
String
HOME_ON_END
=
"move home after job"
;
private
Map
<
String
,
Object
>
properties
=
new
LinkedHashMap
<
String
,
Object
>();
...
...
@@ -82,6 +83,17 @@ public class IModelaMill extends LaserCutter
properties
.
put
(
HOSTNAME
,
"file:///dev/usb/lp0"
);
properties
.
put
(
PORT
,
(
Integer
)
5000
);
properties
.
put
(
HOME_ON_END
,
(
Boolean
)
true
);
properties
.
put
(
FLIP_YAXIS
,
(
Boolean
)
false
);
}
private
boolean
spindleOn
=
false
;
private
void
setSpindleOn
(
PrintStream
out
,
boolean
spindleOn
)
{
if
(
spindleOn
!=
this
.
spindleOn
)
{
this
.
spindleOn
=
spindleOn
;
out
.
println
(
spindleOn
?
"M03"
:
"M05"
);
//start/stop spindle
}
}
private
void
writeInitializationCode
(
PrintStream
out
)
...
...
@@ -90,12 +102,11 @@ public class IModelaMill extends LaserCutter
out
.
println
(
"O00000001"
);
//program number 00000001 - can be changed to any number, must be 8 digits
out
.
println
(
"G90"
);
//absolute positioning
out
.
println
(
"G21"
);
//select mm as input unit
out
.
println
(
"M03"
);
//start spindle
}
private
void
writeFinalizationCode
(
PrintStream
out
)
{
out
.
println
(
"M05"
);
//stop spindle
this
.
setSpindleOn
(
out
,
false
);
out
.
println
(
"G0 Z0"
);
//head up
if
((
Boolean
)
properties
.
get
(
HOME_ON_END
))
{
...
...
@@ -135,16 +146,17 @@ public class IModelaMill extends LaserCutter
moveHead
(
out
,
movedepth
);
//TODO: check if last command was also move and lies on the
//same line. If so, replace the last move command
out
.
print
(
String
.
format
(
Locale
.
ENGLISH
,
"G00 X%f Y%f%s\n"
,
x
,
getBedHeight
()-
y
,
parameters
));
out
.
print
(
String
.
format
(
Locale
.
ENGLISH
,
"G00 X%f Y%f%s\n"
,
x
,
properties
.
get
(
FLIP_YAXIS
)
==
Boolean
.
TRUE
?
getBedHeight
()-
y
:
y
,
parameters
));
parameters
=
""
;
}
private
void
line
(
PrintStream
out
,
double
x
,
double
y
)
{
setSpindleOn
(
out
,
true
);
moveHead
(
out
,
linedepth
);
//TODO: check if last command was also line and lies on the
//same line. If so, replace the last move command
out
.
print
(
String
.
format
(
Locale
.
ENGLISH
,
"G01 X%f Y%f%s\n"
,
x
,
getBedHeight
()-
y
,
parameters
));
out
.
print
(
String
.
format
(
Locale
.
ENGLISH
,
"G01 X%f Y%f%s\n"
,
x
,
properties
.
get
(
FLIP_YAXIS
)
==
Boolean
.
TRUE
?
getBedHeight
()-
y
:
y
,
parameters
));
parameters
=
""
;
}
...
...
@@ -154,7 +166,7 @@ public class IModelaMill extends LaserCutter
if
(
pr
.
getSpindleSpeed
()
!=
spindleSpeed
)
{
spindleSpeed
=
pr
.
getSpindleSpeed
();
parameters
+=
String
.
format
(
Locale
.
ENGLISH
,
" S%
d
\n"
,
spindleSpeed
);
parameters
+=
String
.
format
(
Locale
.
ENGLISH
,
" S%
f
\n"
,
spindleSpeed
);
}
if
(
pr
.
getFeedRate
()
!=
feedRate
)
{
...
...
@@ -309,6 +321,12 @@ public class IModelaMill extends LaserCutter
}
}
@Override
public
LaserProperty
getLaserPropertyForRaster3dPart
()
{
return
new
IModelaProperty
();
}
@Override
public
LaserProperty
getLaserPropertyForVectorPart
()
{
...
...
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