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
4420ab96
Commit
4420ab96
authored
May 29, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve ETA prediction
parent
047144ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
printrun_utils.py
printrun/printrun_utils.py
+7
-3
No files found.
printrun/printrun_utils.py
View file @
4420ab96
...
...
@@ -67,8 +67,10 @@ class RemainingTimeEstimator(object):
self
.
previous_layers_estimate
=
0
self
.
current_layer_estimate
=
0
self
.
current_layer_lines
=
0
self
.
remaining_layers_estimate
=
0
self
.
gcode
=
gcode
self
.
remaining_layers_estimate
=
sum
(
layer
.
duration
for
layer
in
gcode
.
all_layers
)
if
len
(
gcode
)
>
0
:
self
.
update_layer
(
0
,
0
)
def
update_layer
(
self
,
layer
,
printtime
):
self
.
previous_layers_estimate
+=
self
.
current_layer_estimate
...
...
@@ -79,7 +81,9 @@ class RemainingTimeEstimator(object):
self
.
remaining_layers_estimate
-=
self
.
current_layer_estimate
def
__call__
(
self
,
idx
):
if
not
self
.
current_layer_lines
:
return
0
layer
,
line
=
self
.
gcode
.
idxs
(
idx
)
layer_progress
=
(
1
-
((
line
+
1
)
/
self
.
current_layer_lines
))
layer_progress
=
(
1
-
(
float
(
line
+
1
)
/
self
.
current_layer_lines
))
remaining
=
layer_progress
*
self
.
current_layer_estimate
+
self
.
remaining_layers_estimate
return
drift
*
remaining
return
self
.
drift
*
remaining
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