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
07af3e4d
Commit
07af3e4d
authored
Nov 03, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP #575: implement untested !! and // support in pronterface & pronsole
parent
1340bd2f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
19 deletions
+74
-19
pronsole.py
printrun/pronsole.py
+39
-13
pronterface.py
printrun/pronterface.py
+35
-6
No files found.
printrun/pronsole.py
View file @
07af3e4d
...
@@ -1039,7 +1039,7 @@ class pronsole(cmd.Cmd):
...
@@ -1039,7 +1039,7 @@ class pronsole(cmd.Cmd):
def
help_pause
(
self
):
def
help_pause
(
self
):
self
.
log
(
_
(
"Pauses a running print"
))
self
.
log
(
_
(
"Pauses a running print"
))
def
pause
(
self
,
event
):
def
pause
(
self
,
event
=
None
):
return
self
.
do_pause
(
None
)
return
self
.
do_pause
(
None
)
def
do_resume
(
self
,
l
):
def
do_resume
(
self
,
l
):
...
@@ -1217,18 +1217,44 @@ class pronsole(cmd.Cmd):
...
@@ -1217,18 +1217,44 @@ class pronsole(cmd.Cmd):
self
.
m105_waitcycles
=
0
self
.
m105_waitcycles
=
0
return
isreport
return
isreport
def
recvcb_actions
(
self
,
l
):
if
l
.
startswith
(
"!!"
):
self
.
do_pause
(
None
)
msg
=
l
.
split
(
" "
,
1
)[
1
]
if
self
.
silent
is
False
:
self
.
logError
(
msg
.
ljust
(
15
))
sys
.
stdout
.
write
(
self
.
promptf
())
sys
.
stdout
.
flush
()
return
True
elif
l
.
startswith
(
"//"
):
command
=
l
.
split
(
" "
,
1
)[
1
]
self
.
log
(
_
(
"Received command
%
s"
)
%
command
)
command
=
command
.
split
(
":"
)
if
len
(
command
)
==
2
and
command
[
0
]
==
"action"
:
command
=
command
[
1
]
if
command
==
"pause"
:
self
.
do_pause
(
None
)
return
True
elif
command
==
"resume"
:
self
.
do_resume
(
None
)
return
True
elif
command
==
"disconnect"
:
self
.
do_disconnect
(
None
)
return
True
return
False
def
recvcb
(
self
,
l
):
def
recvcb
(
self
,
l
):
l
=
l
.
rstrip
()
if
not
self
.
recvcb_actions
(
l
):
report_type
=
self
.
recvcb_report
(
l
)
report_type
=
self
.
recvcb_report
(
l
)
if
report_type
&
REPORT_TEMP
:
if
report_type
&
REPORT_TEMP
:
self
.
status
.
update_tempreading
(
l
)
self
.
status
.
update_tempreading
(
l
)
tstring
=
l
.
rstrip
()
for
listener
in
self
.
recvlisteners
:
for
listener
in
self
.
recvlisteners
:
listener
(
l
)
listener
(
l
)
if
tstring
!=
"ok"
and
not
self
.
sdlisting
\
if
l
!=
"ok"
and
not
self
.
sdlisting
\
and
not
self
.
monitoring
and
(
report_type
==
REPORT_NONE
or
report_type
&
REPORT_MANUAL
):
and
not
self
.
monitoring
and
(
report_type
==
REPORT_NONE
or
report_type
&
REPORT_MANUAL
):
if
tstring
[:
5
]
==
"echo:"
:
if
l
[:
5
]
==
"echo:"
:
tstring
=
tstring
[
5
:]
.
lstrip
()
l
=
l
[
5
:]
.
lstrip
()
if
self
.
silent
is
False
:
self
.
log
(
"
\r
"
+
tstring
.
ljust
(
15
))
if
self
.
silent
is
False
:
self
.
log
(
"
\r
"
+
l
.
ljust
(
15
))
sys
.
stdout
.
write
(
self
.
promptf
())
sys
.
stdout
.
write
(
self
.
promptf
())
sys
.
stdout
.
flush
()
sys
.
stdout
.
flush
()
...
...
printrun/pronterface.py
View file @
07af3e4d
...
@@ -1171,7 +1171,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1171,7 +1171,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self
.
p
.
clear
=
True
self
.
p
.
clear
=
True
self
.
uploading
=
False
self
.
uploading
=
False
def
pause
(
self
,
event
):
def
pause
(
self
,
event
=
None
):
if
not
self
.
paused
:
if
not
self
.
paused
:
self
.
log
(
_
(
"Print paused at:
%
s"
)
%
format_time
(
time
.
time
()))
self
.
log
(
_
(
"Print paused at:
%
s"
)
%
format_time
(
time
.
time
()))
if
self
.
sdprinting
:
if
self
.
sdprinting
:
...
@@ -1671,17 +1671,46 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1671,17 +1671,46 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
if
y
is
not
None
:
self
.
current_pos
[
1
]
=
y
if
y
is
not
None
:
self
.
current_pos
[
1
]
=
y
if
z
is
not
None
:
self
.
current_pos
[
2
]
=
z
if
z
is
not
None
:
self
.
current_pos
[
2
]
=
z
def
recvcb_actions
(
self
,
l
):
if
l
.
startswith
(
"!!"
):
if
not
self
.
paused
:
self
.
pause
()
msg
=
l
.
split
(
" "
,
1
)[
1
]
if
not
self
.
p
.
loud
:
wx
.
CallAfter
(
self
.
addtexttolog
,
msg
+
"
\n
"
)
return
True
elif
l
.
startswith
(
"//"
):
command
=
l
.
split
(
" "
,
1
)[
1
]
self
.
log
(
_
(
"Received command
%
s"
)
%
command
)
command
=
command
.
split
(
":"
)
if
len
(
command
)
==
2
and
command
[
0
]
==
"action"
:
command
=
command
[
1
]
if
command
==
"pause"
:
if
not
self
.
paused
:
self
.
pause
()
return
True
elif
command
==
"resume"
:
if
self
.
paused
:
self
.
do_resume
(
None
)
return
True
elif
command
==
"disconnect"
:
self
.
do_disconnect
(
None
)
return
True
return
False
def
recvcb
(
self
,
l
):
def
recvcb
(
self
,
l
):
l
=
l
.
rstrip
()
if
l
.
startswith
(
"!!"
):
return
report_type
=
self
.
recvcb_report
(
l
)
report_type
=
self
.
recvcb_report
(
l
)
isreport
=
report_type
!=
REPORT_NONE
isreport
=
report_type
!=
REPORT_NONE
if
report_type
==
REPORT_POS
:
if
report_type
&
REPORT_POS
:
self
.
update_pos
()
self
.
update_pos
()
elif
report_type
==
REPORT_TEMP
:
elif
report_type
&
REPORT_TEMP
:
wx
.
CallAfter
(
self
.
tempdisp
.
SetLabel
,
self
.
tempreadings
.
strip
()
.
replace
(
"ok "
,
""
))
wx
.
CallAfter
(
self
.
tempdisp
.
SetLabel
,
self
.
tempreadings
.
strip
()
.
replace
(
"ok "
,
""
))
self
.
update_tempdisplay
()
self
.
update_tempdisplay
()
tstring
=
l
.
rstrip
()
if
not
self
.
p
.
loud
and
(
l
not
in
[
"ok"
,
"wait"
]
and
not
isreport
):
if
not
self
.
p
.
loud
and
(
tstring
not
in
[
"ok"
,
"wait"
]
and
not
isreport
):
wx
.
CallAfter
(
self
.
addtexttolog
,
l
+
"
\n
"
)
wx
.
CallAfter
(
self
.
addtexttolog
,
tstring
+
"
\n
"
)
for
listener
in
self
.
recvlisteners
:
for
listener
in
self
.
recvlisteners
:
listener
(
l
)
listener
(
l
)
...
...
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