GladeVCP - Cannot Activate Hal Widget on UI Start

More
15 Aug 2012 17:05 #23247 by wd5jwy
I'm trying to activate a Hal Table widget in a GladeVCP custom interface and am getting a Linuxcnc error:

/home/dennis/CoilWinder/CoilWinderUI/cwh.hal:1: parameter or pin 'cw.hal_table1' not found.


I have the path statement for the .hal file correct in my config.ini file - otherwise it wouldn't find the file on Axis startup and generate the error above.

I am using the following Hal command in the .hal file:

"setp cw.hal_table1 1" (without the quotes obviously)

When I comment out the Hal command in the .hal file, restart Axis and start the UI, I can then go Show Hal Configuration and view the Hal widget pin status. I can issue the Hal command "setp cw.hal_table1 1" there and the command works and forces the Hal Table active. So, the syntax of the Hal command is obviously correct.

Anyone have any idea what I'm doing wrong?

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

More
15 Aug 2012 19:08 #23255 by BigJohnT
Yes, any hal commands that address gladevcp pins must go into your postgui file.

John

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

More
15 Aug 2012 19:26 #23257 by wd5jwy
From the GladeVCP documentation:

3.4. Preparing the HAL command file

The suggested way of linking HAL pins in a GladeVCP panel is to collect them in a separate file with extension .hal. This file is passed via the POSTGUI_HALFILE= option in the HAL section of your ini file.


I have the path set in the POSTGUI_HALFILE section of my .ini file as shown below:

[HAL]
HALUI = halui
HALFILE = config1.hal
HALFILE = custom.hal
POSTGUI_HALFILE = /home/dennis/CoilWinder/CoilWinderUI/cwh.hal

So the GladeVCP documentation is wrong and I should instead place the path somewhere in the custom_postgui. hal file?

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

More
15 Aug 2012 20:05 - 15 Aug 2012 20:06 #23261 by BigJohnT
The postgui hal file as well as the rest of your config files should be in the same directory and no path is needed in your ini file just the name.

The manual is correct if not a tiny bit confusing...

John
Last edit: 15 Aug 2012 20:06 by BigJohnT.

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

More
15 Aug 2012 20:43 #23264 by wd5jwy
OK, so I moved all my files over to my linuxcnc/configs directory. Updated the custom_postgui.hal file with the Hal command below:

setp cw.hal_table1 1

I changed the .ini file under the HAL section to use the postgui_halfile line to:

POSTGUI_HALFILE = custom_postgui.hal

I get the same error as before:

custom_postgui.hal:3: parameter or pin 'cw.hal_table1' not found.

The notes in the default custom_postgui.hal file do say that the "commands in this file are run after the AXIS GUI (including PyPVC panel) starts". So, that appears to be the correct place to put a "setp" Hal command, but for some reason it's not finding the parameter or pin. Not sure why.

I'm just trying to get a custom interface up and running using Hal widgets - I haven't even begun to think about a python file to handle events as yet. Since the panel is using a Hal Table with other embedded Hal widgets (spinbuttons & etc.), I need the Hal Table to go active after the panel comes up so the other Hal widgets are accessible. If there's any other method to do this, please let me know.

Would it be possible to use a standard Table instead of a Hal Table? Maybe that way the panel would come up with an active Table which would allow me to access the embedded Hal widgets.

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

More
15 Aug 2012 21:02 #23268 by mhaberler
I would suggest posting both the ini file and hal files

it's a bit hard to tell since there is more than one way how a gladeVCP panel can be integrated into Axis and how the component name is set.


- Michael

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

More
15 Aug 2012 21:18 #23269 by wd5jwy
I've attached the AXIS .ini (named config1.ini) file. I'm no longer trying to use a separate .hal file (although I get the same error either way). I've placed my gladevpc file (.ui) in the same directory (linuxcnc/configs/config1). As I stated earlier in the thread, if I comment out the "setp" Hal command, AXIS starts and I can start my custom panel and examine the pins. I can also manually issue the "setp" command within AXIS and it works - activates the hal_table1 so the embedded widgets are accessible.

I'm rebuilding the panel in Glade right now and am going to eliminate the hal_table and try a standard table as a container instead. If that works, I can proceed with a python event handler (hopefully). That is unless all the embedded Hal widgets must be embedded in a Hal table container for them to work properly?

File Attachment:

File Name: config1.ini
File Size:2 KB
Attachments:

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

More
15 Aug 2012 21:19 #23270 by wd5jwy
custom_postgui.hal file attached.

File Attachment:

File Name: custom_pos...2a3d.hal
File Size:0 KB
Attachments:

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

More
15 Aug 2012 21:23 #23271 by wd5jwy
ok, let me try that again - don't know what happened on the last file attach. custom_postgui.hal file.

File Attachment:

File Name: custom_pos...a586.hal
File Size:0 KB
Attachments:

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

More
15 Aug 2012 21:43 #23273 by wd5jwy
OK, so I rebuilt the panel in Glade using a standard table as a container and that works - the panel comes up with the embedded Hal widgets active. So, I guess this is the way to go - unless there is some strange hal-widget parenting issue I'm going to run into down the road when I start trying to handle events in python. Hopefully that won't happen. Screenshot attached.
Attachments:

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

Moderators: HansU
Time to create page: 0.360 seconds
Powered by Kunena Forum