Setting initval of a spinbox in hal

More
13 years 6 months ago #32981 by mariusl
Awesome stuff man. I suggest that you submit this as a featured change. It is very handy.

Just to make sure I dont screw this up.

This is where the real code sits:
./usr/share/pyshared/pyvcp_widgets.py

These two are replaced by a symlink:
./usr/lib/pymodules/python2.6/pyvcp_widgets.py
./usr/lib/python2.6/dist-packages/pyvcp_widgets.pyc

Regards
Marius


www.bluearccnc.com

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

More
13 years 6 months ago #32982 by ArcEye
Almost

Just delete all the .pyc (python compiled) libs, those are generated automatically from the new .py file next time it is run

You need to symlink the /usr/share/pyshared/pyvcp_widgets.py to everywhere it occurred, having deleted the old .py file first of course
I actually had it in /usr/lib/python2.5 as well, but you probably don't have that

regards

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

More
13 years 6 months ago #32983 by mariusl
It works like a charm. Thanks a lot ArcEye.

Regards
Marius


www.bluearccnc.com

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

More
13 years 6 months ago - 13 years 6 months ago #33050 by ArcEye
Hi

If you or anyone else wants to, this patch will change the spinbox, scale and dial widgets, so that there is a parameter pin which allows the initial setting through HAL.
EDIT: It is not just for initialisation, it can be used to change the value displayed and output directly.

The methodology and naming is the same as I did for the spinbox, if you number your widgets with a suffix starting at 0, they will match the relevant initparams.



I don't know how generally useful this is, so don't think I will bother submitting for inclusion in the release.

regards

(rename to params.patch)


File Attachment:

File Name: params-patch.txt
File Size:5.5 KB
Last edit: 13 years 6 months ago by ArcEye.

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

More
13 years 6 months ago #33052 by BigJohnT
I think it would be very useful to be able to set the initial value of just about every pyvcp widget. I always want my light check box on when I start up my lathe and only turn it off after it is off and running.

John

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

More
13 years 6 months ago #33075 by ArcEye
JT

If you think that is worth doing, the better way might be to have a field in the .xml file, called for instance writeable .

When <writeable>1</writeable> say, is found inside a widget block, the extra pin could be created giving direct access to the value output or the state of the widget etc.
If not, everything works as previously with no extra pins cluttering pyvcp.

Certainly achievable, just a question of whether it is likely to be adopted and whether it is macro managing an aspect of a larger problem, which is better addressed through gladeVCP?

I only use pyVCP for simple controls and that is probably what it is best for.
Others would use gladeVCP and I would use a Qt panel and component for something more complicated.

regards

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

Time to create page: 0.069 seconds
Powered by Kunena Forum