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
281050e4
Commit
281050e4
authored
12 years ago
by
Thomas Oster
Browse files
Options
Downloads
Patches
Plain Diff
LAOS Driver RasterMode: Add space on every line to let the head gain speed
parent
fad39c72
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nbproject/project.properties
+3
-0
3 additions, 0 deletions
nbproject/project.properties
src/com/t_oster/liblasercut/drivers/LaosCutter.java
+46
-2
46 additions, 2 deletions
src/com/t_oster/liblasercut/drivers/LaosCutter.java
with
49 additions
and
2 deletions
nbproject/project.properties
+
3
−
0
View file @
281050e4
...
...
@@ -26,8 +26,11 @@ dist.jar=${dist.dir}/LibLaserCut.jar
dist.javadoc.dir
=
${dist.dir}/javadoc
endorsed.classpath
=
excludes
=
file.reference.commons-net-3.1.jar
=
lib/commons-net-3.1.jar
includes
=
**
jar.compress
=
false
javac.classpath
=
\
${file.reference.commons-net-3.1.jar}
# Space-separated list of extra javac options
javac.compilerargs
=
javac.deprecation
=
false
...
...
This diff is collapsed.
Click to expand it.
src/com/t_oster/liblasercut/drivers/LaosCutter.java
+
46
−
2
View file @
281050e4
...
...
@@ -62,7 +62,33 @@ public class LaosCutter extends LaserCutter
private
static
final
String
SETTING_FLIPX
=
"X axis goes right to left (yes/no)"
;
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
double
addSpacePerRasterLine
=
5
;
/**
* Get the value of addSpacePerRasterLine
*
* @return the value of addSpacePerRasterLine
*/
public
double
getAddSpacePerRasterLine
()
{
return
addSpacePerRasterLine
;
}
/**
* Set the value of addSpacePerRasterLine
* This is a space (in mm) for the laserhead to gain
* speed before the first 'black' pixel in every line
*
* @param addSpacePerRasterLine new value of addSpacePerRasterLine
*/
public
void
setAddSpacePerRasterLine
(
double
addSpacePerRasterLine
)
{
this
.
addSpacePerRasterLine
=
addSpacePerRasterLine
;
}
@Override
public
String
getModelName
()
{
...
...
@@ -433,6 +459,8 @@ public class LaosCutter extends LaserCutter
{
if
(
dirRight
)
{
//add some space to the left
move
(
out
,
Math
.
max
(
0
,
(
int
)
(
lineStart
.
x
-
Util
.
mm2px
(
this
.
addSpacePerRasterLine
,
resolution
))),
lineStart
.
y
,
resolution
);
//move to the first nonempyt point of the line
move
(
out
,
lineStart
.
x
,
lineStart
.
y
,
resolution
);
byte
old
=
bytes
.
get
(
0
);
...
...
@@ -454,9 +482,13 @@ public class LaosCutter extends LaserCutter
}
//last point is also not "white"
line
(
out
,
lineStart
.
x
+
bytes
.
size
()
-
1
,
lineStart
.
y
,
prop
.
getPower
()
*
(
0xFF
&
bytes
.
get
(
bytes
.
size
()
-
1
))
/
255
,
prop
.
getSpeed
(),
prop
.
getFrequency
(),
resolution
);
//add some space to the right
move
(
out
,
Math
.
min
((
int
)
Util
.
mm2px
(
bedWidth
,
resolution
),
(
int
)
(
lineStart
.
x
+
bytes
.
size
()
-
1
+
Util
.
mm2px
(
this
.
addSpacePerRasterLine
,
resolution
))),
lineStart
.
y
,
resolution
);
}
else
{
//add some space to the right
move
(
out
,
Math
.
min
((
int
)
Util
.
mm2px
(
bedWidth
,
resolution
),
(
int
)
(
lineStart
.
x
+
bytes
.
size
()
-
1
+
Util
.
mm2px
(
this
.
addSpacePerRasterLine
,
resolution
))),
lineStart
.
y
,
resolution
);
//move to the last nonempty point of the line
move
(
out
,
lineStart
.
x
+
bytes
.
size
()
-
1
,
lineStart
.
y
,
resolution
);
byte
old
=
bytes
.
get
(
bytes
.
size
()
-
1
);
...
...
@@ -478,6 +510,8 @@ public class LaosCutter extends LaserCutter
}
//last point is also not "white"
line
(
out
,
lineStart
.
x
,
lineStart
.
y
,
prop
.
getPower
()
*
(
0xFF
&
bytes
.
get
(
0
))
/
255
,
prop
.
getSpeed
(),
prop
.
getFrequency
(),
resolution
);
//add some space to the left
move
(
out
,
Math
.
max
(
0
,
(
int
)
(
lineStart
.
x
-
Util
.
mm2px
(
this
.
addSpacePerRasterLine
,
resolution
))),
lineStart
.
y
,
resolution
);
}
}
dirRight
=
!
dirRight
;
...
...
@@ -659,6 +693,7 @@ public class LaosCutter extends LaserCutter
settingAttributes
.
add
(
SETTING_FLIPX
);
settingAttributes
.
add
(
SETTING_MMPERSTEP
);
settingAttributes
.
add
(
SETTING_TFTP
);
settingAttributes
.
add
(
SETTING_RASTER_WHITESPACE
);
}
return
settingAttributes
;
}
...
...
@@ -666,7 +701,11 @@ public class LaosCutter extends LaserCutter
@Override
public
String
getSettingValue
(
String
attribute
)
{
if
(
SETTING_HOSTNAME
.
equals
(
attribute
))
if
(
SETTING_RASTER_WHITESPACE
.
equals
(
attribute
))
{
return
""
+
this
.
getAddSpacePerRasterLine
();
}
else
if
(
SETTING_HOSTNAME
.
equals
(
attribute
))
{
return
this
.
getHostname
();
}
...
...
@@ -704,7 +743,11 @@ public class LaosCutter extends LaserCutter
@Override
public
void
setSettingValue
(
String
attribute
,
String
value
)
{
if
(
SETTING_HOSTNAME
.
equals
(
attribute
))
if
(
SETTING_RASTER_WHITESPACE
.
equals
(
attribute
))
{
this
.
setAddSpacePerRasterLine
(
Double
.
parseDouble
(
value
));
}
else
if
(
SETTING_HOSTNAME
.
equals
(
attribute
))
{
this
.
setHostname
(
value
);
}
...
...
@@ -756,6 +799,7 @@ public class LaosCutter extends LaserCutter
clone
.
flipXaxis
=
flipXaxis
;
clone
.
mmPerStep
=
mmPerStep
;
clone
.
useTftp
=
useTftp
;
clone
.
addSpacePerRasterLine
=
addSpacePerRasterLine
;
return
clone
;
}
}
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