重构删除/移动主文件冗余函数

This commit is contained in:
xinzhu.yin
2026-04-21 10:48:15 +08:00
parent 982210a724
commit a5595b7e60
5 changed files with 421 additions and 2699 deletions

View File

@@ -1,5 +1,6 @@
"""主布局面板创建函数Step 6 重构)。"""
import re
import tkinter as tk
import ttkbootstrap as ttk
@@ -496,3 +497,41 @@ def create_operation_frame(self):
self.update_custom_button_visibility()
def on_screen_module_timing_changed(self, event=None):
"""屏模组信号格式改变时的回调"""
try:
selected_timing = self.screen_module_timing_var.get()
# 记录日志
self.log_gui.log(f"屏模组信号格式已更改为: {selected_timing}")
match = re.search(r"(\d+)x(\d+)\s*@\s*(\d+)", selected_timing)
if match:
width = int(match.group(1))
height = int(match.group(2))
refresh_rate = int(match.group(3))
self.log_gui.log(f" ├─ 分辨率: {width}x{height}")
self.log_gui.log(f" └─ 刷新率: {refresh_rate}Hz")
# 根据分辨率给出提示
if width >= 3840: # 4K及以上
self.log_gui.log(" 检测到4K分辨率")
if refresh_rate >= 120:
self.log_gui.log(" 检测到高刷新率")
# 更新配置
self.config.set_current_timing(selected_timing)
# 如果正在测试,提示用户
if self.testing:
self.log_gui.log("⚠️ 警告: 测试进行中,信号格式更改将在下次测试时生效")
# 保存配置
self.save_pq_config()
except Exception as e:
self.log_gui.log(f"❌ 屏模组信号格式更改失败: {str(e)}")