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
7c3250a9
Commit
7c3250a9
authored
May 18, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add lineno => (layer, layer_line) mapping to gcoder
parent
be10cff3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
gcoder.py
printrun/gcoder.py
+10
-0
No files found.
printrun/gcoder.py
View file @
7c3250a9
...
@@ -131,6 +131,7 @@ class GCode(object):
...
@@ -131,6 +131,7 @@ class GCode(object):
lines
=
None
lines
=
None
layers
=
None
layers
=
None
all_layers
=
None
all_layers
=
None
idxs
=
None
def
__init__
(
self
,
data
):
def
__init__
(
self
,
data
):
self
.
lines
=
[
Line
(
l2
)
for
l2
in
self
.
lines
=
[
Line
(
l2
)
for
l2
in
...
@@ -169,6 +170,10 @@ class GCode(object):
...
@@ -169,6 +170,10 @@ class GCode(object):
def
_create_layers
(
self
):
def
_create_layers
(
self
):
layers
=
{}
layers
=
{}
all_layers
=
[]
all_layers
=
[]
idxs
=
[]
layer_id
=
0
layer_line
=
0
prev_z
=
None
prev_z
=
None
cur_z
=
0
cur_z
=
0
...
@@ -189,8 +194,12 @@ class GCode(object):
...
@@ -189,8 +194,12 @@ class GCode(object):
old_lines
+=
cur_lines
old_lines
+=
cur_lines
layers
[
prev_z
]
=
old_lines
layers
[
prev_z
]
=
old_lines
cur_lines
=
[]
cur_lines
=
[]
layer_id
+=
1
layer_line
=
0
cur_lines
.
append
(
line
)
cur_lines
.
append
(
line
)
idxs
.
append
((
layer_id
,
layer_line
))
layer_line
+=
1
prev_z
=
cur_z
prev_z
=
cur_z
if
cur_lines
:
if
cur_lines
:
...
@@ -213,6 +222,7 @@ class GCode(object):
...
@@ -213,6 +222,7 @@ class GCode(object):
self
.
all_layers
=
all_layers
self
.
all_layers
=
all_layers
self
.
layers
=
layers
self
.
layers
=
layers
self
.
idxs
=
idxs
def
num_layers
(
self
):
def
num_layers
(
self
):
return
len
(
self
.
layers
)
return
len
(
self
.
layers
)
...
...
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