Gscreen - a GTK / Glade / Python based screen

More
13 years 5 months ago #33548 by jlviloria
Regards,

I made ​​to adapt the incremental jog buttons. the jog rate with slider

I have a problem when I press the arrow keys (up, down, left right) also begins the slider up or down according to the direction of the keys

I thought then vbox1 containing JOG_INCREMENT buttons and jog slider rate, apply the set_sensitive (False) when pressing any of the keys


I tried this:

if keyname == "Up":
if self.data.key_event_up == signal: return
self.gscreen.do_key_jog(0,0,signal)
self.data.key_event_up = signal
if self.data.key_even_up = 1:
self.widgets.vbox1.set_sensitive(False)
if self.data.key_even_up = 0:
self.widgets.vbox1.set_sensitive(True)

elif keyname == "Down":
if self.data.key_event_dwn == signal: return
self.gscreen.do_key_jog(0,1,signal)
self.data.key_event_dwn = signal
if self.data.key_even_dwn = 1:
self.widgets.vbox1.set_sensitive(False)
if self.data.key_even_dwn = 0:
self.widgets.vbox1.set_sensitive(True)

elif keyname == "Left":
self.gscreen.do_key_jog(2,0,signal)
if self.data.key_even_left = 1:
self.widgets.vbox1.set_sensitive(False)
if self.data.key_even_left = 0:
self.widgets.vbox1.set_sensitive(True)

elif keyname == "Right":
self.gscreen.do_key_jog(2,1,signal)
if self.data.key_even_right = 1:
self.widgets.vbox1.set_sensitive(False)
if self.data.key_even_riht = 0:
self.widgets.vbox1.set_sensitive(True)

works well for up and down, left and right but it does not tell me key.data_event_left, not defined

I tried several things but I was unable to do, please if anyone knows I appreciate

Jorge Viloria

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

More
13 years 5 months ago #33549 by cmorley
I'm having a hard time understanding you here.
So you made a custom screen with a jog rate slider?
and the slider is responding to the jogging keys?
This is a problem with the keybinding continuing past the jogging code.
You must return True to stop this from happening, but you must also allow the keybinding through if you want MDI or Gcode editting.

As for the error about key.data_event_left that is because gscreen has not defined it.
Up and down code is different from left right code.
This is because the keybinding stuff is new and experimental.

I am now back home so hopefully can spend some time fixing these problems.

Chris M
The following user(s) said Thank You: jlviloria

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

More
13 years 5 months ago - 13 years 5 months ago #33550 by jlviloria
Chris,

Chris not forget industrial error does not update mode mm

is what is happening, I have placed a slider for jog-rate and responds to the arrow keys (up, down, left, right) I make an accident almost without realizing I reach the maximum speed. I do not understand the solution?

thanks,

Jorge Viloria
Last edit: 13 years 5 months ago by jlviloria.

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

More
13 years 5 months ago #33645 by newbynobi
As far as I understood, Jorge want to add sliders to industrial and they should work like they do in gmoccapy. I looked at the code, but industrial is handling the thinks quiet different to gmoccapy, so I decided no to change the code.

The problem of key handling, moving the sliders is solved in gmoccapy, In 0.9.1 there is still a problem, that you will not be able to change parameters in the tool editor, when you are in manual mode. There are two solutions:

- Wait aprox. two days, I got 0.9.2 on the roll witch solved this and then it will support also lathes!

- change line 427 in gmoccapy_handler from:
Code:
if self.gscreen.emcstat.task_mode <> _MANUAL or self.widgets.ntb_main.get_current_page() == 1:
to
Code:
if self.gscreen.emcstat.task_mode <> _MANUAL or not self.widgets.ntb_main.get_current_page() == 0:

Norbert

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

More
13 years 5 months ago #33660 by cmorley
ok I think the key binding issue is fixed.
I also changed the jogging keys around, I think it makes sense.

up/down is the Z left/right is X and page up/down is Y
I changed the direction of Z jogging.

still working on the metric problem.

Chris M

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

More
13 years 5 months ago #33689 by cmorley
keybinndings probably going to change again as i seem to have it different then the other linuxcnc GUIs...

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

Time to create page: 0.582 seconds
Powered by Kunena Forum