修改引用逻辑、新增Pattern更改界面、新增Calman灰阶界面
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""侧边面板(日志 / Local Dimming / 调试)"""
|
||||
"""侧边面板(日志 / Local Dimming / 调试)"""
|
||||
|
||||
import traceback
|
||||
import tkinter as tk
|
||||
@@ -7,7 +7,13 @@ import ttkbootstrap as ttk
|
||||
from app.views.pq_log_gui import PQLogGUI
|
||||
from app.views.pq_debug_panel import PQDebugPanel
|
||||
|
||||
def create_log_panel(self):
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pqAutomationApp import PQAutomationApp
|
||||
|
||||
|
||||
def create_log_panel(self: "PQAutomationApp"):
|
||||
"""创建日志面板"""
|
||||
self.log_frame = ttk.Frame(self.content_frame)
|
||||
self.log_gui = PQLogGUI(self.log_frame)
|
||||
@@ -22,7 +28,7 @@ def create_log_panel(self):
|
||||
) # button会在后面设置
|
||||
|
||||
|
||||
def create_local_dimming_panel(self):
|
||||
def create_local_dimming_panel(self: "PQAutomationApp"):
|
||||
"""创建 Local Dimming 测试面板 - 手动控制版"""
|
||||
self.local_dimming_frame = ttk.Frame(self.content_frame)
|
||||
|
||||
@@ -172,12 +178,12 @@ def create_local_dimming_panel(self):
|
||||
self.current_ld_percentage = None
|
||||
|
||||
|
||||
def toggle_local_dimming_panel(self):
|
||||
def toggle_local_dimming_panel(self: "PQAutomationApp"):
|
||||
"""切换 Local Dimming 面板显示"""
|
||||
self.show_panel("local_dimming")
|
||||
|
||||
|
||||
def toggle_log_panel(self):
|
||||
def toggle_log_panel(self: "PQAutomationApp"):
|
||||
"""切换日志面板的显示状态"""
|
||||
self.show_panel("log")
|
||||
|
||||
@@ -226,7 +232,7 @@ DEBUG_PANEL_CONFIGS = {
|
||||
}
|
||||
|
||||
|
||||
def _toggle_debug_panel(self, test_type):
|
||||
def _toggle_debug_panel(self: "PQAutomationApp", test_type):
|
||||
"""打开/关闭对应测试类型的单步调试面板(独立窗口)。"""
|
||||
cfg = DEBUG_PANEL_CONFIGS[test_type]
|
||||
win_attr = cfg["window_attr"]
|
||||
@@ -288,20 +294,20 @@ def _toggle_debug_panel(self, test_type):
|
||||
win.update_idletasks()
|
||||
|
||||
|
||||
def toggle_screen_debug_panel(self):
|
||||
def toggle_screen_debug_panel(self: "PQAutomationApp"):
|
||||
_toggle_debug_panel(self, "screen_module")
|
||||
|
||||
|
||||
def toggle_sdr_debug_panel(self):
|
||||
def toggle_sdr_debug_panel(self: "PQAutomationApp"):
|
||||
_toggle_debug_panel(self, "sdr_movie")
|
||||
|
||||
|
||||
def toggle_hdr_debug_panel(self):
|
||||
def toggle_hdr_debug_panel(self: "PQAutomationApp"):
|
||||
_toggle_debug_panel(self, "hdr_movie")
|
||||
|
||||
|
||||
|
||||
def update_sidebar_selection(self):
|
||||
def update_sidebar_selection(self: "PQAutomationApp"):
|
||||
"""更新侧边栏按钮的选中状态"""
|
||||
# 重置所有按钮样式为默认
|
||||
self.screen_module_btn.configure(style="Sidebar.TButton")
|
||||
@@ -316,3 +322,18 @@ def update_sidebar_selection(self):
|
||||
self.sdr_movie_btn.configure(style="SidebarSelected.TButton")
|
||||
elif current_type == "hdr_movie":
|
||||
self.hdr_movie_btn.configure(style="SidebarSelected.TButton")
|
||||
|
||||
|
||||
class SidePanelsMixin:
|
||||
"""由 tools/refactor_to_mixins.py 自动生成。
|
||||
把本模块的自由函数挂到 PQAutomationApp 上,便于 F12 跳转与类型推断。
|
||||
"""
|
||||
create_log_panel = create_log_panel
|
||||
create_local_dimming_panel = create_local_dimming_panel
|
||||
toggle_local_dimming_panel = toggle_local_dimming_panel
|
||||
toggle_log_panel = toggle_log_panel
|
||||
_toggle_debug_panel = _toggle_debug_panel
|
||||
toggle_screen_debug_panel = toggle_screen_debug_panel
|
||||
toggle_sdr_debug_panel = toggle_sdr_debug_panel
|
||||
toggle_hdr_debug_panel = toggle_hdr_debug_panel
|
||||
update_sidebar_selection = update_sidebar_selection
|
||||
|
||||
Reference in New Issue
Block a user