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
6b66a85d
Commit
6b66a85d
authored
May 17, 2016
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert last change and fix another way the timing
parent
4584cef1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
10 deletions
+7
-10
gcoder.py
printrun/gcoder.py
+1
-3
printcore.py
printrun/printcore.py
+1
-4
utils.py
printrun/utils.py
+5
-3
No files found.
printrun/gcoder.py
View file @
6b66a85d
...
@@ -724,9 +724,7 @@ class GCode(object):
...
@@ -724,9 +724,7 @@ class GCode(object):
self
.
duration
=
totaltime
self
.
duration
=
totaltime
def
idxs
(
self
,
i
):
def
idxs
(
self
,
i
):
if
i
in
self
.
layer_idxs
and
i
in
self
.
line_idxs
:
return
self
.
layer_idxs
[
i
],
self
.
line_idxs
[
i
]
return
self
.
layer_idxs
[
i
],
self
.
line_idxs
[
i
]
return
None
,
None
def
estimate_duration
(
self
):
def
estimate_duration
(
self
):
return
self
.
layers_count
,
self
.
duration
return
self
.
layers_count
,
self
.
duration
...
...
printrun/printcore.py
View file @
6b66a85d
...
@@ -551,10 +551,7 @@ class printcore():
...
@@ -551,10 +551,7 @@ class printcore():
if
self
.
preprintsendcb
:
if
self
.
preprintsendcb
:
if
self
.
queueindex
+
1
<
len
(
self
.
mainqueue
):
if
self
.
queueindex
+
1
<
len
(
self
.
mainqueue
):
(
next_layer
,
next_line
)
=
self
.
mainqueue
.
idxs
(
self
.
queueindex
+
1
)
(
next_layer
,
next_line
)
=
self
.
mainqueue
.
idxs
(
self
.
queueindex
+
1
)
try
:
next_gline
=
self
.
mainqueue
.
all_layers
[
next_layer
][
next_line
]
next_gline
=
self
.
mainqueue
.
all_layers
[
next_layer
][
next_line
]
except
:
next_gline
=
None
else
:
else
:
next_gline
=
None
next_gline
=
None
gline
=
self
.
preprintsendcb
(
gline
,
next_gline
)
gline
=
self
.
preprintsendcb
(
gline
,
next_gline
)
...
...
printrun/utils.py
View file @
6b66a85d
...
@@ -172,9 +172,11 @@ class RemainingTimeEstimator(object):
...
@@ -172,9 +172,11 @@ class RemainingTimeEstimator(object):
return
(
0
,
0
)
return
(
0
,
0
)
if
idx
==
self
.
last_idx
:
if
idx
==
self
.
last_idx
:
return
self
.
last_estimate
return
self
.
last_estimate
layer
,
line
=
self
.
gcode
.
idxs
(
idx
)
try
:
if
layer
is
None
or
line
is
None
:
layer
,
line
=
self
.
gcode
.
idxs
(
idx
)
return
(
0
,
total
)
except
:
self
.
last_idx
=
idx
return
(
0
,
total
)
layer_progress
=
(
1
-
(
float
(
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
remaining
=
layer_progress
*
self
.
current_layer_estimate
+
self
.
remaining_layers_estimate
estimate
=
self
.
drift
*
remaining
estimate
=
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