- Posts: 7368
- Thank you received: 2181
Glade Panel in Axis blocks arrow keys
- cmorley
- Offline
- Moderator
-
Less
More
8 years 9 months ago #105263
by cmorley
Replied by cmorley on topic Glade Panel in Axis blocks arrow keys
looks likethis should do it for master:
Chris M
Code:
CMD.jog(self.emc.JOG_STOP, 0,0)
CMD.jog(self.emc.JOG_STOP, 0,1)
CMD.jog(self.emc.JOG_STOP, 0,2)
Chris M
Please Log in or Create an account to join the conversation.
- +Jan+
- Offline
- Senior Member
-
Less
More
- Posts: 63
- Thank you received: 17
8 years 8 months ago - 8 years 8 months ago #105342
by +Jan+
Replied by +Jan+ on topic Glade Panel in Axis blocks arrow keys
Hey Chris,
Me too...
I upgraded again to Master, and did some tests, until now I was not able to fix the problem in Master. I had to change again "self.emc" to "linuxcnc". Now I do not get any error message on the Terminal (the print messages are displayed).
Here is my actual xembed code (the interesting parts) I use for Master 2.8.
At this point I am just glade we have made a positive step...
Me too...
I upgraded again to Master, and did some tests, until now I was not able to fix the problem in Master. I had to change again "self.emc" to "linuxcnc". Now I do not get any error message on the Terminal (the print messages are displayed).
Here is my actual xembed code (the interesting parts) I use for Master 2.8.
Code:
#!/usr/bin/env python
# vim: sts=4 sw=4 et
"""
XEmbed helper functions to allow correct embeding inside Axis
"""
import gtk
import linuxcnc
CMD = linuxcnc.command()
...
def forward_press(w, e, fw):
if e.keyval in ignore:
return
g = fw.get_geometry()
fe = gtk2xlib(e, fw, g)
if not fe: return
fw.send_event(fe)
def forward_release(w, e, fw):
if e.keyval in ignore:
CMD.jog(linuxcnc.JOG_STOP, 0,0)
print 'stop0'
CMD.jog(linuxcnc.JOG_STOP, 0,1)
print 'stop1'
CMD.jog(linuxcnc.JOG_STOP, 0,2)
print 'stop2'
g = fw.get_geometry()
fe = gtk2xlib(e, fw, g)
if not fe: return
g = fw.get_geometry()
fe = gtk2xlib(e, fw, g)
if not fe: return
fw.send_event(fe)
window.connect_after("key-press-event", forward_press, fw)
window.connect("key-release-event", forward_release, fw)
window.add_events(gtk.gdk.KEY_PRESS_MASK)
window.add_events(gtk.gdk.KEY_RELEASE_MASK)
Last edit: 8 years 8 months ago by +Jan+.
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7368
- Thank you received: 2181
8 years 8 months ago #105344
by cmorley
Replied by cmorley on topic Glade Panel in Axis blocks arrow keys
Sorry I did it again...You are right self.emc is wrong.
I'm copying and pasting code from another program.
You are a linuxcnc coder now!
Chris M
I'm copying and pasting code from another program.
You are a linuxcnc coder now!
Chris M
Please Log in or Create an account to join the conversation.
- +Jan+
- Offline
- Senior Member
-
Less
More
- Posts: 63
- Thank you received: 17
8 years 8 months ago #105355
by +Jan+
Haha don`t think so...
Replied by +Jan+ on topic Glade Panel in Axis blocks arrow keys
You are a linuxcnc coder now!
Haha don`t think so...
in my last post means, that I do not get any error on the shell, but the behaviour remains in master 2.8.:dry:ow I do not get any error message on the Terminal (the print messages are displayed).
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7368
- Thank you received: 2181
8 years 8 months ago #105363
by cmorley
Replied by cmorley on topic Glade Panel in Axis blocks arrow keys
try:
CMD.jog(linuxcnc.JOG_STOP, 1,0)
CMD.jog(linuxcnc.JOG_STOP, 1,1)
CMD.jog(linuxcnc.JOG_STOP, 1,2)
Chris M
CMD.jog(linuxcnc.JOG_STOP, 1,0)
CMD.jog(linuxcnc.JOG_STOP, 1,1)
CMD.jog(linuxcnc.JOG_STOP, 1,2)
Chris M
Please Log in or Create an account to join the conversation.
- +Jan+
- Offline
- Senior Member
-
Less
More
- Posts: 63
- Thank you received: 17
8 years 8 months ago #105410
by +Jan+
Replied by +Jan+ on topic Glade Panel in Axis blocks arrow keys
Thanks, that did the job.
I attach both xembed files, for 2.7 and 2.8, maybe it is helpful for someone.
Best wishes.
Jan
I attach both xembed files, for 2.7 and 2.8, maybe it is helpful for someone.
Best wishes.
Jan
Please Log in or Create an account to join the conversation.
Time to create page: 0.296 seconds