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
e00311ab
Commit
e00311ab
authored
May 21, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add forced coordinates parsing and S coordinate parsing
parent
eaa74765
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
gcoder.py
printrun/gcoder.py
+4
-3
No files found.
printrun/gcoder.py
View file @
e00311ab
...
@@ -19,7 +19,7 @@ import re
...
@@ -19,7 +19,7 @@ import re
import
math
import
math
import
datetime
import
datetime
gcode_parsed_args
=
[
"x"
,
"y"
,
"e"
,
"f"
,
"z"
,
"p"
,
"i"
,
"j"
]
gcode_parsed_args
=
[
"x"
,
"y"
,
"e"
,
"f"
,
"z"
,
"p"
,
"i"
,
"j"
,
"s"
]
gcode_exp
=
re
.
compile
(
"
\
([^
\
(
\
)]*
\
)|;.*|[/
\
*].*
\n
|[a-z][-+]?[0-9]*
\
.?[0-9]*"
)
gcode_exp
=
re
.
compile
(
"
\
([^
\
(
\
)]*
\
)|;.*|[/
\
*].*
\n
|[a-z][-+]?[0-9]*
\
.?[0-9]*"
)
m114_exp
=
re
.
compile
(
"
\
([^
\
(
\
)]*
\
)|[/
\
*].*
\n
|[A-Z]:?[-+]?[0-9]*
\
.?[0-9]*"
)
m114_exp
=
re
.
compile
(
"
\
([^
\
(
\
)]*
\
)|[/
\
*].*
\n
|[A-Z]:?[-+]?[0-9]*
\
.?[0-9]*"
)
move_gcodes
=
[
"G0"
,
"G1"
,
"G2"
,
"G3"
]
move_gcodes
=
[
"G0"
,
"G1"
,
"G2"
,
"G3"
]
...
@@ -33,6 +33,7 @@ class Line(object):
...
@@ -33,6 +33,7 @@ class Line(object):
f
=
None
f
=
None
i
=
None
i
=
None
j
=
None
j
=
None
s
=
None
raw
=
None
raw
=
None
split_raw
=
None
split_raw
=
None
...
@@ -51,9 +52,9 @@ class Line(object):
...
@@ -51,9 +52,9 @@ class Line(object):
self
.
command
=
self
.
split_raw
[
0
]
.
upper
()
if
not
self
.
split_raw
[
0
]
.
startswith
(
"n"
)
else
self
.
split_raw
[
1
]
.
upper
()
self
.
command
=
self
.
split_raw
[
0
]
.
upper
()
if
not
self
.
split_raw
[
0
]
.
startswith
(
"n"
)
else
self
.
split_raw
[
1
]
.
upper
()
self
.
is_move
=
self
.
command
in
move_gcodes
self
.
is_move
=
self
.
command
in
move_gcodes
def
parse_coordinates
(
self
,
imperial
):
def
parse_coordinates
(
self
,
imperial
=
False
,
force
=
False
):
# Not a G-line, we don't want to parse its arguments
# Not a G-line, we don't want to parse its arguments
if
not
self
.
command
[
0
]
==
"G"
:
if
not
force
and
not
self
.
command
[
0
]
==
"G"
:
return
return
if
imperial
:
if
imperial
:
for
bit
in
self
.
split_raw
:
for
bit
in
self
.
split_raw
:
...
...
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