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:
@@ -22,6 +22,11 @@
|
||||
* 作者:王建锋
|
||||
* 创建日期:2026-10-25
|
||||
* 修改记录:
|
||||
* v3 2026-11-16 DTU 项目组 「开入开出」页数据源:实时帧尾追加
|
||||
* dio_di_mask/dio_di_valid/dio_do_mask/dio_do_valid
|
||||
* 四字段(板级 8 路开入 + 4 路开出),与 33 点遥信
|
||||
* 位图 yx_bits/yx_valid/yx_dp **刻意互不引用**——前者
|
||||
* 是板级引脚事实,后者是 104 点表语义,见字段注
|
||||
* v1.x 2026-10-27 DTU 项目组 道G task-9:通道六通讯参数注入表
|
||||
* (ui_data_comm_ops_t,通讯设置页消费)。
|
||||
* v1.0 2026-10-25 王建锋 创建(道E task-14:契约 §4 快照层落地;相对契约
|
||||
@@ -55,14 +60,26 @@ extern "C" {
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* 板级开入路数(v3):实时帧 dio_di_mask / dio_di_valid 的位宽依据。
|
||||
* 为什么在契约里再写一个数而不 include App/util/ioboard_di.h:本头是表现层叶子,
|
||||
* 不得 include 任何 App 头(分层门禁拦提交)。两处数字的等值由**写侧**(App 侧唯一
|
||||
* 同时看见两份头的编译单元 App/app/ui_data_feed.c)编译期守卫钉死,BSP 物理上
|
||||
* 自证不了,所以守卫点放在写侧而不是这里 */
|
||||
#define UI_DATA_DI_N 8u
|
||||
/* 板级开出路数(v3):dio_do_mask / dio_do_valid 的位宽依据。等值守卫同上落在写侧
|
||||
* (与 Drivers/BSP/IOBOARD/ioboard.h 的 IOBOARD_DO_KO6/TRIP/ERT/CLZ 四位对表) */
|
||||
#define UI_DATA_DO_N 4u
|
||||
|
||||
/*
|
||||
* 契约版本:结构体字段只允许尾部追加,追加即升此值并在写侧填默认值
|
||||
* (禁止删除或重排字段——页面按名字取,重排是静默错位;
|
||||
* 口径 docs/UI设计/UI_数据供给设计说明.md §4.3)
|
||||
*/
|
||||
/* v2(2026-10-26,道F task-1):ui_data_par_t 尾追加 cal_block——版本号是页面与
|
||||
* 写侧唯一的对齐凭据,追加字段不升版 = 老页面按新帧长 memcpy 时静默错位 */
|
||||
#define UI_DATA_VER 2u
|
||||
* 写侧唯一的对齐凭据,追加字段不升版 = 老页面按新帧长 memcpy 时静默错位
|
||||
* v3(2026-11-16):「开入开出」页——ui_data_rt_t 尾追加 dio_di_mask/dio_di_valid/
|
||||
* dio_do_mask/dio_do_valid(板级开入开出,208 B → 212 B,见 ui_data_rt_t 字段注) */
|
||||
#define UI_DATA_VER 3u
|
||||
|
||||
/* ── 通道数量 ─────────────────────────────────────────────────────────────── */
|
||||
|
||||
@@ -159,6 +176,35 @@ typedef struct {
|
||||
uint8_t clock_ok; /* 0 = 墙钟无效(RTC 异常/未对时) */
|
||||
uint8_t rsv3[3]; /* 预留(对齐填充) */
|
||||
char clock[UI_DATA_CLOCK_LEN]; /* "YYYY-MM-DD HH:MM:SS";无效时空串 */
|
||||
/* ── v3 尾追加:板级开入 / 开出(「开入开出」页的数据源)──────────────────
|
||||
* 为什么另开四个字段而不复用上面的 yx_bits/yx_valid:那三张位图是**104 点表
|
||||
* 语义**(bit i = 点表第 i 点),板级 ioboard 的 8 路开入与点表没有任何映射关系
|
||||
* (点表 YX1~4 开关位置点在 V0.1 恒无效)。把板级开入塞进点表位图 = 拿物理引脚
|
||||
* 冒充点表事实,主站与屏会按两套语义读同一组位——那正是本仓最忌的静默错。
|
||||
* 两族字段互不引用,页面各画各的,谁改了谁也不会悄悄改到另一边。
|
||||
* 字段宽度:8 路 / 4 路各一字节即够,两块 mask/valid 合占 4 B,struct 由 208 B
|
||||
* 变 212 B(对齐只到 4,无尾部填充);写侧共用缓冲 s_scr 因此 +4 B(宿主机单测
|
||||
* TC-UIDATA-021g 钉尺寸,改字段要同步那里) */
|
||||
uint8_t dio_di_mask; /* 8 路开入去抖后状态:bit n = 通道 n 合(1)。
|
||||
* 来源 = defaultTask 的 DI 去抖快照
|
||||
* (App/util/ioboard_di.h),写侧按序号协议
|
||||
* 取一致值,不直接读引脚 */
|
||||
uint8_t dio_di_valid; /* 1 = 本次读到一致且有效的开入快照;0 = 无数据源
|
||||
* (未登记)或写入过程中读失败。**0 时
|
||||
* dio_di_mask 仍是上一次的有效值,但不得当
|
||||
* 新数据用**——铁律"读失败不得当全 0 上报"
|
||||
* 的落点:全 0 在现场会被读成"开入全部复归"。
|
||||
* 与本文件头的 valid(首帧)不是同一件事 */
|
||||
uint8_t dio_do_mask; /* 4 路开出影子寄存器:bit n = 吸合(1)。
|
||||
* 语义位 = IOBOARD_DO_KO6/TRIP/ERT/CLZ
|
||||
* (bit0..bit3)。⚠ 这是**软件意图**(上一次
|
||||
* 成功写入的值),不是继电器机械吸合实测——
|
||||
* 本平台没有辅助触点回读通路,页面措辞
|
||||
* 不得让人以为读到了机械反馈 */
|
||||
uint8_t dio_do_valid; /* 1 = 本帧已从驱动取到影子寄存器;0 = 未取到
|
||||
* (此时 dio_do_mask 不可消费)。取影子寄存器
|
||||
* 零硬件访问,正常恒 1;保留 0 态是为了让
|
||||
* "读失败"与"全部释放"在屏上仍能区分 */
|
||||
} ui_data_rt_t;
|
||||
|
||||
/* ── 通道二:参数(写侧节拍 = 定值校验和变化才发)────────────────────────── */
|
||||
|
||||
Reference in New Issue
Block a user