How to get values from retain memory and ini file?
24 Feb 2021 21:39 #200039
by aleksamc
How to get values from retain memory and ini file? was created by aleksamc
I wan't to get from ini file value of maximum speed for setting jog speed . As in the
basic tutorial
.
Also QHSpinbox I would like to save last value to some file that in next turn on, it will load values from that file.
Does it's possible to do this?
Also QHSpinbox I would like to save last value to some file that in next turn on, it will load values from that file.
Does it's possible to do this?
Please Log in or Create an account to join the conversation.
13 Mar 2021 11:07 #202083
by HansU
Replied by HansU on topic How to get values from retain memory and ini file?
For saving persistent values have a look at github.com/LinuxCNC/linuxcnc/blob/b8ce6c.../persistence.py#L122
And for reading the INI file could this be useful I think: github.com/LinuxCNC/linuxcnc/blob/b8ce6c...y/getiniinfo.py#L242
In forum.linuxcnc.org/gmoccapy/40709-gmocap...lock?start=30#201950 you find an example how to use this.
And for reading the INI file could this be useful I think: github.com/LinuxCNC/linuxcnc/blob/b8ce6c...y/getiniinfo.py#L242
In forum.linuxcnc.org/gmoccapy/40709-gmocap...lock?start=30#201950 you find an example how to use this.
The following user(s) said Thank You: aleksamc
Please Log in or Create an account to join the conversation.
13 Mar 2021 19:11 #202128
by aleksamc
Replied by aleksamc on topic How to get values from retain memory and ini file?
Thanks Hansu for your answer. Please give me more information where I can connect this python code? I've never used gmoccapy.
Please Log in or Create an account to join the conversation.
13 Mar 2021 19:25 - 14 Mar 2021 09:06 #202132
by HansU
Replied by HansU on topic How to get values from retain memory and ini file?
It is not only for gmoccapy. What GUI do you use?
Hans
Hans
Last edit: 14 Mar 2021 09:06 by HansU.
Please Log in or Create an account to join the conversation.
13 Mar 2021 19:29 #202133
by aleksamc
Replied by aleksamc on topic How to get values from retain memory and ini file?
I use QtPyVCP, there is main file .py where I add functions for buttons.
Please Log in or Create an account to join the conversation.
14 Mar 2021 09:09 - 14 Mar 2021 21:00 #202199
by HansU
Ok what stupid question of me as your post is in the QtPyVCP sub forum
So you just have to import the libs like
and create a IniFile object and so on...
Replied by HansU on topic How to get values from retain memory and ini file?
I use QtPyVCP, there is main file .py where I add functions for buttons.
Ok what stupid question of me as your post is in the QtPyVCP sub forum
So you just have to import the libs like
from gladevcp.persistence import IniFile # we use this one to save the states of the widgets on shut down and restart
Last edit: 14 Mar 2021 21:00 by HansU.
Please Log in or Create an account to join the conversation.
14 Mar 2021 16:14 #202224
by aleksamc
Replied by aleksamc on topic How to get values from retain memory and ini file?
Ok, thanks, I will try.
I'm not so good in python but I will try.
I'm not so good in python but I will try.
Please Log in or Create an account to join the conversation.
13 May 2021 15:35 - 13 May 2021 15:58 #208738
by aleksamc
Replied by aleksamc on topic How to get values from retain memory and ini file?
I copied to directory with main file.py
persistance.py and getiniinfo.py.
in main file i added
And also lineBut I really doesn't understand from what directory file is imported.
and visualisation doesn't load.
But really I don't know logic of execution of QtPyVCP, I write to this file functions that should be executable when buttons pressed,
persistance.py and getiniinfo.py.
in main file i added
import persistance.py
import getiniinfo.py
And also line
from gladevcp.persistence import IniFile
and visualisation doesn't load.
But really I don't know logic of execution of QtPyVCP, I write to this file functions that should be executable when buttons pressed,
Attachments:
Last edit: 13 May 2021 15:58 by aleksamc.
Please Log in or Create an account to join the conversation.
16 Jan 2022 08:45 #231991
by HansU
Replied by HansU on topic How to get values from retain memory and ini file?
Basically you have to do something like this
import linuxcnc
inifile = linuxcnc.ini("name amd path of ini file")
max_jog_vel = inifile.find("TRAJ","MAX_LINEAR_VELOCITY")
Please Log in or Create an account to join the conversation.
Time to create page: 0.087 seconds