From 7611b96a5d0f6ba44f38999654727dcf5108e30c Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Tue, 8 Sep 2026 16:52:36 +1000 Subject: [PATCH] axis: read the program the config opens once the HAL is whole The interpreter reads HAL pins to preview a program, the parameters of a kinematics module whose geometry lives in HAL among them, and a postgui file connects those after the panels that carry them exist. The program a config opens is read before that, so a machine whose geometry comes from a panel is previewed with the geometry all zeros. Read the program after the postgui file has run instead, in the same step that raises the window. --- src/emc/usr_intf/axis/scripts/axis.py | 32 ++++++++++++++++----------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/emc/usr_intf/axis/scripts/axis.py b/src/emc/usr_intf/axis/scripts/axis.py index f9f04cc72a5..228a22b0886 100755 --- a/src/emc/usr_intf/axis/scripts/axis.py +++ b/src/emc/usr_intf/axis/scripts/axis.py @@ -4042,21 +4042,25 @@ def remove_tempdir(t): initialfile = os.path.join(BASE, "share", "axis", "images", "axis.ngc") addrecent = False -if os.path.exists(initialfile): - open_file_guts(initialfile, False, addrecent) +# read once the HAL is whole: the interpreter reads pins to preview a +# program, the kinematics parameters of a machine whose geometry lives in +# HAL among them, and a postgui file connects them after the panels exist +def open_initial_file(): + if os.path.exists(initialfile): + open_file_guts(initialfile, False, addrecent) -if lathe: - if lathe_backtool: - commands.set_view_y2() + if lathe: + if lathe_backtool: + commands.set_view_y2() + else: + commands.set_view_y() else: - commands.set_view_y() -else: - commands.set_view_p() -if o.canon: - x = (o.canon.min_extents[0] + o.canon.max_extents[0])/2 - y = (o.canon.min_extents[1] + o.canon.max_extents[1])/2 - z = (o.canon.min_extents[2] + o.canon.max_extents[2])/2 - o.set_centerpoint(x, y, z) + commands.set_view_p() + if o.canon: + x = (o.canon.min_extents[0] + o.canon.max_extents[0])/2 + y = (o.canon.min_extents[1] + o.canon.max_extents[1])/2 + z = (o.canon.min_extents[2] + o.canon.max_extents[2])/2 + o.set_centerpoint(x, y, z) def destroy_splash(): try: @@ -4142,6 +4146,7 @@ def check_dynamic_tabs(): res = os.spawnvp(os.P_WAIT, "halcmd", ["halcmd"] + f.split()) if res: raise SystemExit(res) + open_initial_file() root_window.deiconify() destroy_splash() return @@ -4285,6 +4290,7 @@ def forget(widget, *pins): load_gladevcp_panel() check_dynamic_tabs() else: + open_initial_file() root_window.deiconify() destroy_splash()