Setting initval of a spinbox in hal
- bigalex
- Offline
- Premium Member
-
- Posts: 148
- Thank you received: 4
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

Please Log in or Create an account to join the conversation.
- mariusl
-
Topic Author
- Offline
- Platinum Member
-
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.
- ArcEye
- Offline
- Junior Member
-
- Posts: 24
- Thank you received: 758
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.
- mariusl
-
Topic Author
- Offline
- Platinum Member
-
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.
- ArcEye
- Offline
- Junior Member
-
- Posts: 24
- Thank you received: 758
I was under the impression that you are a regular contributor and developer
Just a lowly user and hacker

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.
- mariusl
-
Topic Author
- Offline
- Platinum Member
-
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.
- ArcEye
- Offline
- Junior Member
-
- Posts: 24
- Thank you received: 758
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
Please Log in or Create an account to join the conversation.
- MadGuest
- Offline
- New Member
-
- Posts: 4
- Thank you received: 0
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.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23323
- Thank you received: 4948
Please Log in or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
-
- Posts: 24
- Thank you received: 758

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.