gladeVCP Hal widgets: how to connect hal pins ?

More
01 Mar 2020 22:36 - 01 Mar 2020 22:38 #158918 by geertd
I am trying to add some radiobuttons and led indicators to Gmoccapy.
So far, I designed how they should look with glade, modified my .ini file to make them appear between the cooling and spindle boxes which looks OK:


Starting Gmoccapy shows the buttons as expected and in the correct location:



Opening halshow shows the correct component (vaccool) as well as the corresponding pins as available:



But as soon as I want to use those pins in my custom_postgui.hal file:



I get the following error when starting linuxcnc:



Am I missing something fundamental here ?

Geert
Attachments:
Last edit: 01 Mar 2020 22:38 by geertd.

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

More
02 Mar 2020 04:11 #158936 by Todd Zuercher
I'm not sure about this, but it is possible that the underscores in your pin names are causing a problem. Can you try to rename what the hal pins your gui is creating are called to get rid of them.
The following user(s) said Thank You: geertd

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

More
02 Mar 2020 06:23 #158940 by cmorley
You must connect HAL pins for the custom gladevcp in a separate file by using the -H option in gladevcp.
linuxcnc.org/docs/2.7/html/gui/gladevcp....command_line_options

in that file connect the widgets pins to signals only
then in any other file you can connect those signals to what ever other pins you like.
In this way the it doesn't matter on the timing of the availability of the pins.

Chris

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

More
02 Mar 2020 06:25 #158941 by rodw

I'm not sure about this, but it is possible that the underscores in your pin names are causing a problem. Can you try to rename what the hal pins your gui is creating are called to get rid of them.


x 2 I think your choice of pin names with an underscore is illegal so Hal rejects them. I say this because: If you write a component and compile it with halcompile, pin names containing an underscore in the component are converted to have a hyphen in hal (which is expected behaviour)

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

More
02 Mar 2020 06:26 #158943 by cmorley
Pin names can have underscores - that's a limitation imposed by the comp system.

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

More
02 Mar 2020 06:35 #158944 by rodw

Pin names can have underscores - that's a limitation imposed by the comp system.


So long since I've ventured into this stuff but could there be a disconnect in the python screen handler?

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

More
02 Mar 2020 06:45 #158945 by cmorley

Pin names can have underscores - that's a limitation imposed by the comp system.


So long since I've ventured into this stuff but could there be a disconnect in the python screen handler?

Rod - i'm not sure if you are talking about the comp limitation or the problem he is having.

The comp limitation is because of legal c names IIRC, I imagine it was easier to just add the limitation.

Geerd's problem is a race condition - caused by how gladevcp is loaded without waiting for the pins to be ready.

Chris
The following user(s) said Thank You: rodw

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

More
02 Mar 2020 06:46 #158947 by cmorley
Or at least I'm 90% sure it's the problem :)
The following user(s) said Thank You: geertd

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

More
02 Mar 2020 08:40 #158952 by geertd
Removing the underscores did not change anything.

Cmorley's reply however seems to be the correct one. My gladevcp hal-radiobuttons now work as expected.

Thanks !

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

Moderators: mhaberlerHansU
Time to create page: 0.377 seconds
Powered by Kunena Forum