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
f6fbb75d
Commit
f6fbb75d
authored
Nov 05, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass parsed gcoder line to sendcb
parent
36688d2f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
printcore.py
printrun/printcore.py
+4
-2
pronterface.py
printrun/pronterface.py
+4
-9
prontserve.py
printrun/prontserve.py
+1
-1
No files found.
printrun/printcore.py
View file @
f6fbb75d
...
@@ -563,14 +563,16 @@ class printcore():
...
@@ -563,14 +563,16 @@ class printcore():
if
self
.
printer
:
if
self
.
printer
:
self
.
sent
.
append
(
command
)
self
.
sent
.
append
(
command
)
# run the command through the analyzer
# run the command through the analyzer
try
:
self
.
analyzer
.
append
(
command
,
store
=
False
)
gline
=
None
try
:
gline
=
self
.
analyzer
.
append
(
command
,
store
=
False
)
except
:
except
:
logging
.
warning
(
_
(
"Could not analyze command
%
s:"
)
%
command
+
logging
.
warning
(
_
(
"Could not analyze command
%
s:"
)
%
command
+
"
\n
"
+
traceback
.
format_exc
())
"
\n
"
+
traceback
.
format_exc
())
if
self
.
loud
:
if
self
.
loud
:
logging
.
info
(
"SENT:
%
s"
%
command
)
logging
.
info
(
"SENT:
%
s"
%
command
)
if
self
.
sendcb
:
if
self
.
sendcb
:
try
:
self
.
sendcb
(
command
)
try
:
self
.
sendcb
(
command
,
gline
)
except
:
pass
except
:
pass
try
:
try
:
self
.
printer
.
write
(
str
(
command
+
"
\n
"
))
self
.
printer
.
write
(
str
(
command
+
"
\n
"
))
...
...
printrun/pronterface.py
View file @
f6fbb75d
...
@@ -277,11 +277,10 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -277,11 +277,10 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
self
.
filename
:
if
self
.
filename
:
self
.
printbtn
.
Enable
()
self
.
printbtn
.
Enable
()
def
sentcb
(
self
,
line
):
def
sentcb
(
self
,
line
,
gline
):
gline
=
gcoder
.
Line
(
line
)
if
not
gline
:
split_raw
=
gcoder
.
split
(
gline
)
pass
gcoder
.
parse_coordinates
(
gline
,
split_raw
,
imperial
=
False
)
elif
gline
.
is_move
:
if
gline
.
is_move
:
if
gline
.
z
is
not
None
:
if
gline
.
z
is
not
None
:
layer
=
gline
.
z
layer
=
gline
.
z
if
layer
!=
self
.
curlayer
:
if
layer
!=
self
.
curlayer
:
...
@@ -289,14 +288,12 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -289,14 +288,12 @@ class PronterWindow(MainWindow, pronsole.pronsole):
wx
.
CallAfter
(
self
.
gviz
.
clearhilights
)
wx
.
CallAfter
(
self
.
gviz
.
clearhilights
)
wx
.
CallAfter
(
self
.
gviz
.
setlayer
,
layer
)
wx
.
CallAfter
(
self
.
gviz
.
setlayer
,
layer
)
elif
gline
.
command
in
[
"M104"
,
"M109"
]:
elif
gline
.
command
in
[
"M104"
,
"M109"
]:
gcoder
.
parse_coordinates
(
gline
,
split_raw
,
imperial
=
False
,
force
=
True
)
gline_s
=
gcoder
.
S
(
gline
)
gline_s
=
gcoder
.
S
(
gline
)
if
gline_s
is
not
None
:
if
gline_s
is
not
None
:
temp
=
gline_s
temp
=
gline_s
if
self
.
display_gauges
:
wx
.
CallAfter
(
self
.
hottgauge
.
SetTarget
,
temp
)
if
self
.
display_gauges
:
wx
.
CallAfter
(
self
.
hottgauge
.
SetTarget
,
temp
)
if
self
.
display_graph
:
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0TargetTemperature
,
temp
)
if
self
.
display_graph
:
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0TargetTemperature
,
temp
)
elif
gline
.
command
in
[
"M140"
,
"M190"
]:
elif
gline
.
command
in
[
"M140"
,
"M190"
]:
gline
.
parse_coordinates
(
gline
,
split_raw
,
imperial
=
False
,
force
=
True
)
gline_s
=
gcoder
.
S
(
gline
)
gline_s
=
gcoder
.
S
(
gline
)
if
gline_s
is
not
None
:
if
gline_s
is
not
None
:
temp
=
gline_s
temp
=
gline_s
...
@@ -305,8 +302,6 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -305,8 +302,6 @@ class PronterWindow(MainWindow, pronsole.pronsole):
elif
gline
.
command
.
startswith
(
"T"
):
elif
gline
.
command
.
startswith
(
"T"
):
tool
=
gline
.
command
[
1
:]
tool
=
gline
.
command
[
1
:]
if
hasattr
(
self
,
"extrudersel"
):
wx
.
CallAfter
(
self
.
extrudersel
.
SetValue
,
tool
)
if
hasattr
(
self
,
"extrudersel"
):
wx
.
CallAfter
(
self
.
extrudersel
.
SetValue
,
tool
)
else
:
return
self
.
sentlines
.
put_nowait
(
line
)
self
.
sentlines
.
put_nowait
(
line
)
def
is_excluded_move
(
self
,
gline
):
def
is_excluded_move
(
self
,
gline
):
...
...
printrun/prontserve.py
View file @
f6fbb75d
...
@@ -285,7 +285,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -285,7 +285,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
if
l
!=
"ok"
and
not
l
.
startswith
(
"ok T"
)
and
not
l
.
startswith
(
"T:"
):
if
l
!=
"ok"
and
not
l
.
startswith
(
"ok T"
)
and
not
l
.
startswith
(
"T:"
):
self
.
async
(
self
.
_receive_printer_error
,
l
)
self
.
async
(
self
.
_receive_printer_error
,
l
)
def
sendcb
(
self
,
l
):
def
sendcb
(
self
,
l
,
gl
):
# Monitor the sent commands for new extruder target temperatures
# Monitor the sent commands for new extruder target temperatures
if
(
"M109"
in
l
)
or
(
"M104"
in
l
)
or
(
"M140"
in
l
)
or
(
"M190"
in
l
):
if
(
"M109"
in
l
)
or
(
"M104"
in
l
)
or
(
"M140"
in
l
)
or
(
"M190"
in
l
):
temp
=
float
(
re
.
search
(
'S([0-9]+)'
,
l
)
.
group
(
1
))
temp
=
float
(
re
.
search
(
'S([0-9]+)'
,
l
)
.
group
(
1
))
...
...
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