修复LocalDimming测试错误

This commit is contained in:
xinzhu.yin
2026-06-09 15:22:20 +08:00
parent 8916f2fff0
commit f33984affa
7 changed files with 331 additions and 509 deletions

View File

@@ -774,7 +774,6 @@ def create_test_type_frame(self: "PQAutomationApp"):
).pack(fill=tk.X, padx=16, pady=(16, 6), anchor="w")
panel_buttons = [
("log_btn", "测试日志", self.toggle_log_panel),
("ai_image_btn", "AI 图片", self.toggle_ai_image_panel),
("pantone_baseline_btn", "Pantone 摸底", self.toggle_pantone_baseline_panel),
("gamma_pattern_btn", "Gamma Pattern编辑", self.toggle_gamma_pattern_panel),
@@ -801,6 +800,17 @@ def create_test_type_frame(self: "PQAutomationApp"):
)
beta_lbl.pack(fill=tk.X, side=tk.BOTTOM, padx=4, pady=(6, 4))
# ---------- 测试日志(底部固定) ----------
self.log_btn = ttk.Button(
self.sidebar_frame,
text="测试日志",
style="Sidebar.TButton",
command=self.toggle_log_panel,
takefocus=False,
)
self.log_btn.pack(fill=tk.X, padx=0, pady=(0, 2), side=tk.BOTTOM)
# ---------- 主题切换(底部固定) ----------
self.theme_toggle_btn = ttk.Button(
self.sidebar_frame,
@@ -814,8 +824,6 @@ def create_test_type_frame(self: "PQAutomationApp"):
# 注册面板按钮
if hasattr(self, "panels"):
if "log" in self.panels:
self.panels["log"]["button"] = self.log_btn
if "ai_image" in self.panels:
self.panels["ai_image"]["button"] = self.ai_image_btn
if "single_step" in self.panels:
@@ -1020,10 +1028,10 @@ def on_screen_module_timing_changed(self: "PQAutomationApp", event=None):
# 根据分辨率给出提示
if width >= 3840: # 4K及以上
self.log_gui.log(" 检测到4K分辨率", level="info")
self.log_gui.log("检测到4K分辨率", level="info")
if refresh_rate >= 120:
self.log_gui.log(" 检测到高刷新率", level="info")
self.log_gui.log("检测到高刷新率", level="info")
# 更新屏模组配置(独立于 current_test_type
self.config.current_test_types.setdefault("screen_module", {})[

View File

@@ -42,13 +42,13 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
ttk.Label(
title_frame,
text="🔆 Local Dimming 窗口测试",
text="Local Dimming 窗口测试",
font=("微软雅黑", 14, "bold"),
).pack(side=tk.LEFT)
# ==================== 2. 窗口百分比按钮 ====================
window_frame = ttk.LabelFrame(
main_container, text="🔆 窗口百分比(点击发送)", padding=10
main_container, text="窗口百分比", padding=10
)
window_frame.pack(fill=tk.X, pady=(0, 10))
@@ -133,16 +133,9 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
).pack(side=tk.LEFT, padx=3)
# ==================== 3. 其他手动图案 ====================
pattern_frame = ttk.LabelFrame(main_container, text="🧩 其他测试图案", padding=10)
pattern_frame = ttk.LabelFrame(main_container, text="其他测试图案", padding=10)
pattern_frame.pack(fill=tk.X, pady=(0, 10))
ttk.Label(
pattern_frame,
text="手动发送棋盘格、瞬时峰值、黑场图案,再点击采集当前亮度",
font=("", 9),
style="SuccessState.TLabel",
).pack(pady=(0, 8))
pattern_row = ttk.Frame(pattern_frame)
pattern_row.pack(fill=tk.X)
@@ -171,21 +164,16 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
).pack(side=tk.LEFT, padx=3)
# ==================== 4. 独立瞬时峰值连续测试 ====================
peak_frame = ttk.LabelFrame(main_container, text="瞬时峰值独立测试", padding=10)
peak_frame = ttk.LabelFrame(main_container, text="瞬时峰值独立测试", padding=10)
peak_frame.pack(fill=tk.X, pady=(0, 10))
ttk.Label(
peak_frame,
text="先黑场切窗口后连续测亮度,直到回落或到达最长测量时间",
font=("", 9),
style="WarningState.TLabel",
).grid(row=0, column=0, columnspan=8, sticky=tk.W, pady=(0, 8))
self.ld_peak_window_size_var = tk.StringVar(value="10")
self.ld_peak_window_luminance_var = tk.StringVar(value="100")
self.ld_peak_duration_var = tk.StringVar(value="20")
self.ld_peak_sample_interval_var = tk.StringVar(value="0.3")
self.ld_peak_record_curve_var = tk.BooleanVar(value=True)
self.ld_peak_no_limit_var = tk.BooleanVar(value=False)
self.ld_peak_drop_percent_var = tk.StringVar(value="3")
ttk.Label(peak_frame, text="窗口(%):").grid(row=1, column=0, sticky=tk.W, padx=(0, 4))
ttk.Entry(peak_frame, textvariable=self.ld_peak_window_size_var, width=8).grid(
@@ -242,8 +230,25 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
)
self.ld_peak_stop_btn.pack(side=tk.LEFT)
ttk.Label(peak_frame, text="亮度回落(%):").grid(
row=2, column=0, sticky=tk.W, padx=(0, 4), pady=(6, 0)
)
ttk.Entry(
peak_frame,
textvariable=self.ld_peak_drop_percent_var,
width=8
).grid(row=2, column=1, sticky=tk.W, pady=(6, 0))
ttk.Checkbutton(
peak_frame,
text="不固定测试时间",
variable=self.ld_peak_no_limit_var,
bootstyle="round-toggle",
).grid(row=2, column=2, columnspan=3, sticky=tk.W, pady=(6, 0))
# ==================== 5. CA410 采集按钮 ====================
measure_frame = ttk.LabelFrame(main_container, text="📊 CA410 测量", padding=10)
measure_frame = ttk.LabelFrame(main_container, text="CA410 测量", padding=10)
measure_frame.pack(fill=tk.X, pady=(0, 10))
measure_btn_frame = ttk.Frame(measure_frame)
@@ -251,7 +256,7 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
self.ld_measure_btn = ttk.Button(
measure_btn_frame,
text="📏 采集当前亮度",
text="采集当前亮度",
command=self.measure_ld_luminance,
bootstyle="primary",
width=15,
@@ -268,7 +273,7 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
self.ld_result_label.pack(side=tk.LEFT, padx=(10, 0))
# ==================== 6. 测试结果表格 ====================
result_frame = ttk.LabelFrame(main_container, text="📋 测试记录", padding=10)
result_frame = ttk.LabelFrame(main_container, text="测试记录", padding=10)
result_frame.pack(fill=tk.BOTH, expand=True, pady=(0, 10))
# Treeview
@@ -314,7 +319,7 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
self.ld_save_btn = ttk.Button(
bottom_frame,
text="💾 保存结果",
text="保存结果",
command=self.save_local_dimming_results,
bootstyle="info",
width=12,
@@ -323,7 +328,7 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
self.ld_plot_btn = ttk.Button(
bottom_frame,
text="📈 生成峰值曲线",
text="生成峰值曲线",
command=self.plot_ld_instant_peak_curve,
bootstyle="warning-outline",
width=14,