[Solved] EMC_Stat handlers problem
16 Jul 2012 21:02 - 22 Jul 2012 13:03 #22037
by hpopols
[Solved] EMC_Stat handlers problem was created by hpopols
Hi,
I use the last (this day) master version of Linuxcnc from official git server.
I encountered a problem with the GladeVCP "EMC_stat" widget.
It doesn't seems to send call my pyhtons callbacks.
I tried/check many things many times but none works. I prepare some very simple example to underline the problem.
Pyhon hanldler
The two first handlers aren't called but the third is (when the button is clicked).
You will find attached the simple button-label-EMC_Stat ui file (GTK) which fit with the python handler.
Thank you
Xavier H
I use the last (this day) master version of Linuxcnc from official git server.
I encountered a problem with the GladeVCP "EMC_stat" widget.
It doesn't seems to send call my pyhtons callbacks.
I tried/check many things many times but none works. I prepare some very simple example to underline the problem.
Pyhon hanldler
#!/usr/bin/env python
class HandlerClass:
[file name=test.ui size=1427]http://www.linuxcnc.org/media/kunena/attachments/legacy/files/test.ui[/file] def on_state_estop(self,EMC_stat,data=None):
print "ESTOPPPPPPP"
self.state_lab.set_label("e-stop")
def on_state_estop_reset(self,EMC_stat,data=None):
print "ESTOPPPPPPP RESEETTTT"
self.state_lab.set_label("e-stop-reset")
def on_button1_clicked(self,EMC_stat,data=None):
print "CLLLLIIIICK"
self.state_lab.set_label("Click")
def __init__(self, halcomp,builder,useropts):
self.halcomp = halcomp
self.state_lab = builder.get_object("state_lab")
self.hal_stat = builder.get_object("hal_stat")
self.but = builder.get_object("button1")
def get_handlers(halcomp,builder,useropts):
return [HandlerClass(halcomp,builder,useropts)] [file name=test.ui size=1427]http://www.linuxcnc.org/media/kunena/attachments/legacy/files/test.ui[/file]
The two first handlers aren't called but the third is (when the button is clicked).
You will find attached the simple button-label-EMC_Stat ui file (GTK) which fit with the python handler.
Thank you
Xavier H
Last edit: 22 Jul 2012 13:03 by hpopols.
Please Log in or Create an account to join the conversation.
16 Jul 2012 21:04 #22039
by hpopols
Replied by hpopols on topic Re:EMC_Stat handlers problem
Attached ui file :
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-requires gladevcp 0.0 -->
<!-- interface-naming-policy project-wide -->
<object class="GtkWindow" id="window1">
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<child>
<object class="GtkButton" id="button1">
<property name="label" translatable="yes">button</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_button1_clicked"/>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="state_lab">
<property name="visible">True</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<object class="EMC_Stat" id="hal_stat">
<signal name="state_estop_reset" handler="on_state_estop_reset"/>
<signal name="state_estop" handler="on_state_estop"/>
</object>
</interface>
Please Log in or Create an account to join the conversation.
17 Jul 2012 08:47 #22060
by mhaberler
Replied by mhaberler on topic Re:EMC_Stat handlers problem
I can reproduce your problem
actually the underlying signal is emitted by Gstat, but the handler isnt called for some reason
I need to talk to Pavel about this
-m
actually the underlying signal is emitted by Gstat, but the handler isnt called for some reason
I need to talk to Pavel about this
-m
Please Log in or Create an account to join the conversation.
17 Jul 2012 15:57 #22095
by hpopols
Replied by hpopols on topic Re:EMC_Stat handlers problem
Thank you Micheal.
Xavier H (Diony)
Xavier H (Diony)
Please Log in or Create an account to join the conversation.
20 Jul 2012 21:05 #22246
by mhaberler
Replied by mhaberler on topic Re:EMC_Stat handlers problem
Pavel fixed it. its repaired both in v2.5_branch and master.
- Michael
- Michael
Please Log in or Create an account to join the conversation.
22 Jul 2012 13:02 - 22 Jul 2012 13:15 #22316
by hpopols
Replied by hpopols on topic Re:EMC_Stat handlers problem
Nice, it works fine now! Problem solved.
Thanks Micheal and Pavel
Xavier
Thanks Micheal and Pavel
Xavier
Last edit: 22 Jul 2012 13:15 by hpopols.
Please Log in or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.118 seconds