Files
STM32F4-Base/simulator/tests
wandering1 515db819ab feat(ui): fold board inputs and outputs into the telemetry page
The 12 board-level rows now live at the end of the 遥信量 page instead of
a separate 开入开出 page: 8 opto inputs (DI_A..DI_H) and 4 relay outputs
(KO6/TRIP/ERT/CLZ). 33 rows become 45, five pages become six. The
standalone page, its menu entry, its golden references and both build
registrations are removed.

Folding the display is not folding the point table. The board rows
render from dio_di_* / dio_do_* and stay out of yx_bits / yx_valid /
yx_dp: any change to those carriers is provably absent from this diff.
IEC 104 mapping and YX_VALID_MASK are untouched, so nothing new is
reported to a master station.

Input polarity was wrong and is fixed here. On this board a 24 V input
drives the opto, which pulls the 74HC165 pin LOW, so the raw mask is
inverted relative to "has signal". The bit assembly only reordered bits;
nothing converted the level. The screen showed 分 on every channel no
matter what the operator drove in. Polarity now converts once, in the
driver, behind IOBOARD_DI_LEVEL_ACTIVE (0 = active low), so callers see
1 = has signal for both inputs and outputs.

Verified on the board: page 5 shows YX33 followed immediately by DI_A,
crossing the 33-point boundary with no drift; DI_C reads 合 because the
operator's signal is on channel C, the other seven read 分; page 6 shows
DI_H then all four outputs 释放. Page rows end at y=134, the footer
starts at y=144.

Input bit order is only partly verified: channel C was confirmed against
a real signal, the other seven have not been exercised channel by
channel. The board detects the presence of 24 V, not contact closure,
and the output rows show the shadow register (our intent) rather than
mechanical contact feedback. All three limits are recorded in the page
header and in the IOBOARD README.

Also adds a polarity guard to the host tests: the input polarity was
flipped once already, and until now no assertion would have caught a
silent re-flip, since only the DO side was pinned.
2026-11-16 23:30:35 +08:00
..

simulator/tests/ — UI 模拟器无头回归测试

PC 端无头(headless)UI 像素回归测试:在模拟器中渲染各页面,与黄金参考图比对, 检测 UI 改动是否引入像素级回归。属于 ui-verify skill 五步门禁的一部分。

文件一览

文件 作用
check_menu_rows.py 菜单像素回归:渲染菜单行 → 与黄金参考比对
check_content_pages.py 内容页回归:各内容页渲染比对
check_remo_sink.py 推流(RemoDispBus)回归:接收端渲染比对
regen_ref_png.py 由 ref/*.bin 批量出目检 PNG(不产生基准;基准由 check_content_pages.py --update 刷)
ref/*.bin 像素黄金参考(入库):74 张 × 3200 B,160×160 单色打包(2026-10-29 录波 UI 道 +6 张;2026-11-04 SNTP 设置页 +8 张)

使用方式

# 跑回归(按 ui-verify skill 流程)
& '.venv\Scripts\python.exe' simulator/tests/check_menu_rows.py
& '.venv\Scripts\python.exe' simulator/tests/check_content_pages.py

# UI 有意变更、确认无误后重建基准
& '.venv\Scripts\python.exe' simulator/tests/regen_ref_png.py

⚠️ 注意

  • 重建黄金参考前必须确认变更是有意的——否则会把 bug 固化成"基准"
  • ref/*.bin 已入库:刷参考 = 改基准,git diff 里会显形,提交正文必须写明为什么变
  • ref/*.png 只是给人看的派生物(已忽略),刷完 .bin 要重跑 regen_ref_png.py 才对得上
  • UI 改动一律走 ui-verify skill 五步门禁(regression 是其中一步)
  • 依赖模拟器已构建(simulator/build_sim.bat)

相关文档

  • docs/UI设计/UI_自动化测试流程.md — ui-verify 五步门禁
  • docs/UI设计/LVGL模拟器部署与使用说明.md