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
9a273b79
Commit
9a273b79
authored
Jun 15, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove code duplication in parse_coordinates
parent
56ed3dad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
gcoder.py
printrun/gcoder.py
+5
-10
No files found.
printrun/gcoder.py
View file @
9a273b79
...
@@ -69,16 +69,11 @@ def parse_coordinates(line, split_raw, imperial = False, force = False):
...
@@ -69,16 +69,11 @@ def parse_coordinates(line, split_raw, 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
force
and
line
.
command
[
0
]
!=
"G"
:
if
not
force
and
line
.
command
[
0
]
!=
"G"
:
return
return
if
imperial
:
unit_factor
=
25.4
if
imperial
else
1
for
bit
in
split_raw
:
for
bit
in
split_raw
:
code
=
bit
[
0
]
code
=
bit
[
0
]
if
code
in
gcode_parsed_args
and
len
(
bit
)
>
1
:
if
code
in
gcode_parsed_args
and
len
(
bit
)
>
1
:
setattr
(
line
,
code
,
25.4
*
float
(
bit
[
1
:]))
setattr
(
line
,
code
,
unit_factor
*
float
(
bit
[
1
:]))
else
:
for
bit
in
split_raw
:
code
=
bit
[
0
]
if
code
in
gcode_parsed_args
and
len
(
bit
)
>
1
:
setattr
(
line
,
code
,
float
(
bit
[
1
:]))
class
Layer
(
object
):
class
Layer
(
object
):
...
...
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