修复所有 Panel 的相对路径传递问题,防止 FileNotFoundError
This commit is contained in:
@ -308,11 +308,17 @@ class Step5_5Panel(QWidget):
|
||||
# 优先直接从 Step5 的输出 widget 读取(已运行的最新输出)
|
||||
step5_output = main_window.step5_panel.output_file.get_path()
|
||||
if step5_output:
|
||||
# 若为相对路径,使用 work_dir 合成为绝对路径
|
||||
if not os.path.isabs(step5_output):
|
||||
step5_output = os.path.join(self.work_dir or '', step5_output).replace('\\', '/')
|
||||
self.training_data_widget.set_path(step5_output)
|
||||
else:
|
||||
# 退而求其次,使用 Step5 的输入 CSV
|
||||
step5_csv = main_window.step5_panel.csv_file.get_path()
|
||||
if step5_csv:
|
||||
# 若为相对路径,使用 work_dir 合成为绝对路径
|
||||
if not os.path.isabs(step5_csv):
|
||||
step5_csv = os.path.join(self.work_dir or '', step5_csv).replace('\\', '/')
|
||||
self.training_data_widget.set_path(step5_csv)
|
||||
|
||||
# 如果上述都没找到,尝试从 pipeline.step_outputs 回退
|
||||
|
||||
Reference in New Issue
Block a user