Using Offsetpage Widget?

  • Todd Zuercher
  • Todd Zuercher's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
18 Apr 2026 05:40 #345676 by Todd Zuercher
Replied by Todd Zuercher on topic Using Offsetpage Widget?
Here is what it looks like.  All offsets show zero, even though they are not zero.

 
Attachments:

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

More
19 Apr 2026 13:29 #345734 by cmorley
Replied by cmorley on topic Using Offsetpage Widget?
As I expected, it's because offsetpage does not automatically find the var file.
You must make a handler file to set the var file  path.

Something like this (it assumes the offset widget is called 'offsetpage' and the var file is called 'sim.var')
import os

varpath = os.path.join(os.getcwd(),'sim.var')

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

class HandlerClass:
    def __init__(self, halcomp,builder,useropts):
        obj = builder.get_object('offsetpage')
        obj.set_filename(varpath)
        obj.set_col_visible("abcuvw", False)

The following user(s) said Thank You: Todd Zuercher, tommylight

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

  • Todd Zuercher
  • Todd Zuercher's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
20 Apr 2026 10:21 #345759 by Todd Zuercher
Replied by Todd Zuercher on topic Using Offsetpage Widget?
I tried coping what you have above (with the appropriate name changes) to the handler file, but I still get all zeros in the table.

 
Attachments:

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

  • Todd Zuercher
  • Todd Zuercher's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
20 Apr 2026 10:41 - 21 Apr 2026 18:39 #345762 by Todd Zuercher
Replied by Todd Zuercher on topic Using Offsetpage Widget?
Never mind, I had the name of my handler file wrong in the ini file.
It works! 

Thank you

 

File Attachment:

File Name: offsets.py
File Size:0 KB
 

File Attachment:

File Name: offsets_2026-04-20.ui
File Size:1 KB


And the INI lines to add it to a tab in Axis.
EMBED_TAB_NAME=Work Offsets
EMBED_TAB_COMMAND=gladevcp -u ./offsets.py -x {XID} ./offsets.ui
Attachments:
Last edit: 21 Apr 2026 18:39 by Todd Zuercher. Reason: added ini lines.

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

More
20 Apr 2026 13:24 #345771 by cmorley
Replied by cmorley on topic Using Offsetpage Widget?
excellent.

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

Moderators: HansU
Time to create page: 0.157 seconds
Powered by Kunena Forum