重构添加统一异常处理

This commit is contained in:
xinzhu.yin
2026-04-20 15:34:45 +08:00
parent 2e92b48496
commit b1b14c2d49
8 changed files with 114 additions and 61 deletions

View File

@@ -1064,37 +1064,26 @@ class PQDebugPanel:
def _enable_test_button(self, test_type, test_item):
"""启用测试按钮"""
dispatch = self.app._dispatch_ui
if test_type == "screen_module":
if test_item == "gamma":
self.app.root.after(0, lambda: self.screen_test_btn.config(state=tk.NORMAL))
dispatch(self.screen_test_btn.config, state=tk.NORMAL)
elif test_item == "rgb":
self.app.root.after(0, lambda: self.screen_rgb_test_btn.config(state=tk.NORMAL))
dispatch(self.screen_rgb_test_btn.config, state=tk.NORMAL)
elif test_type == "sdr_movie":
if test_item == "gamma":
self.app.root.after(
0, lambda: self.sdr_gamma_test_btn.config(state=tk.NORMAL)
)
dispatch(self.sdr_gamma_test_btn.config, state=tk.NORMAL)
elif test_item == "accuracy":
self.app.root.after(
0, lambda: self.sdr_accuracy_test_btn.config(state=tk.NORMAL)
)
dispatch(self.sdr_accuracy_test_btn.config, state=tk.NORMAL)
elif test_item == "rgb":
self.app.root.after(
0, lambda: self.sdr_rgb_test_btn.config(state=tk.NORMAL)
)
dispatch(self.sdr_rgb_test_btn.config, state=tk.NORMAL)
elif test_type == "hdr_movie":
if test_item == "eotf":
self.app.root.after(
0, lambda: self.hdr_eotf_test_btn.config(state=tk.NORMAL)
)
dispatch(self.hdr_eotf_test_btn.config, state=tk.NORMAL)
elif test_item == "accuracy":
self.app.root.after(
0, lambda: self.hdr_accuracy_test_btn.config(state=tk.NORMAL)
)
dispatch(self.hdr_accuracy_test_btn.config, state=tk.NORMAL)
elif test_item == "rgb":
self.app.root.after(
0, lambda: self.hdr_rgb_test_btn.config(state=tk.NORMAL)
)
dispatch(self.hdr_rgb_test_btn.config, state=tk.NORMAL)
# ==================== 辅助方法 ====================