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
-1
View File
@@ -128,7 +128,6 @@ set(UI_SOURCES
${UI_DIR}/ui_page_wave_manual.c
${UI_DIR}/ui_page_wave_play.c
${UI_DIR}/ui_page_sntp.c
${UI_DIR}/ui_page_di_do.c
)
# 运行/自检记录引擎(双端共享核心 + 平台存储后端;MCU 端编 sys_log_mcu.c,见 Keil 工程)
+58 -8
View File
@@ -78,12 +78,11 @@ PAGES = [
# yxp2 再多按 8 次下移,让选中行跨过页边界落到第 2 页首行
("yx", "dedde"),
("yxp2", "dedde dddddddd"),
# 开入开出(node 6,实时数据下第 4 项 = 遥信量之后):d 到实时数据 → e 进(选中交流量)
# → ddd 到开入开出 → e 开页。12 行 / 8 行每页 = 2 页:第 1 页是 8 路开入(DI_A..DI_H),
# 第 2 页是 4 路开出(KO6/TRIP/ERT/CLZ)+ 4 行空白;di_do_p2 再按 8 次下移让选中行
# 落到 row 8 = 第 2 页窗口顶行(first = (8/8)*8),页脚随之变"第 2 页,共 2 页"
("di_do", "deddd e"),
("di_do_p2", "deddd e dddddddd"),
# 遥信页 33→45 行(板级开入开出 12 行追加在末尾),8 行/页 → 6 页:
# 第 5 页 = row32(过流Ⅲ段) + row33..39(DI_A..DI_G),第 6 页 = row40(DI_H) + row41..44(KO6/TRIP/ERT/CLZ)。
# 每段 dddddddd = 8 次下移翻一页;从第 1 页到第 6 页共 5 段。
("yxp5", "dedde dddddddd dddddddd dddddddd dddddddd"),
("yxp6", "dedde dddddddd dddddddd dddddddd dddddddd dddddddd"),
# SOE 记录(node 51,记录查询下第 1 项):6 下进记录查询 → e → 首项 SOE记录 → e;
# 数据 = simulator/main.c 的固定 3 条假记录(含 type 7 未标定闭锁这条非元件支路)
("soe", "dddddde e"),
@@ -421,7 +420,7 @@ TEXTS = {
("r6值", "--", (108, 122), False),
("r7名", "YX8", (122, 136), False),
("r7值", "--", (122, 136), False),
("页脚", "第 1 页,共 5 页", (140, 160), False),
("页脚", "第 1 页,共 6 页", (140, 160), False),
],
"yxp2": [
("标题", "遥信量", (0, 24), False),
@@ -441,7 +440,43 @@ TEXTS = {
("r6值", "复归", (108, 122), False),
("r7名", "过流Ⅰ段", (122, 136), False),
("r7值", "复归", (122, 136), False),
("页脚", "第 2 页,共 5 页", (140, 160), False), # 选中行落到第 2 页首行(YX9);页码同时钉住 33/8 = 5 页
("页脚", "第 2 页,共 6 页", (140, 160), False), # 选中行落到第 2 页首行(YX9);页码同时钉住 45/8 = 6 页
],
# 第 5 页:row32 = YX33,row33..39 = DI_A..DI_G(板级开入,模拟器无数据源 → 值恒 --)
"yxp5": [
("标题", "遥信量", (0, 24), False),
("r0名", "YX33", (24, 38), True),
("r0值", "--", (24, 38), True),
("r1名", "DI_A", (38, 52), False),
("r1值", "--", (38, 52), False),
("r2名", "DI_B", (52, 66), False),
("r2值", "--", (52, 66), False),
("r3名", "DI_C", (66, 80), False),
("r3值", "--", (66, 80), False),
("r4名", "DI_D", (80, 94), False),
("r4值", "--", (80, 94), False),
("r5名", "DI_E", (94, 108), False),
("r5值", "--", (94, 108), False),
("r6名", "DI_F", (108, 122), False),
("r6值", "--", (108, 122), False),
("r7名", "DI_G", (122, 136), False),
("r7值", "--", (122, 136), False),
("页脚", "第 5 页,共 6 页", (140, 160), False),
],
# 第 6 页:row40 = DI_H,row41..44 = KO6/TRIP/ERT/CLZ(开出,模拟器无 ioboard → --)
"yxp6": [
("标题", "遥信量", (0, 24), False),
("r0名", "DI_H", (24, 38), True),
("r0值", "--", (24, 38), True),
("r1名", "KO6", (38, 52), False),
("r1值", "--", (38, 52), False),
("r2名", "TRIP", (52, 66), False),
("r2值", "--", (52, 66), False),
("r3名", "ERT", (66, 80), False),
("r3值", "--", (66, 80), False),
("r4名", "CLZ", (80, 94), False),
("r4值", "--", (80, 94), False),
("页脚", "第 6 页,共 6 页", (140, 160), False),
],
# ── 批 3:参数定值 → 查看 四页(数据 = prot_set 出厂默认,值串带单位)──
# 名与值两列都断:值列断的是换算后的小数位与单位——光看像素,没人会去核 0.95 是不是被
@@ -854,6 +889,21 @@ ABSENT = {
"wave_manual_ro": [
("只读无回报行", "已请求录波", (0, 160), False),
],
# ---- 板级开入开出入遥信页:钉「读失败不得当全 0 上报」这条铁律 ----
# 模拟器构建里 dio_di_valid / dio_do_valid 恒为 0(没有 ioboard 硬件),此时 mask 里可能
# 还留着上一次的值,把它画成「分」/「释放」等于把"没数据"说成"已复归",现场会当成
# 开入全断、继电器全放。这一侧断言不依赖黄金参考——哪天有人为了"好看"改成默认画分,
# 像素参考会跟着 --update 一起变"正确",只有这里会拦。
# inv 取 False:这些行此刻画的是 "--",属于普通行(黑底白字),不是选中白带。
"yxp5": [
("开入无数据不画分", "分", (38, 136), False),
("开入无数据不画合", "合", (38, 136), False),
],
"yxp6": [
("开出无数据不画释放", "释放", (38, 94), False),
("开出无数据不画吸合", "吸合", (38, 94), False),
("开入H无数据不画分", "分", (24, 38), True), # r0 是选中行(白带),inv=True
],
# ---- 道F task-3:反向断言钉的是"规矩本身",不依赖参考图 ----
# 1970 那条是本页最值钱的反向断言:记录侧的占位串一旦漏进时钟页,
# 用户一次"照抄保存"就把 1970 写进 RTC(口径见 ui_page_clock.c 的 CK_INVAL 注)
+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):
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.