feat(DLPilot): v0.3.5 — 电源读数框等长自适应 + 最大化卡顿治理
This commit is contained in:
Binary file not shown.
+34
-27
@@ -40,7 +40,7 @@ CHIP_OK = '#2FA574'
|
||||
CHIP_ERR = '#D9534F'
|
||||
|
||||
APP_NAME = 'DLPilot'
|
||||
APP_VERSION = '0.3.4'
|
||||
APP_VERSION = '0.3.5'
|
||||
REPO_URL = 'https://gitea.hulk.wang/hulk/LT8619C_Debug_Tools'
|
||||
|
||||
|
||||
@@ -238,10 +238,13 @@ class App(ctk.CTk):
|
||||
self.txt_modes.configure(state='disabled')
|
||||
|
||||
# -- EDID 信息 --
|
||||
# CTkTextbox 而非 CTkScrollableFrame+逐行 Label: 后者 40+ 个画布控件,
|
||||
# 窗口最大化时逐个重绘是卡顿主因; 文本框整体重排, 开销低一个量级
|
||||
card, c = self._card(col, 'EDID 信息')
|
||||
card.grid(row=2, column=0, sticky='nsew', pady=(10, 0))
|
||||
self.edid_scroll = ctk.CTkScrollableFrame(c, height=150)
|
||||
self.edid_scroll.pack(fill='both', expand=True)
|
||||
self.txt_edid = ctk.CTkTextbox(c, font=MONO, wrap='none')
|
||||
self.txt_edid.pack(fill='both', expand=True)
|
||||
self.txt_edid.configure(state='disabled')
|
||||
|
||||
# -- 测试图案 --
|
||||
card, c = self._card(col,'测试图案 — 黑底 1:1 居中, 投屏按 ESC 或"停止测试图像"退出',
|
||||
@@ -353,30 +356,37 @@ class App(ctk.CTk):
|
||||
'累加和校验; 全部命令见 README"光机控制"')
|
||||
|
||||
# -- 电源检查 --
|
||||
# 网格对齐两行: col2 为读数框列(weight=1) -> FPDO 色框与功率黑框
|
||||
# 起止位置完全一致(等长), 且随窗口拉伸自适应
|
||||
card, c = self._card(col, '电源检查 — PD 自检 / 功率读数')
|
||||
card.grid(row=2, column=0, sticky='ew', pady=(10, 0))
|
||||
rowp1 = ctk.CTkFrame(c, fg_color='transparent')
|
||||
rowp1.pack(fill='x')
|
||||
ctk.CTkButton(rowp1, text='电源自检', width=90,
|
||||
command=self._pd_selftest).pack(side='left')
|
||||
ctk.CTkLabel(rowp1, text='协议:').pack(side='left', padx=(10, 4))
|
||||
self.chip_pd = ctk.CTkLabel(rowp1, text='PD', width=60, height=26,
|
||||
pwr_grid = ctk.CTkFrame(c, fg_color='transparent')
|
||||
pwr_grid.pack(fill='x')
|
||||
pwr_grid.grid_columnconfigure(2, weight=1)
|
||||
ctk.CTkButton(pwr_grid, text='电源自检', width=90,
|
||||
command=self._pd_selftest).grid(row=0, column=0, sticky='w')
|
||||
proto_cell = ctk.CTkFrame(pwr_grid, fg_color='transparent')
|
||||
proto_cell.grid(row=0, column=1, sticky='w', padx=(10, 0))
|
||||
ctk.CTkLabel(proto_cell, text='协议:').pack(side='left', padx=(0, 4))
|
||||
self.chip_pd = ctk.CTkLabel(proto_cell, text='PD', width=60, height=26,
|
||||
corner_radius=6, fg_color=CHIP_IDLE,
|
||||
text_color=CHIP_IDLE_TEXT)
|
||||
self.chip_pd.pack(side='left')
|
||||
self.var_fpdo = tk.StringVar(value='FPDO: —')
|
||||
self.chip_fpdo = ctk.CTkLabel(rowp1, textvariable=self.var_fpdo, width=150,
|
||||
height=26, corner_radius=6, fg_color=CHIP_IDLE,
|
||||
self.chip_fpdo = ctk.CTkLabel(pwr_grid, textvariable=self.var_fpdo,
|
||||
height=26, corner_radius=6,
|
||||
fg_color=CHIP_IDLE,
|
||||
text_color=CHIP_IDLE_TEXT, anchor='w', padx=8)
|
||||
self.chip_fpdo.pack(side='left', padx=(12, 0))
|
||||
rowp2 = ctk.CTkFrame(c, fg_color='transparent')
|
||||
rowp2.pack(fill='x', pady=(6, 0))
|
||||
ctk.CTkButton(rowp2, text='功率检测', width=90,
|
||||
command=self._pwr_query).pack(side='left')
|
||||
self.chip_fpdo.grid(row=0, column=2, sticky='ew', padx=(12, 0))
|
||||
ctk.CTkButton(pwr_grid, text='功率检测', width=90,
|
||||
command=self._pwr_query).grid(row=1, column=0,
|
||||
sticky='w', pady=(6, 0))
|
||||
self.var_pwr = tk.StringVar(value='电压: — 电流: — 功率: —')
|
||||
ctk.CTkLabel(rowp2, textvariable=self.var_pwr, height=28,
|
||||
corner_radius=6, fg_color=('#F2F2F2', '#181818'),
|
||||
anchor='w', padx=8).pack(side='left', padx=(8, 0))
|
||||
self.box_pwr = ctk.CTkLabel(pwr_grid, textvariable=self.var_pwr,
|
||||
height=26, corner_radius=6,
|
||||
fg_color=('#F2F2F2', '#181818'),
|
||||
anchor='w', padx=8)
|
||||
self.box_pwr.grid(row=1, column=2, sticky='ew', padx=(8, 0), pady=(6, 0))
|
||||
|
||||
# -- 光机命令 --
|
||||
# 标题行右侧: 电流实时读数 + 查电流按钮(okR..G..B.. 应答解析)
|
||||
@@ -562,16 +572,13 @@ class App(ctk.CTk):
|
||||
self._set_text(self.txt_hex, edid_parse.hex_dump(d['edid']))
|
||||
|
||||
def _clear_edid_rows(self):
|
||||
for w in self.edid_scroll.winfo_children():
|
||||
w.destroy()
|
||||
self._set_text(self.txt_edid, '')
|
||||
|
||||
def _add_edid_row(self, k, v):
|
||||
row = ctk.CTkFrame(self.edid_scroll, fg_color='transparent')
|
||||
row.pack(fill='x', pady=1)
|
||||
ctk.CTkLabel(row, text=k, width=132, anchor='w',
|
||||
text_color='gray60').pack(side='left')
|
||||
ctk.CTkLabel(row, text=v, anchor='w').pack(side='left',
|
||||
fill='x', expand=True)
|
||||
self.txt_edid.configure(state='normal')
|
||||
self.txt_edid.insert('end', f'{k:<16}{v}\n')
|
||||
self.txt_edid.see('end')
|
||||
self.txt_edid.configure(state='disabled')
|
||||
|
||||
def _apply_mode(self):
|
||||
d = self._cur_display()
|
||||
|
||||
Reference in New Issue
Block a user