From 494c9126f7a49d78e9f2cb4e18682c6a2cd2ec7f Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Thu, 28 Apr 2022 14:26:02 -0300 Subject: [PATCH] Fixed used layers detection in --quick-start - We must reset some Layer members before doing a new detect --- kibot/kiplot.py | 3 ++- kibot/layer.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kibot/kiplot.py b/kibot/kiplot.py index 6942b12b..e2abf7bd 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -695,6 +695,8 @@ def solve_project_file(): def look_for_used_layers(): + from .layer import Layer + Layer.reset() layers = set() components = {} # Look inside the modules @@ -721,7 +723,6 @@ def look_for_used_layers(): else: layers.add(e.GetLayer()) # Now filter the pads and vias potential layers - from .layer import Layer declared_layers = {la._id for la in Layer.solve('all')} layers = sorted(declared_layers.intersection(layers)) logger.debug('- Detected layers: {}'.format(layers)) diff --git a/kibot/layer.py b/kibot/layer.py index bcc3c287..004376b4 100644 --- a/kibot/layer.py +++ b/kibot/layer.py @@ -162,6 +162,11 @@ class Layer(Optionable): self.suffix = self.layer.replace('.', '_') self.clean_suffix() + @staticmethod + def reset(): + Layer._pcb_layers = None + Layer._plot_layers = None + def clean_suffix(self): filtered_suffix = ''.join(char for char in self.suffix if ord(char) < 128) if filtered_suffix != self.suffix: