Minor Python pad array improvement.

Allow selection of square pads and allow to rotate the pads in the
circular pad array wizard
This commit is contained in:
Christoph Riehl
2018-01-06 10:39:32 -05:00
committed by Wayne Stambaugh
parent b98f6a2fd1
commit f6023d22e4
2 changed files with 19 additions and 3 deletions
@@ -37,6 +37,11 @@ class circular_pad_array_wizard(FootprintWizardBase.FootprintWizard):
self.AddParam("Pads", "diameter", self.uMM, 1.5)
self.AddParam("Pads", "drill", self.uMM, 0.8)
self.AddParam("Pads", "angle", self.uDegrees, 0, designator='a')
self.AddParam("Pads", "rectangle", self.uBool, False)
self.AddParam("Pad rotation", "pad rotation", self.uBool, False, designator='r')
self.AddParam("Pad rotation", "pad angle offset", self.uDegrees, 0, designator='o')
self.AddParam("Numbering", "initial", self.uInteger, 1, min_value=1)
#self.AddParam("Numbering", "increment", self.uInteger, 1, min_value=1)
@@ -50,6 +55,7 @@ class circular_pad_array_wizard(FootprintWizardBase.FootprintWizard):
pads = self.parameters['Pads']
numbering = self.parameters['Numbering']
outline = self.parameters['Outline']
padRotation = self.parameters['Pad rotation']
# Check that pads do not overlap
pad_dia = pcbnew.ToMM(pads['diameter'])
@@ -73,16 +79,20 @@ class circular_pad_array_wizard(FootprintWizardBase.FootprintWizard):
pads = self.parameters['Pads']
numbering = self.parameters['Numbering']
outline = self.parameters['Outline']
padRotation = self.parameters['Pad rotation']
pad_size = pads['diameter']
pad_shape = pcbnew.PAD_SHAPE_RECT if pads["rectangle"] else pcbnew.PAD_SHAPE_OVAL
pad = PA.PadMaker(self.module).THPad(pads['diameter'], pads['diameter'], pads['drill'])
pad = PA.PadMaker(self.module).THPad(pads['diameter'], pads['diameter'], pads['drill'], shape=pad_shape)
array = PA.PadCircleArray(
pad, pads['count'], pads['center diameter'] / 2,
angle_offset=pads["angle"],
centre=pcbnew.wxPoint(0, 0),
clockwise=numbering["clockwise"])
clockwise=numbering["clockwise"],
padRotationEnable= padRotation["pad rotation"],
padRotationOffset = padRotation["pad angle offset"])
array.SetFirstPadInArray(numbering["initial"])