515db819ab
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.
101 lines
4.4 KiB
C
101 lines
4.4 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_sntp.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_wave_manual.h"
|
|
#include "ui_page_wave_play.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 强制复归 */
|
|
{ 26u, &ui_page_wave_manual_desc }, /* node 26 手动录波 */
|
|
{ 27u, &ui_page_clear_desc }, /* node 27 清除记录 */
|
|
{ 29u, &ui_page_comm_desc }, /* node 29 通讯设置 */
|
|
{ 30u, &ui_page_net_cfg_desc }, /* node 30 网口设置 */
|
|
{ 31u, &ui_page_sntp_desc }, /* node 31 SNTP设置 */
|
|
{ 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 运行报告 */
|
|
{ 42u, &ui_page_wave_play_desc }, /* node 42 录波回放 */
|
|
};
|
|
|
|
/*
|
|
* 函数功能:查叶子节点绑定的内容页描述符
|
|
* 入口参数: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;
|
|
}
|