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.
This commit is contained in:
2026-11-16 23:30:35 +08:00
parent 2b466b85f0
commit 515db819ab
22 changed files with 309 additions and 366 deletions
+10 -9
View File
@@ -12,7 +12,7 @@ check_menu_rows.py — 自绘菜单 8 状态像素回归(160x160 I1,MSB-firs
MENU-STATE-01 "d" sel=1
MENU-STATE-02 "dd" sel=2
MENU-STATE-03 "ddu" 回退 → 须与 MENU-STATE-01 全像素一致
MENU-STATE-04 "de" 开 L2(实时数据 4 子项),根框不变
MENU-STATE-04 "de" 开 L2(实时数据 3 子项),根框不变
MENU-STATE-05 "ded" L2 sel=1
MENU-STATE-06 "des" 返回 → 须与 MENU-STATE-01 全像素一致(销毁/重建一致性)
MENU-STATE-07 "ddes" 根框 sel=2、L2 已毁 → 须与 MENU-STATE-02 全像素一致
@@ -182,14 +182,15 @@ def main():
for i in range(7):
row_check(p, *root_row_strip(i), band=(i == sel), tag=name + "行%d" % i)
# --- MENU-STATE-04:L2 开于 sel=1 行右侧(实时数据 4 子项、无箭头),根框区与 MENU-STATE-01 相同 ---
# 子项数 4 = 交流量/直流量/遥信量/开入开出(node 6 于 2026-11-16 挂到实时数据下,
# 此前是 3 子项)。子项数与最长名宽都写进几何(h = cnt*15+2,w 随最长名 48 px
# 的「开入开出」变 54),菜单加减叶子必改这里。
# --- MENU-STATE-04:L2 开于 sel=1 行右侧(实时数据 3 子项、无箭头),根框区与 MENU-STATE-01 相同 ---
# 子项数 3 = 交流量/直流量/遥信量(最长名 3 汉字 = 36 px)。子项数与最长名宽都
# 写进几何(h = cnt*15+2,w = 2+max_name_px+2+2),菜单加减叶子必改这里。
# 2026-11-16 曾因"开入开出"挂进来一度是 4 子项 / 48 px;该页已并入遥信页删除,
# 这里随菜单树回落到 3 / 36。
p = S["MENU-STATE-04"]
lx0, ly0, lw, lh = l2_geom(1, 4, 48)
lx0, ly0, lw, lh = l2_geom(1, 3, 36)
border_check(p, lx0, ly0, lw, lh, "MENU-STATE-04-L2框")
for i in range(4):
for i in range(3):
row_check(p, *l2_row_strip(lx0, ly0, i, lw), band=(i == 0), tag="MENU-STATE-04-L2行%d" % i)
# 根框区(x 0..65)须与 MENU-STATE-01 逐像素一致
for y in range(H):
@@ -201,8 +202,8 @@ def main():
# --- MENU-STATE-05:L2 sel=1,根框区仍与 MENU-STATE-01 同 ---
p = S["MENU-STATE-05"]
lx0, ly0, lw, lh = l2_geom(1, 4, 48)
for i in range(4):
lx0, ly0, lw, lh = l2_geom(1, 3, 36)
for i in range(3):
row_check(p, *l2_row_strip(lx0, ly0, i, lw), band=(i == 1), tag="MENU-STATE-05-L2行%d" % i)
for y in range(H):
for x in range(0, ROOT_X0 + ROOT_W):