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
a55d6981
Commit
a55d6981
authored
Nov 07, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store & restore current tool in gcodeplater
parent
03c532cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
gcodeplater.py
gcodeplater.py
+4
-0
No files found.
gcodeplater.py
View file @
a55d6981
...
@@ -98,6 +98,7 @@ class GcodePlater(Plater):
...
@@ -98,6 +98,7 @@ class GcodePlater(Plater):
for
(
layer_i
,
layer
)
in
enumerate
(
model
.
gcode
.
all_layers
)
if
layer
]
for
(
layer_i
,
layer
)
in
enumerate
(
model
.
gcode
.
all_layers
)
if
layer
]
alllayers
.
sort
()
alllayers
.
sort
()
laste
=
[
0
]
*
len
(
models
)
laste
=
[
0
]
*
len
(
models
)
lasttool
=
[
0
]
*
len
(
models
)
lastrelative
=
[
False
]
*
len
(
models
)
lastrelative
=
[
False
]
*
len
(
models
)
with
open
(
name
,
"w"
)
as
f
:
with
open
(
name
,
"w"
)
as
f
:
analyzer
=
gcoder
.
GCode
(
None
,
get_home_pos
(
self
.
build_dimensions
))
analyzer
=
gcoder
.
GCode
(
None
,
get_home_pos
(
self
.
build_dimensions
))
...
@@ -124,6 +125,8 @@ class GcodePlater(Plater):
...
@@ -124,6 +125,8 @@ class GcodePlater(Plater):
analyzer
.
write
(
"G91
\n
"
)
analyzer
.
write
(
"G91
\n
"
)
else
:
else
:
analyzer
.
write
(
"G90
\n
"
)
analyzer
.
write
(
"G90
\n
"
)
if
analyzer
.
current_tool
!=
lasttool
[
model_i
]:
analyzer
.
write
(
"T
%
d
\n
"
%
lasttool
[
model_i
])
analyzer
.
write
(
"G92 X
%.5
f Y
%.5
f Z
%.5
f
\n
"
%
trans_wpos
)
analyzer
.
write
(
"G92 X
%.5
f Y
%.5
f Z
%.5
f
\n
"
%
trans_wpos
)
analyzer
.
write
(
"G92 E
%.5
f
\n
"
%
laste
[
model_i
])
analyzer
.
write
(
"G92 E
%.5
f
\n
"
%
laste
[
model_i
])
for
l
in
layer
:
for
l
in
layer
:
...
@@ -133,6 +136,7 @@ class GcodePlater(Plater):
...
@@ -133,6 +136,7 @@ class GcodePlater(Plater):
last_real_position
=
analyzer
.
current_pos
last_real_position
=
analyzer
.
current_pos
laste
[
model_i
]
=
analyzer
.
current_e
laste
[
model_i
]
=
analyzer
.
current_e
lastrelative
[
model_i
]
=
analyzer
.
relative
lastrelative
[
model_i
]
=
analyzer
.
relative
lasttool
[
model_i
]
=
analyzer
.
current_tool
print
_
(
"Exported merged G-Codes to
%
s"
)
%
name
print
_
(
"Exported merged G-Codes to
%
s"
)
%
name
def
export_sequential
(
self
,
name
):
def
export_sequential
(
self
,
name
):
...
...
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