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
5e02f686
Commit
5e02f686
authored
Mar 28, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pronsole's do_upload and add a cancelprint() helper to printcore
parent
0699d3df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
printcore.py
printrun/printcore.py
+6
-1
pronsole.py
printrun/pronsole.py
+10
-8
No files found.
printrun/printcore.py
View file @
5e02f686
...
...
@@ -361,7 +361,7 @@ class printcore():
self
.
queueindex
=
startindex
self
.
resendfrom
=
-
1
self
.
_send
(
"M110"
,
-
1
,
True
)
if
not
gcode
.
lines
:
if
not
gcode
or
not
gcode
.
lines
:
return
True
self
.
clear
=
False
resuming
=
(
startindex
!=
0
)
...
...
@@ -370,6 +370,11 @@ class printcore():
self
.
print_thread
.
start
()
return
True
def
cancelprint
(
self
):
self
.
paused
=
False
self
.
mainqueue
=
None
self
.
p
.
clear
=
True
# run a simple script if it exists, no multithreading
def
runSmallScript
(
self
,
filename
):
if
filename
is
None
:
return
...
...
printrun/pronsole.py
View file @
5e02f686
...
...
@@ -969,25 +969,27 @@ class pronsole(cmd.Cmd):
try
:
sys
.
stdout
.
write
(
_
(
"Progress: "
)
+
"00.0
%
"
)
sys
.
stdout
.
flush
()
time
.
sleep
(
1
)
while
self
.
p
.
printing
:
time
.
sleep
(
1
)
time
.
sleep
(
0.5
)
sys
.
stdout
.
write
(
"
\b\b\b\b\b
%04.1
f
%%
"
%
(
100
*
float
(
self
.
p
.
queueindex
)
/
len
(
self
.
p
.
mainqueue
),))
sys
.
stdout
.
flush
()
self
.
p
.
send_now
(
"M29 "
+
targetname
)
self
.
sleep
(
0.2
)
self
.
p
.
clear
=
1
time
.
sleep
(
0.2
)
self
.
p
.
clear
=
True
self
.
_do_ls
(
False
)
self
.
log
(
"
\b\b\b\b\b
100
%
."
)
self
.
log
(
_
(
"Upload completed.
%
s should now be on the card."
)
%
targetname
)
return
except
:
self
.
logError
(
_
(
"...interrupted!"
))
except
Exception
,
e
:
if
not
isinstance
(
e
,
KeyboardInterrupt
):
self
.
logError
(
_
(
"Something wrong happened while uploading:"
))
traceback
.
print_exc
(
file
=
sys
.
stdout
)
else
:
self
.
logError
(
_
(
"...interrupted!"
))
self
.
p
.
pause
()
self
.
p
.
send_now
(
"M29 "
+
targetname
)
time
.
sleep
(
0.2
)
self
.
p
.
clear
=
1
self
.
p
.
startprint
(
None
)
self
.
p
.
cancelprint
()
self
.
logError
(
_
(
"A partial file named
%
s may have been written to the sd card."
)
%
targetname
)
def
complete_upload
(
self
,
text
,
line
,
begidx
,
endidx
):
...
...
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