Skip to content

Commit

Permalink
support hidden pins
Browse files Browse the repository at this point in the history
It turns out this was actually already supported, but with a different name and we have agreed on new terminology (pointhi#586 (comment))
  • Loading branch information
evanshultz committed Aug 27, 2020
1 parent 7b1904d commit eccb29e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions KicadModTree/nodes/specialized/PadArray.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions scripts/tools/quad_dual_pad_border.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eccb29e

Please sign in to comment.