Setting initval of a spinbox in hal

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:

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

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

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

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

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

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

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

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

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

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

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

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.

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

More
18 Jul 2017 17:11 #96004 by MadGuest
Hi. Setting initval of spinbox is a very nice function. Is there way to set it from gcode?
For example. I need to:
1. run z probe
2. run z-compensation routine
3. do G92 Z0 and the run main code.
Sometimes (almost always) it need to run main code part again but when I stop my routine, disable first 2 steps with special checkbox, I loose my Z-axis offset. And I want to store #5063 found at step 1 as spinbox initial value (#5063 is always near -35..-38 mm, so my spinbox values will be changed from -34 to -39 with 0.01 resolution), and then use it later. Is it possible???

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

More
19 Jul 2017 14:26 #96078 by andypugh
My impression from scanning back is that the initval is a parameter in the XML. If it doesn't exist as a HAL pin then setting it from G-code is likely to be difficult.

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

More
19 Jul 2017 16:31 #96091 by ArcEye
I figured out eventually why I kept getting notifications about this thread - I wrote the stuff and couldn't remember :P

If all else fails, read the code
class pyvcp_spinbox(Spinbox):
    """ (control) controls a float, also shown as text.
        reacts to the mouse wheel.
        <spinbox>
            [ <halpin>"my-spinbox"</halpin> ]
            [ <min_>55</min_> ]   sets the minimum value to 55
            [ <max_>123</max_> ]  sets the maximum value to 123
            [ <initval>100</initval> ]  sets intial value to 100  TJP 12 04 2007
            [ <param_pin>1</param_pin>] creates param pin if > 0, set to initval, value can then be set externally, ArcEye 2013............
        </spinbox>
    """
    <snip>

        if halparam == None:
            self.param_pin = param_pin
            if self.param_pin == 1:
                halparam = "spinbox." + str(pyvcp_spinbox.n) + ".param_pin"
                self.halparam=halparam
                pycomp.newpin(halparam, HAL_FLOAT, HAL_IN)

If you set param_pin to 1 in your .xml file, a pin will be created which can be used to update or read the value of the spinbox.

If you read through there are come other widgets I did the same with.
Seem to recall I wrote a component that saved all the values to file and reinstated them at next startup too, but that was a long time ago

regards

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

Time to create page: 0.234 seconds
Powered by Kunena Forum