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
9642395a
Commit
9642395a
authored
Feb 14, 2017
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now tool change is cached
parent
c9bf3cfc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
MK4duo.py
pymkcam/Exporters/GCode/MK4duo.py
+4
-3
__init__.py
pymkcam/Exporters/GCode/__init__.py
+1
-1
No files found.
pymkcam/Exporters/GCode/MK4duo.py
View file @
9642395a
...
...
@@ -25,6 +25,7 @@ from pymkcam.Toolpath import CORNER_STYLE_EXACT_PATH, CORNER_STYLE_EXACT_STOP, \
CORNER_STYLE_OPTIMIZE_SPEED
,
CORNER_STYLE_OPTIMIZE_TOLERANCE
DEFAULT_HEADER
=
(
(
"M82"
,
"select absolute coordinate system"
),
)
...
...
@@ -51,7 +52,6 @@ class MK4duo(pymkcam.Exporters.GCode.BaseGenerator):
sspeed
=
"10000"
feed
=
"300"
fast
=
"3000"
tool_id
=
0
def
add_header
(
self
):
for
command
,
comment
in
DEFAULT_HEADER
:
...
...
@@ -60,6 +60,7 @@ class MK4duo(pymkcam.Exporters.GCode.BaseGenerator):
self
.
add_command
(
"G21"
,
"metric"
)
else
:
self
.
add_command
(
"G20"
,
"imperial"
)
self
.
header_added
=
True
def
add_footer
(
self
):
for
command
,
comment
in
DEFAULT_FOOTER
:
...
...
@@ -97,9 +98,9 @@ class MK4duo(pymkcam.Exporters.GCode.BaseGenerator):
self
.
feed
=
_render_number
(
feedrate
)
def
command_select_tool
(
self
,
tool_id
):
if
self
.
tool_id
>
0
and
self
.
tool_id
!=
tool_id
:
if
self
.
_last_tool_id
>
0
and
self
.
_last_
tool_id
!=
tool_id
:
self
.
add_command
(
"T
%
d"
%
tool_id
,
"select tool"
)
self
.
tool_id
=
tool_id
self
.
_last_
tool_id
=
tool_id
def
command_spindle_speed
(
self
,
speed
):
self
.
sspeed
=
_render_number
(
speed
)
...
...
pymkcam/Exporters/GCode/__init__.py
View file @
9642395a
...
...
@@ -46,6 +46,7 @@ class BaseGenerator(object):
self
.
_close_stream_on_exit
=
False
self
.
_filters
=
[]
self
.
_cache
=
{}
self
.
_last_tool_id
=
0
self
.
add_header
()
def
_get_cache
(
self
,
key
,
default_value
):
...
...
@@ -79,7 +80,6 @@ class BaseGenerator(object):
all_filters
.
extend
(
filters
)
filtered_moves
=
pymkcam
.
Toolpath
.
Filters
.
get_filtered_moves
(
moves
,
all_filters
)
_log
.
info
(
filtered_moves
)
for
move_type
,
args
in
filtered_moves
:
if
move_type
in
(
MOVE_STRAIGHT
,
MOVE_STRAIGHT_RAPID
):
is_rapid
=
move_type
==
MOVE_STRAIGHT_RAPID
...
...
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