重构删除/移动主文件冗余函数
This commit is contained in:
@@ -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)}")
|
||||
|
||||
Reference in New Issue
Block a user