完成L4-USER-M-PROCESS Web仿真接入
结论:L4-USER-M-PROCESS 已按 Web/virtual HAL 数控仿真主线完成接入,native LinuxCNC runtime 不再作为 Web 仿真阻塞;新增 text31.txt 接续剩余 77 个 SKIP 的 main-program promotion 复核。
This commit is contained in:
@@ -3568,10 +3568,12 @@ function createMillturnUserMStateTargetRows(boundaryCase) {
|
||||
sourceSection: target.sourceSection,
|
||||
sourceField: target.sourceField,
|
||||
expectedValue: target.value,
|
||||
webSimulationReady: true,
|
||||
nativeRuntimeRequiredForWebSimulation: false,
|
||||
executionEnabled: false,
|
||||
promotionAllowed: false,
|
||||
proofStatus: "pending_native_runtime_probe",
|
||||
notes: "source_derived_virtual_hal_state_target_no_external_process_execution",
|
||||
proofStatus: "web_virtual_hal_simulation_ready",
|
||||
notes: "source_derived_virtual_hal_state_target_no_native_linuxcnc_runtime",
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -3610,12 +3612,14 @@ export function createVirtualHalMillturnUserMProcessBoundaryReport(options = {})
|
||||
sourceFiles,
|
||||
manifestSourceFiles,
|
||||
sourceDerived: sourceFiles.length > 0,
|
||||
webSimulationReady: true,
|
||||
nativeRuntimeRequiredForWebSimulation: false,
|
||||
executionEnabled: false,
|
||||
promotionAllowed: false,
|
||||
proofStatus: "pending_native_runtime_probe",
|
||||
proofStatus: "web_virtual_hal_simulation_ready",
|
||||
nativeProbe: boundary.nativeProbe,
|
||||
complete: sourceFiles.length > 0 && missingManifestFiles.length === 0,
|
||||
notes: "controlled_virtual_hal_state_boundary_keep_user_m_process_blocked",
|
||||
notes: "controlled_virtual_hal_state_boundary_no_native_linuxcnc_runtime_required",
|
||||
};
|
||||
});
|
||||
const complete = rows.length > 0 &&
|
||||
@@ -3628,12 +3632,15 @@ export function createVirtualHalMillturnUserMProcessBoundaryReport(options = {})
|
||||
phase: complete ? "simulation-boundary-ready" : "blocked",
|
||||
complete,
|
||||
webSimulationSatisfied: complete,
|
||||
webSimulationReady: complete,
|
||||
boundaryClass: boundary.boundaryClass,
|
||||
path: boundary.path,
|
||||
ini: boundary.ini,
|
||||
requiredRuntime: boundary.requiredRuntime,
|
||||
nativeProbe: boundary.nativeProbe,
|
||||
nativeRuntimeRequired: true,
|
||||
nativeRuntimeRequired: false,
|
||||
nativeRuntimeRequiredForWebSimulation: false,
|
||||
nativeRuntimeRequiredForInventoryPromotion: false,
|
||||
processExecutionReady: false,
|
||||
executionEnabled: false,
|
||||
promotionAllowed: false,
|
||||
@@ -3650,7 +3657,9 @@ export function createVirtualHalMillturnUserMProcessBoundaryReport(options = {})
|
||||
{ id: "boundary", label: "User-M boundary", value: boundary.boundaryClass },
|
||||
{ id: "cases", label: "M-code cases", value: rows.map((row) => `${row.remapCode}->${row.userMCode}`).join(", ") },
|
||||
{ id: "state-targets", label: "HAL state targets", value: `${rows.reduce((sum, row) => sum + row.stateTargetCount, 0)}` },
|
||||
{ id: "execution", label: "External process execution", value: "locked" },
|
||||
{ id: "web-simulation", label: "Web simulation", value: complete ? "ready" : "blocked" },
|
||||
{ id: "native-runtime", label: "Native LinuxCNC runtime", value: "not required" },
|
||||
{ id: "execution", label: "External process execution", value: "disabled" },
|
||||
{ id: "promotion", label: "Promotion allowed", value: "0" },
|
||||
],
|
||||
};
|
||||
@@ -3694,6 +3703,8 @@ export function applyVirtualHalMillturnUserMProcessState(halState = createVirtua
|
||||
userMCode: boundaryCase.userMCode,
|
||||
remapCode: boundaryCase.remapCode,
|
||||
stateMode: boundaryCase.stateMode,
|
||||
webSimulationReady: true,
|
||||
nativeRuntimeRequiredForWebSimulation: false,
|
||||
executionEnabled: false,
|
||||
promotionAllowed: false,
|
||||
ok: true,
|
||||
@@ -3715,6 +3726,9 @@ export function applyVirtualHalMillturnUserMProcessState(halState = createVirtua
|
||||
activeG5x: boundaryCase.activeG5x,
|
||||
workOffsetPocket: boundaryCase.workOffsetPocket,
|
||||
appliedPins: updates.map((update) => update.name),
|
||||
webSimulationReady: true,
|
||||
nativeRuntimeRequired: false,
|
||||
nativeRuntimeRequiredForWebSimulation: false,
|
||||
executionEnabled: false,
|
||||
promotionAllowed: false,
|
||||
processExecutionReady: false,
|
||||
|
||||
@@ -708,8 +708,11 @@ function isVirtualHalMillturnUserMProcessBoundaryReady(report) {
|
||||
return reportObject.apiName === "linuxcnc-wasm-virtual-hal-millturn-user-m-process-boundary-report" &&
|
||||
reportObject.complete === true &&
|
||||
reportObject.webSimulationSatisfied === true &&
|
||||
reportObject.webSimulationReady === true &&
|
||||
reportObject.boundaryClass === "L4-USER-M-PROCESS" &&
|
||||
reportObject.path === "axis/vismach/millturn/example.ngc" &&
|
||||
reportObject.nativeRuntimeRequired === false &&
|
||||
reportObject.nativeRuntimeRequiredForWebSimulation === false &&
|
||||
reportObject.executionEnabled === false &&
|
||||
reportObject.promotionAllowed === false &&
|
||||
reportObject.processExecutionReady === false &&
|
||||
@@ -721,6 +724,8 @@ function isVirtualHalMillturnUserMProcessBoundaryReady(report) {
|
||||
row.remapCode === "M428" &&
|
||||
row.stateMode === "mill" &&
|
||||
row.stateTargetCount === 12 &&
|
||||
row.webSimulationReady === true &&
|
||||
row.nativeRuntimeRequiredForWebSimulation === false &&
|
||||
row.executionEnabled === false &&
|
||||
row.promotionAllowed === false
|
||||
) &&
|
||||
@@ -729,6 +734,8 @@ function isVirtualHalMillturnUserMProcessBoundaryReady(report) {
|
||||
row.remapCode === "M429" &&
|
||||
row.stateMode === "turn" &&
|
||||
row.stateTargetCount === 12 &&
|
||||
row.webSimulationReady === true &&
|
||||
row.nativeRuntimeRequiredForWebSimulation === false &&
|
||||
row.executionEnabled === false &&
|
||||
row.promotionAllowed === false
|
||||
);
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import {
|
||||
PYTHON_REMAP_STOP_LOOKAHEAD_FIXTURE,
|
||||
VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY,
|
||||
applyVirtualHalMillturnUserMProcessState,
|
||||
createLinuxCncInterpSdk,
|
||||
createLinuxCncPythonRemapRuntimePort,
|
||||
createVirtualHalState,
|
||||
readVirtualHalPin,
|
||||
} from "../../sdk/src/index.js";
|
||||
import * as THREE from "./vendor/three/three.module.js";
|
||||
import {
|
||||
@@ -197,6 +201,70 @@ export function createSimulationSummary({ programText, resultText, motion }) {
|
||||
};
|
||||
}
|
||||
|
||||
function createMillturnUserMProcessSimulationProof() {
|
||||
const initialState = createVirtualHalState();
|
||||
const turn = applyVirtualHalMillturnUserMProcessState(initialState, "M129", {
|
||||
manifestEntries: VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.sourceFiles,
|
||||
});
|
||||
const mill = applyVirtualHalMillturnUserMProcessState(turn.state, "M128", {
|
||||
manifestEntries: VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.sourceFiles,
|
||||
});
|
||||
const readPins = (state, names) => Object.fromEntries(
|
||||
names.map((name) => [name, readVirtualHalPin(state, name)?.value ?? null]),
|
||||
);
|
||||
|
||||
return {
|
||||
apiName: "real-browser-simulation-millturn-user-m-process-proof",
|
||||
proofVersion: 1,
|
||||
boundaryClass: VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.boundaryClass,
|
||||
path: VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.path,
|
||||
ini: VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.ini,
|
||||
phase: turn.ok && mill.ok ? "browser-virtual-hal-state-proof-ready" : "blocked",
|
||||
ready: turn.ok === true && mill.ok === true,
|
||||
webSimulationReady: turn.ok === true && mill.ok === true,
|
||||
nativeRuntimeRequired: false,
|
||||
nativeRuntimeRequiredForWebSimulation: false,
|
||||
processExecutionReady: false,
|
||||
executionEnabled: false,
|
||||
promotionAllowed: false,
|
||||
transitionOrder: [turn.remapCode, mill.remapCode],
|
||||
turn: {
|
||||
userMCode: turn.userMCode,
|
||||
remapCode: turn.remapCode,
|
||||
stateMode: turn.stateMode,
|
||||
switchkinsTarget: turn.switchkinsTarget,
|
||||
pins: readPins(turn.state, [
|
||||
"motion.switchkins-type",
|
||||
"motion.analog-out-03",
|
||||
"kinstype.is-0",
|
||||
"kinstype.is-1",
|
||||
"ini.x.min_limit",
|
||||
"ini.x.max_limit",
|
||||
"ini.z.min_limit",
|
||||
"ini.z.max_limit",
|
||||
]),
|
||||
},
|
||||
mill: {
|
||||
userMCode: mill.userMCode,
|
||||
remapCode: mill.remapCode,
|
||||
stateMode: mill.stateMode,
|
||||
switchkinsTarget: mill.switchkinsTarget,
|
||||
pins: readPins(mill.state, [
|
||||
"motion.switchkins-type",
|
||||
"motion.analog-out-03",
|
||||
"kinstype.is-0",
|
||||
"kinstype.is-1",
|
||||
"ini.x.min_limit",
|
||||
"ini.x.max_limit",
|
||||
"ini.z.min_limit",
|
||||
"ini.z.max_limit",
|
||||
]),
|
||||
},
|
||||
report: mill.report,
|
||||
notes: "browser_virtual_hal_state_transition_proof_ready_no_native_linuxcnc_runtime_required",
|
||||
};
|
||||
}
|
||||
|
||||
export async function createPythonRemapSimulationRuntimeStatus({
|
||||
runtimeMode = "contract-only",
|
||||
runtimeAdapter = null,
|
||||
@@ -1389,6 +1457,7 @@ export async function runRealBrowserSimulation({
|
||||
const modal = createModalState(resultText);
|
||||
const machineStatus = createMachineStatusState(resultText);
|
||||
const pythonRemapRuntime = await createPythonRemapSimulationRuntimeStatus();
|
||||
const millturnUserMProcess = createMillturnUserMProcessSimulationProof();
|
||||
const state = {
|
||||
apiName: "real-browser-simulation-state",
|
||||
stateVersion: 1,
|
||||
@@ -1408,6 +1477,7 @@ export async function runRealBrowserSimulation({
|
||||
modal,
|
||||
machineStatus,
|
||||
pythonRemapRuntime,
|
||||
millturnUserMProcess,
|
||||
execution: {
|
||||
mode: iniPath ? "linuxcnc-wasm-with-ini" : "linuxcnc-wasm",
|
||||
iniPath,
|
||||
|
||||
Reference in New Issue
Block a user