fix(gui): step8_panel QBrush崩溃修复 + step9_panel step5→step8_panel 回填链路对齐

This commit is contained in:
DXC
2026-06-09 13:23:17 +08:00
parent 47cbb4a013
commit c9b9eded84
2 changed files with 21 additions and 23 deletions

View File

@ -297,23 +297,20 @@ class Step9Panel(QWidget):
else:
self.work_dir = None
# 1. 尝试从 Step5 界面读取训练光谱 CSV 路径
# 1. 尝试从 Step8 界面读取训练光谱 CSV 路径
main_window = self.window()
if main_window and hasattr(main_window, 'step5_panel'):
step5_widget = getattr(main_window.step5_panel, 'output_file', None)
step5_output_path = ""
if hasattr(step5_widget, 'get_path'):
step5_output_path = step5_widget.get_path() or ""
elif hasattr(step5_widget, 'text'):
step5_output_path = step5_widget.text() or ""
if main_window and hasattr(main_window, 'step8_panel'):
step8_widget = main_window.step8_panel.training_data_widget
step8_output_path = ""
if hasattr(step8_widget, 'get_path'):
step8_output_path = step8_widget.get_path() or ""
if step5_output_path:
# 若为相对路径,使用 work_dir 合成为绝对路径
if not os.path.isabs(step5_output_path):
step5_output_path = os.path.join(self.work_dir or '', step5_output_path).replace('\\', '/')
if step8_output_path:
if not os.path.isabs(step8_output_path):
step8_output_path = os.path.join(self.work_dir or '', step8_output_path).replace('\\', '/')
existing = self.csv_file.get_path()
if not existing or not existing.strip():
self.csv_file.set_path(step5_output_path)
self.csv_file.set_path(step8_output_path)
# 1.5 自动探测并回填 Step 8 双轨输出的 Traditional_Indices 目录
if self.work_dir: