Setting default 'relative to work piece' TO value

More
20 Jul 2016 13:22 #77709 by jblakey
Hi all,

I've been using LinuxCNC for a few years now on my little hobby CNC, and I finally got around to making myself a little touch-off plate from Aluminum. It works great and makes things quick and easy. But I need to keep typing in ".26" into the touch-off window, 'cause my aluminum is .26 inches thick.

My TO plate is what I touch-off to most of the time - is there anyway to set a default value for the text box on this screen?


Thanks much,
jason
Attachments:

Please Log in or Create an account to join the conversation.

More
20 Jul 2016 13:37 #77712 by andypugh
It looks like you should be able to edit axis.py

git.linuxcnc.org/gitweb?p=linuxcnc.git;a...4000b060384a14#l2531

And set a new default value.
The following user(s) said Thank You: jblakey

Please Log in or Create an account to join the conversation.

More
20 Jul 2016 14:19 #77721 by jblakey
I'll try that tonight - figure out the axis involved, then if it's "Z", supply the default...

I've done a little python, I'll see how it goes:)

Thanks very much,
jason

Please Log in or Create an account to join the conversation.

More
20 Jul 2016 14:32 #77722 by jblakey
Maybe something like this:

2531
2532 def touch_off_system(event=None, new_axis_value = None):
2533 global system
2534 if not manual_ok(): return
2535 offset_axis = trajcoordinates.index(vars.ja_rbutton.get())

default_offset = "0.0"
if offset_axis.upper() == "Z"
default_offset = "0.26"


2536 if new_axis_value is None:
2537 new_axis_value, system = prompt_touchoff(
2538 title=_("Touch Off (system)"),
2539 text=_("Enter %s coordinate relative to %%s:") % vars.ja_rbutton.get().upper(),
2540 default=default_offset,
2541 tool_only=False,
2542 system=vars.touch_off_system.get()
2543 )
2544 else:
2545 system = vars.touch_off_system.get()
2546 if new_axis_value is None: return
2547
2548 save_task_mode = s.task_mode
2549 vars.touch_off_system.set(system)
2550 ensure_mode(linuxcnc.MODE_MDI)
2551 s


I'll try it out tonight, and see how it goes

Thanks,
jason

Please Log in or Create an account to join the conversation.

More
20 Jul 2016 14:54 #77723 by andypugh
This isn't better, it's just different, but would scale better to X, Y, U,V,W etc

offsets = {"X":0, "Y":0, "Z":2.6, "A":0, "B":0, "C":0, "U":0, "V":0, "W":0}
...
default=offsets(offset_axis.upper)

Please Log in or Create an account to join the conversation.

More
20 Jul 2016 15:22 #77725 by jblakey
No, that's better - more future proof.

Thanks again,
jason

Please Log in or Create an account to join the conversation.

Time to create page: 0.184 seconds
Powered by Kunena Forum