Footprint wizards: fix some issues due to C++ code change.

Some constants were renamed, breaking some wizards.
This commit is contained in:
jean-pierre charras 2020-09-02 15:45:20 +02:00
parent c0afeed13d
commit eb16fec7ec
8 changed files with 14 additions and 14 deletions

View File

@ -133,7 +133,7 @@ class FPC_FootprintWizard(FootprintWizardBase.FootprintWizard):
self.draw.Line(-xstart, posy, -xend, yend) self.draw.Line(-xstart, posy, -xend, yend)
# set SMD attribute # set SMD attribute
self.module.SetAttributes(pcbnew.MOD_CMS) self.module.SetAttributes(pcbnew.MOD_SMD)
# vertical segment at left of the pad # vertical segment at left of the pad
xstart = xend xstart = xend
@ -162,18 +162,18 @@ class FPC_FootprintWizard(FootprintWizardBase.FootprintWizard):
# right pad side # right pad side
self.draw.Line(-xstart, posy, -xend, yend) self.draw.Line(-xstart, posy, -xend, yend)
# Courtyard # Courtyard
self.draw.SetLayer(pcbnew.F_CrtYd) self.draw.SetLayer(pcbnew.F_CrtYd)
max_x = max_x + linewidth + margin max_x = max_x + linewidth + margin
min_y = min_y - linewidth - margin min_y = min_y - linewidth - margin
max_y = max_y + linewidth + margin max_y = max_y + linewidth + margin
# round size to nearest 0.1mm, rectangle will thus land on a 0.05mm grid # round size to nearest 0.1mm, rectangle will thus land on a 0.05mm grid
max_x = pcbnew.PutOnGridMM(max_x, 0.05) max_x = pcbnew.PutOnGridMM(max_x, 0.05)
max_y = pcbnew.PutOnGridMM(max_y, 0.05) max_y = pcbnew.PutOnGridMM(max_y, 0.05)
min_y = pcbnew.PutOnGridMM(min_y, 0.05) min_y = pcbnew.PutOnGridMM(min_y, 0.05)
# set courtyard line thickness to the one defined in KLC # set courtyard line thickness to the one defined in KLC
self.draw.SetLineThickness(pcbnew.FromMM(0.05)) self.draw.SetLineThickness(pcbnew.FromMM(0.05))
self.draw.Line( -max_x, min_y, max_x, min_y ) self.draw.Line( -max_x, min_y, max_x, min_y )

View File

@ -164,6 +164,6 @@ class BGAWizard(FootprintWizardBase.FootprintWizard):
self.draw.Reference(0, -ypos, text_size) self.draw.Reference(0, -ypos, text_size)
# set SMD attribute # set SMD attribute
self.module.SetAttributes(pcbnew.MOD_CMS) self.module.SetAttributes(pcbnew.MOD_SMD)
BGAWizard().register() BGAWizard().register()

View File

@ -227,7 +227,7 @@ class QFNWizard(FootprintWizardBase.FootprintWizard):
self.draw.Reference(0, -text_offset, text_size) self.draw.Reference(0, -text_offset, text_size)
# set SMD attribute # set SMD attribute
self.module.SetAttributes(pcbnew.MOD_CMS) self.module.SetAttributes(pcbnew.MOD_SMD)
QFNWizard().register() QFNWizard().register()

View File

@ -166,6 +166,6 @@ class QFPWizard(FootprintWizardBase.FootprintWizard):
self.draw.Reference(0, -text_offset, text_size) self.draw.Reference(0, -text_offset, text_size)
# set SMD attribute # set SMD attribute
self.module.SetAttributes(pcbnew.MOD_CMS) self.module.SetAttributes(pcbnew.MOD_SMD)
QFPWizard().register() QFPWizard().register()

View File

@ -150,7 +150,7 @@ class QRCodeWizard(FootprintWizardBase.FootprintWizard):
self.module.Value().SetPos0(pos) self.module.Value().SetPos0(pos)
self.module.Value().SetTextHeight(self.textHeight) self.module.Value().SetTextHeight(self.textHeight)
self.module.Value().SetTextWidth(self.textWidth) self.module.Value().SetTextWidth(self.textWidth)
self.module.Value().SetThickness(self.textThickness) self.module.Value().SetTextThickness(self.textThickness)
# Add Reference field # Add Reference field
pos = pcbnew.wxPoint(0, textPosition) pos = pcbnew.wxPoint(0, textPosition)

View File

@ -132,9 +132,9 @@ class RowedFootprint(FootprintWizardBase.FootprintWizard):
# set the attribute # set the attribute
if self.GetName() == "S-DIP": if self.GetName() == "S-DIP":
self.module.SetAttributes(pcbnew.MOD_DEFAULT) self.module.SetAttributes(pcbnew.MOD_THROUGH_HOLE)
elif self.GetName() == "SOIC": elif self.GetName() == "SOIC":
self.module.SetAttributes(pcbnew.MOD_CMS) self.module.SetAttributes(pcbnew.MOD_SMD)
class SDIPWizard(RowedFootprint): class SDIPWizard(RowedFootprint):

View File

@ -189,7 +189,7 @@ class TouchSliderWizard(FootprintWizardBase.FootprintWizard):
self.draw.Reference(0, -ypos, t_size) self.draw.Reference(0, -ypos, t_size)
# set SMD attribute # set SMD attribute
self.module.SetAttributes(MOD_CMS) self.module.SetAttributes(MOD_SMD)
# starting pad # starting pad
band_width = touch_width/bands band_width = touch_width/bands

View File

@ -113,9 +113,9 @@ class RowedFootprint(FootprintWizardBase.FootprintWizard):
# set SMD attribute # set SMD attribute
if self.GetName() == "ZIP": if self.GetName() == "ZIP":
self.module.SetAttributes(pcbnew.MOD_DEFAULT) self.module.SetAttributes(pcbnew.MOD_THROUGH_HOLE)
elif self.GetName() == "ZOIC": elif self.GetName() == "ZOIC":
self.module.SetAttributes(pcbnew.MOD_CMS) self.module.SetAttributes(pcbnew.MOD_SMD)
def DrawBox(self, sizex, sizey): def DrawBox(self, sizex, sizey):