From 6efd735a746ac1a939772cf1a6cc68c9f7f913e9 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 13 Jan 2021 12:35:53 -0300 Subject: [PATCH] Now layers can be selected using the default KiCad names. --- CHANGELOG.md | 3 ++- kibot/layer.py | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 714f28c2..398f148b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - The multipart id to references of multipart components others than part 1. - Internal BoM: `no_conflict` option to exclude fields from conflict detection. -- Support for KICAD_CONFIG_HOME defined from inside KiCad +- Support for KICAD_CONFIG_HOME defined from inside KiCad. +- Now layers can be selected using the default KiCad names. ### Changed - Now the default output name applies to the DRC and ERC report names. diff --git a/kibot/layer.py b/kibot/layer.py index 044b072c..61769960 100644 --- a/kibot/layer.py +++ b/kibot/layer.py @@ -153,6 +153,8 @@ class Layer(Optionable): # Give compatibility for the KiCad 5 default names (automagically renamed by KiCad 6) elif GS.kicad_version_n >= KICAD_VERSION_5_99 and layer in Layer.KICAD6_RENAME: ext = [Layer.create_layer(Layer.KICAD6_RENAME[layer])] + elif layer in Layer.DEFAULT_LAYER_NAMES: + ext = [Layer.create_layer(layer)] if ext is None: raise KiPlotConfigurationError("Unknown layer spec: `{}`".format(layer)) new_vals.extend(ext) @@ -225,3 +227,8 @@ class Layer(Optionable): def __str__(self): return "{} ({} '{}' {})".format(self.layer, self._id, self.description, self.suffix) + +for i in range(1, 30): + name = 'In'+str(i)+'.Cu' + Layer.DEFAULT_LAYER_NAMES[name] = pcbnew.In1_Cu+i-1 + Layer.DEFAULT_LAYER_DESC[name] = 'Inner layer '+str(i)