Category: General LinuxCNC Questions
I need to set the jog increment to a specific value and bind it to a key, let's say 'e'. I'm using the Axis GUI so the key binding is done like this in .axisrc, which works:
root_window.bind( "<e>", set_jog_inc_precise )
The contents of the function set_jog_inc_precise is the issue. I've tried the following
vars.jog.increment.set( "0.001" )
linuxcnc.command().jog( linuxcnc.JOG_INCREMENT, True, 0, 10, 0.001 )
j = root_window.nametowidget( ".pane.top.jogspeed.jogincrement")
j.set( "0.001" )
root_window.tk.eval( "set jogincrement 0.001" )
commands.set_jog_increments()
Only the second (linuxcnc.command()...) had an effect. It actually jogged the axis, when I was watching the DRO. So when I press "e" it would jog X 0.001 in the positive direction but when I used the arrow, it jogged X based on the drop-down menu in the Manual Control tab.
The backstory is that I have a pendant that isn't supported and have managed to map it from /dev/hidraw<n> to a virtual keyboard. Most of the buttons work but the relative adjustment of the jog increment (i, I) is not the best because the dial on the pendant is labeled and it's easy to get out of sync.
I've spent a few hours trying to get this working, reviewed the documentation for the python linuxcnc module, and even asked a few chatbots. What am I doing wrong?