优化日志显示

This commit is contained in:
xinzhu.yin
2026-04-21 15:31:48 +08:00
parent 6cc3e55ebb
commit e27312d0a3
22 changed files with 684 additions and 553 deletions

View File

@@ -1,4 +1,4 @@
"""图表框架相关逻辑Step 3 重构)。
"""图表框架相关逻辑Step 3 重构)。
从 pqAutomationApp.PQAutomationApp 中搬迁而来。每个函数第一行 `self = app`
以保留原有 `self.xxx` 属性访问不变。
@@ -21,7 +21,7 @@ def init_gamut_chart(self):
canvas_widget = self.gamut_canvas.get_tk_widget()
canvas_widget.pack(expand=True, fill=tk.BOTH)
# 恢复原来的大尺寸0.84 高度
# 恢复原来的大尺寸0.84 高度
self.gamut_ax_xy = self.gamut_fig.add_axes(
[0.02, 0.08, 0.46, 0.84]
) # ← 改回 0.84
@@ -47,7 +47,7 @@ def init_gamut_chart(self):
self.gamut_canvas.draw()
def init_gamma_chart(self):
"""初始化Gamma曲线图表 - 左侧曲线 + 右侧表格(4列 + 通用说明)"""
"""初始化Gamma曲线图表 - 左侧曲线 + 右侧表格4列 + 通用说明)"""
container = ttk.Frame(self.gamma_chart_frame)
container.pack(expand=True, fill=tk.BOTH)
@@ -156,7 +156,7 @@ def init_gamma_chart(self):
self.gamma_canvas.draw()
def init_eotf_chart(self):
"""初始化 EOTF 曲线图表HDR 专用)- 左侧曲线 + 右侧表格(4列"""
"""初始化 EOTF 曲线图表HDR 专用)- 左侧曲线 + 右侧表格4列"""
container = ttk.Frame(self.eotf_chart_frame)
container.pack(expand=True, fill=tk.BOTH)
@@ -741,7 +741,7 @@ def update_chart_tabs_state(self):
except Exception as e:
if hasattr(self, "log_gui"):
self.log_gui.log(f"更新Tab状态失败: {str(e)}")
self.log_gui.log(f"更新Tab状态失败: {str(e)}", level="error")
def create_result_chart_frame(self):
"""创建结果图表区域 - 6个独立TabGamma 和 EOTF 分离)"""
@@ -790,10 +790,10 @@ def create_result_chart_frame(self):
# 绑定Tab切换事件
self.chart_notebook.bind("<<NotebookTabChanged>>", self.on_chart_tab_changed)
# ==================== 在图表下方创建单步调试面板 ====================
# ==================== 在图表下方创建单步调试面板 ====================
self.debug_container = ttk.LabelFrame(
self.result_frame, # ← 放在 result_frame 内,图表正下方
text="🔧 单步调试",
text=" 单步调试",
padding=10,
)
# 默认不显示
@@ -801,7 +801,7 @@ def create_result_chart_frame(self):
# 创建单步调试面板实例
self.debug_panel = PQDebugPanel(self.debug_container, self)
self.log_gui.log("单步调试面板已创建(放在测试结果图表下方)")
self.log_gui.log("单步调试面板已创建(放在测试结果图表下方)", level="success")
def on_chart_tab_changed(self, event):
"""Tab切换时的事件处理"""
@@ -810,5 +810,5 @@ def on_chart_tab_changed(self, event):
self.chart_notebook.select()
)
except Exception as e:
self.log_gui.log(f"Tab切换事件处理失败: {str(e)}")
self.log_gui.log(f"Tab切换事件处理失败: {str(e)}", level="error")