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
6e4b9c02
Commit
6e4b9c02
authored
11 years ago
by
Thomas Oster
Browse files
Options
Downloads
Patches
Plain Diff
Added: Laos supports bottom-up engraving and unidirectional is property of the engrave-profile now.
parent
804b3b10
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/LaosCutter.java
+16
-33
16 additions, 33 deletions
src/com/t_oster/liblasercut/drivers/LaosCutter.java
src/com/t_oster/liblasercut/drivers/LaosEngraveProperty.java
+112
-0
112 additions, 0 deletions
src/com/t_oster/liblasercut/drivers/LaosEngraveProperty.java
with
128 additions
and
33 deletions
src/com/t_oster/liblasercut/drivers/LaosCutter.java
+
16
−
33
View file @
6e4b9c02
...
...
@@ -36,7 +36,6 @@ import java.net.Socket;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Locale
;
import
org.apache.commons.net.tftp.TFTP
;
...
...
@@ -61,7 +60,6 @@ public class LaosCutter extends LaserCutter
private
static
final
String
SETTING_MMPERSTEP
=
"mm per Step (for SimpleMode)"
;
private
static
final
String
SETTING_TFTP
=
"Use TFTP instead of TCP"
;
private
static
final
String
SETTING_RASTER_WHITESPACE
=
"Additional space per Raster line"
;
private
static
final
String
SETTING_UNIDIR
=
"Engrave unidirectional"
;
private
static
final
String
SETTING_DEBUGFILE
=
"Debug output file"
;
private
static
final
String
SETTING_SUPPORTS_PURGE
=
"Supports purge"
;
private
static
final
String
SETTING_SUPPORTS_VENTILATION
=
"Supports ventilation"
;
...
...
@@ -116,7 +114,8 @@ public class LaosCutter extends LaserCutter
this
.
supportsVentilation
=
supportsVentilation
;
}
private
boolean
unidir
=
false
;
//only kept for backwards compatibility. unused
private
transient
boolean
unidir
=
false
;
private
String
debugFilename
=
""
;
@Override
...
...
@@ -126,25 +125,15 @@ public class LaosCutter extends LaserCutter
}
@Override
public
Laos
Cutter
Property
getLaserPropertyForRasterPart
()
public
Laos
Engrave
Property
getLaserPropertyForRasterPart
()
{
return
new
Laos
Cutter
Property
(!
this
.
supportsPurge
,
!
this
.
supportsVentilation
,
!
this
.
supportsFocus
,
!
this
.
supportsFrequency
);
return
new
Laos
Engrave
Property
(!
this
.
supportsPurge
,
!
this
.
supportsVentilation
,
!
this
.
supportsFocus
,
!
this
.
supportsFrequency
);
}
@Override
public
LaosCutterProperty
getLaserPropertyForRaster3dPart
()
{
return
new
LaosCutterProperty
(!
this
.
supportsPurge
,
!
this
.
supportsVentilation
,
!
this
.
supportsFocus
,
!
this
.
supportsFrequency
);
}
public
void
setEngraveUnidirectional
(
boolean
uni
)
{
this
.
unidir
=
uni
;
}
public
boolean
isEngraveUnidirectional
()
public
LaosEngraveProperty
getLaserPropertyForRaster3dPart
()
{
return
this
.
unidir
;
return
new
LaosEngraveProperty
(!
this
.
supportsPurge
,
!
this
.
supportsVentilation
,
!
this
.
supportsFocus
,
!
this
.
supportsFrequency
)
;
}
private
double
addSpacePerRasterLine
=
5
;
...
...
@@ -451,9 +440,11 @@ public class LaosCutter extends LaserCutter
PrintStream
out
=
new
PrintStream
(
result
,
true
,
"US-ASCII"
);
boolean
dirRight
=
true
;
Point
rasterStart
=
rp
.
getRasterStart
();
this
.
setCurrentProperty
(
out
,
rp
.
getLaserProperty
());
LaosEngraveProperty
prop
=
rp
.
getLaserProperty
()
instanceof
LaosEngraveProperty
?
(
LaosEngraveProperty
)
rp
.
getLaserProperty
()
:
new
LaosEngraveProperty
(
rp
.
getLaserProperty
());
this
.
setCurrentProperty
(
out
,
prop
);
float
maxPower
=
this
.
currentPower
;
for
(
int
line
=
0
;
line
<
rp
.
getRasterHeight
();
line
++)
boolean
bu
=
prop
.
isEngraveBottomUp
();
for
(
int
line
=
bu
?
rp
.
getRasterHeight
()-
1
:
0
;
bu
?
line
>=
0
:
line
<
rp
.
getRasterHeight
();
line
+=
bu
?
-
1
:
1
)
{
Point
lineStart
=
rasterStart
.
clone
();
lineStart
.
y
+=
line
;
...
...
@@ -524,7 +515,7 @@ public class LaosCutter extends LaserCutter
line
(
out
,
lineStart
.
x
,
lineStart
.
y
,
resolution
);
}
}
if
(!
this
.
isEngraveUnidirectional
())
if
(!
prop
.
isEngraveUnidirectional
())
{
dirRight
=
!
dirRight
;
}
...
...
@@ -581,8 +572,10 @@ public class LaosCutter extends LaserCutter
PrintStream
out
=
new
PrintStream
(
result
,
true
,
"US-ASCII"
);
boolean
dirRight
=
true
;
Point
rasterStart
=
rp
.
getRasterStart
();
this
.
setCurrentProperty
(
out
,
rp
.
getLaserProperty
());
for
(
int
line
=
0
;
line
<
rp
.
getRasterHeight
();
line
++)
LaosEngraveProperty
prop
=
rp
.
getLaserProperty
()
instanceof
LaosEngraveProperty
?
(
LaosEngraveProperty
)
rp
.
getLaserProperty
()
:
new
LaosEngraveProperty
(
rp
.
getLaserProperty
());
this
.
setCurrentProperty
(
out
,
prop
);
boolean
bu
=
prop
.
isEngraveBottomUp
();
for
(
int
line
=
bu
?
rp
.
getRasterHeight
()-
1
:
0
;
bu
?
line
>=
0
:
line
<
rp
.
getRasterHeight
();
line
+=
bu
?
-
1
:
1
)
{
Point
lineStart
=
rasterStart
.
clone
();
lineStart
.
y
+=
line
;
...
...
@@ -633,7 +626,7 @@ public class LaosCutter extends LaserCutter
line
(
out
,
lineStart
.
x
,
lineStart
.
y
,
resolution
);
}
}
if
(!
this
.
isEngraveUnidirectional
())
if
(!
prop
.
isEngraveUnidirectional
())
{
dirRight
=
!
dirRight
;
}
...
...
@@ -807,7 +800,6 @@ public class LaosCutter extends LaserCutter
private
static
String
[]
settingAttributes
=
new
String
[]{
SETTING_HOSTNAME
,
SETTING_PORT
,
SETTING_UNIDIR
,
SETTING_BEDWIDTH
,
SETTING_BEDHEIGHT
,
//SETTING_FLIPX,
...
...
@@ -855,10 +847,6 @@ public class LaosCutter extends LaserCutter
{
return
(
Boolean
)
this
.
supportsFocus
;
}
else
if
(
SETTING_UNIDIR
.
equals
(
attribute
))
{
return
(
Boolean
)
this
.
isEngraveUnidirectional
();
}
else
if
(
SETTING_HOSTNAME
.
equals
(
attribute
))
{
return
this
.
getHostname
();
...
...
@@ -921,10 +909,6 @@ public class LaosCutter extends LaserCutter
{
this
.
setSupportsFocus
((
Boolean
)
value
);
}
else
if
(
SETTING_UNIDIR
.
endsWith
(
attribute
))
{
this
.
setEngraveUnidirectional
((
Boolean
)
value
);
}
else
if
(
SETTING_HOSTNAME
.
equals
(
attribute
))
{
this
.
setHostname
((
String
)
value
);
...
...
@@ -973,7 +957,6 @@ public class LaosCutter extends LaserCutter
clone
.
mmPerStep
=
mmPerStep
;
clone
.
useTftp
=
useTftp
;
clone
.
addSpacePerRasterLine
=
addSpacePerRasterLine
;
clone
.
unidir
=
unidir
;
clone
.
supportsFrequency
=
supportsFrequency
;
clone
.
supportsPurge
=
supportsPurge
;
clone
.
supportsVentilation
=
supportsVentilation
;
...
...
This diff is collapsed.
Click to expand it.
src/com/t_oster/liblasercut/drivers/LaosEngraveProperty.java
0 → 100644
+
112
−
0
View file @
6e4b9c02
/**
* This file is part of LibLaserCut.
* Copyright (C) 2011 - 2013 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
* LibLaserCut 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.
*
* LibLaserCut 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 LibLaserCut. If not, see <http://www.gnu.org/licenses/>.
**/
package
com.t_oster.liblasercut.drivers
;
import
com.t_oster.liblasercut.LaserProperty
;
import
java.util.Arrays
;
import
java.util.LinkedList
;
/**
*
* @author Thomas Oster <thomas.oster@rwth-aachen.de>
*/
public
class
LaosEngraveProperty
extends
LaosCutterProperty
{
public
LaosEngraveProperty
(
boolean
hidePurge
,
boolean
hideVentilation
,
boolean
hideFocus
,
boolean
hideFrequency
)
{
super
(
hidePurge
,
hideVentilation
,
hideFocus
,
hideFrequency
);
}
public
LaosEngraveProperty
()
{};
public
LaosEngraveProperty
(
LaserProperty
o
)
{
for
(
String
k
:
o
.
getPropertyKeys
())
{
try
{
this
.
setProperty
(
k
,
o
.
getProperty
(
k
));
}
catch
(
Exception
e
)
{
}
}
}
private
static
final
String
BOTTOM_UP
=
"engrave bottom up"
;
private
boolean
engraveBottomUp
=
false
;
public
boolean
isEngraveBottomUp
()
{
return
engraveBottomUp
;
}
private
static
final
String
UNIDIRECTIONAL
=
"engrave unidirectional"
;
private
boolean
engraveUnidirectional
=
false
;
public
boolean
isEngraveUnidirectional
()
{
return
engraveUnidirectional
;
}
@Override
public
String
[]
getPropertyKeys
()
{
LinkedList
<
String
>
result
=
new
LinkedList
<
String
>();
result
.
addAll
(
Arrays
.
asList
(
super
.
getPropertyKeys
()));
result
.
add
(
BOTTOM_UP
);
result
.
add
(
UNIDIRECTIONAL
);
return
result
.
toArray
(
new
String
[
0
]);
}
@Override
public
Object
getProperty
(
String
name
)
{
if
(
BOTTOM_UP
.
equals
(
name
))
{
return
(
Boolean
)
engraveBottomUp
;
}
else
if
(
UNIDIRECTIONAL
.
equals
(
name
))
{
return
(
Boolean
)
engraveUnidirectional
;
}
else
{
return
super
.
getProperty
(
name
);
}
}
@Override
public
void
setProperty
(
String
name
,
Object
value
)
{
if
(
BOTTOM_UP
.
equals
(
name
))
{
engraveBottomUp
=
(
Boolean
)
value
;
}
else
if
(
UNIDIRECTIONAL
.
equals
(
name
))
{
engraveUnidirectional
=
(
Boolean
)
value
;
}
else
{
super
.
setProperty
(
name
,
value
);
}
}
}
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