mapping_table.create_mapping_tab 是单个 632 行的 tkinter 闭包巨型函数, 把其中相对独立的 5 个块抽到 mapping_table_helpers: - open_entry_detail_window:弹出条目详情(原代码出现 2 次) - compute_card_layout:根据画布宽度计算列数和卡片宽度 - set_card_bg:批量切换 widget + 子 widget 背景色 - make_card_event_handlers:单卡片的 click/dbl/enter/leave 处理器工厂 - render_card_labels:渲染单卡片内的 title + meta + body label 逻辑保持等价,只是提取闭包消除重复嵌套。新增 8 个单元测试覆盖 compute_card_layout / API 表面,1026 → 1034 用例全过。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GUI 目录
本目录包含项目的所有图形用户界面相关文件。
文件列表
- gui_app.py - 主GUI应用程序(基于tkinter/ttkbootstrap)
- gui_core.py - GUI核心功能模块(参数处理、设备管理、配置读写等)
- web_gui.py - Web GUI服务器
- webgui_launcher.py - Web GUI启动器
使用方法
桌面GUI
python gui/gui_app.py
Web GUI
python gui/webgui_launcher.py