推进 INI 面板 control view renderer helper
This commit is contained in:
@@ -53,6 +53,9 @@ import {
|
||||
createMachineSessionStateReportExport,
|
||||
createMachineSessionWorkflowStatus,
|
||||
} from "./panel-state-summary.js";
|
||||
import {
|
||||
renderMachineSessionControlView,
|
||||
} from "./control-view-renderer.js";
|
||||
|
||||
const SAMPLE_PATH =
|
||||
"../../../vendor/linuxcnc/configs/sim/axis/vismach/5axis/table-dual-rotary/xyzab-tdr.ini";
|
||||
@@ -114,6 +117,7 @@ const runProgressLabelNode = document.getElementById("run-progress-label");
|
||||
const runMotionNode = document.getElementById("run-motion");
|
||||
const runLineNode = document.getElementById("run-line");
|
||||
const runStatementNode = document.getElementById("run-statement");
|
||||
const controlViewNode = document.getElementById("machine-session-control-view");
|
||||
const axisNodes = {
|
||||
x: document.getElementById("axis-x"),
|
||||
y: document.getElementById("axis-y"),
|
||||
@@ -176,6 +180,10 @@ function getMachineSessionControlView() {
|
||||
return createMachineSessionControlView(getMachineSessionStateBundle());
|
||||
}
|
||||
|
||||
function renderCurrentMachineSessionControlView(container = controlViewNode) {
|
||||
return renderMachineSessionControlView(container, getMachineSessionControlView());
|
||||
}
|
||||
|
||||
function updatePanelMachineSessionState(patch = {}) {
|
||||
panelMachineSessionState = createMachineSessionStateSnapshot({
|
||||
...panelMachineSessionState,
|
||||
@@ -186,6 +194,7 @@ function updatePanelMachineSessionState(patch = {}) {
|
||||
},
|
||||
});
|
||||
window.linuxCncIniPanelMachineSessionState = panelMachineSessionState;
|
||||
renderCurrentMachineSessionControlView();
|
||||
return panelMachineSessionState;
|
||||
}
|
||||
|
||||
@@ -195,13 +204,16 @@ window.linuxCncIniPanelApi = {
|
||||
getMachineSessionStateReport,
|
||||
getMachineSessionStateReportExport,
|
||||
getMachineSessionWorkflowStatus,
|
||||
renderMachineSessionControlView: renderCurrentMachineSessionControlView,
|
||||
};
|
||||
window.getMachineSessionControlView = getMachineSessionControlView;
|
||||
window.getMachineSessionStateBundle = getMachineSessionStateBundle;
|
||||
window.getMachineSessionStateReport = getMachineSessionStateReport;
|
||||
window.getMachineSessionStateReportExport = getMachineSessionStateReportExport;
|
||||
window.getMachineSessionWorkflowStatus = getMachineSessionWorkflowStatus;
|
||||
window.renderMachineSessionControlView = renderCurrentMachineSessionControlView;
|
||||
window.linuxCncIniPanelMachineSessionState = panelMachineSessionState;
|
||||
renderCurrentMachineSessionControlView();
|
||||
|
||||
function setBadge(node, text, className = "badge") {
|
||||
node.className = className;
|
||||
|
||||
Reference in New Issue
Block a user