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
d26d566e
Commit
d26d566e
authored
Apr 01, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Please flake8/pep8
parent
2a2d63c1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
21 deletions
+18
-21
printcore.py
printrun/printcore.py
+13
-11
pronsole.py
printrun/pronsole.py
+5
-10
No files found.
printrun/printcore.py
View file @
d26d566e
...
...
@@ -68,13 +68,16 @@ class printcore():
self
.
baud
=
None
self
.
port
=
None
self
.
analyzer
=
gcoder
.
GCode
()
self
.
printer
=
None
# Serial instance connected to the printer,
# should be None when disconnected
self
.
clear
=
0
# clear to send, enabled after responses
self
.
online
=
False
# The printer has responded to the initial command
# and is active
self
.
printing
=
False
# is a print currently running, true if printing
# , false if paused
# Serial instance connected to the printer, should be None when
# disconnected
self
.
printer
=
None
# clear to send, enabled after responses
# FIXME: should probably be changed to a sliding window approach
self
.
clear
=
0
# The printer has responded to the initial command and is active
self
.
online
=
False
# is a print currently running, true if printing, false if paused
self
.
printing
=
False
self
.
mainqueue
=
None
self
.
priqueue
=
Queue
(
0
)
self
.
queueindex
=
0
...
...
@@ -298,7 +301,7 @@ class printcore():
if
line
.
startswith
(
tuple
(
self
.
greetings
))
or
line
.
startswith
(
'ok'
):
self
.
clear
=
True
if
line
.
startswith
(
'ok'
)
and
"T:"
in
line
and
self
.
tempcb
:
#callback for temp, status, whatever
#
callback for temp, status, whatever
try
:
self
.
tempcb
(
line
)
except
:
traceback
.
print_exc
()
elif
line
.
startswith
(
'Error'
):
...
...
@@ -313,7 +316,6 @@ class printcore():
try
:
toresend
=
int
(
linewords
.
pop
(
0
))
self
.
resendfrom
=
toresend
#print str(toresend)
break
except
:
pass
...
...
@@ -473,7 +475,7 @@ class printcore():
self
.
_stop_sender
()
try
:
if
self
.
startcb
:
#callback for printing started
#
callback for printing started
try
:
self
.
startcb
(
resuming
)
except
:
self
.
logError
(
_
(
"Print start callback failed with:"
)
+
...
...
@@ -484,7 +486,7 @@ class printcore():
self
.
log
.
clear
()
self
.
sent
=
[]
if
self
.
endcb
:
#callback for printing done
#
callback for printing done
try
:
self
.
endcb
()
except
:
self
.
logError
(
_
(
"Print end callback failed with:"
)
+
...
...
printrun/pronsole.py
View file @
d26d566e
...
...
@@ -291,10 +291,6 @@ class BuildDimensionsSetting(wxSetting):
self
.
value
=
"
%.02
fx
%.02
fx
%.02
f
%+.02
f
%+.02
f
%+.02
f
%+.02
f
%+.02
f
%+.02
f"
%
tuple
(
values
)
class
Settings
(
object
):
#def _temperature_alias(self): return {"pla":210, "abs":230, "off":0}
#def _temperature_validate(self, v):
# if v < 0: raise ValueError("You cannot set negative temperatures. To turn the hotend off entirely, set its temperature to 0.")
#def _bedtemperature_alias(self): return {"pla":60, "abs":110, "off":0}
def
_baudrate_list
(
self
):
return
[
"2400"
,
"9600"
,
"19200"
,
"38400"
,
"57600"
,
"115200"
,
"250000"
]
def
__init__
(
self
,
root
):
...
...
@@ -587,7 +583,7 @@ class pronsole(cmd.Cmd):
promptstr
=
self
.
promptstrs
[
"online"
]
else
:
promptstr
=
self
.
promptstrs
[
"fallback"
]
if
not
"
%
"
in
promptstr
:
if
"
%
"
not
in
promptstr
:
return
promptstr
else
:
specials
=
{}
...
...
@@ -948,9 +944,9 @@ class pronsole(cmd.Cmd):
if
rci
is
not
None
:
rci
.
close
()
rco
.
close
()
#if definition != "":
#
if definition != "":
# self.log("Saved '"+key+"' to '"+self.rc_filename+"'")
#else:
#
else:
# self.log("Removed '"+key+"' from '"+self.rc_filename+"'")
except
Exception
,
e
:
self
.
logError
(
"Saving failed for "
,
key
+
":"
,
str
(
e
))
...
...
@@ -1349,7 +1345,7 @@ class pronsole(cmd.Cmd):
self
.
log
(
_
(
"Starting print"
))
self
.
p
.
send_now
(
"M24"
)
self
.
sdprinting
=
1
#self.recvlisteners.remove(self.waitforsdresponse)
#
self.recvlisteners.remove(self.waitforsdresponse)
return
if
"Done printing file"
in
l
:
self
.
log
(
l
)
...
...
@@ -1357,7 +1353,7 @@ class pronsole(cmd.Cmd):
self
.
recvlisteners
.
remove
(
self
.
waitforsdresponse
)
return
if
"SD printing byte"
in
l
:
#M27 handler
#
M27 handler
try
:
resp
=
l
.
split
()
vals
=
resp
[
-
1
]
.
split
(
"/"
)
...
...
@@ -1606,7 +1602,6 @@ class pronsole(cmd.Cmd):
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
:
preface
=
_
(
"Print progress: "
)
progress
=
100
*
float
(
self
.
p
.
queueindex
)
/
len
(
self
.
p
.
mainqueue
)
...
...
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