feat: sync latest run execution updates
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user