feat: sync latest run execution updates

This commit is contained in:
2026-06-22 21:47:16 -04:00
parent 0b1aad39e1
commit 8d3177cb73
92 changed files with 22837 additions and 246 deletions

View File

@@ -1,4 +1,5 @@
import { renderFiveAxisScene } from "../visualization/five-axis-scene.js";
import { gateLinuxCncTaskAction } from "../state/linuxcnc-task-policy.js";
const REGIONS = [
"titlebar",
@@ -623,7 +624,12 @@ function renderBottomControls(element, state, dispatch) {
element.innerHTML = `
<input type="file" class="program-file-input" data-action="OPEN_FILE" accept=".ngc,.nc,.tap,.gcode,.txt" />
${controls
.map(([label, action]) => `<button type="button" data-action="${action}">${label}</button>`)
.map(([label, action]) => {
const gate = bottomControlGate(state, action);
const disabled = gate.allowed ? "" : " disabled";
const title = gate.allowed ? "" : ` title="${escapeHtml(gate.operatorMessage || "blocked")}"`;
return `<button type="button" data-action="${action}"${disabled}${title}>${label}</button>`;
})
.join("")}
`;
@@ -650,6 +656,22 @@ function renderBottomControls(element, state, dispatch) {
}
}
function bottomControlGate(state, action) {
const actionMap = {
RUN: { type: "RUN" },
STEP: { type: "STEP" },
PAUSE: { type: "PAUSE" },
RESUME: { type: "RESUME" },
HOME: { type: "HOME" },
MDI_RUN: { type: "RUN_MDI" },
JOG_X_NEG: { type: "JOG" },
JOG_X_POS: { type: "JOG" },
JOG_Y_NEG: { type: "JOG" },
JOG_Y_POS: { type: "JOG" },
};
return gateLinuxCncTaskAction(state, actionMap[action] || { type: "UI_CONTROL" });
}
function formatNumber(value, digits = 3) {
return Number(value).toFixed(digits);
}