Skip to content

hal_glib: defer file-loaded when the interp is already running - #4399

Merged
BsAtHome merged 1 commit into
LinuxCNC:masterfrom
grandixximo:gstat-file-loaded-pending
Aug 18, 2026
Merged

hal_glib: defer file-loaded when the interp is already running#4399
BsAtHome merged 1 commit into
LinuxCNC:masterfrom
grandixximo:gstat-file-loaded-pending

Conversation

@grandixximo

@grandixximo grandixximo commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

GSTAT only emits 'file-loaded' if the poll that first sees stat.file change finds the interp IDLE; the guard exists to skip reloads when the "new file" is a remap procedure. A client doing program_open + AUTO_RUN back to back starts the program within a few ms, so every ~100 ms poll sees the new file with the interp busy, the change is swallowed, and the signal never fires: gmoccapy sits at "No Program loaded" with an empty editor and preview after an externally driven run. Seen in the ui-smoke CI screenshots (#4136), where it flip-flopped with runner timing.

Fix: emit a skipped change on the first poll with the interp back at IDLE. Remap protection unchanged (merge() ignores the file name at call level != 0). qtvcp inherits via Status(GStat). Verified locally: gmoccapy shows the program after a run that previously left it empty.

GSTAT only emits 'file-loaded' if the poll that first sees stat.file
change finds the interp IDLE. A client doing program_open + AUTO_RUN
back to back starts the program within ms, so every 100 ms poll sees
the file with the interp busy, the remap guard swallows the change,
and the signal is never emitted: gmoccapy sits at 'No Program loaded'
with an empty editor and preview after an externally driven run, and
whether it does depends on poll timing.

Emit a skipped change on the first poll with the interp back at IDLE.
Remap protection unchanged: merge() ignores the file name at call
level != 0.
@grandixximo
grandixximo marked this pull request as ready for review August 17, 2026 23:21
@grandixximo

grandixximo commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

This is to make the UI smoke test more consistent, but also a bug fix, the GUI should not show 'No Program loaded' while a program is loaded and running.

@BsAtHome
BsAtHome merged commit 0f0cda3 into LinuxCNC:master Aug 18, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants