Fix python fp wizards according to last kicad code changes, especially EDA_ANGLE
This commit is contained in:
parent
d32a72ddde
commit
901a9387e9
|
@ -639,8 +639,7 @@ class FootprintWizardDrawingAids:
|
|||
self.module.Reference().SetPosition(
|
||||
self.module.Reference().GetPos0())
|
||||
self.module.Reference().SetTextSize(text_size)
|
||||
# internal angles are in 0.1 deg
|
||||
self.module.Reference().SetTextAngle(orientation_degree * 10)
|
||||
self.module.Reference().SetTextAngle( pcbnew.EDA_ANGLE( orientation_degree, pcbnew.DEGREES_T ) )
|
||||
|
||||
def Value(self, x, y, size, orientation_degree=0):
|
||||
"""!
|
||||
|
@ -657,8 +656,7 @@ class FootprintWizardDrawingAids:
|
|||
self.module.Value().SetPosition(self.module.Value().GetPos0())
|
||||
self.module.Value().SetTextSize(text_size)
|
||||
self.module.Value().SetLayer(self.DefaultTextValueLayer())
|
||||
# internal angles are in 0.1 deg
|
||||
self.module.Value().SetTextAngle(orientation_degree * 10)
|
||||
self.module.Value().SetTextAngle( pcbnew.EDA_ANGLE( orientation_degree, pcbnew.DEGREES_T ) )
|
||||
|
||||
def Box(self, x, y, w, h):
|
||||
"""!
|
||||
|
|
|
@ -52,7 +52,7 @@ class PadMaker(object):
|
|||
pad.SetAttribute(pcbnew.PAD_ATTRIB_PTH)
|
||||
pad.SetLayerSet(pad.PTHMask())
|
||||
pad.SetDrillSize(pcbnew.VECTOR2I(drill, drill))
|
||||
pad.SetOrientation(rot_degree*10) # rotation is in 0.1 degrees
|
||||
pad.SetOrientation( pcbnew.EDA_ANGLE( rot_degree, pcbnew.DEGREES_T ) )
|
||||
|
||||
return pad
|
||||
|
||||
|
@ -93,7 +93,7 @@ class PadMaker(object):
|
|||
pad.SetShape(shape)
|
||||
pad.SetAttribute(pcbnew.PAD_ATTRIB_SMD)
|
||||
pad.SetLayerSet(pad.SMDMask())
|
||||
pad.SetOrientation(rot_degree*10) # rotation is in 0.1 degrees
|
||||
pad.SetOrientation( pcbnew.EDA_ANGLE( rot_degree, pcbnew.DEGREES_T ) )
|
||||
|
||||
return pad
|
||||
|
||||
|
@ -423,7 +423,7 @@ class PadCircleArray(PadArray):
|
|||
padAngle = self.padRotationOffset
|
||||
if self.padRotationEnable:
|
||||
padAngle -=angle
|
||||
pad.SetOrientation(padAngle*10)
|
||||
pad.SetOrientation( pcbnew.EDA_ANGLE( padAngle, pcbnew.DEGREES_T ) )
|
||||
pad.SetName(self.GetName(pin))
|
||||
self.AddPad(pad)
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class DemoArc(FootprintWizardBase.FootprintWizard):
|
|||
centery = self.parameters["demo"]["centerY"]
|
||||
startptx = centerx
|
||||
startpty = centery+radius
|
||||
self.draw.Arc(centerx, centery, startptx, startpty, arc_angle_deg * 10)
|
||||
self.draw.Arc(centerx, centery, startptx, startpty, pcbnew.EDA_ANGLE( arc_angle_deg, pcbnew.DEGREES_T ) )
|
||||
t_size = self.GetTextSize()
|
||||
self.draw.Reference(0, -t_size, t_size)
|
||||
self.draw.Value(0, t_size, t_size)
|
||||
|
|
|
@ -88,7 +88,7 @@ class MutualcapButtonWizard(FootprintWizardBase.FootprintWizard):
|
|||
|
||||
###border h
|
||||
self.module.SetLayer(F_Cu)
|
||||
size_pad = pcbnew.wxSize( w, oew )
|
||||
size_pad = pcbnew.VECTOR2I( w, oew )
|
||||
self.module.Add(self.smdRectPad(self.module,size_pad,
|
||||
pcbnew.VECTOR2I(0, (int)((-h/2)+oew/2) ),
|
||||
str(1)))
|
||||
|
@ -96,7 +96,7 @@ class MutualcapButtonWizard(FootprintWizardBase.FootprintWizard):
|
|||
pcbnew.VECTOR2I(0, (int)(( h/2)-oew/2) ),
|
||||
str(1)))
|
||||
###border v
|
||||
size_pad = pcbnew.wxSize(oBorderWidth, h-2*oew)
|
||||
size_pad = pcbnew.VECTOR2I( int(oBorderWidth), int(h-2*oew) )
|
||||
self.module.Add(self.smdRectPad(self.module,size_pad,
|
||||
pcbnew.VECTOR2I( (int)((-w/2)+oBorderWidth/2), 0),
|
||||
str(1)))
|
||||
|
@ -105,10 +105,10 @@ class MutualcapButtonWizard(FootprintWizardBase.FootprintWizard):
|
|||
str(1)))
|
||||
|
||||
xPos = -w/2+oBorderWidth+clearance+iew
|
||||
oFingerSize = pcbnew.wxSize(oew/2, h-oew-iew-2*clearance-oew)
|
||||
iFingerSize = pcbnew.wxSize(iew,h-2*oew-2*clearance)
|
||||
oFingerSize = pcbnew.VECTOR2I( int(oew/2), int(h-oew-iew-2*clearance-oew) )
|
||||
iFingerSize = pcbnew.VECTOR2I( int(iew), int(h-2*oew-2*clearance) )
|
||||
#horizontal inner electrode trace
|
||||
self.module.Add(self.smdRectPad(self.module,pcbnew.wxSize(w-2*oBorderWidth-2*clearance,iew),
|
||||
self.module.Add(self.smdRectPad(self.module,pcbnew.VECTOR2I( int(w-2*oBorderWidth-2*clearance), int(iew) ),
|
||||
pcbnew.VECTOR2I(0, (int)(h/2-oew-clearance-iew/2) ),str(2)))
|
||||
for i in range(0,oFingerCount):
|
||||
#inner electrode fingers
|
||||
|
|
|
@ -87,7 +87,7 @@ class QRCodeWizard(FootprintWizardBase.FootprintWizard):
|
|||
# and a rectangle (a square) on silkscreen
|
||||
if self.UseCu:
|
||||
pad = pcbnew.PAD(self.module)
|
||||
pad.SetSize(pcbnew.wxSize(self.X, self.X))
|
||||
pad.SetSize(pcbnew.VECTOR2I(self.X, self.X))
|
||||
pad_pos = pcbnew.VECTOR2I(xposition,yposition)
|
||||
pad.SetPosition(pad_pos)
|
||||
pad.SetPos0(pad_pos)
|
||||
|
|
Loading…
Reference in New Issue