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
// 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 () {