Update python for the pad wxSize switch

This commit is contained in:
Marek Roszko 2022-01-04 23:23:23 -05:00
parent 6d2fd17a39
commit cc5003a919
2 changed files with 6 additions and 6 deletions

View File

@ -47,11 +47,11 @@ class PadMaker(object):
@param rot_degree: the pad rotation, in degrees @param rot_degree: the pad rotation, in degrees
""" """
pad = pcbnew.PAD(self.module) pad = pcbnew.PAD(self.module)
pad.SetSize(pcbnew.wxSize(Hsize, Vsize)) pad.SetSize(pcbnew.VECTOR2I(Hsize, Vsize))
pad.SetShape(shape) pad.SetShape(shape)
pad.SetAttribute(pcbnew.PAD_ATTRIB_PTH) pad.SetAttribute(pcbnew.PAD_ATTRIB_PTH)
pad.SetLayerSet(pad.PTHMask()) pad.SetLayerSet(pad.PTHMask())
pad.SetDrillSize(pcbnew.wxSize(drill, drill)) pad.SetDrillSize(pcbnew.VECTOR2I(drill, drill))
pad.SetOrientation(rot_degree*10) # rotation is in 0.1 degrees pad.SetOrientation(rot_degree*10) # rotation is in 0.1 degrees
return pad return pad
@ -72,11 +72,11 @@ class PadMaker(object):
@param drill: the drill diameter (equals the NPTH diameter) @param drill: the drill diameter (equals the NPTH diameter)
""" """
pad = pcbnew.PAD(self.module) pad = pcbnew.PAD(self.module)
pad.SetSize(pcbnew.wxSize(drill, drill)) pad.SetSize(pcbnew.VECTOR2I(drill, drill))
pad.SetShape(pcbnew.PAD_SHAPE_CIRCLE) pad.SetShape(pcbnew.PAD_SHAPE_CIRCLE)
pad.SetAttribute(pcbnew.PAD_ATTRIB_HOLE_NOT_PLATED) pad.SetAttribute(pcbnew.PAD_ATTRIB_HOLE_NOT_PLATED)
pad.SetLayerSet(pad.UnplatedHoleMask()) pad.SetLayerSet(pad.UnplatedHoleMask())
pad.SetDrillSize(pcbnew.wxSize(drill, drill)) pad.SetDrillSize(pcbnew.VECTOR2I(drill, drill))
return pad return pad
def SMDPad(self, Vsize, Hsize, shape=pcbnew.PAD_SHAPE_RECT, rot_degree=0): def SMDPad(self, Vsize, Hsize, shape=pcbnew.PAD_SHAPE_RECT, rot_degree=0):
@ -89,7 +89,7 @@ class PadMaker(object):
@param rot_degree: the pad rotation, in degrees @param rot_degree: the pad rotation, in degrees
""" """
pad = pcbnew.PAD(self.module) pad = pcbnew.PAD(self.module)
pad.SetSize(pcbnew.wxSize(Hsize, Vsize)) pad.SetSize(pcbnew.VECTOR2I(Hsize, Vsize))
pad.SetShape(shape) pad.SetShape(shape)
pad.SetAttribute(pcbnew.PAD_ATTRIB_SMD) pad.SetAttribute(pcbnew.PAD_ATTRIB_SMD)
pad.SetLayerSet(pad.SMDMask()) pad.SetLayerSet(pad.SMDMask())

View File

@ -66,7 +66,7 @@ class TestBoardClass(unittest.TestCase):
module.Add(pad) module.Add(pad)
pad.SetShape(PAD_SHAPE_OVAL) pad.SetShape(PAD_SHAPE_OVAL)
pad.SetSize(wxSizeMM(2.0, 3.0)) pad.SetSize(VECTOR2I_MM(2.0, 3.0))
pad.SetPosition(VECTOR2I_MM(0,0)) pad.SetPosition(VECTOR2I_MM(0,0))
# easy case # easy case