AXIS and keyboard

More
13 Jun 2024 12:23 - 14 Jun 2024 07:09 #302934 by denis1024
AXIS and keyboard was created by denis1024
Hello,
AXIS has a selection box with jog increments (1, 0.1, 0.01 mm). But to select a certain value, you need the mouse.
I want to link a key on the keyboard to a value. For example, I press "Key-A" and the 0.1 mm selection is made. It's a bit like a shortcut.
I found a command to change the speed:

root_window.bind('<Key-1>',lambda event: set_feedrate(10))

This works and is exactly what I want.
Now the problem is finding the correct routine to call, set_feedrate() is for ffeed rate ... but what's the name for jog increment ?
I guess it's something like jog_increment()?
Subsidiary question: where can I find a list of functions of this type that can be called from a script?
Thanks,
Denis
Last edit: 14 Jun 2024 07:09 by denis1024. Reason: clarify

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

More
14 Jun 2024 19:22 #303020 by Grotius
Replied by Grotius on topic AXIS and keyboard
~/linuxcnc/src/emc/usr_intf/halui.cc Line 894
[size=85] retval =  hal_pin_bit_newf(HAL_IN, &(halui_data->jjog_increment_plus[num_joints]), comp_id, "halui.joint.selected.increment-plus");[/size]

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

More
15 Jun 2024 09:32 #303041 by andypugh
Replied by andypugh on topic AXIS and keyboard

Subsidiary question: where can I find a list of functions of this type that can be called from a script?


The best way is to look in the Axis Python code: github.com/LinuxCNC/linuxcnc/blob/master...cripts/axis.py#L3267

But whilst there is a set_feedrate (look for def set_feedrate) I don't see a matching function to set the jog increment. Instead the increment is set simply by reading the value from the UI element.

You can probably add code in the .axisrc file to both bind a key to a new set_increment function and to define that function. But I haven't experimented to see how that would work.

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

More
15 Jun 2024 16:44 #303056 by cakeslob
Replied by cakeslob on topic AXIS and keyboard
root_window.bind("i")#, lambda event: jogspeed_incremental())
    root_window.bind("I")#, lambda event: jogspeed_incremental(-1))

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

More
15 Jun 2024 17:01 #303058 by andypugh
Replied by andypugh on topic AXIS and keyboard
I _think_ that i and I switch between continuous and incremental, but that was just from glancing at the code.

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

More
15 Jun 2024 18:41 #303065 by cakeslob
Replied by cakeslob on topic AXIS and keyboard
ok I just tested, lower case i makes it go down in increments, and uppercase I makes it go up in increments , and neither make it continuous

so the command....increments through the increments

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

Time to create page: 0.178 seconds
Powered by Kunena Forum