修改引用逻辑、新增Pattern更改界面、新增Calman灰阶界面
This commit is contained in:
@@ -5,7 +5,13 @@ register_panel / show_panel / hide_all_panels —— 在右侧栏不同浮动面
|
||||
|
||||
import tkinter as tk
|
||||
|
||||
def register_panel(self, panel_name, frame, button, visible_attr):
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pqAutomationApp import PQAutomationApp
|
||||
|
||||
|
||||
def register_panel(self: "PQAutomationApp", panel_name, frame, button, visible_attr):
|
||||
"""注册一个面板到管理系统"""
|
||||
self.panels[panel_name] = {
|
||||
"frame": frame,
|
||||
@@ -14,7 +20,7 @@ def register_panel(self, panel_name, frame, button, visible_attr):
|
||||
}
|
||||
|
||||
|
||||
def show_panel(self, panel_name):
|
||||
def show_panel(self: "PQAutomationApp", panel_name):
|
||||
"""显示指定面板,隐藏其他所有面板"""
|
||||
if panel_name not in self.panels:
|
||||
return
|
||||
@@ -47,7 +53,7 @@ def show_panel(self, panel_name):
|
||||
self.current_panel = panel_name
|
||||
|
||||
|
||||
def hide_all_panels(self):
|
||||
def hide_all_panels(self: "PQAutomationApp"):
|
||||
"""隐藏所有面板,显示主内容区域"""
|
||||
# 隐藏所有注册的面板
|
||||
for panel_name, panel_info in self.panels.items():
|
||||
@@ -70,3 +76,12 @@ def hide_all_panels(self):
|
||||
self.current_panel = None
|
||||
|
||||
|
||||
|
||||
|
||||
class PanelManagerMixin:
|
||||
"""由 tools/refactor_to_mixins.py 自动生成。
|
||||
把本模块的自由函数挂到 PQAutomationApp 上,便于 F12 跳转与类型推断。
|
||||
"""
|
||||
register_panel = register_panel
|
||||
show_panel = show_panel
|
||||
hide_all_panels = hide_all_panels
|
||||
|
||||
Reference in New Issue
Block a user