Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
e2630df4
Commit
e2630df4
authored
Jan 24, 2013
by
Lenbok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support M82/M83 for relative E
parent
c527601f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
gcoder.py
gcoder.py
+11
-1
No files found.
gcoder.py
View file @
e2630df4
...
...
@@ -40,6 +40,7 @@ class Line(object):
self
.
raw
=
l
.
upper
()
.
lstrip
()
self
.
imperial
=
False
self
.
relative
=
False
self
.
relative_e
=
False
if
";"
in
self
.
raw
:
self
.
raw
=
self
.
raw
.
split
(
";"
)[
0
]
...
...
@@ -145,6 +146,7 @@ class Layer(object):
ymax
=
-
999999999
zmax
=
-
999999999
relative
=
False
relative_e
=
False
current_x
=
0
current_y
=
0
...
...
@@ -200,6 +202,7 @@ class GCode(object):
#checks for G20, G21, G90 and G91, sets imperial and relative flags
imperial
=
False
relative
=
False
relative_e
=
False
for
line
in
self
.
lines
:
if
line
.
command
()
==
"G20"
:
imperial
=
True
...
...
@@ -207,11 +210,18 @@ class GCode(object):
imperial
=
False
elif
line
.
command
()
==
"G90"
:
relative
=
False
relative_e
=
False
elif
line
.
command
()
==
"G91"
:
relative
=
True
relative_e
=
True
elif
line
.
command
()
==
"M82"
:
relative_e
=
False
elif
line
.
command
()
==
"M83"
:
relative_e
=
True
elif
line
.
is_move
():
line
.
imperial
=
imperial
line
.
relative
=
relative
line
.
relative_e
=
relative_e
def
_create_layers
(
self
):
self
.
layers
=
[]
...
...
@@ -316,7 +326,7 @@ class GCode(object):
total_e
+=
cur_e
cur_e
=
line
.
e
elif
line
.
is_move
()
and
line
.
e
:
if
line
.
relative
:
if
line
.
relative
_e
:
cur_e
+=
line
.
e
else
:
cur_e
=
line
.
e
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment