按规划继续工作

结论:接入 LinuxCNC iniFindBool 到 INI WASM/SDK,并让 machine-session bridge 通过 vendored INI 解析 [EMCIO]RANDOM_TOOLCHANGER 后透传给 tooldata;native、WASM、OPFS 和浏览器 smoke 验证已通过。
This commit is contained in:
2026-06-08 08:49:38 +08:00
parent 3f4eb06b47
commit cf0887e0e7
16 changed files with 151 additions and 20 deletions

View File

@@ -29,7 +29,8 @@ import {
```
`createLinuxCncIniSdk()` wraps the INI parser module built from vendored
LinuxCNC `inifile.cc`.
LinuxCNC `inifile.cc` and exposes `getString()` plus `getBool()`. Boolean
conversion is performed by vendored LinuxCNC `iniFindBool()`.
`createLinuxCncInterpSdk()` wraps the interpreter-core module built from
vendored LinuxCNC RS274NGC sources and exposes:

View File

@@ -55,6 +55,23 @@ export async function createLinuxCncIniSdk(moduleOptions = {}) {
}
},
getBool(path, section, tag) {
const pathPtr = allocCString(mod, path);
const sectionPtr = allocCString(mod, section);
const tagPtr = allocCString(mod, tag);
const outPtr = mod._malloc(4);
try {
const rc = mod._lcini_get_bool(pathPtr, sectionPtr, tagPtr, outPtr);
return rc === 0 ? mod.HEAP32[outPtr >> 2] !== 0 : null;
} finally {
mod._free(pathPtr);
mod._free(sectionPtr);
mod._free(tagPtr);
mod._free(outPtr);
}
},
getFields(path, fields) {
return Object.fromEntries(
Object.entries(fields).map(([name, query]) => [