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
c45b2b60
Commit
c45b2b60
authored
Jul 13, 2013
by
Felipe Acebes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error with spaces in printcore
parent
836db39d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
printcore.py
printcore.py
+13
-13
No files found.
printcore.py
View file @
c45b2b60
...
...
@@ -94,7 +94,7 @@ class printcore():
self
.
xy_feedrate
=
None
self
.
z_feedrate
=
None
self
.
pronterface
=
None
@
locked
def
disconnect
(
self
):
"""Disconnects from printer and pauses the print
...
...
@@ -112,8 +112,8 @@ class printcore():
self
.
printer
.
close
()
except
socket
.
error
:
pass
except
OSError
:
pass
except
OSError
:
pass
self
.
printer
=
None
self
.
online
=
False
self
.
printing
=
False
...
...
@@ -333,7 +333,7 @@ class printcore():
self
.
print_thread
.
start
()
return
True
# run a simple script if it exists, no multithreading
# run a simple script if it exists, no multithreading
def
runSmallScript
(
self
,
filename
):
if
filename
==
None
:
return
f
=
None
...
...
@@ -348,22 +348,22 @@ class printcore():
l
=
l
[:
l
.
find
(
";"
)]
#remove comment
self
.
send_now
(
l
)
f
.
close
()
def
pause
(
self
):
"""Pauses the print, saving the current position.
"""
if
not
self
.
printing
:
return
False
self
.
paused
=
True
self
.
printing
=
False
# try joining the print thread: enclose it in try/except because we might be calling it from the thread itself
try
:
self
.
print_thread
.
join
()
except
:
pass
self
.
print_thread
=
None
# saves the status
self
.
pauseX
=
self
.
analyzer
.
x
-
self
.
analyzer
.
xOffset
;
self
.
pauseY
=
self
.
analyzer
.
y
-
self
.
analyzer
.
yOffset
;
...
...
@@ -379,7 +379,7 @@ class printcore():
if
self
.
paused
:
#restores the status
self
.
send_now
(
"G90"
)
# go to absolute coordinates
xyFeedString
=
""
zFeedString
=
""
if
self
.
xy_feedrate
!=
None
:
xyFeedString
=
" F"
+
str
(
self
.
xy_feedrate
)
...
...
@@ -388,11 +388,11 @@ class printcore():
self
.
send_now
(
"G1 X"
+
str
(
self
.
pauseX
)
+
" Y"
+
str
(
self
.
pauseY
)
+
xyFeedString
)
self
.
send_now
(
"G1 Z"
+
str
(
self
.
pauseZ
)
+
zFeedString
)
self
.
send_now
(
"G92 E"
+
str
(
self
.
pauseE
))
if
self
.
pauseRelative
:
self
.
send_now
(
"G91"
)
# go back to relative if needed
#reset old feed rate
self
.
send_now
(
"G1 F"
+
str
(
self
.
pauseF
))
self
.
paused
=
False
self
.
printing
=
True
self
.
print_thread
=
Thread
(
target
=
self
.
_print
,
kwargs
=
{
"resuming"
:
True
})
...
...
@@ -453,7 +453,7 @@ class printcore():
self
.
pronterface
.
pause
(
None
)
else
:
self
.
pause
()
def
_sendnext
(
self
):
if
not
self
.
printer
:
return
...
...
@@ -497,7 +497,7 @@ class printcore():
self
.
queueindex
+=
1
self
.
clear
=
True
return
tline
=
tline
.
split
(
";"
)[
0
]
if
len
(
tline
)
>
0
:
self
.
_send
(
tline
,
self
.
lineno
,
True
)
...
...
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