From 95f9b7914e405cffa0893d20517a037cb20426db Mon Sep 17 00:00:00 2001 From: Diego Capusotto Date: Sat, 18 Dec 2021 18:38:08 -0300 Subject: [PATCH] KiCad 6 doesn't support the Rescue layer - Now we use User.9 for KiCad 6 --- kibot/__main__.py | 3 +++ kibot/gs.py | 1 + kibot/out_base.py | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kibot/__main__.py b/kibot/__main__.py index 53c9d633..42791920 100644 --- a/kibot/__main__.py +++ b/kibot/__main__.py @@ -258,6 +258,8 @@ def detect_kicad(): GS.kicad_conf_path = GS.kicad_conf_path.replace('/kicad/', '/kicadnightly/') GS.kicad_share_path = GS.kicad_share_path.replace('/kicad/', '/kicadnightly/') GS.pro_ext = '.kicad_pro' + # KiCad 6 doesn't support the Rescue layer + GS.work_layer = 'User.9' else: # Bug in KiCad (#6989), prints to stderr: # `../src/common/stdpbase.cpp(62): assert "traits" failed in Get(test_dir): create wxApp before calling this` @@ -266,6 +268,7 @@ def detect_kicad(): with hide_stderr(): GS.kicad_conf_path = pcbnew.GetKicadConfigPath() GS.pro_ext = '.pro' + GS.work_layer = 'Rescue' # Dirs to look for plugins GS.kicad_plugins_dirs = [] # /usr/share/kicad/* diff --git a/kibot/gs.py b/kibot/gs.py index 2d4f64e2..68219e1e 100644 --- a/kibot/gs.py +++ b/kibot/gs.py @@ -41,6 +41,7 @@ class GS(object): kicad_share_path = None kicad_plugins_dirs = [] pro_ext = '.pro' + work_layer = 'Rescue' # KiCad version: major*1e6+minor*1e3+patch kicad_version_n = 0 kicad_version_major = 0 diff --git a/kibot/out_base.py b/kibot/out_base.py index 0cd3da91..16c861a6 100644 --- a/kibot/out_base.py +++ b/kibot/out_base.py @@ -278,7 +278,7 @@ class VariantOptions(BaseOptions): badhes = board.GetLayerID('B.Adhes') old_fadhes = [] old_badhes = [] - rescue = board.GetLayerID('Rescue') + rescue = board.GetLayerID(GS.work_layer) fmask = board.GetLayerID('F.Mask') bmask = board.GetLayerID('B.Mask') for m in GS.get_modules_board(board): @@ -342,7 +342,7 @@ class VariantOptions(BaseOptions): bfab = board.GetLayerID('B.Fab') old_ffab = [] old_bfab = [] - rescue = board.GetLayerID('Rescue') + rescue = board.GetLayerID(GS.work_layer) for m in GS.get_modules_board(board): ref = m.GetReference() c = comps_hash.get(ref, None)