完成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:
@@ -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