From eb16fec7ec97201172839c780fd9df6fcc26f2f7 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 2 Sep 2020 15:45:20 +0200 Subject: [PATCH] Footprint wizards: fix some issues due to C++ code change. Some constants were renamed, breaking some wizards. --- pcbnew/python/plugins/FPC_wizard.py | 10 +++++----- pcbnew/python/plugins/bga_wizard.py | 2 +- pcbnew/python/plugins/qfn_wizard.py | 2 +- pcbnew/python/plugins/qfp_wizard.py | 2 +- pcbnew/python/plugins/qrcode_footprint_wizard.py | 2 +- pcbnew/python/plugins/sdip_wizard.py | 4 ++-- pcbnew/python/plugins/touch_slider_wizard.py | 2 +- pcbnew/python/plugins/zip_wizard.py | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pcbnew/python/plugins/FPC_wizard.py b/pcbnew/python/plugins/FPC_wizard.py index f57f08230b..894615015f 100644 --- a/pcbnew/python/plugins/FPC_wizard.py +++ b/pcbnew/python/plugins/FPC_wizard.py @@ -133,7 +133,7 @@ class FPC_FootprintWizard(FootprintWizardBase.FootprintWizard): self.draw.Line(-xstart, posy, -xend, yend) # set SMD attribute - self.module.SetAttributes(pcbnew.MOD_CMS) + self.module.SetAttributes(pcbnew.MOD_SMD) # vertical segment at left of the pad xstart = xend @@ -162,18 +162,18 @@ class FPC_FootprintWizard(FootprintWizardBase.FootprintWizard): # right pad side self.draw.Line(-xstart, posy, -xend, yend) - + # Courtyard self.draw.SetLayer(pcbnew.F_CrtYd) max_x = max_x + 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 max_x = pcbnew.PutOnGridMM(max_x, 0.05) max_y = pcbnew.PutOnGridMM(max_y, 0.05) min_y = pcbnew.PutOnGridMM(min_y, 0.05) - + # set courtyard line thickness to the one defined in KLC self.draw.SetLineThickness(pcbnew.FromMM(0.05)) self.draw.Line( -max_x, min_y, max_x, min_y ) diff --git a/pcbnew/python/plugins/bga_wizard.py b/pcbnew/python/plugins/bga_wizard.py index e2b5aceb8a..82746f45b6 100644 --- a/pcbnew/python/plugins/bga_wizard.py +++ b/pcbnew/python/plugins/bga_wizard.py @@ -164,6 +164,6 @@ class BGAWizard(FootprintWizardBase.FootprintWizard): self.draw.Reference(0, -ypos, text_size) # set SMD attribute - self.module.SetAttributes(pcbnew.MOD_CMS) + self.module.SetAttributes(pcbnew.MOD_SMD) BGAWizard().register() diff --git a/pcbnew/python/plugins/qfn_wizard.py b/pcbnew/python/plugins/qfn_wizard.py index 97e533490a..b134918e9e 100644 --- a/pcbnew/python/plugins/qfn_wizard.py +++ b/pcbnew/python/plugins/qfn_wizard.py @@ -227,7 +227,7 @@ class QFNWizard(FootprintWizardBase.FootprintWizard): self.draw.Reference(0, -text_offset, text_size) # set SMD attribute - self.module.SetAttributes(pcbnew.MOD_CMS) + self.module.SetAttributes(pcbnew.MOD_SMD) QFNWizard().register() diff --git a/pcbnew/python/plugins/qfp_wizard.py b/pcbnew/python/plugins/qfp_wizard.py index 4dd686064f..52cb05a9ef 100644 --- a/pcbnew/python/plugins/qfp_wizard.py +++ b/pcbnew/python/plugins/qfp_wizard.py @@ -166,6 +166,6 @@ class QFPWizard(FootprintWizardBase.FootprintWizard): self.draw.Reference(0, -text_offset, text_size) # set SMD attribute - self.module.SetAttributes(pcbnew.MOD_CMS) + self.module.SetAttributes(pcbnew.MOD_SMD) QFPWizard().register() diff --git a/pcbnew/python/plugins/qrcode_footprint_wizard.py b/pcbnew/python/plugins/qrcode_footprint_wizard.py index 7040821636..a80c920089 100644 --- a/pcbnew/python/plugins/qrcode_footprint_wizard.py +++ b/pcbnew/python/plugins/qrcode_footprint_wizard.py @@ -150,7 +150,7 @@ class QRCodeWizard(FootprintWizardBase.FootprintWizard): self.module.Value().SetPos0(pos) self.module.Value().SetTextHeight(self.textHeight) self.module.Value().SetTextWidth(self.textWidth) - self.module.Value().SetThickness(self.textThickness) + self.module.Value().SetTextThickness(self.textThickness) # Add Reference field pos = pcbnew.wxPoint(0, textPosition) diff --git a/pcbnew/python/plugins/sdip_wizard.py b/pcbnew/python/plugins/sdip_wizard.py index 79e80de0c6..3961284b04 100644 --- a/pcbnew/python/plugins/sdip_wizard.py +++ b/pcbnew/python/plugins/sdip_wizard.py @@ -132,9 +132,9 @@ class RowedFootprint(FootprintWizardBase.FootprintWizard): # set the attribute if self.GetName() == "S-DIP": - self.module.SetAttributes(pcbnew.MOD_DEFAULT) + self.module.SetAttributes(pcbnew.MOD_THROUGH_HOLE) elif self.GetName() == "SOIC": - self.module.SetAttributes(pcbnew.MOD_CMS) + self.module.SetAttributes(pcbnew.MOD_SMD) class SDIPWizard(RowedFootprint): diff --git a/pcbnew/python/plugins/touch_slider_wizard.py b/pcbnew/python/plugins/touch_slider_wizard.py index ee24c22b9b..3476d63a38 100644 --- a/pcbnew/python/plugins/touch_slider_wizard.py +++ b/pcbnew/python/plugins/touch_slider_wizard.py @@ -189,7 +189,7 @@ class TouchSliderWizard(FootprintWizardBase.FootprintWizard): self.draw.Reference(0, -ypos, t_size) # set SMD attribute - self.module.SetAttributes(MOD_CMS) + self.module.SetAttributes(MOD_SMD) # starting pad band_width = touch_width/bands diff --git a/pcbnew/python/plugins/zip_wizard.py b/pcbnew/python/plugins/zip_wizard.py index 75e03ca457..127088dba2 100644 --- a/pcbnew/python/plugins/zip_wizard.py +++ b/pcbnew/python/plugins/zip_wizard.py @@ -113,9 +113,9 @@ class RowedFootprint(FootprintWizardBase.FootprintWizard): # set SMD attribute if self.GetName() == "ZIP": - self.module.SetAttributes(pcbnew.MOD_DEFAULT) + self.module.SetAttributes(pcbnew.MOD_THROUGH_HOLE) elif self.GetName() == "ZOIC": - self.module.SetAttributes(pcbnew.MOD_CMS) + self.module.SetAttributes(pcbnew.MOD_SMD) def DrawBox(self, sizex, sizey):