From 8fde79c071eeff431ab4446638fab2194433e4cb Mon Sep 17 00:00:00 2001 From: hulk Date: Mon, 28 Sep 2026 18:51:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20v0.4.2=20=E4=B8=B2=E5=8F=A3=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=B8=85=E7=A9=BA=E6=8C=89=E9=92=AE=E5=B9=B6=E5=85=A5?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E8=A1=8C=E5=AF=B9=E9=BD=90=EF=BC=9B=E6=81=A2?= =?UTF-8?q?=E5=A4=8D=E5=85=89=E6=9C=BA=E5=91=BD=E4=BB=A4=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=8E=92(=E5=BC=80/=E5=85=B3=E5=85=89?= =?UTF-8?q?=E6=9C=BA=E7=AD=897=E4=B8=AA,=20v0.4.0=20=E9=87=8D=E5=86=99?= =?UTF-8?q?=E6=97=B6=E4=B8=A2=E5=A4=B1)=EF=BC=9B=E9=87=8D=E6=89=93?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DLPilot/AGENTS.md | 12 ++++++++++++ DLPilot/src/app_fluent.py | 21 ++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/DLPilot/AGENTS.md b/DLPilot/AGENTS.md index a7da79c..b45b8a4 100644 --- a/DLPilot/AGENTS.md +++ b/DLPilot/AGENTS.md @@ -162,6 +162,9 @@ python publish_gitea.py ../release/DLPilot-v<版本>-win64.zip --replace --insec - GUI 与 hdmi_source.ps1 各自独立实现显示器枚举,行为可能微差(GUI 与 `-List` 序号一致, 但与"设置"面板序号无保证);多屏操作前先确认序号; - `pattern_slots.json` 兼容两种历史格式,写出只写新格式(详见 §3.11); +- `--seconds` 冒烟在已有 DLPilot 实例(含用户开着的 exe)运行时会"挂起":run_gui + 检测到单实例互斥后弹模态框等点击。无头验证改用直启 `App(5)` 的等效脚本,或先关实例; + 重打包同理——build_exe.py 会 taskkill 同名进程,等于替用户关掉开着的实例; - 旧版 `app_gui.py` 仅保留作历史对照,当前入口使用 `app_fluent.py`;新增或修改界面时 应遵循 PySide6-Fluent-Widgets 的控件和 Qt 布局,不要把旧版 CustomTkinter 依赖带回入口。 @@ -218,3 +221,12 @@ python publish_gitea.py ../release/DLPilot-v<版本>-win64.zip --replace --insec 验证:compileall / selftest_rs485 ALL PASS / 离屏断言(空串口提示、长文本下标签 最小宽度<300 可换行)/ GUI 冒烟 / 新 exe `--seconds 5` exit 0;v0.4.1 exe(15:05) 与 zip 均已用该修复重打。 +- 2026-09-28 v0.4.2 两处 UI 小修:①"串口数据 · 收发日志"卡的"清空"按钮原本自占 + 一行(_card 的标题行是独立 row,按钮行加在其下),与标题错位且多占一行高度—— + `_card()` 增加 `trailing` 参数把按钮并入标题行右端;②v0.4.0 fluent 重写把旧版 + app_gui.py 光机命令卡首行的快捷按钮排(开光机/关光机/查版本/软件重启/开TEC/ + 关TEC/TEC33.0°C)整行丢失,开/关光机只能走预设下拉——本次按旧版排布原样恢复, + 位于电流行与预设行之间(命令直发 `_dlpc_send`,无新增协议逻辑)。 + 验证:compileall / selftest_rs485 / selftest_theme ALL PASS;离屏渲染断言"清空" + 与标题垂直中心差 0px、7 个快捷按钮齐全;真实桌面冒烟 exit 0。APP_VERSION → 0.4.2 + 并重打包。 diff --git a/DLPilot/src/app_fluent.py b/DLPilot/src/app_fluent.py index ec1ab62..6ebaa91 100644 --- a/DLPilot/src/app_fluent.py +++ b/DLPilot/src/app_fluent.py @@ -63,7 +63,7 @@ import edid_parse import patterns APP_NAME = "DLPilot" -APP_VERSION = "0.4.1" +APP_VERSION = "0.4.2" REPO_URL = "https://gitea.hulk.wang/hulk/HW-Debug-Tools" MONO = QFont("Consolas", 10) CHIP_IDLE = "#666666" @@ -210,7 +210,7 @@ class App(QMainWindow): button.clicked.connect(callback) return button - def _card(self, title, parent): + def _card(self, title, parent, trailing=None): card = CardWidget(parent) layout = QVBoxLayout(card) layout.setContentsMargins(14, 12, 14, 14) @@ -218,6 +218,8 @@ class App(QMainWindow): row = QHBoxLayout() row.addWidget(StrongBodyLabel(title, card)) row.addStretch(1) + if trailing is not None: + row.addWidget(trailing) layout.addLayout(row) return card, layout @@ -434,11 +436,8 @@ class App(QMainWindow): body.addLayout(params) layout.addWidget(card) - card, body = self._card("串口数据 · 收发日志(译码 + 原始 hex)", self) - row = QHBoxLayout() - row.addStretch(1) - row.addWidget(self._button("清空", self._dlpc_clear)) - body.addLayout(row) + card, body = self._card("串口数据 · 收发日志(译码 + 原始 hex)", self, + trailing=self._button("清空", self._dlpc_clear)) self.txt_dlpc = self._text() self.txt_dlpc.setMinimumHeight(230) body.addWidget(self.txt_dlpc) @@ -472,6 +471,14 @@ class App(QMainWindow): row.addStretch(1) row.addWidget(self._button("查电流", self._query_current)) body.addLayout(row) + # 快捷命令行: v0.4.0 重写时从旧版 app_gui.py 丢失, 开关光机等一发命令 + # 不应只能走预设下拉 + quick = QHBoxLayout() + for name, cmd in (("开光机", "M730S0"), ("关光机", "M730S1"), ("查版本", "M999"), + ("软件重启", "M888"), ("开TEC", "M7S0"), ("关TEC", "M7S1"), + ("TEC33.0°C", "M8S330")): + quick.addWidget(self._button(name, lambda checked=False, c=cmd: self._dlpc_send(c))) + body.addLayout(quick) preset_row = QHBoxLayout() self._dlpc_presets = [(n, cmd) for n, cmd, _ in dlpc_rs485.PRESETS] self.cbo_dlpc_cmd = ComboBox(card)