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
a1b3015e
Commit
a1b3015e
authored
12 years ago
by
Thomas Oster
Browse files
Options
Downloads
Patches
Plain Diff
Imodela improvements
parent
10c3c999
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/com/t_oster/liblasercut/drivers/IModelaMill.java
+37
-11
37 additions, 11 deletions
src/com/t_oster/liblasercut/drivers/IModelaMill.java
src/com/t_oster/liblasercut/drivers/IModelaProperty.java
+50
-15
50 additions, 15 deletions
src/com/t_oster/liblasercut/drivers/IModelaProperty.java
with
87 additions
and
26 deletions
src/com/t_oster/liblasercut/drivers/IModelaMill.java
+
37
−
11
View file @
a1b3015e
/**
* This file is part of
Visi
Cut.
* This file is part of
LibLaser
Cut.
* Copyright (C) 2011 - 2013 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
*
Visi
Cut is free software: you can redistribute it and/or modify
*
LibLaser
Cut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
Visi
Cut is distributed in the hope that it will be useful,
*
LibLaser
Cut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with
Visi
Cut. If not, see <http://www.gnu.org/licenses/>.
* along with
LibLaser
Cut. If not, see <http://www.gnu.org/licenses/>.
**/
package
com.t_oster.liblasercut.drivers
;
...
...
@@ -58,10 +58,12 @@ public class IModelaMill extends LaserCutter
out
.
println
(
"%"
);
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
out
.
println
(
"M02"
);
//END_OF_PROGRAM
out
.
println
(
"%"
);
}
...
...
@@ -69,7 +71,12 @@ public class IModelaMill extends LaserCutter
private
void
writeVectorCode
(
VectorPart
p
,
PrintStream
out
)
{
double
dpi
=
p
.
getDPI
();
boolean
spindleOn
=
false
;
boolean
headDown
=
false
;
double
olddepth
=
0
;
double
depth
=
0
;
int
spindleSpeed
=
-
1
;
double
feedRate
=
-
1
;
int
tool
=
-
1
;
for
(
VectorCommand
c
:
p
.
getCommandList
())
{
switch
(
c
.
getType
())
...
...
@@ -78,10 +85,10 @@ public class IModelaMill extends LaserCutter
{
double
x
=
Util
.
px2mm
(
c
.
getX
(),
dpi
);
double
y
=
Util
.
px2mm
(
c
.
getY
(),
dpi
);
if
(
spindleO
n
)
if
(
headDow
n
)
{
out
.
print
ln
(
"M05"
);
//stop spindle
spindleO
n
=
false
;
out
.
print
f
(
"G00 Z0\n"
);
headDow
n
=
false
;
}
out
.
printf
(
"G00 X%f Y%f\n"
,
x
,
y
);
break
;
...
...
@@ -90,16 +97,35 @@ public class IModelaMill extends LaserCutter
{
double
x
=
Util
.
px2mm
(
c
.
getX
(),
dpi
);
double
y
=
Util
.
px2mm
(
c
.
getY
(),
dpi
);
if
(!
spindleOn
)
if
(!
headDown
||
depth
!=
olddepth
)
{
out
.
println
(
"M03"
);
//start spindle
spindleOn
=
true
;
out
.
printf
(
"G01 Zf\n"
,
depth
);
headDown
=
true
;
olddepth
=
depth
;
}
out
.
printf
(
"G01 X%f Y%f\n"
,
x
,
y
);
break
;
}
case
SETPROPERTY:
{
IModelaProperty
pr
=
(
IModelaProperty
)
c
.
getProperty
();
depth
=
pr
.
getDepth
();
if
(
pr
.
getSpindleSpeed
()
!=
spindleSpeed
)
{
spindleSpeed
=
pr
.
getSpindleSpeed
();
out
.
printf
(
"S%d\n"
,
spindleSpeed
);
}
if
(
pr
.
getFeedRate
()
!=
feedRate
)
{
feedRate
=
pr
.
getFeedRate
();
out
.
printf
(
"F%f\n"
,
feedRate
);
}
if
(
pr
.
getTool
()
!=
tool
)
{
tool
=
pr
.
getTool
();
out
.
printf
(
"M06T0\n"
);
//return current tool
out
.
printf
(
"M06T%d\n"
,
tool
);
}
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/com/t_oster/liblasercut/drivers/IModelaProperty.java
+
50
−
15
View file @
a1b3015e
/**
* This file is part of
Visi
Cut.
* This file is part of
LibLaser
Cut.
* Copyright (C) 2011 - 2013 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
*
Visi
Cut is free software: you can redistribute it and/or modify
*
LibLaser
Cut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
Visi
Cut is distributed in the hope that it will be useful,
*
LibLaser
Cut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with
Visi
Cut. If not, see <http://www.gnu.org/licenses/>.
* along with
LibLaser
Cut. If not, see <http://www.gnu.org/licenses/>.
**/
package
com.t_oster.liblasercut.drivers
;
...
...
@@ -28,13 +28,35 @@ import com.t_oster.liblasercut.LaserProperty;
public
class
IModelaProperty
implements
LaserProperty
{
private
static
String
FEED_RATE
=
"feedRate"
;
private
static
String
SPINDLE_SPEED
=
"spindleSpeed"
;
private
static
String
DEPTH
=
"milling depth"
;
private
static
String
FEED_RATE
=
"feed rate"
;
private
static
String
SPINDLE_SPEED
=
"spindle speed"
;
private
static
String
TOOL
=
"tool"
;
private
double
feedRate
=
0
;
private
double
spindleSpeed
=
0
;
private
double
depth
=
0
;
private
double
feedRate
=
1
;
private
int
spindleSpeed
=
100
;
private
int
tool
=
1
;
public
double
getDepth
()
{
return
depth
;
}
public
double
getFeedRate
()
{
return
feedRate
;
}
public
int
getSpindleSpeed
()
{
return
spindleSpeed
;
}
public
int
getTool
()
{
return
tool
;
}
@Override
public
Object
getMinimumValue
(
String
name
)
...
...
@@ -43,6 +65,10 @@ public class IModelaProperty implements LaserProperty
{
return
(
Integer
)
1
;
}
else
if
(
SPINDLE_SPEED
.
equals
(
name
))
{
return
(
Integer
)
100
;
}
else
{
return
(
Double
)
0
d
;
...
...
@@ -65,24 +91,29 @@ public class IModelaProperty implements LaserProperty
public
LaserProperty
clone
()
{
IModelaProperty
result
=
new
IModelaProperty
();
result
.
feedRate
=
feedRate
;
result
.
spindleSpeed
=
spindleSpeed
;
result
.
tool
=
tool
;
for
(
String
k
:
getPropertyKeys
())
{
result
.
setProperty
(
k
,
getProperty
(
k
));
}
return
result
;
}
@Override
public
String
[]
getPropertyKeys
()
{
return
new
String
[]{
SPINDLE_SPEED
,
FEED_RATE
,
TOOL
};
return
new
String
[]{
DEPTH
,
SPINDLE_SPEED
,
FEED_RATE
,
TOOL
};
}
@Override
public
void
setProperty
(
String
key
,
Object
value
)
{
if
(
SPINDLE_SPEED
.
equals
(
key
))
if
(
DEPTH
.
equals
(
key
))
{
depth
=
(
Double
)
value
;
}
else
if
(
SPINDLE_SPEED
.
equals
(
key
))
{
spindleSpeed
=
(
Double
)
value
;
spindleSpeed
=
(
Integer
)
value
;
}
else
if
(
FEED_RATE
.
equals
(
key
))
{
...
...
@@ -97,7 +128,11 @@ public class IModelaProperty implements LaserProperty
@Override
public
Object
getProperty
(
String
key
)
{
if
(
SPINDLE_SPEED
.
equals
(
key
))
if
(
DEPTH
.
equals
(
key
))
{
return
depth
;
}
else
if
(
SPINDLE_SPEED
.
equals
(
key
))
{
return
spindleSpeed
;
}
...
...
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