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
e2f7fd61
Commit
e2f7fd61
authored
Jun 22, 2012
by
Lars Kruse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a simple get/set wrapper to touch-off plugin
parent
5b8977dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
GCodeTouchOff.py
pycam/Plugins/GCodeTouchOff.py
+24
-1
No files found.
pycam/Plugins/GCodeTouchOff.py
View file @
e2f7fd61
...
@@ -29,13 +29,25 @@ class GCodeTouchOff(pycam.Plugins.PluginBase):
...
@@ -29,13 +29,25 @@ class GCodeTouchOff(pycam.Plugins.PluginBase):
DEPENDS
=
[
"ToolpathProcessors"
]
DEPENDS
=
[
"ToolpathProcessors"
]
CATEGORIES
=
[
"GCode"
]
CATEGORIES
=
[
"GCode"
]
UI_FILE
=
"gcode_touch_off.ui"
UI_FILE
=
"gcode_touch_off.ui"
_NAME_CONTROL_MAP
=
((
"ToolChangePosX"
,
"change_pos_x"
,
0
),
(
"ToolChangePosY"
,
"change_pos_y"
,
0
),
(
"ToolChangePosZ"
,
"change_pos_z"
,
0
),
(
"GCodeTouchOffOnStartup"
,
"on_startup"
,
False
),
(
"GCodeTouchOffOnToolChange"
,
"on_tool_change"
,
False
),
(
"TouchOffLocationSelector"
,
"location_selector"
,
0
),
(
"ToolChangeRapidMoveDown"
,
"rapid_move_down"
,
0.0
),
(
"ToolChangeSlowMoveDown"
,
"slow_move_down"
,
0.0
),
(
"ToolChangeSlowMoveSpeed"
,
"slow_move_speed"
,
1
),
(
"TouchOffHeight"
,
"height"
,
0.0
),
(
"TouchOffPauseExecution"
,
"pause_execution"
,
False
))
def
setup
(
self
):
def
setup
(
self
):
if
self
.
gui
:
if
self
.
gui
:
self
.
box
=
self
.
gui
.
get_object
(
"TouchOffBox"
)
self
.
box
=
self
.
gui
.
get_object
(
"TouchOffBox"
)
self
.
box
.
unparent
()
self
.
box
.
unparent
()
self
.
core
.
get
(
"register_parameter"
)(
"toolpath_processor"
,
self
.
core
.
get
(
"register_parameter"
)(
"toolpath_processor"
,
"touch_off"
,
self
.
box
)
"touch_off"
,
self
.
box
,
get_func
=
self
.
_get_value
,
set_func
=
self
.
_set_value
)
self
.
core
.
register_ui
(
"gcode_preferences"
,
"Touch Off"
,
self
.
core
.
register_ui
(
"gcode_preferences"
,
"Touch Off"
,
self
.
box
,
weight
=
70
)
self
.
box
,
weight
=
70
)
self
.
_gtk_handlers
=
[]
self
.
_gtk_handlers
=
[]
...
@@ -59,6 +71,17 @@ class GCodeTouchOff(pycam.Plugins.PluginBase):
...
@@ -59,6 +71,17 @@ class GCodeTouchOff(pycam.Plugins.PluginBase):
self
.
core
.
get
(
"unregister_parameter"
)(
"toolpath_processor"
,
self
.
core
.
get
(
"unregister_parameter"
)(
"toolpath_processor"
,
"touch_off"
,
self
.
box
)
"touch_off"
,
self
.
box
)
def
_get_value
(
self
):
result
=
{}
for
objname
,
key
,
default
in
self
.
_NAME_CONTROL_MAP
:
result
[
key
]
=
self
.
gui
.
get_object
(
objname
)
.
get_value
()
def
_set_value
(
self
,
value
=
None
):
if
value
is
None
:
value
=
{}
for
objname
,
key
,
default
in
self
.
_NAME_CONTROL_MAP
:
self
.
gui
.
get_object
(
objname
)
.
set_value
(
value
.
get
(
key
,
default
))
def
update_widgets
(
self
,
widget
=
None
):
def
update_widgets
(
self
,
widget
=
None
):
# tool change controls
# tool change controls
pos_control
=
self
.
gui
.
get_object
(
"TouchOffLocationSelector"
)
pos_control
=
self
.
gui
.
get_object
(
"TouchOffLocationSelector"
)
...
...
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