Clear stale toolpaths on program replacement
This commit is contained in:
@@ -1926,6 +1926,11 @@ export class SimSession {
|
||||
case "PROGRAM_LOAD": {
|
||||
if (["RUNNING", "PAUSED"].includes(this.task.state.state)) return finish(this.error(input, "task_state", "program_load_while_active"), "failed");
|
||||
const source = input.payload?.source ?? input.payload?.text ?? input.payload?.program_source;
|
||||
// PROGRAM_LOAD is a replacement transaction. Clear the previous
|
||||
// canonical preview before asking the WASM interpreter to parse the
|
||||
// new source, so a parse/subroutine error cannot re-publish the old
|
||||
// toolpath as if it belonged to the requested file.
|
||||
this.previewState = null;
|
||||
if (this.xyzacProgram) {
|
||||
this.pendingXyzacMotion = null;
|
||||
this.pendingProgramControl = 0;
|
||||
|
||||
Reference in New Issue
Block a user