step/continuous from keyboard

More
3 years 7 months ago #267631 by Dorro1971
Cheers Vmax549

Great! can you please explain how you did that?...i have a googled it to no avail...

thanks

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

More
3 years 7 months ago #267639 by Vmax549
Hi Dorro I see your email is not listed. IF you email me we will talk.

(;-) TP

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

More
3 years 7 months ago - 3 years 6 months ago #267640 by snowgoer540

Hi folks,

Does anybody know if there is a way that I could toggle between step and continuous jog from my keyboard?

I would really like to add keys for zero axis



Sure, if you don't mind editing a python file.

Guessing you know how to get to the file system, but if not, ctrl + alt + x, then type "mate-panel" in the terminal.

I assume you're using a mill but it should be similar for others, also I'm assuming you're on v2.9.3 (for line number reference).

Open v2.9.3/python/tormach_mill_ui.py in geany.

Search for (at line 935):
Code:
'jog_zero', 'jog_one', 'jog_two', 'jog_three',


Change it to:
Code:
'jog_zero', 'jog_one', 'jog_two', 'jog_three', jog_inc_cont,


Search for (at line 4152):
Code:
# Escape key for stop


Below the if statement under that comment, in line with "if event.type == gtk.gdk.KEY_PRESS:" add the following:


Code:
# Step/Cont, Increments, Zero Axis keys for Dorro1971 if event.state & (gtk.gdk.MOD1_MASK | gtk.gdk.MOD5_MASK) and event.type == gtk.gdk.KEY_PRESS: if kv in [gtk.keysyms.g, gtk.keysyms.G]: self.enqueue_button_press_release(self.button_list['jog_inc_cont']) if kv in [gtk.keysyms.h, gtk.keysyms.H]: self.enqueue_button_press_release(self.button_list['jog_zero']) if kv in [gtk.keysyms.j, gtk.keysyms.J]: self.enqueue_button_press_release(self.button_list['jog_one']) if kv in [gtk.keysyms.k, gtk.keysyms.K]: self.enqueue_button_press_release(self.button_list['jog_two']) if kv in [gtk.keysyms.l, gtk.keysyms.L]: self.enqueue_button_press_release(self.button_list['jog_three']) if kv in [gtk.keysyms.x, gtk.keysyms.X]: self.enqueue_button_press_release(self.button_list['zero_x']) if kv in [gtk.keysyms.y, gtk.keysyms.Y]: self.enqueue_button_press_release(self.button_list['zero_y']) if kv in [gtk.keysyms.z, gtk.keysyms.Z]: self.enqueue_button_press_release(self.button_list['zero_z']) if kv in [gtk.keysyms.a, gtk.keysyms.A]: self.enqueue_button_press_release(self.button_list['zero_a'])


The result of that whole section starting at line 4145 would look like this:



Code:
if event.type == gtk.gdk.KEY_PRESS: # Handle feed hold if kv == gtk.keysyms.space and self.moving(): self.error_handler.log("Spacebar key - queueing feedhold event") self.enqueue_button_press_release(self.button_list['feedhold']) return True # Escape key for stop if kv == gtk.keysyms.Escape: self.error_handler.log("ESC key - queueing stop button event") self.enqueue_button_press_release(self.button_list['stop']) self.tool_descript_entry.shutdown_view() tooltipmgr.TTMgr().on_esc_key() return True # Step/Cont, Increments, Zero Axis keys for Dorro1971 if event.state & (gtk.gdk.MOD1_MASK | gtk.gdk.MOD5_MASK) and event.type == gtk.gdk.KEY_PRESS: if kv in [gtk.keysyms.g, gtk.keysyms.G]: self.enqueue_button_press_release(self.button_list['jog_inc_cont']) if kv in [gtk.keysyms.h, gtk.keysyms.H]: self.enqueue_button_press_release(self.button_list['jog_zero']) if kv in [gtk.keysyms.j, gtk.keysyms.J]: self.enqueue_button_press_release(self.button_list['jog_one']) if kv in [gtk.keysyms.k, gtk.keysyms.K]: self.enqueue_button_press_release(self.button_list['jog_two']) if kv in [gtk.keysyms.l, gtk.keysyms.L]: self.enqueue_button_press_release(self.button_list['jog_three']) if kv in [gtk.keysyms.x, gtk.keysyms.X]: self.enqueue_button_press_release(self.button_list['zero_x']) if kv in [gtk.keysyms.y, gtk.keysyms.Y]: self.enqueue_button_press_release(self.button_list['zero_y']) if kv in [gtk.keysyms.z, gtk.keysyms.Z]: self.enqueue_button_press_release(self.button_list['zero_z']) if kv in [gtk.keysyms.a, gtk.keysyms.A]: self.enqueue_button_press_release(self.button_list['zero_a'])

and divide by 2 as well



Anything is possible, but that one may be more tricky. I'm out of time to dig into it tonight.
Last edit: 3 years 6 months ago by snowgoer540.
The following user(s) said Thank You: Dorro1971

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

More
3 years 7 months ago #267642 by snowgoer540
Forgot to add that you can change the keys to anything that you'd like, I figured that part was self evident.
The following user(s) said Thank You: Dorro1971

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

More
3 years 7 months ago #267647 by Vmax549
Also please remind them to make a backup of the file you are working on and place it on the desktop or somewhere you can to it IF the Mod goes south and crashes PathPilot.

A nother note Python is extremely case and indent sensitive. ONE mistake when typing can casue PP not to start and THEN you have to find the mistake and correct it. THAT is where the LOGFILE comes in handy. Tormach did do a good jog of creating the logfile messages and Python hads a decent debugger.

Next is learning to hope back and forth between PP and Linux and the LOGFILE. There is a method to the madness. And there are a lot of little things you can add to make your CNC machine a better place to work..

I say teach the machne to work work for me not the other way around.

ALSO I go in for back surgury Wednesday morning so I may seem to dissapear for a short while.

(;-) TP
The following user(s) said Thank You: Dorro1971

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

More
3 years 7 months ago #267653 by snowgoer540
Dont forget to backup the file first :) 

It's worth noting, that if you do mess something up, and you get the "unable to load" config chooser screen, you dont have to pick a different config.  Just press ctrl + alt + x, type mate-panel again, and you can get back into the file system and muck around some more, or restore the backup file if you decide to give up.  Then restart and you'll be back in business.
 
The following user(s) said Thank You: Dorro1971

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

Time to create page: 0.539 seconds
Powered by Kunena Forum