Setting initval of a spinbox in hal

More
13 years 3 months ago - 13 years 3 months ago #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: 13 years 3 months ago by ArcEye.

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

More
9 years 3 months ago #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
9 years 3 months ago #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
9 years 3 months ago #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
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.

More
9 years 3 months ago #96095 by andypugh

ArcEye wrote: 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


wiki.linuxcnc.org/cgi-bin/wiki.pl?Contri...ents#Parameter_Saver ?

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

Time to create page: 0.392 seconds
Powered by Kunena Forum