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
44e8f055
Commit
44e8f055
authored
Sep 28, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't fail miserably when parsing host commands in GCodeAnalyzer
parent
016cb3e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
GCodeAnalyzer.py
printrun/GCodeAnalyzer.py
+7
-2
No files found.
printrun/GCodeAnalyzer.py
View file @
44e8f055
...
...
@@ -70,9 +70,14 @@ class GCodeAnalyzer():
gline
=
gcoder
.
Line
(
gcode
)
split_raw
=
gcoder
.
split
(
gline
)
if
gline
.
command
.
startswith
(
";@"
):
return
# code is a host command
gcoder
.
parse_coordinates
(
gline
,
split_raw
,
self
.
imperial
)
try
:
code_g
=
int
(
gline
.
command
[
1
:])
if
gline
.
command
.
startswith
(
"G"
)
else
None
code_m
=
int
(
gline
.
command
[
1
:])
if
gline
.
command
.
startswith
(
"M"
)
else
None
except
ValueError
:
# If we fail to parse the code number, this is probably not a
# standard G-Code but rather a host command, so return immediately
return
gcoder
.
parse_coordinates
(
gline
,
split_raw
,
self
.
imperial
)
#get movement codes
if
gline
.
is_move
:
...
...
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