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
79af67f1
Commit
79af67f1
authored
May 21, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor PronterWindow.sentcb
parent
e00311ab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
41 deletions
+25
-41
pronterface.py
pronterface.py
+25
-41
No files found.
pronterface.py
View file @
79af67f1
...
...
@@ -245,47 +245,31 @@ class PronterWindow(MainWindow, pronsole.pronsole):
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
def
sentcb
(
self
,
line
):
if
"G1"
in
line
:
if
"Z"
in
line
:
try
:
layer
=
float
(
line
.
split
(
"Z"
)[
1
]
.
split
()[
0
]
.
split
(
"*"
)[
0
])
gline
=
gcoder
.
Line
(
line
)
gline
.
parse_coordinates
(
imperial
=
False
)
if
gline
.
is_move
:
if
gline
.
z
!=
None
:
layer
=
gline
.
z
if
layer
!=
self
.
curlayer
:
self
.
curlayer
=
layer
self
.
gviz
.
hilight
.
clear
()
self
.
gviz
.
hilightarcs
.
clear
()
threading
.
Thread
(
target
=
wx
.
CallAfter
,
args
=
(
self
.
gviz
.
setlayer
,
layer
))
.
start
()
except
:
pass
try
:
self
.
sentlines
.
put_nowait
(
line
)
except
Queue
.
Full
:
pass
#threading.Thread(target = self.gviz.addgcode, args = (line, 1)).start()
#self.gwindow.p.addgcode(line, hilight = 1)
if
"M104"
in
line
or
"M109"
in
line
:
if
"S"
in
line
:
try
:
temp
=
float
(
line
.
split
(
"S"
)[
1
]
.
split
(
"*"
)[
0
])
wx
.
CallAfter
(
self
.
gviz
.
setlayer
,
layer
)
elif
gline
.
command
in
[
"M104"
,
"M109"
]:
gline
.
parse_coordinates
(
imperial
=
False
,
force
=
True
)
if
gline
.
s
!=
None
:
temp
=
gline
.
s
if
self
.
display_gauges
:
wx
.
CallAfter
(
self
.
hottgauge
.
SetTarget
,
temp
)
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0TargetTemperature
,
temp
)
except
:
pass
try
:
self
.
sentlines
.
put_nowait
(
line
)
except
:
pass
if
"M140"
in
line
:
if
"S"
in
line
:
try
:
temp
=
float
(
line
.
split
(
"S"
)[
1
]
.
split
(
"*"
)[
0
])
elif
gline
.
command
==
"M140"
:
gline
.
parse_coordinates
(
imperial
=
False
,
force
=
True
)
if
gline
.
s
!=
None
:
temp
=
gline
.
s
if
self
.
display_gauges
:
wx
.
CallAfter
(
self
.
bedtgauge
.
SetTarget
,
temp
)
wx
.
CallAfter
(
self
.
graph
.
SetBedTargetTemperature
,
temp
)
except
:
pass
try
:
else
:
return
self
.
sentlines
.
put_nowait
(
line
)
except
:
pass
def
do_extrude
(
self
,
l
=
""
):
try
:
...
...
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