添加瞬时峰值测试

This commit is contained in:
xinzhu.yin
2026-06-08 11:14:12 +08:00
parent febbb28a4c
commit e4890d9d8d
3 changed files with 264 additions and 11 deletions

View File

@@ -134,7 +134,79 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
width=12,
).pack(side=tk.LEFT, padx=3)
# ==================== 4. CA410 采集按钮 ====================
# ==================== 4. 独立瞬时峰值连续测试 ====================
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)
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(
row=1, column=1, sticky=tk.W, padx=(0, 10)
)
ttk.Label(peak_frame, text="窗口亮度(%):").grid(
row=1, column=2, sticky=tk.W, padx=(0, 4)
)
ttk.Entry(peak_frame, textvariable=self.ld_peak_window_luminance_var, width=8).grid(
row=1, column=3, sticky=tk.W, padx=(0, 10)
)
ttk.Label(peak_frame, text="连续时长(s):").grid(
row=1, column=4, sticky=tk.W, padx=(0, 4)
)
ttk.Entry(peak_frame, textvariable=self.ld_peak_duration_var, width=8).grid(
row=1, column=5, sticky=tk.W, padx=(0, 10)
)
ttk.Label(peak_frame, text="采样间隔(s):").grid(
row=1, column=6, sticky=tk.W, padx=(0, 4)
)
ttk.Entry(peak_frame, textvariable=self.ld_peak_sample_interval_var, width=8).grid(
row=1, column=7, sticky=tk.W
)
ttk.Checkbutton(
peak_frame,
text="记录曲线点到表格",
variable=self.ld_peak_record_curve_var,
bootstyle="round-toggle",
).grid(row=2, column=0, columnspan=3, sticky=tk.W, pady=(8, 0))
peak_btn_row = ttk.Frame(peak_frame)
peak_btn_row.grid(row=2, column=4, columnspan=4, sticky=tk.EW, pady=(8, 0))
self.ld_peak_start_btn = ttk.Button(
peak_btn_row,
text="开始峰值追踪",
command=self.start_ld_instant_peak_tracking,
bootstyle="warning",
width=14,
)
self.ld_peak_start_btn.pack(side=tk.LEFT, padx=(0, 5))
self.ld_peak_stop_btn = ttk.Button(
peak_btn_row,
text="停止",
command=self.stop_ld_instant_peak_tracking,
bootstyle="danger-outline",
width=10,
state="disabled",
)
self.ld_peak_stop_btn.pack(side=tk.LEFT)
# ==================== 5. CA410 采集按钮 ====================
measure_frame = ttk.LabelFrame(main_container, text="📊 CA410 测量", padding=10)
measure_frame.pack(fill=tk.X, pady=(0, 10))
@@ -159,7 +231,7 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
)
self.ld_result_label.pack(side=tk.LEFT, padx=(10, 0))
# ==================== 5. 测试结果表格 ====================
# ==================== 6. 测试结果表格 ====================
result_frame = ttk.LabelFrame(main_container, text="📋 测试记录", padding=10)
result_frame.pack(fill=tk.BOTH, expand=True, pady=(0, 10))
@@ -191,7 +263,7 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
self.ld_tree.configure(yscrollcommand=scrollbar.set)
# ==================== 6. 底部操作按钮 ====================
# ==================== 7. 底部操作按钮 ====================
bottom_frame = ttk.Frame(main_container)
bottom_frame.pack(fill=tk.X)
@@ -228,6 +300,7 @@ def create_local_dimming_panel(self: "PQAutomationApp"):
self.current_ld_percentage = None
self.current_ld_test_item = None
self.current_ld_pattern_label = None
self.ld_peak_tracking = False
def toggle_local_dimming_panel(self: "PQAutomationApp"):