- Posts: 1
- Thank you received: 0
AXIS and keyboard
2 years 4 months ago #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
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
Please Log in to join the conversation.
2 years 4 months ago #303020
by Grotius
Replied by Grotius on topic AXIS and keyboard
~/linuxcnc/src/emc/usr_intf/halui.cc Line 894
Code:
[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 to join the conversation.
2 years 4 months ago #303041
by andypugh
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.
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 to join the conversation.
2 years 4 months ago #303056
by cakeslob
Replied by cakeslob on topic AXIS and keyboard
Code:
root_window.bind("i")#, lambda event: jogspeed_incremental())
root_window.bind("I")#, lambda event: jogspeed_incremental(-1))
Please Log in to join the conversation.
2 years 4 months ago #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 to join the conversation.
2 years 4 months ago #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
so the command....increments through the increments
Please Log in to join the conversation.
Time to create page: 0.555 seconds
