Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pyMKcam
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
pyMKcam
Commits
c9bf3cfc
Commit
c9bf3cfc
authored
Feb 14, 2017
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manage tool change in single gcode exports
parent
76a6b0a9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
5 deletions
+15
-5
MK4duo.py
pymkcam/Exporters/GCode/MK4duo.py
+6
-4
__init__.py
pymkcam/Exporters/GCode/__init__.py
+1
-0
TaskTypes.py
pymkcam/Plugins/TaskTypes.py
+7
-0
Filters.py
pymkcam/Toolpath/Filters.py
+1
-1
No files found.
pymkcam/Exporters/GCode/MK4duo.py
View file @
c9bf3cfc
...
@@ -31,8 +31,8 @@ DEFAULT_HEADER = (
...
@@ -31,8 +31,8 @@ DEFAULT_HEADER = (
DEFAULT_FOOTER
=
(
DEFAULT_FOOTER
=
(
(
"G0 Z5.00000 F200"
,
"safe Z position"
),
#
("G0 Z5.00000 F200", "safe Z position"),
(
"M5"
,
"stop spindle"
),
#
("M5", "stop spindle"),
(
"M18"
,
"unlock all steppers"
),
(
"M18"
,
"unlock all steppers"
),
(
"M2"
,
"program ends"
)
(
"M2"
,
"program ends"
)
)
)
...
@@ -51,7 +51,7 @@ class MK4duo(pymkcam.Exporters.GCode.BaseGenerator):
...
@@ -51,7 +51,7 @@ class MK4duo(pymkcam.Exporters.GCode.BaseGenerator):
sspeed
=
"10000"
sspeed
=
"10000"
feed
=
"300"
feed
=
"300"
fast
=
"3000"
fast
=
"3000"
tool_id
=
0
def
add_header
(
self
):
def
add_header
(
self
):
for
command
,
comment
in
DEFAULT_HEADER
:
for
command
,
comment
in
DEFAULT_HEADER
:
...
@@ -97,7 +97,9 @@ class MK4duo(pymkcam.Exporters.GCode.BaseGenerator):
...
@@ -97,7 +97,9 @@ class MK4duo(pymkcam.Exporters.GCode.BaseGenerator):
self
.
feed
=
_render_number
(
feedrate
)
self
.
feed
=
_render_number
(
feedrate
)
def
command_select_tool
(
self
,
tool_id
):
def
command_select_tool
(
self
,
tool_id
):
if
self
.
tool_id
>
0
and
self
.
tool_id
!=
tool_id
:
self
.
add_command
(
"T
%
d"
%
tool_id
,
"select tool"
)
self
.
add_command
(
"T
%
d"
%
tool_id
,
"select tool"
)
self
.
tool_id
=
tool_id
def
command_spindle_speed
(
self
,
speed
):
def
command_spindle_speed
(
self
,
speed
):
self
.
sspeed
=
_render_number
(
speed
)
self
.
sspeed
=
_render_number
(
speed
)
...
...
pymkcam/Exporters/GCode/__init__.py
View file @
c9bf3cfc
...
@@ -79,6 +79,7 @@ class BaseGenerator(object):
...
@@ -79,6 +79,7 @@ class BaseGenerator(object):
all_filters
.
extend
(
filters
)
all_filters
.
extend
(
filters
)
filtered_moves
=
pymkcam
.
Toolpath
.
Filters
.
get_filtered_moves
(
moves
,
filtered_moves
=
pymkcam
.
Toolpath
.
Filters
.
get_filtered_moves
(
moves
,
all_filters
)
all_filters
)
_log
.
info
(
filtered_moves
)
for
move_type
,
args
in
filtered_moves
:
for
move_type
,
args
in
filtered_moves
:
if
move_type
in
(
MOVE_STRAIGHT
,
MOVE_STRAIGHT_RAPID
):
if
move_type
in
(
MOVE_STRAIGHT
,
MOVE_STRAIGHT_RAPID
):
is_rapid
=
move_type
==
MOVE_STRAIGHT_RAPID
is_rapid
=
move_type
==
MOVE_STRAIGHT_RAPID
...
...
pymkcam/Plugins/TaskTypes.py
View file @
c9bf3cfc
...
@@ -22,6 +22,7 @@ along with pyMKcam. If not, see <http://www.gnu.org/licenses/>.
...
@@ -22,6 +22,7 @@ along with pyMKcam. If not, see <http://www.gnu.org/licenses/>.
import
pymkcam.Plugins
import
pymkcam.Plugins
import
pymkcam.Toolpath.Filters
as
Filters
class
TaskTypeMilling
(
pymkcam
.
Plugins
.
PluginBase
):
class
TaskTypeMilling
(
pymkcam
.
Plugins
.
PluginBase
):
...
@@ -62,6 +63,12 @@ class TaskTypeMilling(pymkcam.Plugins.PluginBase):
...
@@ -62,6 +63,12 @@ class TaskTypeMilling(pymkcam.Plugins.PluginBase):
funcs
[
key
]
=
self
.
core
.
get
(
"get_parameter_sets"
)(
key
)
\
funcs
[
key
]
=
self
.
core
.
get
(
"get_parameter_sets"
)(
key
)
\
[
environment
[
key
][
set_name
]][
"func"
]
[
environment
[
key
][
set_name
]][
"func"
]
tool
,
tool_filters
=
funcs
[
"tool"
](
environment
[
"tool"
][
"parameters"
])
tool
,
tool_filters
=
funcs
[
"tool"
](
environment
[
"tool"
][
"parameters"
])
selecttool
=
False
for
tool_filter
in
tool_filters
:
if
isinstance
(
tool_filter
,
Filters
.
SelectTool
):
selecttool
=
True
if
not
selecttool
:
tool_filters
.
insert
(
0
,
Filters
.
SelectTool
(
task
[
"parameters"
][
"tool"
][
"id"
]))
low
,
high
=
environment
[
"bounds"
]
.
get_absolute_limits
(
low
,
high
=
environment
[
"bounds"
]
.
get_absolute_limits
(
tool_radius
=
tool
.
radius
,
models
=
environment
[
"collision_models"
])
tool_radius
=
tool
.
radius
,
models
=
environment
[
"collision_models"
])
path_generator
,
motion_grid
=
funcs
[
"process"
](
environment
[
"process"
],
path_generator
,
motion_grid
=
funcs
[
"process"
](
environment
[
"process"
],
...
...
pymkcam/Toolpath/Filters.py
View file @
c9bf3cfc
...
@@ -232,7 +232,7 @@ class SelectTool(BaseFilter):
...
@@ -232,7 +232,7 @@ class SelectTool(BaseFilter):
index
=
0
index
=
0
# skip all non-moves
# skip all non-moves
while
(
index
<
len
(
toolpath
))
and
\
while
(
index
<
len
(
toolpath
))
and
\
(
not
toolpath
[
0
][
0
]
in
MOVES_LIST
):
(
(
not
toolpath
[
index
][
0
]
in
MOVES_LIST
)
or
(
not
not
toolpath
[
index
][
1
][
0
]
==
"spindle_enabled"
)
):
index
+=
1
index
+=
1
toolpath
.
insert
(
index
,
(
MACHINE_SETTING
,
toolpath
.
insert
(
index
,
(
MACHINE_SETTING
,
(
"select_tool"
,
self
.
settings
[
"tool_id"
])))
(
"select_tool"
,
self
.
settings
[
"tool_id"
])))
...
...
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