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
cda29232
Commit
cda29232
authored
Aug 04, 2012
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt at adding a recover print function
parent
e046dc80
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
printcore.py
printcore.py
+2
-2
pronterface.py
pronterface.py
+19
-0
No files found.
printcore.py
View file @
cda29232
...
...
@@ -185,7 +185,7 @@ class printcore():
def
_checksum
(
self
,
command
):
return
reduce
(
lambda
x
,
y
:
x
^
y
,
map
(
ord
,
command
))
def
startprint
(
self
,
data
):
def
startprint
(
self
,
data
,
startindex
=
0
):
"""Start a print, data is an array of gcode commands.
returns True on success, False if already printing.
The print queue will be replaced with the contents of the data array, the next line will be set to 0 and the firmware notified.
...
...
@@ -196,7 +196,7 @@ class printcore():
self
.
printing
=
True
self
.
mainqueue
=
[]
+
data
self
.
lineno
=
0
self
.
queueindex
=
0
self
.
queueindex
=
startindex
self
.
resendfrom
=
-
1
self
.
_send
(
"M110"
,
-
1
,
True
)
if
len
(
data
)
==
0
:
...
...
pronterface.py
View file @
cda29232
...
...
@@ -1697,8 +1697,27 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
status_thread
=
threading
.
Thread
(
target
=
self
.
statuschecker
)
self
.
status_thread
.
start
()
def
recover
(
self
,
event
):
self
.
extra_print_time
=
0
if
not
self
.
p
.
online
:
wx
.
CallAfter
(
self
.
status
.
SetStatusText
,
_
(
"Not connected to printer."
))
return
# Reset Z
self
.
p
.
send_now
(
"G92 Z"
+
self
.
predisconnect_layer
)
# Home X and Y
self
.
p
.
send_now
(
"G28 X Y"
)
self
.
on_startprint
()
self
.
p
.
startprint
(
self
.
predisconnect_mainqueue
)
def
store_predisconnect_state
(
self
):
self
.
predisconnect_mainqueue
=
self
.
p
.
mainqueue
self
.
predisconnect_queueindex
=
self
.
p
.
queueindex
self
.
predisconnect_layer
=
self
.
curlayer
def
disconnect
(
self
,
event
):
print
_
(
"Disconnected."
)
if
self
.
p
.
printing
or
self
.
p
.
paused
or
self
.
paused
:
self
.
store_predisconnect_state
()
self
.
p
.
disconnect
()
self
.
statuscheck
=
False
self
.
status_thread
.
join
()
...
...
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