Files
wasm-simulator/docs/linuxcnc-switchkins-remap-source-map.md
cnc 8fe468ba3c 参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke
结论:补齐 switchkins/remap 源映射守卫,接入 native/source-link/聚合检查;未扩展 smoke 行为。验证通过:./check-linuxcnc-switchkins-remap-source-map.sh、./check-linuxcnc-switchkins-remap-table.sh linuxcnc-kinematics-source-files.txt、./test-native.sh、./test-linuxcnc-source-link.sh、CNC_SIM_ALL_NATIVE_GUARDRAILS_ONLY=1 ./test-all-native.sh。
2026-06-04 15:36:19 +08:00

49 lines
2.3 KiB
Markdown

# LinuxCNC switchkins/remap source map
This map records the source basis for generated M428/M429/M430 switchkins
aliases and config cases. It is a generator/table map only; it must not add new smoke parser behavior or expose LinuxCNC source-only assets as browser API fields.
## LinuxCNC Source Basis
- `configs/sim/**.ini` files with `REMAP = M428`, `REMAP = M429`, or
`REMAP = M430` provide the switchkins configuration roots.
- `remap_subs/{428,429,430}remap.ngc` files provide the adjacent
`#<kinstype>` assignments.
- `src/hal/utils/halcmd_commands.cc` `do_loadusr_cmd()` and
`getopt("+wWin:")` define the `loadusr` option model used by the generator.
- `src/hal/utils/halcmd_completion.c` documents common `loadusr`
`-W/-Wn/-w/-iw` forms preserved by the generator.
## Generated Coverage
| Output | Count | Source coverage role |
| --- | ---: | --- |
| `core/src/linuxcnc_switchkins_remap_table.inc` | 177 | Generated switchkins aliases from LinuxCNC INI/HAL/remap sources. |
| `core/tests/linuxcnc_switchkins_remap_config_cases.inc` | 616 | Generated C++ config cases for accepted switchkins config fields. |
| `web/public/linuxcnc_switchkins_remap_config_cases.json` | 616 | Generated browser-readable config cases mirroring the C++ cases. |
| LinuxCNC M428/M429/M430 remap sources | 31 | LinuxCNC `#<kinstype>` source assignments. |
| LinuxCNC switchkins REMAP INI sources | 16 | LinuxCNC configs that declare M428/M429/M430 remaps. |
## Boundaries
- `[EMCIO] TOOL_TABLE` entries are source coverage only. They must stay in the kinematics manifest as `tooldata` entries and must not become generated switchkins aliases, config fields, or browser option keys.
- `asset`, `metadata`, and `tooldata` inputs referenced by switchkins configs
are source coverage, not browser API surface.
- Generated tables must continue to derive M428/M429/M430 kinstypes from
LinuxCNC remap `#<kinstype>` assignments, not from hand-authored behavior.
## Checks
Run:
```bash
./check-linuxcnc-switchkins-remap-source-map.sh
./check-linuxcnc-switchkins-remap-table.sh linuxcnc-kinematics-source-files.txt
./test-native.sh
./test-linuxcnc-source-link.sh
```
`check-linuxcnc-switchkins-remap-source-map.sh` keeps this document, generator
source anchors, generated output counts, and source-only `TOOL_TABLE` boundary
synchronized.