feat(ui): add DI/DO status page showing 8 inputs and 4 outputs
New read-only content page under 实时数据 → 开入开出 showing the board's
8 opto inputs (DI_A..DI_H, 合/分) and 4 relay outputs (KO6/TRIP/ERT/CLZ,
吸合/释放) as a 12-row list, 8 rows per page, 2 pages.
Data path reuses the existing de-bounced input poll instead of adding a
second hardware reader:
defaultTask (50 ms) → ioboard_di_snap_publish() → de-bounced snapshot
→ ioboard_di_snap_lookup() [new registration channel]
→ ui_data_feed_tick() (uiTask, 200 ms)
→ ui_data_rt_t.dio_di_* / dio_do_*
No new critical sections, no new hardware access on the UI path. Outputs
come from the volatile shadow register (a memory read, no lock).
Semantic honesty, recorded in ui_page_di_do.c and README §6:
· Output state is the software shadow register (ODR mirror), NOT a
mechanical contact feedback — this platform has no auxiliary contact
readback path. ioboard_do_read_level() also reads ODR, so comparing
the two is tautological.
· IOBOARD_DO_LEVEL_ACTIVE polarity has not been checked against the
schematic.
· Input bit order has not been verified by manual shorting. The
2026-11-16 run read 0x00 eight times because the operator had no time
to short each channel — the data path itself was fine.
· Board-level inputs are deliberately kept out of the 33-point telemetry
bitmap (IEC 104 point-table semantics); the two have no mapping.
Invalid snapshots render "--", never 合/分 or 吸合/释放: painting "no data"
as "all inputs released" would tell the field the inputs are open when we
simply failed to read them.
Board-verified 2026-11-16: page 1 shows 分 on all 8 inputs, page 2 shows
释放 on all 4 outputs, page footer and paging correct. Input bit order
still pending manual shorting.
Also: regenerate ui_font_cn_12 for 吸/释, add golden references for both
pages, align check_menu_rows.py L2 geometry with the now-4-item submenu,
and register the new source file in both the Keil project and CMake.
Reviewed independently; zero blocking findings.
This commit is contained in:
@@ -128,6 +128,7 @@ 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 工程)
|
||||
|
||||
@@ -78,6 +78,12 @@ 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"),
|
||||
# SOE 记录(node 51,记录查询下第 1 项):6 下进记录查询 → e → 首项 SOE记录 → e;
|
||||
# 数据 = simulator/main.c 的固定 3 条假记录(含 type 7 未标定闭锁这条非元件支路)
|
||||
("soe", "dddddde e"),
|
||||
|
||||
@@ -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(实时数据 3 子项),根框不变
|
||||
MENU-STATE-04 "de" 开 L2(实时数据 4 子项),根框不变
|
||||
MENU-STATE-05 "ded" L2 sel=1
|
||||
MENU-STATE-06 "des" 返回 → 须与 MENU-STATE-01 全像素一致(销毁/重建一致性)
|
||||
MENU-STATE-07 "ddes" 根框 sel=2、L2 已毁 → 须与 MENU-STATE-02 全像素一致
|
||||
@@ -90,10 +90,10 @@ def root_row_strip(i):
|
||||
return (ROOT_X0 + 1, ROOT_X0 + ROOT_W - 2, y1, y1 + ROW_H - 1)
|
||||
|
||||
|
||||
def l2_geom(root_sel, cnt):
|
||||
def l2_geom(root_sel, cnt, max_name_px=36):
|
||||
x0 = ROOT_X0 + ROOT_W - 1 # 65(共享边框列)
|
||||
y0 = ROOT_Y0 + 1 + root_sel * ROW_H # 顶对齐父框选中行行顶
|
||||
w = 42 # 2+36+2 + 2 边框(3 汉字行)
|
||||
w = 2 + max_name_px + 2 + 2 # 左右内边距 + 最长名宽 + 2 边框
|
||||
h = cnt * ROW_H + 2
|
||||
return x0, y0, w, h
|
||||
|
||||
@@ -182,11 +182,14 @@ 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 行右侧(3 子项、无箭头),根框区与 MENU-STATE-01 相同 ---
|
||||
# --- 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),菜单加减叶子必改这里。
|
||||
p = S["MENU-STATE-04"]
|
||||
lx0, ly0, lw, lh = l2_geom(1, 3)
|
||||
lx0, ly0, lw, lh = l2_geom(1, 4, 48)
|
||||
border_check(p, lx0, ly0, lw, lh, "MENU-STATE-04-L2框")
|
||||
for i in range(3):
|
||||
for i in range(4):
|
||||
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):
|
||||
@@ -198,8 +201,8 @@ def main():
|
||||
|
||||
# --- MENU-STATE-05:L2 sel=1,根框区仍与 MENU-STATE-01 同 ---
|
||||
p = S["MENU-STATE-05"]
|
||||
lx0, ly0, lw, lh = l2_geom(1, 3)
|
||||
for i in range(3):
|
||||
lx0, ly0, lw, lh = l2_geom(1, 4, 48)
|
||||
for i in range(4):
|
||||
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.
Reference in New Issue
Block a user