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
4b5456e1
Commit
4b5456e1
authored
Apr 04, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print message after a successful injection
parent
c2072b38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
gcoder.py
printrun/gcoder.py
+1
-0
injectgcode.py
printrun/injectgcode.py
+8
-4
No files found.
printrun/gcoder.py
View file @
4b5456e1
...
...
@@ -246,6 +246,7 @@ class GCode(object):
# Update indices arrays & global gcodes list
self
.
layer_idxs
.
insert
(
end_index
+
i
,
layer_idx
)
self
.
line_idxs
.
insert
(
end_index
+
i
,
end_line
+
i
+
1
)
return
commands
[::
-
1
]
def
append
(
self
,
command
,
store
=
True
):
command
=
command
.
strip
()
...
...
printrun/injectgcode.py
View file @
4b5456e1
...
...
@@ -15,12 +15,16 @@
from
.gui.widgets
import
MacroEditor
from
.utils
import
install_locale
install_locale
(
'pronterface'
)
def
injector
(
gcode
,
viz_layer
,
layer_idx
):
cb
=
lambda
toadd
:
inject
(
gcode
,
layer_idx
,
toadd
)
cb
=
lambda
toadd
:
inject
(
gcode
,
viz_layer
,
layer_idx
,
toadd
)
z
=
gcode
.
all_layers
[
layer_idx
]
.
z
z
=
z
if
z
is
not
None
else
0
MacroEditor
(
_
(
"Inject G-Code at layer
%
d (Z =
%.03
f)"
)
%
(
viz_layer
,
z
),
""
,
cb
,
True
)
def
inject
(
gcode
,
layer_idx
,
toadd
):
# TODO: save modifier gcode after injection ?
gcode
.
prepend_to_layer
(
toadd
,
layer_idx
)
def
inject
(
gcode
,
viz_layer
,
layer_idx
,
toadd
):
# TODO: save modified gcode after injection ?
nlines
=
len
(
gcode
.
prepend_to_layer
(
toadd
,
layer_idx
))
print
_
(
"Successfully injected
%
d lines at beginning of layer
%
d"
)
%
(
nlines
,
viz_layer
)
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