YD_TrainingCompetition_Api/debug-timeup-stop-projection.md
2026-06-10 15:54:30 +08:00

32 lines
2.2 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.

# Debug Session: timeup-stop-projection
- **Status**: [OPEN]
- **Issue**: 倒计时结束后终端计数器仍可继续计数;点击投屏没有打开新页面。
- **Debug Server**: http://127.0.0.1:7777/event
- **Log File**: .dbg/trae-debug-log-timeup-stop-projection.ndjson
## Reproduction Steps
1. 打开前端配置页并进入比赛页。
2. 点击投屏,观察是否打开新页面进入投屏页。
3. 下载本场并开始比赛。
4. 等待倒计时结束,观察终端设备是否停止计数。
## Hypotheses & Verification
| ID | Hypothesis | Likelihood | Effort | Evidence |
|----|------------|------------|--------|----------|
| A | 到时后后端比赛状态结束了,但停止帧 `0x30` 没有真正发到串口 | High | Med | Pending |
| B | 停止帧发出了,但设备又被后续上报或其他命令重新带回计数状态 | Med | Med | Pending |
| C | WinForms 在到时停机前后还有额外串口时序,当前只发一次 `0x30` 不足以对齐旧逻辑 | High | Med | Rejected |
| D | 投屏按钮执行了,但浏览器拦截了新窗口,或新窗口打开后没有读到投屏会话 | High | Low | Rejected |
| E | 投屏按钮事件没有正确执行到 `window.open`,或投屏 URL/窗口复用逻辑有问题 | Med | Low | Confirmed |
## Log Evidence
- 日志只记录到 2 条 `App.setup` 初始化事件,其中第 2 条显示 `isProjectionWindow=true`、`search=?screen=counter`、`windowName=rope-skipping-projection`
- 这说明投屏页实际上已经被打开并进入投屏模式
- WinForms 全局检索只发现显式停止按钮 `button15_Click` 发送 `0x30`,未发现额外的“到时自动补发其他串口命令”逻辑
- 当前缺少“倒计时到 0”的运行日志,尚未采到 `countdown reached zero / auto stop command requested / stop frame sent to serial`
## Verification Conclusion
- 投屏问题的根因更接近“固定窗口名导致浏览器复用已有投屏窗口”,而不是打不开投屏页
- 已将投屏打开方式改为 `_blank`,满足“每次点击都打开新页面”的诉求
- 到时停机问题仍需一次聚焦复现,以确认是“没触发停机”还是“停机帧已发但设备未停”