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
23e7c661
Commit
23e7c661
authored
Jun 03, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify nesting in gcode duration estimation code
parent
07cf32d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
63 deletions
+62
-63
gcoder.py
printrun/gcoder.py
+62
-63
No files found.
printrun/gcoder.py
View file @
23e7c661
...
...
@@ -492,13 +492,7 @@ class GCode(object):
ymax
=
max
(
ymax
,
line
.
current_y
)
# Compute duration
if
line
.
command
in
[
"G1"
,
"G0"
,
"G4"
]:
if
line
.
command
==
"G4"
:
moveduration
=
P
(
line
)
if
moveduration
:
moveduration
/=
1000.0
totalduration
+=
moveduration
else
:
if
line
.
command
==
"G0"
or
line
.
command
==
"G1"
:
x
=
line
.
x
if
line
.
x
is
not
None
else
lastx
y
=
line
.
y
if
line
.
y
is
not
None
else
lasty
z
=
line
.
z
if
line
.
z
is
not
None
else
lastz
...
...
@@ -558,6 +552,11 @@ class GCode(object):
lastz
=
z
laste
=
e
lastf
=
f
elif
line
.
command
==
"G4"
:
moveduration
=
P
(
line
)
if
moveduration
:
moveduration
/=
1000.0
totalduration
+=
moveduration
# FIXME : looks like this needs to be tested with "lift Z on move"
if
line
.
z
is
not
None
:
...
...
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