参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke:锁定浏览器应用源码映射结论
This commit is contained in:
50
docs/linuxcnc-browser-app-source-map.md
Normal file
50
docs/linuxcnc-browser-app-source-map.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# LinuxCNC browser app source map
|
||||
|
||||
This map records the source basis and boundaries for the browser application
|
||||
entry point. It is an app/bridge guard only; it must not add CNC behavior and
|
||||
must not expand the temporary smoke parser.
|
||||
|
||||
## LinuxCNC Source Basis
|
||||
|
||||
- `src/emc/rs274ngc/interp_internal.hh` defines
|
||||
`RS274NGC_PARAMETER_FILE_NAME_DEFAULT` as `rs274ngc.var`.
|
||||
- `src/emc/rs274ngc/interp_internal.hh` defines
|
||||
`RS274NGC_PARAMETER_FILE_BACKUP_SUFFIX` as `.bak`.
|
||||
- `src/emc/rs274ngc/rs274ngc_pre.cc` restores parameter files through
|
||||
`Interp::restore_parameters()`.
|
||||
- `src/emc/rs274ngc/rs274ngc_pre.cc` saves parameter files through
|
||||
`Interp::save_parameters()`, including `filename + ".new"` and
|
||||
`filename + ".bak"` behavior.
|
||||
- `src/emc/rs274ngc/rs274ngc_pre.cc` reads program blocks through `read_text()`
|
||||
after the browser bridge mirrors the OPFS program into the WASM filesystem.
|
||||
|
||||
## App Coverage
|
||||
|
||||
| Entry | Boundary |
|
||||
| --- | --- |
|
||||
| `web/index.html` | Loads the browser app module and exposes only the LinuxCNC backend selector. |
|
||||
| `web/src/app.js` | Creates a required OPFS-backed simulator workspace and parses browser programs with a LinuxCNC parameter file. |
|
||||
| `web/test-browser-wasm-smoke-app-sections.js` | Verifies app-level OPFS program save, parameter save, parameter backup, and reload behavior. |
|
||||
|
||||
## Boundaries
|
||||
|
||||
- The app must use the existing `createWasmSimulator()` OPFS API; it must not
|
||||
add browser filesystem persistence outside OPFS.
|
||||
- The app must persist the current program at `programs/current.ngc`.
|
||||
- The app must persist LinuxCNC parameter state at `parameters/rs274ngc.var`.
|
||||
- The app must require OPFS for browser program parsing and call
|
||||
`parseFileWithParameterFile(programPath, parameterPath, "linuxcnc", ...)`.
|
||||
- The visible backend selector must stay limited to the LinuxCNC RS274 backend.
|
||||
|
||||
## Checks
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
./check-linuxcnc-browser-app-source-map.sh
|
||||
./test-native.sh
|
||||
./test-linuxcnc-source-link.sh
|
||||
```
|
||||
|
||||
`check-linuxcnc-browser-app-source-map.sh` keeps this document, LinuxCNC source
|
||||
anchors, app OPFS paths, app parse routing, and app smoke coverage synchronized.
|
||||
Reference in New Issue
Block a user