94b0d79026
本笔含两组收尾工作(同一工作区内交错在 6 个共享文档/门禁配置里, 拆开会产生"文档声称的页数与树里黄金数不一致"的中间提交,故合为一笔): 一、UI 补齐(清单清空) - 新建 6 个内容页模块:ui_page_accident / oper / alarm / start / yk 复用 ui_w_records 共享组件(分页、空态"无记录"、按实例读盘缓存), 记录层与五个写入点已由道F task-10 / 道G task-12 落地,本批只补页面; ui_page_runreport 为 13 行 2 页只读统计,四个数逐个挂范围标签 (自电池周期 / 本次开机),boot_ready=0 显 "--" 不显 0。 - 数据面:ui_data_info_t 尾部追加 9 字段,ui_data_feed 用 boot_stats_get() + iec104_serv_get_stats() 纯搬运;模拟器填确定值假数据 (差异登记 docs/测试说明/模拟器差距清单.md §2.3 两行)。 - 接线:菜单树 6 叶绑 #page=,绑定叶 22→28、UI_PAGE_MAP_COUNT=28; 字库 185→218 字 / 280→313 字形;双端注册 uvprojx +30、CMakeLists +6。 - 回归:内容页黄金 53→60(含 runreport_p2 真拍第 2 页),文本断言 425 正向 / 36 反向;存量 53 张逐字节零漂移;记录 5 页各用独立空目录 (模拟器把操作留痕写进 cwd 的 sim_oper.log,共用 tmp 会让空态拍不到)。 二、数据可信销项 + 「数据可信」任务卡号整族清退 - 删除已闭环的"已知电压注入验证"行与闭环结论块(证据在 docs/硬件平台/ADC通道映射说明.md §8.1 与 docs/测试说明/ADC前端注入验证流程.md §5~§7),§5 标识列改语义短语。 - 卡 0/0b/1~12 共 14 个号全仓 288 站点 / 56 文件清退成语义短语, 代码注释、测试、门禁配置与文档一并改;换算表入 docs/编号规范.md §9.3。 这一族是中文前缀,不进 check_ids 语料,刻意不入 id_aliases.json。 验证(实测) - @build 0 错 0 警:Code=236456 RO=28124 RW=1876 ZI=137084; RAM +464 B(RW +304 / ZI +160),RW_IRAM1 62.2% / RW_CCM 87.9%, 体积同码凭证与 RAM 台账已回填。 - check_menu_rows 8 状态 rc=0(池 5368/5448 常量未动); check_content_pages 60 页 rc=0;check_font_charset / registration / coding-standard / bom-drift / mojibake / doc-links --all / layer-deps / nested-comment 全 rc=0;check_ids --strict 无错误;主机单测 ui_data 295 / boot_stats 21 / sys_log_mcu 141 / soe 32 / soe_store 27。 未做(不是遗漏) - 六页真机判据(真记录翻页、掉电保持、清除后归零、boot_count 自增、 拔 RTC 电池落 RESTARTED、IWDG 复位落 rst_cause、主站连一次 conn_up+1) 已登记 docs/任务规划/登记簿.md §7;模拟器结构上照不到。 - docs/产品需求/产品需求设计文档.md 属另一条在飞改动,本笔不含; 其中我已同步 6 处现状数字(28 叶 / 60 页 / 218 字),随该笔入库。
95 lines
4.1 KiB
C
95 lines
4.1 KiB
C
/*
|
|
* 模块名称:UI 页面注册表(自动生成)
|
|
* 模块功能:叶子节点 → 内容页描述符映射表 + 2 个查询 API(导航逻辑层消费)
|
|
* 适用平台:STM32F407ZGTx / PC 模拟器(共用源码)
|
|
* 作者:王建锋
|
|
* 创建日期:2026-10-15
|
|
* 自动生成:本文件由 tools/menu_gen/gen_menu.py 从 ui_menu_tree.txt 的 #page= 注记生成,请勿手改。
|
|
* 新增一页:菜单树给叶子加 " #page=<模块名>" + 写 ui_page_<模块名>.c,重跑生成器
|
|
*/
|
|
#include "ui_page_registry.h"
|
|
|
|
#include "ui_page_ac.h"
|
|
#include "ui_page_accident.h"
|
|
#include "ui_page_alarm.h"
|
|
#include "ui_page_calib.h"
|
|
#include "ui_page_clear.h"
|
|
#include "ui_page_clock.h"
|
|
#include "ui_page_comm.h"
|
|
#include "ui_page_dc.h"
|
|
#include "ui_page_deadband.h"
|
|
#include "ui_page_device_info.h"
|
|
#include "ui_page_net_cfg.h"
|
|
#include "ui_page_oper.h"
|
|
#include "ui_page_password.h"
|
|
#include "ui_page_reset.h"
|
|
#include "ui_page_runlog.h"
|
|
#include "ui_page_runreport.h"
|
|
#include "ui_page_selftest.h"
|
|
#include "ui_page_soe.h"
|
|
#include "ui_page_start.h"
|
|
#include "ui_page_view_param.h"
|
|
#include "ui_page_view_plate.h"
|
|
#include "ui_page_view_set.h"
|
|
#include "ui_page_view_word.h"
|
|
#include "ui_page_yk.h"
|
|
#include "ui_page_yx.h"
|
|
|
|
const ui_page_entry_t g_ui_page_map[UI_PAGE_MAP_COUNT] = {
|
|
{ 1u, &ui_page_device_info_desc }, /* node 1 装置信息 */
|
|
{ 3u, &ui_page_ac_desc }, /* node 3 交流量 */
|
|
{ 4u, &ui_page_dc_desc }, /* node 4 直流量 */
|
|
{ 5u, &ui_page_yx_desc }, /* node 5 遥信量 */
|
|
{ 8u, &ui_page_view_param_desc }, /* node 8 参数 */
|
|
{ 9u, &ui_page_view_set_desc }, /* node 9 定值 */
|
|
{ 10u, &ui_page_view_word_desc }, /* node 10 控制字 */
|
|
{ 11u, &ui_page_view_plate_desc }, /* node 11 软压板 */
|
|
{ 13u, &ui_page_view_param_desc }, /* node 13 参数 */
|
|
{ 14u, &ui_page_view_set_desc }, /* node 14 定值 */
|
|
{ 15u, &ui_page_view_word_desc }, /* node 15 控制字 */
|
|
{ 16u, &ui_page_view_plate_desc }, /* node 16 软压板 */
|
|
{ 18u, &ui_page_deadband_desc }, /* node 18 遥测死区 */
|
|
{ 19u, &ui_page_calib_desc }, /* node 19 遥测系数 */
|
|
{ 24u, &ui_page_clock_desc }, /* node 24 时钟设置 */
|
|
{ 25u, &ui_page_reset_desc }, /* node 25 强制复归 */
|
|
{ 27u, &ui_page_clear_desc }, /* node 27 清除记录 */
|
|
{ 29u, &ui_page_comm_desc }, /* node 29 通讯设置 */
|
|
{ 30u, &ui_page_net_cfg_desc }, /* node 30 网口设置 */
|
|
{ 33u, &ui_page_soe_desc }, /* node 33 SOE记录 */
|
|
{ 34u, &ui_page_accident_desc }, /* node 34 事故记录 */
|
|
{ 35u, &ui_page_oper_desc }, /* node 35 操作记录 */
|
|
{ 36u, &ui_page_alarm_desc }, /* node 36 保护告警 */
|
|
{ 37u, &ui_page_start_desc }, /* node 37 保护启动 */
|
|
{ 38u, &ui_page_yk_desc }, /* node 38 遥控记录 */
|
|
{ 39u, &ui_page_selftest_desc }, /* node 39 自检记录 */
|
|
{ 40u, &ui_page_runlog_desc }, /* node 40 运行记录 */
|
|
{ 41u, &ui_page_runreport_desc }, /* node 41 运行报告 */
|
|
};
|
|
|
|
/*
|
|
* 函数功能:查叶子节点绑定的内容页描述符
|
|
* 入口参数:node - 菜单叶子节点下标 uint8_t
|
|
* 返回值:页面描述符;未绑定返回 NULL const content_page_def_t *
|
|
* 限定条件:无(越界 node 不会命中任何条目,直接 NULL)
|
|
* 函数说明:线性扫描绑定表(条目 = 有内容页的叶子,个位数量级)
|
|
*/
|
|
const content_page_def_t *ui_page_registry_for(uint8_t node) {
|
|
for (uint8_t i = 0u; i < UI_PAGE_MAP_COUNT; i++) {
|
|
if (g_ui_page_map[i].node == node) {
|
|
return g_ui_page_map[i].desc;
|
|
}
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
/*
|
|
* 函数功能:取密码页描述符(需密码叶子统一进这一页,非节点绑定)
|
|
* 入口参数:无
|
|
* 返回值:密码页描述符 const content_page_def_t *
|
|
* 限定条件:无
|
|
* 函数说明:取值来自 ui_menu_tree.txt 的 @password 指令(生成期解析,运行期零开销)
|
|
*/
|
|
const content_page_def_t *ui_page_registry_password(void) {
|
|
return &ui_page_password_desc;
|
|
}
|