Skip to content

qtvcp: write the var file before reloading the preview on offset changes - #4607

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:qtvcp-preview-offsets
Open

grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:qtvcp-preview-offsets

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

After ZERO G5X, ZERO G92, zero rotation, set axis origin or lathe mirror, qtdragon can keep drawing the program at the old offsets.

The preview reads offsets from the var file, which the interpreter writes only when it synchs (on a mode change). The CALL_MDI based actions reloaded before the G10/G92.1 ran; the others, when already in MDI mode, had no mode change to trigger the write.

All six now go through one helper: run the MDI, wait, task_plan_synch(), restore the mode, reload. MDILine already does this for typed G10. As a side effect, the former CALL_MDI actions return to the calling mode instead of staying in MDI.

Tested in the qtdragon_xyz sim under xvfb, from MANUAL and from MDI:

Action MANUAL MDI
ZERO_ROTATIONAL_OFFSET stale => ok stale => ok
ZERO_G92_OFFSET stale => ok stale => ok
SET_LATHE_MIRROR_X stale => ok stale => ok
ZERO_G5X_OFFSET ok stale => ok
SET_AXIS_ORIGIN ok stale => ok

probe_routines.py set_zero / rotate_coord_system have the same pattern; not changed here (untested).

@cmorley, is restoring the previous mode OK for these actions?

The preview reads offsets from the var file, which the interpreter only writes when it synchs. Offset actions reloaded before that happened: the CALL_MDI ones did not wait for the MDI, and the others had no mode change to trigger the write when already in MDI mode.

Run them through one helper that waits, requests a plan synch, restores the previous mode and reloads.
@c-morley

Copy link
Copy Markdown
Collaborator

Restoring the mode is good yes.

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