← Back to team overview

kicad-developers team mailing list archive

Re: PATCH: Set SMD attribute in footprint wizard

 

I agree with that, most of my small components dont comply with this KLC
rule and I live very well with it.

I split this patch in two. Here is the part which takes care of setting the
attributes. I'll submit the rounding function patch later today.

Cheers,
Mikael

On Tue, Feb 16, 2016 at 10:00 AM, jp charras <jp.charras@xxxxxxxxxx> wrote:

> Le 16/02/2016 18:05, Mikael Arguedas a écrit :
> > What can be done is add a parameter to this ceiling function which
> default
> > value would be 0.05 but that people can provide if they want a different
> > value.
> >
> > Regarding the ceiling function itself, I designed it only for the current
> > use of the python scripts drawing courtyard so I dealt only positive
> values
> > but if people can specify coordinates or lines in grid space it makes a
> lot
> > of sense to handle negative values.
> >
> > Finally, Jean-Pierre by doing a put on grid function, would you like to
> > have the option to chose between near ceil or floor ? or do you want this
> > ceiling function to be named "round on grid" to allow us to change the
> > rounding later without changing the method name ?
> >
> > Cheers,
> > Mikael
> >
>
> I do not have a strong opinion about that.
> In many cases the best choice is not easy to know, especially for
> coordinates.
>
> So, for me: the simpler the best:
> round on grid to near (usual rounding) is the simpler.
> And if the rounding error can create issues for small components, it
> means the grid is too large.
>
> Therefore round on grid to nearest with a grid size as parameter could
> be the best.
>
> (For very small footprints why to round coordinates or sizes ? This is
> not useful)
>
> --
> Jean-Pierre CHARRAS
>
=== modified file 'pcbnew/scripting/plugins/FPC_(SMD_type)_footprintwizard.py'
--- pcbnew/scripting/plugins/FPC_(SMD_type)_footprintwizard.py	2016-02-11 15:02:37 +0000
+++ pcbnew/scripting/plugins/FPC_(SMD_type)_footprintwizard.py	2016-02-16 17:42:45 +0000
@@ -127,6 +127,9 @@
         # 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)

=== modified file 'pcbnew/scripting/plugins/bga_wizard.py'
--- pcbnew/scripting/plugins/bga_wizard.py	2016-02-11 15:02:37 +0000
+++ pcbnew/scripting/plugins/bga_wizard.py	2016-02-16 17:43:54 +0000
@@ -98,5 +98,7 @@
         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()

=== modified file 'pcbnew/scripting/plugins/qfp_wizard.py'
--- pcbnew/scripting/plugins/qfp_wizard.py	2016-02-11 15:02:37 +0000
+++ pcbnew/scripting/plugins/qfp_wizard.py	2016-02-16 17:44:32 +0000
@@ -127,4 +127,7 @@
         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()

=== modified file 'pcbnew/scripting/plugins/sdip_wizard.py'
--- pcbnew/scripting/plugins/sdip_wizard.py	2016-02-14 09:47:07 +0000
+++ pcbnew/scripting/plugins/sdip_wizard.py	2016-02-16 17:47:43 +0000
@@ -128,6 +128,11 @@
             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):
 

=== modified file 'pcbnew/scripting/plugins/touch_slider_wizard.py'
--- pcbnew/scripting/plugins/touch_slider_wizard.py	2016-02-11 15:02:37 +0000
+++ pcbnew/scripting/plugins/touch_slider_wizard.py	2016-02-16 17:48:06 +0000
@@ -193,6 +193,9 @@
         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

=== modified file 'pcbnew/scripting/plugins/zip_wizard.py'
--- pcbnew/scripting/plugins/zip_wizard.py	2016-02-11 15:02:37 +0000
+++ pcbnew/scripting/plugins/zip_wizard.py	2016-02-16 17:46:33 +0000
@@ -118,6 +118,12 @@
         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):
 
         #  ----------


Follow ups

References