修改calman灰阶点击异常、修改色准结果显示异常

This commit is contained in:
xinzhu.yin
2026-06-02 17:34:46 +08:00
parent 85ac47e8de
commit 3aa975c4d3
19 changed files with 968 additions and 157 deletions

View File

@@ -394,6 +394,15 @@ class PQAutomationApp(
return
try:
def _safe_insert_tab(frame, text, target_pos=1):
"""安全插入 Tab有目标位置则插入否则追加到末尾。"""
tabs = list(self.chart_notebook.tabs())
if not tabs or target_pos >= len(tabs):
self.chart_notebook.add(frame, text=text)
return
before_tab_id = tabs[target_pos]
self.chart_notebook.insert(before_tab_id, frame, text=text)
current_tabs = list(self.chart_notebook.tabs())
gamma_tab_id = str(self.gamma_chart_frame)
eotf_tab_id = str(self.eotf_chart_frame)
@@ -402,14 +411,12 @@ class PQAutomationApp(
if gamma_tab_id in current_tabs:
self.chart_notebook.forget(self.gamma_chart_frame)
if eotf_tab_id not in current_tabs:
insert_pos = min(1, len(self.chart_notebook.tabs()))
self.chart_notebook.insert(insert_pos, self.eotf_chart_frame, text="EOTF 曲线")
_safe_insert_tab(self.eotf_chart_frame, "EOTF 曲线", target_pos=1)
else:
if eotf_tab_id in current_tabs:
self.chart_notebook.forget(self.eotf_chart_frame)
if gamma_tab_id not in current_tabs:
insert_pos = min(1, len(self.chart_notebook.tabs()))
self.chart_notebook.insert(insert_pos, self.gamma_chart_frame, text="Gamma 曲线")
_safe_insert_tab(self.gamma_chart_frame, "Gamma 曲线", target_pos=1)
custom_tab_id = str(self.custom_template_tab_frame)
current_tabs = list(self.chart_notebook.tabs())