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
1ea631c8
Commit
1ea631c8
authored
Nov 04, 2011
by
Steven Devijver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nice formating of duration; renamed variables; added extra cost per movement
parent
ca5e7f11
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
duration.py
duration.py
+9
-7
No files found.
duration.py
View file @
1ea631c8
...
@@ -12,9 +12,9 @@ def get_value(axis, parts):
...
@@ -12,9 +12,9 @@ def get_value(axis, parts):
return
None
return
None
extra_cost_per_movement
=
0.05
total_duration
=
0
total_duration
=
0
starting_velocity
=
0
fallback_feedrate
=
0
global_feedrate
=
0
initial_feedrate
=
0
initial_feedrate
=
0
X_last_position
=
0
X_last_position
=
0
Y_last_position
=
0
Y_last_position
=
0
...
@@ -26,12 +26,12 @@ for i in g:
...
@@ -26,12 +26,12 @@ for i in g:
F
=
get_value
(
"F"
,
parts
[
1
:])
F
=
get_value
(
"F"
,
parts
[
1
:])
if
(
X
is
None
and
Y
is
None
and
F
is
not
None
):
if
(
X
is
None
and
Y
is
None
and
F
is
not
None
):
global
_feedrate
=
F
fallback
_feedrate
=
F
continue
continue
feedrate
=
0
feedrate
=
0
if
(
F
is
None
):
if
(
F
is
None
):
feedrate
=
global
_feedrate
/
60
feedrate
=
fallback
_feedrate
/
60
else
:
else
:
feedrate
=
F
/
60
feedrate
=
F
/
60
...
@@ -62,7 +62,9 @@ for i in g:
...
@@ -62,7 +62,9 @@ for i in g:
else
:
else
:
duration
=
(
halfway_feedrate
*
2
-
initial_feedrate
)
/
acceleration
duration
=
(
halfway_feedrate
*
2
-
initial_feedrate
)
/
acceleration
total_duration
+=
duration
total_duration
+=
duration
+
extra_cost_per_movement
print
(
"Total duration (in minutes): {0}"
.
format
(
total_duration
/
60
))
mod_minutes
=
total_duration
%
(
60
*
60
)
mod_seconds
=
mod_minutes
%
60
print
(
"Estimated total duration (pessimistic): {0:02d}H{1:02d}M"
.
format
(
int
((
total_duration
-
mod_minutes
)
/
(
60
*
60
)),
int
((
mod_minutes
-
mod_seconds
)
/
60
)))
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