how to auto-set widget?

More
28 Dec 2011 21:12 #16050 by dab77
Replied by dab77 on topic Re:how to auto-set widget?
mhaberler wrote:

sorry, I misread your request - you wanted to set a widget property from a HAL pin, not an INI value

I adapted the example in master to accept a widget property via a HAL pin: git.linuxcnc.org/gitweb?p=emc2.git;a=tre...fa5d6887c0df38fbb178

to run, start axis, and in a second window cd to configs/gladevcp/set-param-from-ini and run:

$ export INI_FILE_NAME=demo.ini
$ gladevcp -u meter_scale.py meter_scale.ui

Then adjust the meter_scale.max-value pin and observe the HAL meter widget,

-Michael


Hi! finally i could spend some time on your suggestion.
Your files work (except it doesn't take the min value from demo.ini..), meaning i can change the max_value using setp into the hal command line, into the 'watch hal config' window.

so i menaged to glue this into my setup, first trying only to change one meter, but i've found out that if i want my gladevcp panel inside the emc2 window, it doesn't create the pin. Maybe because to create that it must have the 'gladevcp' name, and not the name of the python file..?

If i run my setup into a terminal window after running emc2 (like you suggested) it works.
I would like to manage that problem, since i want gladevcp panel inside the same windows.

do you have any suggestion?
thanks, Davide.

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

More
28 Dec 2011 22:33 #16057 by mhaberler
Replied by mhaberler on topic Re:how to auto-set widget?
dab77 wrote:

mhaberler wrote:

so i menaged to glue this into my setup, first trying only to change one meter, but i've found out that if i want my gladevcp panel inside the emc2 window, it doesn't create the pin. Maybe because to create that it must have the 'gladevcp' name, and not the name of the python file..?


I am fairly sure that the pin is created as gladevcp.max-value pin , since running gladevcp inside
an Axis pane requires the HAL component name 'gladevcp'.

Please investigate the gladevcp component's pins with 'Show HAL configuration'.

If you find it, use that name. Otherwise I'm sure there's an error message which gives some hints as to what happened. If so, post that here.

- Michael

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

More
29 Dec 2011 18:59 #16087 by dab77
Replied by dab77 on topic Re:how to auto-set widget?

mhaberler wrote:

I am fairly sure that the pin is created as gladevcp.max-value pin , since running gladevcp inside
an Axis pane requires the HAL component name 'gladevcp'.

Please investigate the gladevcp component's pins with 'Show HAL configuration'.

If you find it, use that name. Otherwise I'm sure there's an error message which gives some hints as to what happened. If so, post that here.

- Michael

That's why i'm asking help here, 'cause it seems strange that it didn't create the pin!

now i'll post my files, which work now, but only if i run them after emc2:

File Attachment:

File Name: tgvcp_files.zip
File Size:6 KB


then i try again to set them to work inside the emc2 window, and call all the pins gladevcp.xxx...
Attachments:

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

More
29 Dec 2011 19:22 - 29 Dec 2011 19:26 #16089 by dab77
Replied by dab77 on topic Re:how to auto-set widget?
When i try to use this line into the ini file:

GLADEVCP = -u gladevcp.py gladevcp.ui

using these files:

File Attachment:

File Name: gladevcp_files.zip
File Size:2 KB

i have this error:

gladevcp.hal:109: Pin 'gladevcp.max-value1' does not exist


infact, if i don't load my hal file, i can't see the pin:



p.s. another question for you, in the .py file instead of this line:

inifile = emc.ini(os.getenv("INI_FILE_NAME"))

how can i write directly the name of the file? ..i couldn't..

thanks, Davide.
Attachments:
Last edit: 29 Dec 2011 19:26 by dab77.

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

More
29 Dec 2011 21:59 #16094 by dab77
Replied by dab77 on topic Re:[SOLVED?] how to auto-set widget?
..not in an elegant way, but solved..

into the file: ../emc2-dev/src/emc/usr_intf/axis/scripts/axis.py , i changed the line 3051 in this way:

cmd = "halcmd loadusr -Wn tgvcp gladevcp".split()

in this way it creates the hal pin i need, also if loaded inside emc2 windows.
into the .ini file the Gladevcp line looks like that:

GLADEVCP = -c tgvcp -u tgvcp.py -H tgvcp.hal tgvcp.ui


obviously i needed to run: make , into my src directory.

If i did something wrong please correct me.
Thanks!

p.s. I still need an hint on the previous question about the inifile.
Ciao, Davide.

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

More
30 Dec 2011 08:09 #16114 by mhaberler
Replied by mhaberler on topic Re:how to auto-set widget?
I am unable to run your configuration since essential parts are missing. Please make it a self-contained configuration which runs in simulator mode. Also, I do not see where gladevcp is started from the ini file. Please see www.linuxcnc.org/docs/devel/html/gui/gla...into_axis_like_pyvcp how to set this up.


Re: "pin not created":

The issue could be sequencing. Note that when using a tab inside Axis, gladevcp is started by Axis, which means that the pins created by gladevcp are only accessible after Axis startup. Therefore these pins can be referenced only by HAL commands which are executed through HAL/POSTGUI_HALFILE. Those are executed post gladevcp setup when running inside Axis in the right-hand panel.

-Michael


dab77 wrote:

That's why i'm asking help here, 'cause it seems strange that it didn't create the pin!

now i'll post my files, which work now, but only if i run them after emc2:

File Attachment:

File Name: tgvcp_files.zip
File Size:6 KB


then i try again to set them to work inside the emc2 window, and call all the pins gladevcp.xxx...

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

More
30 Dec 2011 11:58 #16115 by mhaberler
Replied by mhaberler on topic Re:how to auto-set widget?
dab77 wrote:


p.s. another question for you, in the .py file instead of this line:

inifile = emc.ini(os.getenv("INI_FILE_NAME"))

how can i write directly the name of the file? ..i couldn't..


try

inifile = emc.ini("/path/to/inifile")


-Michael

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

More
30 Dec 2011 22:25 #16140 by dab77
Replied by dab77 on topic Re:how to auto-set widget?
mhaberler wrote:

...
Re: "pin not created":

The issue could be sequencing. Note that when using a tab inside Axis, gladevcp is started by Axis, which means that the pins created by gladevcp are only accessible after Axis startup. Therefore these pins can be referenced only by HAL commands which are executed through HAL/POSTGUI_HALFILE. Those are executed post gladevcp setup when running inside Axis in the right-hand panel.

-Michael

Yes it should be like that, but if the pins and glade hal file have the standard name 'gladevcp' the pin is not created. I can say that because i tried to disable all the references to that pins, so that emc2 runs without errors and i can see the pins.
gladevcp.max-value is not there.
then i have tried, as i wrote in my last post, to change the default name to something else, and it worked.
but i really can't understand definitely where the bug is.

I thought i sent you all the necessary files, i'll send you tomorrow all that you may need to try that your self (except you should have a thrustmaster joystick...)

try

inifile = emc.ini("/path/to/inifile")

-Michael

The only thing i didn't try was to put the file name inside ""... sorry.
I'll try that tomorrow.
Thanks, Davide.

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

More
30 Dec 2011 22:31 #16141 by dab77
Replied by dab77 on topic Re:how to auto-set widget?
I checked and i think here: www.linuxcnc.org/index.php/english/compo...imit=6&start=6#16087 into tgvcp.zip there are all the needed files. What is missing?
Ah, maybe it's because this configuration is intended to be run on emc2.4 JA3 branch? so axis and joint configuration into the .ini file is different from standard emc2.

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

More
31 Dec 2011 02:12 #16146 by mhaberler
Replied by mhaberler on topic Re:how to auto-set widget?
dab77 wrote:

I checked ...
What is missing?


Your homebrew kins module, and the fact that you are running some none-standard branch?

Look, this is the deal:

You ask for help, so please do your part of the work first. That is: isolating the problem so it can reproduced without somebody else fiddling for hours on end. This is not a manufacturer support hotline with handholding for a fee.

Your kins stuff, JA3 etc etc is obviously irrelevant to the problem you claim exists.

Please take the time to take master or v2.5_branch, and modify configs/sim/axis.ini it until it shows the problem. Then file it on the bugtracker so it isnt forgotten in the mists of forum posts.

There are some really good Python tutorials online, and this site isnt one of them.

- Michael

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

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