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
f8262789
Commit
f8262789
authored
Mar 27, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename gviz.addgcode to addgcodehilight, remove non-highlight codepaths
parent
4b4e4a2b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
29 deletions
+9
-29
gcview.py
printrun/gcview.py
+1
-1
gviz.py
printrun/gviz.py
+7
-27
pronterface.py
printrun/pronterface.py
+1
-1
No files found.
printrun/gcview.py
View file @
f8262789
...
@@ -298,7 +298,7 @@ class GcodeViewMainWrapper(object):
...
@@ -298,7 +298,7 @@ class GcodeViewMainWrapper(object):
self
.
objects
[
0
]
.
model
=
self
.
platform
self
.
objects
[
0
]
.
model
=
self
.
platform
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
def
addgcode
(
self
,
*
a
):
def
addgcode
highlight
(
self
,
*
a
):
pass
pass
def
setlayer
(
self
,
*
a
):
def
setlayer
(
self
,
*
a
):
...
...
printrun/gviz.py
View file @
f8262789
...
@@ -464,7 +464,7 @@ class Gviz(wx.Panel):
...
@@ -464,7 +464,7 @@ class Gviz(wx.Panel):
self
.
dirty
=
1
self
.
dirty
=
1
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
def
addgcode
(
self
,
gcode
=
"M105"
,
hilight
=
0
):
def
addgcode
highlight
(
self
,
gcode
=
"M105"
):
gcode
=
gcode
.
split
(
"*"
)[
0
]
gcode
=
gcode
.
split
(
"*"
)[
0
]
gcode
=
gcode
.
split
(
";"
)[
0
]
gcode
=
gcode
.
split
(
";"
)[
0
]
gcode
=
gcode
.
lower
()
.
strip
()
gcode
=
gcode
.
lower
()
.
strip
()
...
@@ -481,7 +481,7 @@ class Gviz(wx.Panel):
...
@@ -481,7 +481,7 @@ class Gviz(wx.Panel):
if
gline
.
command
not
in
[
"G0"
,
"G1"
,
"G2"
,
"G3"
]:
if
gline
.
command
not
in
[
"G0"
,
"G1"
,
"G2"
,
"G3"
]:
return
return
start_pos
=
self
.
hilightpos
[:]
if
hilight
else
self
.
lastpos
[:]
start_pos
=
self
.
hilightpos
[:]
target
=
start_pos
[:]
target
=
start_pos
[:]
target
[
5
]
=
0.0
target
[
5
]
=
0.0
...
@@ -494,20 +494,8 @@ class Gviz(wx.Panel):
...
@@ -494,20 +494,8 @@ class Gviz(wx.Panel):
if
gline
.
i
is
not
None
:
target
[
5
]
=
gline
.
i
if
gline
.
i
is
not
None
:
target
[
5
]
=
gline
.
i
if
gline
.
j
is
not
None
:
target
[
6
]
=
gline
.
j
if
gline
.
j
is
not
None
:
target
[
6
]
=
gline
.
j
z
=
target
[
2
]
if
not
hilight
and
z
not
in
self
.
layers
:
self
.
lines
[
z
]
=
[]
self
.
pens
[
z
]
=
[]
self
.
arcs
[
z
]
=
[]
self
.
arcpens
[
z
]
=
[]
self
.
layers
.
append
(
z
)
if
gline
.
command
in
[
"G0"
,
"G1"
]:
if
gline
.
command
in
[
"G0"
,
"G1"
]:
line
=
[
_x
(
start_pos
[
0
]),
_y
(
start_pos
[
1
]),
_x
(
target
[
0
]),
_y
(
target
[
1
])]
line
=
[
_x
(
start_pos
[
0
]),
_y
(
start_pos
[
1
]),
_x
(
target
[
0
]),
_y
(
target
[
1
])]
if
not
hilight
:
self
.
lines
[
z
]
.
append
((
_x
(
start_pos
[
0
]),
_y
(
start_pos
[
1
]),
_x
(
target
[
0
]),
_y
(
target
[
1
])))
self
.
pens
[
z
]
.
append
(
self
.
mainpen
if
target
[
3
]
!=
self
.
lastpos
[
3
]
else
self
.
travelpen
)
else
:
self
.
hilight
.
append
(
line
)
self
.
hilight
.
append
(
line
)
self
.
hilightqueue
.
put_nowait
(
line
)
self
.
hilightqueue
.
put_nowait
(
line
)
elif
gline
.
command
in
[
"G2"
,
"G3"
]:
elif
gline
.
command
in
[
"G2"
,
"G3"
]:
...
@@ -518,17 +506,9 @@ class Gviz(wx.Panel):
...
@@ -518,17 +506,9 @@ class Gviz(wx.Panel):
if
gline
.
command
==
"G2"
:
# clockwise, reverse endpoints
if
gline
.
command
==
"G2"
:
# clockwise, reverse endpoints
arc
[
0
],
arc
[
1
],
arc
[
2
],
arc
[
3
]
=
arc
[
2
],
arc
[
3
],
arc
[
0
],
arc
[
1
]
arc
[
0
],
arc
[
1
],
arc
[
2
],
arc
[
3
]
=
arc
[
2
],
arc
[
3
],
arc
[
0
],
arc
[
1
]
if
not
hilight
:
self
.
arcs
[
z
]
.
append
(
arc
)
self
.
arcpens
[
z
]
.
append
(
self
.
arcpen
)
else
:
self
.
hilightarcs
.
append
(
arc
)
self
.
hilightarcs
.
append
(
arc
)
self
.
hilightarcsqueue
.
put_nowait
(
arc
)
self
.
hilightarcsqueue
.
put_nowait
(
arc
)
if
not
hilight
:
self
.
lastpos
=
target
self
.
dirty
=
1
else
:
self
.
hilightpos
=
target
self
.
hilightpos
=
target
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
...
...
printrun/pronterface.py
View file @
f8262789
...
@@ -1540,7 +1540,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1540,7 +1540,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
try
:
try
:
while
not
self
.
sentlines
.
empty
():
while
not
self
.
sentlines
.
empty
():
gc
=
self
.
sentlines
.
get_nowait
()
gc
=
self
.
sentlines
.
get_nowait
()
wx
.
CallAfter
(
self
.
gviz
.
addgcode
,
gc
,
1
)
wx
.
CallAfter
(
self
.
gviz
.
addgcode
highlight
,
gc
)
self
.
sentlines
.
task_done
()
self
.
sentlines
.
task_done
()
except
Queue
.
Empty
:
except
Queue
.
Empty
:
pass
pass
...
...
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