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
504b3b8e
Commit
504b3b8e
authored
12 years ago
by
Thomas Oster
Browse files
Options
Downloads
Patches
Plain Diff
Added option to Flip Y-Axis to the LAOS driver
parent
3c3d0d00
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/LaosCutter.java
+35
-2
35 additions, 2 deletions
src/com/t_oster/liblasercut/drivers/LaosCutter.java
with
35 additions
and
2 deletions
src/com/t_oster/liblasercut/drivers/LaosCutter.java
+
35
−
2
View file @
504b3b8e
...
...
@@ -57,6 +57,7 @@ public class LaosCutter extends LaserCutter
private
static
final
String
SETTING_BEDWIDTH
=
"Laserbed width"
;
private
static
final
String
SETTING_BEDHEIGHT
=
"Laserbed height"
;
private
static
final
String
SETTING_FLIPX
=
"X axis goes right to left (yes/no)"
;
private
static
final
String
SETTING_FLIPY
=
"Y axis goes bottom to top (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"
;
...
...
@@ -171,6 +172,28 @@ public class LaosCutter extends LaserCutter
this
.
flipXaxis
=
flipXaxis
;
}
protected
boolean
flipYaxis
=
false
;
/**
* Get the value of flipYaxis
*
* @return the value of flipYaxis
*/
public
boolean
isFlipYaxis
()
{
return
flipYaxis
;
}
/**
* Set the value of flipYaxis
*
* @param flipYaxis new value of flipYaxis
*/
public
void
setFlipYaxis
(
boolean
flipYaxis
)
{
this
.
flipYaxis
=
flipYaxis
;
}
protected
String
hostname
=
"192.168.123.111"
;
/**
...
...
@@ -281,7 +304,7 @@ public class LaosCutter extends LaserCutter
private
void
move
(
PrintStream
out
,
int
x
,
int
y
,
int
resolution
)
{
out
.
printf
(
"0 %d %d\n"
,
px2steps
(
isFlipXaxis
()
?
Util
.
mm2px
(
bedWidth
,
resolution
)
-
x
:
x
,
resolution
),
px2steps
(
y
,
resolution
));
out
.
printf
(
"0 %d %d\n"
,
px2steps
(
isFlipXaxis
()
?
Util
.
mm2px
(
bedWidth
,
resolution
)
-
x
:
x
,
resolution
),
px2steps
(
isFlipYaxis
()
?
Util
.
mm2px
(
bedHeight
,
resolution
)
-
y
:
y
,
resolution
));
}
private
int
currentPower
=
-
1
;
private
int
currentSpeed
=
-
1
;
...
...
@@ -304,7 +327,7 @@ public class LaosCutter extends LaserCutter
out
.
printf
(
"7 102 %d\n"
,
frequency
);
currentFrequency
=
frequency
;
}
out
.
printf
(
"1 %d %d\n"
,
px2steps
(
isFlipXaxis
()
?
Util
.
mm2px
(
bedWidth
,
resolution
)
-
x
:
x
,
resolution
),
px2steps
(
y
,
resolution
));
out
.
printf
(
"1 %d %d\n"
,
px2steps
(
isFlipXaxis
()
?
Util
.
mm2px
(
bedWidth
,
resolution
)
-
x
:
x
,
resolution
),
px2steps
(
isFlipYaxis
()
?
Util
.
mm2px
(
bedHeight
,
resolution
)
-
y
:
y
,
resolution
));
}
private
byte
[]
generatePseudoRaster3dGCode
(
Raster3dPart
rp
,
int
resolution
)
throws
UnsupportedEncodingException
...
...
@@ -789,6 +812,7 @@ public class LaosCutter extends LaserCutter
settingAttributes
.
add
(
SETTING_BEDWIDTH
);
settingAttributes
.
add
(
SETTING_BEDHEIGHT
);
settingAttributes
.
add
(
SETTING_FLIPX
);
settingAttributes
.
add
(
SETTING_FLIPY
);
settingAttributes
.
add
(
SETTING_MMPERSTEP
);
settingAttributes
.
add
(
SETTING_TFTP
);
settingAttributes
.
add
(
SETTING_RASTER_WHITESPACE
);
...
...
@@ -819,6 +843,10 @@ public class LaosCutter extends LaserCutter
{
return
this
.
isFlipXaxis
()
?
"yes"
:
"no"
;
}
else
if
(
SETTING_FLIPY
.
equals
(
attribute
))
{
return
this
.
isFlipYaxis
()
?
"yes"
:
"no"
;
}
else
if
(
SETTING_PORT
.
equals
(
attribute
))
{
return
""
+
this
.
getPort
();
...
...
@@ -869,6 +897,10 @@ public class LaosCutter extends LaserCutter
{
this
.
setFlipXaxis
(
"yes"
.
equals
(
value
));
}
else
if
(
SETTING_FLIPY
.
equals
(
attribute
))
{
this
.
setFlipYaxis
(
"yes"
.
equals
(
value
));
}
else
if
(
SETTING_BEDWIDTH
.
equals
(
attribute
))
{
this
.
setBedWidth
(
Double
.
parseDouble
(
value
));
...
...
@@ -902,6 +934,7 @@ public class LaosCutter extends LaserCutter
clone
.
bedHeight
=
bedHeight
;
clone
.
bedWidth
=
bedWidth
;
clone
.
flipXaxis
=
flipXaxis
;
clone
.
flipXaxis
=
flipYaxis
;
clone
.
mmPerStep
=
mmPerStep
;
clone
.
useTftp
=
useTftp
;
clone
.
addSpacePerRasterLine
=
addSpacePerRasterLine
;
...
...
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