python hal glade

More
1 year 8 months ago #322851 by rockcnc
python hal glade was created by rockcnc
I was using linuxcnc 2.8.4 on linux mint 19.1 and I decide to update to a higher version, so I use this version
forum.linuxcnc.org/9-installing-linuxcnc...int-debian-edition-6
After hours of trying I stuck in this one
 

Attachment not found


 It looks like it can't recognize hal python and hal button
this is my code 

Attachment not found

 

Attachment not found

Please Log in to join the conversation.

More
1 year 7 months ago #323458 by andypugh
Replied by andypugh on topic python hal glade
You may have cut off the most important part of the error chain, the real problem is likely to be near the bottom.

Please Log in to join the conversation.

More
1 year 7 months ago #323902 by rockcnc
Replied by rockcnc on topic python hal glade
This is the full error
 

Attachment not found

Please Log in to join the conversation.

More
1 year 6 months ago #325546 by andypugh
Replied by andypugh on topic python hal glade
Yes, almost at the bottom:
AttributeError: Handler hal_button_pressed not found

So, in your .ui file there is a button that triggers the event "hal_button_pressed" and no handler for that event in the python.

Looking through the .ui file in a text editor:
Code:
cnc11.ui:34: <signal name="pressed" handler="hal_button_pressed" swapped="no"/> cnc11.ui:49: <signal name="pressed" handler="hal_button_pressed" swapped="no"/> cnc11.ui:93: <signal name="pressed" handler="hal_button_pressed" swapped="no"/> cnc11.ui:108: <signal name="pressed" handler="hal_button_pressed" swapped="no"/> cnc11.ui:123: <signal name="pressed" handler="hal_button_pressed" swapped="no"/> Found 5 matches for "hal_button_pressed".

in the Python I see:
Code:
def hal_button_pressed(self, widget, data=None): print ("on_button_press calllllllled") s.poll()

So you have written the handler, but in my editor the entire code body in the Python file appears to be triple-quoted (lines 15 and 120) and is highlighted in red. It may be that this is causing the whole handler file to be ignored.

Please Log in to join the conversation.

Time to create page: 0.226 seconds
Powered by Kunena Forum