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
9bb68b8b
Commit
9bb68b8b
authored
Jun 01, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt at cleaning up resuming/restarting behavior
parent
51e26180
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
printcore.py
printcore.py
+4
-4
pronterface.py
pronterface.py
+9
-5
No files found.
printcore.py
View file @
9bb68b8b
...
@@ -343,7 +343,7 @@ class printcore():
...
@@ -343,7 +343,7 @@ class printcore():
self
.
paused
=
False
self
.
paused
=
False
self
.
printing
=
True
self
.
printing
=
True
self
.
print_thread
=
Thread
(
target
=
self
.
_print
)
self
.
print_thread
=
Thread
(
target
=
self
.
_print
,
kwargs
=
{
"resuming"
:
True
}
)
self
.
print_thread
.
start
()
self
.
print_thread
.
start
()
def
send
(
self
,
command
,
wait
=
0
):
def
send
(
self
,
command
,
wait
=
0
):
...
@@ -388,10 +388,10 @@ class printcore():
...
@@ -388,10 +388,10 @@ class printcore():
else
:
else
:
print
"Not connected to printer."
print
"Not connected to printer."
def
_print
(
self
):
def
_print
(
self
,
resuming
=
False
):
if
self
.
startcb
:
if
self
.
startcb
:
#callback for printing started
#callback for printing started
try
:
self
.
startcb
()
try
:
self
.
startcb
(
resuming
)
except
:
pass
except
:
pass
while
self
.
printing
and
self
.
printer
and
self
.
online
:
while
self
.
printing
and
self
.
printer
and
self
.
online
:
self
.
_sendnext
()
self
.
_sendnext
()
...
...
pronterface.py
View file @
9bb68b8b
...
@@ -317,10 +317,13 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -317,10 +317,13 @@ class PronterWindow(MainWindow, pronsole.pronsole):
pronsole
.
pronsole
.
process_cmdline_arguments
(
self
,
args
)
pronsole
.
pronsole
.
process_cmdline_arguments
(
self
,
args
)
self
.
autoconnect
=
args
.
autoconnect
self
.
autoconnect
=
args
.
autoconnect
def
startcb
(
self
):
def
startcb
(
self
,
resuming
=
False
):
self
.
starttime
=
time
.
time
()
self
.
starttime
=
time
.
time
()
self
.
compute_eta
=
RemainingTimeEstimator
(
self
.
p
.
mainqueue
)
if
resuming
:
print
_
(
"Print Started at:
%
s"
)
%
format_time
(
self
.
starttime
)
print
_
(
"Print resumed at:
%
s"
)
%
format_time
(
self
.
starttime
)
else
:
print
_
(
"Print started at:
%
s"
)
%
format_time
(
self
.
starttime
)
self
.
compute_eta
=
RemainingTimeEstimator
(
self
.
fgcode
)
def
endcb
(
self
):
def
endcb
(
self
):
if
self
.
p
.
queueindex
==
0
:
if
self
.
p
.
queueindex
==
0
:
...
@@ -1434,8 +1437,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -1434,8 +1437,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
self
.
paused
:
if
self
.
paused
:
self
.
p
.
paused
=
0
self
.
p
.
paused
=
0
self
.
paused
=
0
self
.
paused
=
0
self
.
on_startprint
()
if
self
.
sdprinting
:
if
self
.
sdprinting
:
self
.
on_startprint
()
self
.
p
.
send_now
(
"M26 S0"
)
self
.
p
.
send_now
(
"M26 S0"
)
self
.
p
.
send_now
(
"M24"
)
self
.
p
.
send_now
(
"M24"
)
return
return
...
@@ -1483,8 +1486,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -1483,8 +1486,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
dlg
.
Destroy
()
dlg
.
Destroy
()
def
pause
(
self
,
event
):
def
pause
(
self
,
event
):
print
_
(
"Paused."
)
if
not
self
.
paused
:
if
not
self
.
paused
:
print
_
(
"Print paused at:
%
s"
)
%
format_time
(
time
.
time
())
if
self
.
sdprinting
:
if
self
.
sdprinting
:
self
.
p
.
send_now
(
"M25"
)
self
.
p
.
send_now
(
"M25"
)
else
:
else
:
...
@@ -1498,6 +1501,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -1498,6 +1501,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
extra_print_time
+=
int
(
time
.
time
()
-
self
.
starttime
)
self
.
extra_print_time
+=
int
(
time
.
time
()
-
self
.
starttime
)
wx
.
CallAfter
(
self
.
pausebtn
.
SetLabel
,
_
(
"Resume"
))
wx
.
CallAfter
(
self
.
pausebtn
.
SetLabel
,
_
(
"Resume"
))
else
:
else
:
print
_
(
"Resuming."
)
self
.
paused
=
False
self
.
paused
=
False
if
self
.
sdprinting
:
if
self
.
sdprinting
:
self
.
p
.
send_now
(
"M24"
)
self
.
p
.
send_now
(
"M24"
)
...
...
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