From eccb29e4d7987c9009c65520369773c767c08f46 Mon Sep 17 00:00:00 2001 From: evanshultz Date: Thu, 27 Aug 2020 06:53:27 -0700 Subject: [PATCH] support hidden pins It turns out this was actually already supported, but with a different name and we have agreed on new terminology (https://github.com/pointhi/kicad-footprint-generator/pull/586#issuecomment-680057204) --- KicadModTree/nodes/specialized/PadArray.py | 20 +++++++++---------- .../size_definitions/soic.yaml | 2 +- scripts/tools/quad_dual_pad_border.py | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/KicadModTree/nodes/specialized/PadArray.py b/KicadModTree/nodes/specialized/PadArray.py index 3a0998956..3983d1e94 100644 --- a/KicadModTree/nodes/specialized/PadArray.py +++ b/KicadModTree/nodes/specialized/PadArray.py @@ -78,8 +78,8 @@ class PadArray(Node): shape for marking pad 1 for through hole components. (deafult: ``Pad.SHAPE_ROUNDRECT``) * *tht_pad1_id* (``int, string``) -- pad number used for "pin 1" (default: 1) - * *exclude_pin_list* (``int, Vector1D``) -- - which pin number should be skipped" + * *hidden_pins* (``int, Vector1D``) -- + pin number(s) to be skipped; a SOIC-8 with pin 7 hidden has the last pin numbered 8" :Example: @@ -105,12 +105,12 @@ def _initPincount(self, **kwargs): if type(self.pincount) is not int or self.pincount <= 0: raise ValueError('{pc} is an invalid value for pincount'.format(pc=self.pincount)) - self.exclude_pin_list = [] - if kwargs.get('exclude_pin_list'): - self.exclude_pin_list = kwargs.get('exclude_pin_list') - if type(self.exclude_pin_list) not in [list, tuple]: - raise TypeError('exclude pin list must be specified like "exclude_pin_list=[0,1]"') - elif any([type(i) not in [int] for i in self.exclude_pin_list]): + self.hidden_pins = [] + if kwargs.get('hidden_pins'): + self.hidden_pins = kwargs.get('hidden_pins') + if type(self.hidden_pins) not in [list, tuple]: + raise TypeError('exclude pin list must be specified like "hidden_pins=[0,1]"') + elif any([type(i) not in [int] for i in self.hidden_pins]): raise ValueError('exclude pin list must be integer value') # Where to start the aray @@ -236,9 +236,9 @@ def _createPads(self, **kwargs): for i, number in enumerate(pad_numbers): includePad = True if type(self.initialPin) == 'int': - includePad = (self.initialPin + i) not in self.exclude_pin_list + includePad = (self.initialPin + i) not in self.hidden_pins else: - includePad = number not in self.exclude_pin_list + includePad = number not in self.hidden_pins if includePad: current_pad_pos = Vector2D( diff --git a/scripts/Packages/Package_Gullwing__QFP_SOIC_SO/size_definitions/soic.yaml b/scripts/Packages/Package_Gullwing__QFP_SOIC_SO/size_definitions/soic.yaml index a71fa723c..e1737a864 100644 --- a/scripts/Packages/Package_Gullwing__QFP_SOIC_SO/size_definitions/soic.yaml +++ b/scripts/Packages/Package_Gullwing__QFP_SOIC_SO/size_definitions/soic.yaml @@ -24,7 +24,7 @@ SOIC-4_4.55x3.7mm_P2.54mm: pitch: 1.27 num_pins_x: 0 num_pins_y: 3 - exclude_pin_list: [2, 5] + hidden_pins: [2, 5] SOIC-4_4.55x2.6mm_P1.27mm: size_source: 'https://toshiba.semicon-storage.com/info/docget.jsp?did=12884&prodName=TLP291' diff --git a/scripts/tools/quad_dual_pad_border.py b/scripts/tools/quad_dual_pad_border.py index c93b53c3d..a96af7a4c 100644 --- a/scripts/tools/quad_dual_pad_border.py +++ b/scripts/tools/quad_dual_pad_border.py @@ -12,8 +12,8 @@ def add_dual_or_quad_pad_border(kicad_mod, configuration, pad_details, device_pa if 'round_rect_max_radius' in configuration: pad_shape_details['maximum_radius'] = configuration['round_rect_max_radius'] - if 'exclude_pin_list' in device_params: - pad_shape_details['exclude_pin_list'] = device_params['exclude_pin_list'] + if 'hidden_pins' in device_params: + pad_shape_details['hidden_pins'] = device_params['hidden_pins'] if device_params['num_pins_x'] == 0: radius = add_dual_pad_border_y(kicad_mod, pad_details, device_params, pad_shape_details)