重构测试执行部分+去除转发器
This commit is contained in:
@@ -8,9 +8,8 @@ import threading
|
||||
import tkinter as tk
|
||||
from tkinter import filedialog, messagebox
|
||||
|
||||
def start_local_dimming_test(app):
|
||||
def start_local_dimming_test(self):
|
||||
"""开始 Local Dimming 测试"""
|
||||
self = app
|
||||
# 检查设备连接
|
||||
if not self.ca or not self.ucd.status:
|
||||
messagebox.showerror("错误", "请先连接 CA410 和 UCD323")
|
||||
@@ -65,9 +64,8 @@ def start_local_dimming_test(app):
|
||||
threading.Thread(target=run_test, daemon=True).start()
|
||||
|
||||
|
||||
def update_ld_results(app, results):
|
||||
def update_ld_results(self, results):
|
||||
"""更新 Local Dimming 结果显示"""
|
||||
self = app
|
||||
for percentage, x, y, lv, X, Y, Z in results:
|
||||
self.ld_tree.insert(
|
||||
"",
|
||||
@@ -76,16 +74,14 @@ def update_ld_results(app, results):
|
||||
)
|
||||
|
||||
|
||||
def stop_local_dimming_test(app):
|
||||
def stop_local_dimming_test(self):
|
||||
"""停止 Local Dimming 测试"""
|
||||
self = app
|
||||
if hasattr(self, "ld_test_instance"):
|
||||
self.ld_test_instance.stop()
|
||||
|
||||
|
||||
def send_ld_window(app, percentage):
|
||||
def send_ld_window(self, percentage):
|
||||
"""发送指定百分比的窗口"""
|
||||
self = app
|
||||
if not self.ucd.status:
|
||||
messagebox.showwarning("警告", "请先连接 UCD323 设备")
|
||||
return
|
||||
@@ -120,9 +116,8 @@ def send_ld_window(app, percentage):
|
||||
threading.Thread(target=send, daemon=True).start()
|
||||
|
||||
|
||||
def measure_ld_luminance(app):
|
||||
def measure_ld_luminance(self):
|
||||
"""测量当前亮度"""
|
||||
self = app
|
||||
if not self.ca:
|
||||
messagebox.showwarning("警告", "请先连接 CA410 色度计")
|
||||
return
|
||||
@@ -178,9 +173,8 @@ def measure_ld_luminance(app):
|
||||
threading.Thread(target=measure, daemon=True).start()
|
||||
|
||||
|
||||
def clear_ld_records(app):
|
||||
def clear_ld_records(self):
|
||||
"""清空测试记录"""
|
||||
self = app
|
||||
for item in self.ld_tree.get_children():
|
||||
self.ld_tree.delete(item)
|
||||
self.ld_result_label.config(text="亮度: -- cd/m² | x: -- | y: --")
|
||||
@@ -188,9 +182,8 @@ def clear_ld_records(app):
|
||||
self.log_gui.log("🗑️ 测试记录已清空")
|
||||
|
||||
|
||||
def save_local_dimming_results(app):
|
||||
def save_local_dimming_results(self):
|
||||
"""保存 Local Dimming 结果"""
|
||||
self = app
|
||||
from tkinter import filedialog
|
||||
import csv
|
||||
import datetime
|
||||
|
||||
Reference in New Issue
Block a user