Saving parameters after shut down

More
12 May 2013 22:15 #33952 by ArcEye
Hi

You seem to be trawling through my back numbers today :laugh:

How would one signal the file to read or write at close down or startup?


The simplest would be to create bit pins in the component which trigger read / write and these could just connect to pyvcp buttons.

A bit more advanced would be to link pins to say halui.machine.is-on and halui.joint.<n>.is-homed
At startup the module can test if(machine-on && axis-homed)
This going true triggers a read of the file, to use the saved parameters or whatever they are.
Thereafter machine-on going to 0 would trigger a file write.

This would however be dependent upon an orderly shutdown sequence.

The best solution would be to hook into the GUI to trigger the file read and write, so that it will be done even if the operator does Alt F4 to close it

Do you have a particular application in mind?

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

More
12 May 2013 23:11 #33957 by mariusl
Told you I am on too many things at the same time. :laugh: And it is good to know that the clever guys already worked the problems out. The only thing I like Bill Gates for is "copy and paste". :lol:

I am busy with a plasma machine and I want to save the tip voltage setting. It is changed from time to time on the spinbox and I don't want the user to re-adjust it at every startup. There are about three or four settings like that.

Regards
Marius


www.bluearccnc.com

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

More
12 May 2013 23:28 #33960 by ArcEye
That should be quite do-able.

You could either wait for close down or just write to file every time a change in value is detected, which would be easier to manage in a lot of ways.

If all the data is coming from a pyvcp panel, just needs a userspace component which links into the widget signals.

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

More
12 May 2013 23:59 #33962 by mariusl
That was my conclusion as well.
I assume that the variables are kept for as long as the component is loaded. So if I write the "old" value in a variable it should stay there until I write to it again?

Regards
Marius


www.bluearccnc.com

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

More
13 May 2013 00:32 - 13 May 2013 00:34 #33964 by ArcEye
Yes, you just save a local copy of the value and then compare it to the widget value.
The local copy is persistent so long as the component is running.

When the widget value changes, it triggers a file write and the new value is entered into the local copy, and so it goes on.

Be aware though that a spinbox for instance might present a swiftly changing set of values as the user goes to the one he wants, so you need to take account of this or you will be
doing numerous file re-writes for just one change.
Last edit: 13 May 2013 00:34 by ArcEye.

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

More
13 May 2013 02:29 #33968 by mariusl
I will use a timer to wait for a while after the first change was detected. That way it will only write very 5 seconds or so.

Regards
Marius


www.bluearccnc.com

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

More
13 May 2013 14:54 #33976 by ArcEye
You can use the amended pyvcp spinbox widget and set the value from a pin when you read the file in at startup.

Situations like this were the reason I did the changes

www.linuxcnc.org/index.php/english/forum...-of-a-spinbox-in-hal

regards

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

More
13 May 2013 18:23 #33984 by mariusl
Yes I know all about that. I started that thread. I am very happy that you did all that work as I am using a lot of it already. I populate the values from settings in the ini file at startup but the ever changing ones I want to handle in a more elegant manner.

Regards
Marius


www.bluearccnc.com

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

More
13 May 2013 21:14 - 13 May 2013 21:14 #33995 by ArcEye

Yes I know all about that. I started that thread.


Oops :blush: Mind like a sieve, I spent the last 2/3rds of the thread talking to Big Alex and had forgotten it was your request originally.

Glad you are finding it useful, after original reservations I am glad I did it too, have used it a couple of times already.
Last edit: 13 May 2013 21:14 by ArcEye.

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

More
13 May 2013 23:48 #34011 by mariusl
Hey, cant blame you. So many things at the same time and a whole lot of moaning users taboo. :)

The pyvcp is now just what the layman needed to make it more usable. I think one can get very creative with labels to make the GUI more friendly.

Regards
Marius


www.bluearccnc.com

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

Time to create page: 0.201 seconds
Powered by Kunena Forum