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
8d85523a
Commit
8d85523a
authored
Nov 05, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ETA computations to pronsole
parent
de64c43b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
pronsole.py
printrun/pronsole.py
+10
-1
pronterface.py
printrun/pronterface.py
+1
-10
No files found.
printrun/pronsole.py
View file @
8d85523a
...
@@ -28,7 +28,8 @@ import logging
...
@@ -28,7 +28,8 @@ import logging
from
.
import
printcore
from
.
import
printcore
from
printrun.printrun_utils
import
install_locale
,
run_command
,
\
from
printrun.printrun_utils
import
install_locale
,
run_command
,
\
format_time
,
format_duration
,
get_home_pos
,
parse_build_dimensions
format_time
,
format_duration
,
RemainingTimeEstimator
,
\
get_home_pos
,
parse_build_dimensions
install_locale
(
'pronterface'
)
install_locale
(
'pronterface'
)
from
printrun
import
gcoder
from
printrun
import
gcoder
...
@@ -417,10 +418,12 @@ class pronsole(cmd.Cmd):
...
@@ -417,10 +418,12 @@ class pronsole(cmd.Cmd):
self
.
completekey
=
None
self
.
completekey
=
None
self
.
status
=
Status
()
self
.
status
=
Status
()
self
.
dynamic_temp
=
False
self
.
dynamic_temp
=
False
self
.
compute_eta
=
None
self
.
p
=
printcore
.
printcore
()
self
.
p
=
printcore
.
printcore
()
self
.
p
.
recvcb
=
self
.
recvcb
self
.
p
.
recvcb
=
self
.
recvcb
self
.
p
.
startcb
=
self
.
startcb
self
.
p
.
startcb
=
self
.
startcb
self
.
p
.
endcb
=
self
.
endcb
self
.
p
.
endcb
=
self
.
endcb
self
.
p
.
layerchangecb
=
self
.
layer_change_cb
self
.
recvlisteners
=
[]
self
.
recvlisteners
=
[]
self
.
in_macro
=
False
self
.
in_macro
=
False
self
.
p
.
onlinecb
=
self
.
online
self
.
p
.
onlinecb
=
self
.
online
...
@@ -1126,6 +1129,7 @@ class pronsole(cmd.Cmd):
...
@@ -1126,6 +1129,7 @@ class pronsole(cmd.Cmd):
self
.
starttime
=
time
.
time
()
self
.
starttime
=
time
.
time
()
if
resuming
:
if
resuming
:
print
_
(
"Print resumed at:
%
s"
)
%
format_time
(
self
.
starttime
)
print
_
(
"Print resumed at:
%
s"
)
%
format_time
(
self
.
starttime
)
self
.
compute_eta
=
RemainingTimeEstimator
(
self
.
fgcode
)
else
:
else
:
print
_
(
"Print started at:
%
s"
)
%
format_time
(
self
.
starttime
)
print
_
(
"Print started at:
%
s"
)
%
format_time
(
self
.
starttime
)
...
@@ -1145,6 +1149,11 @@ class pronsole(cmd.Cmd):
...
@@ -1145,6 +1149,11 @@ class pronsole(cmd.Cmd):
stderr
=
subprocess
.
STDOUT
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
stdout
=
subprocess
.
PIPE
,
blocking
=
False
)
blocking
=
False
)
def
layer_change_cb
(
self
,
newlayer
):
if
self
.
compute_eta
:
secondselapsed
=
int
(
time
.
time
()
-
self
.
starttime
+
self
.
extra_print_time
)
self
.
compute_eta
.
update_layer
(
newlayer
,
secondselapsed
)
def
help_shell
(
self
):
def
help_shell
(
self
):
self
.
log
(
"Executes a python command. Example:"
)
self
.
log
(
"Executes a python command. Example:"
)
self
.
log
(
"! os.listdir('.')"
)
self
.
log
(
"! os.listdir('.')"
)
...
...
printrun/pronterface.py
View file @
8d85523a
...
@@ -31,7 +31,7 @@ from . import pronsole
...
@@ -31,7 +31,7 @@ from . import pronsole
from
.
import
printcore
from
.
import
printcore
from
printrun.printrun_utils
import
install_locale
,
setup_logging
,
\
from
printrun.printrun_utils
import
install_locale
,
setup_logging
,
\
RemainingTimeEstimator
,
get_home_pos
,
parse_build_dimension
s
get_home_po
s
install_locale
(
'pronterface'
)
install_locale
(
'pronterface'
)
try
:
try
:
...
@@ -221,10 +221,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -221,10 +221,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
p
.
sendcb
=
self
.
sentcb
self
.
p
.
sendcb
=
self
.
sentcb
self
.
p
.
preprintsendcb
=
self
.
preprintsendcb
self
.
p
.
preprintsendcb
=
self
.
preprintsendcb
self
.
p
.
printsendcb
=
self
.
printsentcb
self
.
p
.
printsendcb
=
self
.
printsentcb
self
.
p
.
layerchangecb
=
self
.
layer_change_cb
self
.
p
.
startcb
=
self
.
startcb
self
.
p
.
startcb
=
self
.
startcb
self
.
p
.
endcb
=
self
.
endcb
self
.
p
.
endcb
=
self
.
endcb
self
.
compute_eta
=
None
self
.
curlayer
=
0
self
.
curlayer
=
0
self
.
cur_button
=
None
self
.
cur_button
=
None
self
.
predisconnect_mainqueue
=
None
self
.
predisconnect_mainqueue
=
None
...
@@ -249,8 +247,6 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -249,8 +247,6 @@ class PronterWindow(MainWindow, pronsole.pronsole):
def
startcb
(
self
,
resuming
=
False
):
def
startcb
(
self
,
resuming
=
False
):
pronsole
.
pronsole
.
startcb
(
self
,
resuming
)
pronsole
.
pronsole
.
startcb
(
self
,
resuming
)
if
not
resuming
:
self
.
compute_eta
=
RemainingTimeEstimator
(
self
.
fgcode
)
if
self
.
settings
.
lockbox
and
self
.
settings
.
lockonstart
:
if
self
.
settings
.
lockbox
and
self
.
settings
.
lockonstart
:
wx
.
CallAfter
(
self
.
lock
,
force
=
True
)
wx
.
CallAfter
(
self
.
lock
,
force
=
True
)
...
@@ -282,11 +278,6 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -282,11 +278,6 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
self
.
filename
:
if
self
.
filename
:
self
.
printbtn
.
Enable
()
self
.
printbtn
.
Enable
()
def
layer_change_cb
(
self
,
newlayer
):
if
self
.
compute_eta
:
secondselapsed
=
int
(
time
.
time
()
-
self
.
starttime
+
self
.
extra_print_time
)
self
.
compute_eta
.
update_layer
(
newlayer
,
secondselapsed
)
def
sentcb
(
self
,
line
):
def
sentcb
(
self
,
line
):
gline
=
gcoder
.
Line
(
line
)
gline
=
gcoder
.
Line
(
line
)
split_raw
=
gcoder
.
split
(
gline
)
split_raw
=
gcoder
.
split
(
gline
)
...
...
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