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
a7f224d0
Commit
a7f224d0
authored
11 years ago
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't eat user-generated M114 and M105 answers. Fixes #376.
parent
62105278
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
pronterface.py
pronterface.py
+20
-3
No files found.
pronterface.py
View file @
a7f224d0
...
...
@@ -211,6 +211,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
capture_skip
=
{}
self
.
capture_skip_newline
=
False
self
.
tempreport
=
""
self
.
userm114
=
0
self
.
userm105
=
0
self
.
monitor
=
0
self
.
fgcode
=
None
self
.
skeinp
=
None
...
...
@@ -1045,13 +1047,21 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
zb
.
repeatLast
()
self
.
xyb
.
repeatLast
()
def
parseusercmd
(
self
,
line
):
if
line
.
startswith
(
"M114"
):
self
.
userm114
+=
1
elif
line
.
startswith
(
"M105"
):
self
.
userm105
+=
1
def
procbutton
(
self
,
e
):
try
:
if
hasattr
(
e
.
GetEventObject
(),
"custombutton"
):
if
wx
.
GetKeyState
(
wx
.
WXK_CONTROL
)
or
wx
.
GetKeyState
(
wx
.
WXK_ALT
):
return
self
.
editbutton
(
e
)
self
.
cur_button
=
e
.
GetEventObject
()
.
custombutton
self
.
onecmd
(
e
.
GetEventObject
()
.
properties
.
command
)
command
=
e
.
GetEventObject
()
.
properties
.
command
self
.
parseusercmd
(
command
)
self
.
onecmd
(
command
)
self
.
cur_button
=
None
except
:
print
_
(
"event object missing"
)
...
...
@@ -1111,6 +1121,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
not
len
(
command
):
return
wx
.
CallAfter
(
self
.
addtexttolog
,
">>>"
+
command
+
"
\n
"
);
self
.
parseusercmd
(
str
(
command
))
self
.
onecmd
(
str
(
command
))
self
.
commandbox
.
SetSelection
(
0
,
len
(
command
))
self
.
commandbox
.
history
.
append
(
command
)
...
...
@@ -1221,12 +1232,18 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
"ok C:"
in
l
or
"Count"
in
l
:
self
.
posreport
=
l
self
.
update_pos
(
l
)
isreport
=
True
if
self
.
userm114
>
0
:
self
.
userm114
-=
1
else
:
isreport
=
True
if
"ok T:"
in
l
:
self
.
tempreport
=
l
wx
.
CallAfter
(
self
.
tempdisp
.
SetLabel
,
self
.
tempreport
.
strip
()
.
replace
(
"ok "
,
""
))
self
.
update_tempdisplay
()
isreport
=
True
if
self
.
userm105
>
0
:
self
.
userm105
-=
1
else
:
isreport
=
True
tstring
=
l
.
rstrip
()
if
self
.
p
.
loud
or
(
tstring
not
in
[
"ok"
,
"wait"
]
and
not
isreport
):
wx
.
CallAfter
(
self
.
addtexttolog
,
tstring
+
"
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
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