From fb17b3fa1765f69d32b2f42d955f1d099c2eb782 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Feb 2016 15:29:30 +0100 Subject: [PATCH] Set SMD attribute in footprint python generators --- pcbnew/scripting/plugins/FPC_(SMD_type)_footprintwizard.py | 3 +++ pcbnew/scripting/plugins/bga_wizard.py | 2 ++ pcbnew/scripting/plugins/qfp_wizard.py | 3 +++ pcbnew/scripting/plugins/sdip_wizard.py | 5 +++++ pcbnew/scripting/plugins/touch_slider_wizard.py | 3 +++ pcbnew/scripting/plugins/zip_wizard.py | 6 ++++++ 6 files changed, 22 insertions(+) diff --git a/pcbnew/scripting/plugins/FPC_(SMD_type)_footprintwizard.py b/pcbnew/scripting/plugins/FPC_(SMD_type)_footprintwizard.py index 2d0fd36798..bf77e93241 100644 --- a/pcbnew/scripting/plugins/FPC_(SMD_type)_footprintwizard.py +++ b/pcbnew/scripting/plugins/FPC_(SMD_type)_footprintwizard.py @@ -127,6 +127,9 @@ class FPC_FootprintWizard(HFPW.HelpfulFootprintWizardPlugin): # right pad side self.draw.Line(-xstart, posy, -xend, yend) + # set SMD attribute + self.module.SetAttributes(pcbnew.MOD_CMS) + # vertical segment at left of the pad xstart = xend yend = posy - (shl_height + linewidth + margin*2) diff --git a/pcbnew/scripting/plugins/bga_wizard.py b/pcbnew/scripting/plugins/bga_wizard.py index a9e3d775cf..cc93984725 100644 --- a/pcbnew/scripting/plugins/bga_wizard.py +++ b/pcbnew/scripting/plugins/bga_wizard.py @@ -98,5 +98,7 @@ class BGAWizard(HFPW.HelpfulFootprintWizardPlugin): self.draw.Value(0, ypos, text_size) self.draw.Reference(0, -ypos, text_size) + # set SMD attribute + self.module.SetAttributes(pcbnew.MOD_CMS) BGAWizard().register() diff --git a/pcbnew/scripting/plugins/qfp_wizard.py b/pcbnew/scripting/plugins/qfp_wizard.py index c24478a25d..ec35ea47c8 100644 --- a/pcbnew/scripting/plugins/qfp_wizard.py +++ b/pcbnew/scripting/plugins/qfp_wizard.py @@ -127,4 +127,7 @@ class QFPWizard(HelpfulFootprintWizardPlugin.HelpfulFootprintWizardPlugin): self.draw.Value(0, text_offset, text_size) self.draw.Reference(0, -text_offset, text_size) + # set SMD attribute + self.module.SetAttributes(pcbnew.MOD_CMS) + QFPWizard().register() diff --git a/pcbnew/scripting/plugins/sdip_wizard.py b/pcbnew/scripting/plugins/sdip_wizard.py index 12e308252e..2cf9d1591b 100644 --- a/pcbnew/scripting/plugins/sdip_wizard.py +++ b/pcbnew/scripting/plugins/sdip_wizard.py @@ -128,6 +128,11 @@ class RowedFootprint(HFPW.HelpfulFootprintWizardPlugin): self.draw.Value(0, 0, text_size) self.draw.Reference(-text_px, 0, text_size, orientation_degree=90) + # set the attribute + if self.GetName() == "S-DIP": + self.module.SetAttributes(pcbnew.MOD_DEFAULT) + elif self.GetName() == "SOIC": + self.module.SetAttributes(pcbnew.MOD_CMS) class SDIPWizard(RowedFootprint): diff --git a/pcbnew/scripting/plugins/touch_slider_wizard.py b/pcbnew/scripting/plugins/touch_slider_wizard.py index 8e23997743..e27fffb687 100644 --- a/pcbnew/scripting/plugins/touch_slider_wizard.py +++ b/pcbnew/scripting/plugins/touch_slider_wizard.py @@ -193,6 +193,9 @@ class TouchSliderWizard(HFPW.HelpfulFootprintWizardPlugin): ypos += t_size + w_text*2 self.draw.Reference(0, -ypos, t_size) + # set SMD attribute + self.module.SetAttributes(MOD_CMS) + # starting pad pos = wxPointMM(0,0) band_width = touch_width/bands diff --git a/pcbnew/scripting/plugins/zip_wizard.py b/pcbnew/scripting/plugins/zip_wizard.py index c97ebd1418..338728145f 100644 --- a/pcbnew/scripting/plugins/zip_wizard.py +++ b/pcbnew/scripting/plugins/zip_wizard.py @@ -118,6 +118,12 @@ class RowedFootprint(HFPW.HelpfulFootprintWizardPlugin): self.draw.Value(0, t_posy, text_size) self.draw.Reference(0, -t_posy, text_size) + # set SMD attribute + if self.GetName() == "ZIP": + self.module.SetAttributes(pcbnew.MOD_DEFAULT) + elif self.GetName() == "ZOIC": + self.module.SetAttributes(pcbnew.MOD_CMS) + def DrawBox(self, sizex, sizey): # ----------