Setting initval of a spinbox in hal

More
01 May 2013 18:14 - 10 Jul 2013 17:38 #33480 by ArcEye
OK, think it is sorted.

I have written a new widget called pyvcp_multilabel
It can display up to 6 different legends in the label text field, each one has a triggering bit pin which can be linked to anything suitable
It will display the text associated with the last pin triggered, so if you want to display one and then another you will have to leave a pause between triggers

The .xml format is
        <multilabel>
            <legends>["Label0" "Label1" "Label2" "Label3" "Label4" "Label5"]</legends>
            <font>("Helvetica", 20)</font>
            <disable_pin>False</disable_pin>
            <initval>0</initval>    Which legend to display by default (make sure it matches initval for linked widget if any) 
            <halpin>None</halpin>   Optional alternative name base for pins
        </multilabel>

The hal pins are created basename.widgetnumber.legendN
so in the above example the first pin would be
EDIT: pyvcp.multilabel.0.label0

Below is proof of concept screen print
EDIT: (the hal pins still have old experimental names, now set as per above to prevent huge unweildly pin names based on label text)




I have attached a zip of the new pyvcp_widgets.py to replace your old one with and a directory to be inserted into your /home/you/linuxcnc/configs directory,
which will run the example above and allow you to see how widget pins were linked etc.

In the absence of any major reported problems, once I have finished some other stuff I will add this to the patch submission

regards

EDIT:
Amended file to fix oversight which would have led to very long pin names


File Attachment:

File Name: pyvcp_widgets3.zip
File Size:21 KB
Attachments:
Last edit: 10 Jul 2013 17:38 by ArcEye.
More
02 May 2013 13:29 #33511 by bigalex
Hi ArcEye.
What to say ... thank you.
This feature is very nice and useful .
One question ... please do not blame me.
Are you using a "tuple" for the text list ?
To make this widget more flexible is it possible to have instead of boolean pins an integer (unsigned) pin
to define which text have to be displayed ?

bigalex :blink:
More
02 May 2013 15:17 #33513 by ArcEye

Are you using a "tuple" for the text list ?
To make this widget more flexible is it possible to have instead of boolean pins an integer (unsigned) pin
to define which text have to be displayed ?


The code is in the zip.

I have not used tuples, they just seem to be some sort of inflexible, bastardised string array.
Python lists are just string arrays too, you can index through them just as easily.

Far from making the widget more flexible, restricting the ability to trigger label text changes, to widgets or components that can emit the correct s32 or u32 value, would reduce its flexibility hugely.
Most state changes are signalled by a bit pin flag, the appropriate bit pin in the widget can just be linked to it in a hal file.

If you want to make changes for your own special purposes then feel free, that is what open source is about.

regards
More
02 May 2013 15:50 #33515 by bigalex
Hi ArcEye.
Thank you for your efforts.
As I told to you I've not the expertise to make this kind of job.
So I really appreciate what you are doing and your ability to break the code.

regards

bigalex :blink:
More
18 Jul 2013 20:06 #36773 by mariusl
Hi Arceye
Do you know if this work of yours has been included in the master dev yet? I just updated my machine to the latest on buildbot and now the lot is screwed. I have missing stuff all over. If it is not included, how do you suggest that I go about keeping these kind of specials from being lost when I update?

Regards
Marius


www.bluearccnc.com

More
18 Jul 2013 20:17 #36774 by ArcEye
Hi

I submitted a patch, but it was assigned to 'Nobody' and that is the last thing that happened.
I did bump it on the developers list but no response.

I have started a local git repo to track the various changes I make (there are 5 different edits to Axis alone), but that doesn't help you.

I can only suggest that you make a shadow tree to the sources, with the altered files or patches at the appropriate levels.
Then at least you will have a record to work to, to reinstate your changes.

Something like the pyvcp_widgets can just be copied over the new one, it is patches to files that have since been changed that cause problems.

regards
More
18 Jul 2013 20:44 #36777 by mariusl
That's a bit alarming. I was under the impression that you are a regular contributor and developer and should be taken serious. Who controls the development list?

The shadow tree idea is a bit of a challenge as I have not done this kind of thing for many years. You wont think that I wrote production control and release systems based on CVS for huge production systems. And that all done from remote servers. Now I feel stupid if I cant control what is happening on my source.

I will read up a bit and follow your advice.

Regards
Marius


www.bluearccnc.com

More
18 Jul 2013 21:05 #36779 by ArcEye

I was under the impression that you are a regular contributor and developer


Just a lowly user and hacker :laugh:

I don't have push rights and have to rely on the submissions process to work.

The shadow tree idea is a bit of a challenge as I have not done this kind of thing for many years. You wont think that I wrote production control and release systems based on CVS for huge production systems. And that all done from remote servers. Now I feel stupid if I cant control what is happening on my source.


I wasn't thinking of anything as complicated as that.
Just a directory tree that can be tar-balled, with the changed and added files at the appropriate levels.

I have stuff littered all over, which is why I went for the repo. I need to practice with git, so that seemed a good way to do it

I imagine a lot of your stuff is in configs, so that will carry over without problems so long as the bits they rely on get put back

regards
More
18 Jul 2013 21:14 #36780 by mariusl

I imagine a lot of your stuff is in configs, so that will carry over without problems so long as the bits they rely on get put back


That is correct so I am not worried about the configs. I keep my component source separated anyway. As you say, it is just the stuff in the distro that I am reliant on.

What happens to custom components, do they remain in the tree when an update is done?

Regards
Marius


www.bluearccnc.com

More
18 Jul 2013 21:25 - 19 Jul 2013 15:04 #36781 by ArcEye

What happens to custom components, do they remain in the tree when an update is done?


If you have a /usr install, then yes, they will still be in /usr/bin for userspace ones and /usr/realtime/modules/linuxcnc.... for realtime ones
So long as they were built against the same kernel and realtime and don't rely on stuff that has changed, they will be fine

If you run from RIPs that is more difficult, they only exist in the build.

One possible way of creating order would be to have all your components in usr/local/....... symlinked to the relevant directory
If you had a small script which just did
ln -s TARGET LINKNAME
for each one you could re-instate quickly and easily

regards
Last edit: 19 Jul 2013 15:04 by ArcEye.
Time to create page: 0.108 seconds
Powered by Kunena Forum