Offsetpage widget not showing values from .var file

More
13 Mar 2024 17:05 #295837 by Wieser
I am trying to implement a Tool and Offset Tab for my machine.
I can enter values for the offsets and those are then written to the .var file. As long as the machine stays on, those values are shown in the widget.

The problem is that after a new startup, the table is blank. 

What could cause that behavior?

The Tooleditor widget doesn’t have that problem. It reads and displays the value from the file correctly.
To get it working I use a pyhton code snipped I found on the forum:
class HandlerClass:
    def __init__(self, halcomp,builder,useropts):
        tooledit = builder.get_object("tooledit1")
        tooledit.set_filename("/home/linux/linuxcnc/configs/sim.axis.gladevcp/sim1.tbl")

def get_handlers(halcomp,builder,useropts):
    return [HandlerClass(halcomp,builder,useropts)]

See attached screenshot, the higlighted variables correspond to G54 and are applied. Also the values from G59.1 are saved at the bottom of the .var file.
Attachments:

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

More
13 Mar 2024 18:13 #295845 by cakeslob
I like that panel you have, is that both tool and offset combined into one? glade?


anyways, in your ini file, do you have the POSITION_FILE set in your ini?

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

More
13 Mar 2024 20:45 #295853 by Wieser
Position_File is set to position.txt in the INI, it is filled with 6 rows of 0,00000.
I had to look it up in the documentation, but it says this is for storing the axis values at shutdown. (After shutdown the values change to the Axis values)
But as I see it this has nothing to do with the Work offsets...
[list]
[*][i]POSITION_FILE = position.txt[/i] - If set to a non-empty value, the joint positions are stored between runs in this file. This allows the machine to start with the same coordinates it had on shutdown. This assumes there was no movement of the machine while powered off. If unset, joint positions are not stored and will begin at 0 each time LinuxCNC is started. This can help on smaller machines without home switches.
[/list]

Yes it is a glade panel, those two are standard widgets, so no effort at all to create. But i can share it of course.

This INI command is used:
EMBED_TAB_NAME=Werkzeugtabelle
EMBED_TAB_COMMAND=halcmd loadusr -Wn gladevcp gladevcp -u tool.py -c tool -x {XID} tooledit.ui

 
Attachments:

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

Time to create page: 0.077 seconds
Powered by Kunena Forum