Files
cnc_wams/work/working9-执行过程按钮/06-决策记录.md
2026-07-07 16:46:39 -04:00

44 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 06-决策记录
## 记录规则
当出现会影响后续实现路线的技术取舍时追加记录。建议格式:
```text
## DR-W9-xxx - 标题
- 日期:
- 状态:
- 背景:
- 决策:
- 理由:
- 后续影响:
```
## DR-W9-001 - working9 以 Run 为主线但覆盖完整控制链
- 日期2026-07-07
- 状态:已采纳
- 背景:用户目录名为 `working9-执行过程按钮`,来源文档覆盖 AXIS 主控制按钮包括急停、上电、Home、执行、暂停、单步。
- 决策working9 文档以“执行 Run 按钮”为主线同时把急停、上电、Home、Pause、Resume、Step 纳入前置条件和执行过程控制。
- 理由LinuxCNC 中 Run 不能脱离 `STATE_ON``MODE_AUTO`、homed、program open、pause/step 状态机单独成立。只写 Run 会导致后续实现继续用 Web `runState` 绕过真实 task/motion 门禁。
- 后续影响:任务矩阵中的 Run 验收必须包含前置链和运行期链;不能只验证点击 Run 后前端开始播放。
## DR-W9-002 - Web `runState` 只能作为投影状态
- 日期2026-07-07
- 状态:已采纳
- 背景AXIS GUI 通过 `linuxcnc.stat().poll()` 读取 `emcStatus`,按钮本身不保存真实 task/motion 状态。
- 决策Web 中 `runState`、按钮 active、当前行等 UI 状态应由 task/HAL WASM status 投影生成。
- 理由:如果点击 Run 后直接写 `runState=running`,会掩盖 ESTOP、未上电、未 homed、无 program plan 等拒绝条件,形成假执行状态。
- 后续影响:后续代码修改需要优先删除或隔离直接写 running/paused/done 的分支,改为等待 WASM status 同步。
## DR-W9-003 - G-code 到 motion 不再扩展 JS 正则 fallback
- 日期2026-07-07
- 状态:已采纳
- 背景:来源指南指出 `wasm-port` 应复用 LinuxCNC source当前从 G-code 文本中用简单规则派生 motion 属于语义漂移风险。
- 决策Run 所需 motion plan 应来自 LinuxCNC interpreter canonical output 或受控 WASM 适配层。没有 plan 时返回明确错误,不把 JS 正则解析作为长期执行路径。
- 理由Run 按钮的验收对象是 LinuxCNC task/interpreter/motion 链,不是 Web 播放 G-code 文本。
- 后续影响:`W9-003` 必须明确 program open 与 canonical plan 边界;关闭任务前要有无 plan 拒绝 Run 的测试证据。