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
2eac0462
Commit
2eac0462
authored
May 17, 2016
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid error on estimate on the last line
parent
d71d05a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
gcoder.py
printrun/gcoder.py
+3
-1
controls.py
printrun/gui/controls.py
+1
-1
pronsole.py
printrun/pronsole.py
+2
-2
utils.py
printrun/utils.py
+2
-0
No files found.
printrun/gcoder.py
View file @
2eac0462
...
@@ -724,7 +724,9 @@ class GCode(object):
...
@@ -724,7 +724,9 @@ class GCode(object):
self
.
duration
=
totaltime
self
.
duration
=
totaltime
def
idxs
(
self
,
i
):
def
idxs
(
self
,
i
):
return
self
.
layer_idxs
[
i
],
self
.
line_idxs
[
i
]
if
i
in
self
.
layer_idxs
and
i
in
self
.
line_idxs
:
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/gui/controls.py
View file @
2eac0462
...
@@ -216,7 +216,7 @@ def add_extra_controls(self, root, parentpanel, extra_buttons = None, mini_mode
...
@@ -216,7 +216,7 @@ def add_extra_controls(self, root, parentpanel, extra_buttons = None, mini_mode
root
.
htemp
.
SetValue
(
i
)
root
.
htemp
.
SetValue
(
i
)
if
'('
not
in
root
.
ctemp
.
Value
:
if
'('
not
in
root
.
ctemp
.
Value
:
root
.
b
temp
.
SetValue
(
root
.
ctemp
.
Value
+
' (user)'
)
root
.
c
temp
.
SetValue
(
root
.
ctemp
.
Value
+
' (user)'
)
if
'('
not
in
root
.
btemp
.
Value
:
if
'('
not
in
root
.
btemp
.
Value
:
root
.
btemp
.
SetValue
(
root
.
btemp
.
Value
+
' (user)'
)
root
.
btemp
.
SetValue
(
root
.
btemp
.
Value
+
' (user)'
)
if
'('
not
in
root
.
htemp
.
Value
:
if
'('
not
in
root
.
htemp
.
Value
:
...
...
printrun/pronsole.py
View file @
2eac0462
...
@@ -264,11 +264,11 @@ class pronsole(cmd.Cmd):
...
@@ -264,11 +264,11 @@ class pronsole(cmd.Cmd):
return
False
return
False
def
log
(
self
,
*
msg
):
def
log
(
self
,
*
msg
):
msg
=
u""
.
join
(
unicode
(
i
)
for
i
in
msg
)
msg
=
u""
.
join
(
unicode
(
i
)
.
encode
(
'utf-8'
,
'ignore'
)
for
i
in
msg
)
logging
.
info
(
msg
)
logging
.
info
(
msg
)
def
logError
(
self
,
*
msg
):
def
logError
(
self
,
*
msg
):
msg
=
u""
.
join
(
unicode
(
i
)
for
i
in
msg
)
msg
=
u""
.
join
(
unicode
(
i
)
.
encode
(
'utf-8'
,
'ignore'
)
for
i
in
msg
)
logging
.
error
(
msg
)
logging
.
error
(
msg
)
if
not
self
.
settings
.
error_command
:
if
not
self
.
settings
.
error_command
:
return
return
...
...
printrun/utils.py
View file @
2eac0462
...
@@ -173,6 +173,8 @@ class RemainingTimeEstimator(object):
...
@@ -173,6 +173,8 @@ class RemainingTimeEstimator(object):
if
idx
==
self
.
last_idx
:
if
idx
==
self
.
last_idx
:
return
self
.
last_estimate
return
self
.
last_estimate
layer
,
line
=
self
.
gcode
.
idxs
(
idx
)
layer
,
line
=
self
.
gcode
.
idxs
(
idx
)
if
layer
is
None
or
line
is
None
:
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