QtDragon_hd jog increments

More
26 Feb 2024 09:51 - 26 Feb 2024 13:43 #294489 by Oki
QtDragon_hd jog increments was created by Oki
Hi, I am running QtDragon_hd on my PrintNC, and it works well so far. I love the touch-friendly UI, but I need some extra shortcuts for changing increments while manually touching off (/setting up G54 zeros). I am building simple custom keyboard to use it as a pendant.Is there a way to add shortcuts for changing jog increments with two buttons?
It could be similar to shortcuts for jog speed. I would like to be able to change the next increment gradually, such as 5mm, 1mm, 0.5mm, and so on, and back- vice versa.

I could try to do that myself but need some hints where to start.

Thanks a lot in advance
Last edit: 26 Feb 2024 13:43 by Oki.

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

More
27 Feb 2024 07:26 #294581 by cmorley
Replied by cmorley on topic QtDragon_hd jog increments
What version of linuxcnc are you using?

yes using a handler patching file:
linuxcnc.org/docs/stable/html/gui/qtvcp....cp:modifying-screens

you could add keybindings that would call increment changes.

What keys do you want to use?

Or you could add buttons on the screen to set increments directly -if you like touch screens.

Chris
The following user(s) said Thank You: Oki

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

More
27 Feb 2024 12:03 - 27 Feb 2024 18:00 #294596 by Oki
Replied by Oki on topic QtDragon_hd jog increments
Thanks for your time :)
i am on 2.10
I am thinking about [ and ] keys on the keyboard. But basically it doesn't matter for my case (I can send any keypress from my custom keyboard/pendant). There is already an option to use touchscreen for setting increments so I just need physical keypress so i don't have to move my hands to monitor when doing Z zeroing manually.

I will check your link and my setup later when get back home.
Last edit: 27 Feb 2024 18:00 by Oki.

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

More
28 Feb 2024 07:21 #294671 by cmorley
Replied by cmorley on topic QtDragon_hd jog increments
Try this.

rename this file to qtdragon_hd_handler.py then put it in  CONFIGFOLDER/qtvcp/screens/qtdragon_hd

[] key should cycle thru the increments - you will see the combobox change.

rename or delete the file to go back to the original code.
Attachments:
The following user(s) said Thank You: zu4lu

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

More
28 Feb 2024 17:26 - 28 Feb 2024 18:40 #294705 by Oki
Replied by Oki on topic QtDragon_hd jog increments
I am on version 2.10 (should work on 2.9 if am not wrong) and had previously made some changes in my handler located at 'CONFIGFOLDER/qtvcp/screens/qtdragon_hd', though I don't recall the specific alterations. I utilized your code snippet and modified it slightly. Now, the key press [ ] doesn't cycle indefinitely; it transitions from continuous to the lowest increment and remains there until the opposite key is pressed (this applies to increasing increments as well).

//add key bindings  to class HandlerClass:
KEYBIND.add_call('Key_BracketLeft','on_keycall_index_jog_increments',1) KEYBIND.add_call('Key_BracketRight','on_keycall_index_jog_increments',0)

//add ## KEY BINDING CALLS #    
    def on_keycall_index_jog_increments(self,event,state,shift,cntrl,value):
        if state:
            idx = self.w.jogincrements_linear.currentIndex()
            if value:
                if idx < self.w.jogincrements_linear.count()-1: self.w.jogincrements_linear.setCurrentIndex(idx+1)
            else:
                if idx > 0: self.w.jogincrements_linear.setCurrentIndex(idx-1)

This modification works flawlessly, and I can't thank you enough for your excellent work.
Last edit: 28 Feb 2024 18:40 by Oki.
The following user(s) said Thank You: Roguish, tommylight, zu4lu

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

More
29 Feb 2024 03:40 #294747 by cmorley
Replied by cmorley on topic QtDragon_hd jog increments
Nice job! Glad I could help.
The following user(s) said Thank You: tommylight, zu4lu

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

Moderators: cmorley
Time to create page: 0.066 seconds
Powered by Kunena Forum