From b0f38619ba0fa2f73e1b249acd3fcf52ad9597aa Mon Sep 17 00:00:00 2001 From: muehe Date: Fri, 1 May 2026 16:08:39 +0200 Subject: [PATCH] control: keep jog grid visible during jog/home/probe/mdi is_program_executing was checking only state.xx (RUNNING/HOLDING/ STOPPING) which is also true during jogging, homing, probing and MDI cycles. The Now Running panel therefore took over the Control view whenever the user jogged. Add a state.cycle check so only the 'running' cycle (a loaded program executing) triggers the swap. --- src/js/program-mixin.js | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/js/program-mixin.js b/src/js/program-mixin.js index c1acb2c..a4d0b32 100644 --- a/src/js/program-mixin.js +++ b/src/js/program-mixin.js @@ -79,17 +79,28 @@ module.exports = { // True only while a loaded G-code program is actually being // executed (running, paused/holding, or stopping). Excludes - // jogging, homing, MDI commands and other one-off motion that - // also leave state.cycle != 'idle' but should not bring up the - // "Now Running" panel on the Control tab. + // jogging, homing, probing, MDI commands and other one-off + // motion that also leave state.xx == "RUNNING" but must not + // swap the jog grid out for the "Now Running" panel. + // + // Distinguishing signal is state.cycle: + // - "idle" : nothing happening + // - "jogging" : user-initiated jog + // - "homing" : home cycle + // - "probing" : probe cycle + // - "mdi" : single MDI command + // - "running" : an actual loaded program is being run + // Only "running" (combined with a selected file) is what we want. is_program_executing: function () { - const xx = this.state && this.state.xx; - if (xx == "RUNNING" || xx == "HOLDING" || xx == "STOPPING") { - // Only count it as a program run if a file is selected. - // Otherwise an MDI submission also reads xx=RUNNING. - return !!(this.state && this.state.selected); - } - return false; + if (!this.state) return false; + const xx = this.state.xx; + const cycle = this.state.cycle; + const isExecState = xx == "RUNNING" || xx == "HOLDING" || xx == "STOPPING"; + if (!isExecState) return false; + // The cycle string narrows it to a real program run; anything + // else (jogging / homing / probing / mdi) is a one-off. + if (cycle && cycle != "running" && cycle != "idle") return false; + return !!this.state.selected; }, is_paused: function () {