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
fd6eb8ac
Commit
fd6eb8ac
authored
Jun 06, 2011
by
kliment
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add reset command. Make gettemp and monitor less misleading
parent
69b0eed1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
printcore.py
printcore.py
+9
-1
pronsole.py
pronsole.py
+12
-5
No files found.
printcore.py
View file @
fd6eb8ac
...
...
@@ -59,6 +59,14 @@ class printcore():
self
.
printer
=
Serial
(
self
.
port
,
self
.
baud
,
timeout
=
5
)
Thread
(
target
=
self
.
_listen
)
.
start
()
def
reset
(
self
):
"""Reset the printer
"""
if
(
self
.
printer
):
self
.
printer
.
setDTR
(
1
)
self
.
printer
.
setDTR
(
0
)
def
_listen
(
self
):
"""This function acts on messages from the firmware
"""
...
...
@@ -78,7 +86,7 @@ class printcore():
print
"RECV: "
,
line
if
(
line
.
startswith
(
'start'
)
or
line
.
startswith
(
'ok'
)
or
"T:"
in
line
):
self
.
clear
=
True
if
not
self
.
online
and
self
.
onlinecb
is
not
None
:
if
(
not
self
.
online
or
line
.
startswith
(
'start'
))
and
self
.
onlinecb
is
not
None
:
self
.
onlinecb
()
self
.
online
=
True
if
(
line
.
startswith
(
'ok'
)):
...
...
pronsole.py
View file @
fd6eb8ac
...
...
@@ -401,6 +401,12 @@ class pronsole(cmd.Cmd):
except
:
pass
def
do_reset
(
self
,
l
):
self
.
p
.
reset
()
def
help_reset
(
self
):
print
"Resets the printer."
def
do_sdprint
(
self
,
l
):
if
not
self
.
p
.
online
:
print
"Printer is not online. Try connect to it first."
...
...
@@ -466,14 +472,14 @@ class pronsole(cmd.Cmd):
def
tempcb
(
self
,
l
):
if
"T:"
in
l
:
print
l
.
replace
(
"
\r
"
,
""
)
.
replace
(
"T"
,
"Hotend"
)
.
replace
(
"B"
,
"Bed"
)
.
replace
(
"
\n
"
,
""
)
.
replace
(
"ok "
,
""
)
self
.
recvlisteners
.
remove
(
self
.
tempcb
)
def
do_gettemp
(
self
,
l
):
if
self
.
p
.
online
:
self
.
recvlisteners
+=
[
self
.
tempcb
]
self
.
p
.
send_now
(
"M105"
)
time
.
sleep
(
0.5
)
time
.
sleep
(
0.75
)
self
.
recvlisteners
.
remove
(
self
.
tempcb
)
def
help_gettemp
(
self
):
print
"Read the extruder and bed temperature."
...
...
@@ -678,13 +684,14 @@ class pronsole(cmd.Cmd):
self
.
p
.
send_now
(
"M105"
)
if
(
self
.
sdprinting
):
self
.
p
.
send_now
(
"M27"
)
time
.
sleep
(
interval
)
print
(
self
.
tempreadings
.
replace
(
"
\r
"
,
""
)
.
replace
(
"T"
,
"Hotend"
)
.
replace
(
"B"
,
"Bed"
)
.
replace
(
"
\n
"
,
""
)
.
replace
(
"ok "
,
""
))
if
(
self
.
p
.
printing
):
print
"Print progress: "
,
100
*
float
(
self
.
p
.
queueindex
)
/
len
(
self
.
p
.
mainqueue
),
"
%
"
if
(
self
.
sdprinting
):
print
"SD print progress: "
,
self
.
percentdone
,
"
%
"
time
.
sleep
(
interval
)
except
:
print
"Done monitoring."
pass
...
...
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