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.
This commit is contained in:
muehe
2026-05-01 16:08:39 +02:00
parent 549b69c234
commit b0f38619ba

View File

@@ -79,17 +79,28 @@ module.exports = {
// True only while a loaded G-code program is actually being // True only while a loaded G-code program is actually being
// executed (running, paused/holding, or stopping). Excludes // executed (running, paused/holding, or stopping). Excludes
// jogging, homing, MDI commands and other one-off motion that // jogging, homing, probing, MDI commands and other one-off
// also leave state.cycle != 'idle' but should not bring up the // motion that also leave state.xx == "RUNNING" but must not
// "Now Running" panel on the Control tab. // 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 () { is_program_executing: function () {
const xx = this.state && this.state.xx; if (!this.state) return false;
if (xx == "RUNNING" || xx == "HOLDING" || xx == "STOPPING") { const xx = this.state.xx;
// Only count it as a program run if a file is selected. const cycle = this.state.cycle;
// Otherwise an MDI submission also reads xx=RUNNING. const isExecState = xx == "RUNNING" || xx == "HOLDING" || xx == "STOPPING";
return !!(this.state && this.state.selected); if (!isExecState) return false;
} // The cycle string narrows it to a real program run; anything
return false; // else (jogging / homing / probing / mdi) is a one-off.
if (cycle && cycle != "running" && cycle != "idle") return false;
return !!this.state.selected;
}, },
is_paused: function () { is_paused: function () {