fix: accept layout-based PCB projects without optional icdb path

This commit is contained in:
阿白叔 committed 2026-11-02 21:19:57 +08:00
1 parent 797a79c30e
commit dd1fcea7e2
2 files changed
+63

No files matched your search

+5
View File
@@ -100,6 +100,11 @@ def source_project(source, top_level_block=''):
for path in (source, pcb.parent/'pcb.prj'):
if not path.is_file():
raise ValueError('工程缺少 PCB 工程配置。')
# Healthy Expedition PCB projects can use Layout/LayoutDB.lyt without
# declaring an independent iCDBDir. The schematic DB stays mandatory;
# an explicitly declared PCB DB must still pass every reference check.
if path != source and not re.search(r'^KEY iCDBDir\b', _project_text(path), re.M):
continue
db = reference(path, 'iCDBDir')
if not (db/'icdb.dat').is_file():
raise ValueError('工程缺少原理图/PCB 数据库。')