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
12ea0d1f
Commit
12ea0d1f
authored
Nov 04, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use stateful parser for GCodes in 2D viewer as per #443
parent
0d6d7175
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
gviz.py
printrun/gviz.py
+5
-6
No files found.
printrun/gviz.py
View file @
12ea0d1f
...
@@ -217,6 +217,7 @@ class Gviz(wx.Panel):
...
@@ -217,6 +217,7 @@ class Gviz(wx.Panel):
def
clear
(
self
):
def
clear
(
self
):
self
.
lastpos
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
]
self
.
lastpos
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
]
self
.
hilightpos
=
self
.
lastpos
[:]
self
.
hilightpos
=
self
.
lastpos
[:]
self
.
gcoder
=
gcoder
.
GCode
([])
self
.
lines
=
{}
self
.
lines
=
{}
self
.
pens
=
{}
self
.
pens
=
{}
self
.
arcs
=
{}
self
.
arcs
=
{}
...
@@ -463,9 +464,7 @@ class Gviz(wx.Panel):
...
@@ -463,9 +464,7 @@ class Gviz(wx.Panel):
gcode
=
gcode
.
lower
()
.
strip
()
gcode
=
gcode
.
lower
()
.
strip
()
if
not
gcode
:
if
not
gcode
:
return
return
gline
=
gcoder
.
Line
(
gcode
)
gline
=
self
.
gcoder
.
append
(
gcode
,
store
=
False
)
split_raw
=
gcoder
.
split
(
gline
)
gcoder
.
parse_coordinates
(
gline
,
split_raw
,
imperial
=
False
)
def
_y
(
y
):
def
_y
(
y
):
return
self
.
build_dimensions
[
1
]
-
(
y
-
self
.
build_dimensions
[
4
])
return
self
.
build_dimensions
[
1
]
-
(
y
-
self
.
build_dimensions
[
4
])
...
@@ -481,9 +480,9 @@ class Gviz(wx.Panel):
...
@@ -481,9 +480,9 @@ class Gviz(wx.Panel):
target
=
start_pos
[:]
target
=
start_pos
[:]
target
[
5
]
=
0.0
target
[
5
]
=
0.0
target
[
6
]
=
0.0
target
[
6
]
=
0.0
if
gline
.
x
is
not
None
:
target
[
0
]
=
gline
.
x
if
gline
.
current_x
is
not
None
:
target
[
0
]
=
gline
.
current_
x
if
gline
.
y
is
not
None
:
target
[
1
]
=
gline
.
y
if
gline
.
current_y
is
not
None
:
target
[
1
]
=
gline
.
current_
y
if
gline
.
z
is
not
None
:
target
[
2
]
=
gline
.
z
if
gline
.
current_z
is
not
None
:
target
[
2
]
=
gline
.
current_
z
if
gline
.
e
is
not
None
:
target
[
3
]
=
gline
.
e
if
gline
.
e
is
not
None
:
target
[
3
]
=
gline
.
e
if
gline
.
f
is
not
None
:
target
[
4
]
=
gline
.
f
if
gline
.
f
is
not
None
:
target
[
4
]
=
gline
.
f
if
gline
.
i
is
not
None
:
target
[
5
]
=
gline
.
i
if
gline
.
i
is
not
None
:
target
[
5
]
=
gline
.
i
...
...
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