kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #23117
Re: PATCH: Set SMD attribute in footprint wizard
Hi guys,
Here is an updated version of the patch, I removed the textSize fix because
it has already been merged here
<https://lists.launchpad.net/kicad-developers/msg23113.html>.
Cheers,
Mikael Arguedas
On Fri, Feb 12, 2016 at 8:56 AM, Mikael Arguedas <mikael.arguedas@xxxxxxxxx>
wrote:
> Hi Miguel,
>
> I'm new to bazaar and that's the reason I started by just submitting patch
> files but for any further feature addition I'll send a branch for review.
>
> Yes the purpose of this function was to perform a ceil. Either of these
> implementations is good for me given that they have the same complexity and
> the same result.
>
> Cheers,
> Mikael Arguedas
>
>
> On Fri, Feb 12, 2016 at 1:31 AM, Miguel Angel Ajo Pelayo <
> majopela@xxxxxxxxxx> wrote:
>
>> Hi, Mikael, I haven’t fully looked at the patch, it would be easier if
>> you can send a branch for review via launchpad.
>>
>> But, Could you explain those changes:
>>
>> === 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-12 03:39:11 +0000
>> @@ -113,6 +113,8 @@
>> self.draw.SetLayer(pcbnew.F_CrtYd)
>> sizex = (lim_x + cmargin) * 2 + pad_length
>> sizey = (lim_y + cmargin) * 2 + pad_length
>> + sizex = (int(sizex/100000)+1)*100000
>> + sizey = (int(sizey/100000)+1)*100000
>>
>>
>> --- pcbnew/scripting/plugins/zip_wizard.py 2016-02-11 15:02:37 +0000
>> +++ pcbnew/scripting/plugins/zip_wizard.py 2016-02-12 03:31:52 +0000
>> @@ -106,6 +106,8 @@
>> thick = self.draw.GetLineThickness()
>> sizex = (pin1posX + cmarginx) * 2 + pad_Hsize + thick
>> sizey = (pin1posY + cmarginy) * 2 + pad_Vsize + thick
>> + sizex = (int(sizex/100000)+1)*100000
>> + sizey = (int(sizey/100000)+1)*100000
>>
>>
>>
>> The semantics for size x/y seem very different. :)
>>
>> Also, are you trying to round here?
>> + sizex = (int(sizex/100000)+1)*100000
>> + sizey = (int(sizey/100000)+1)*100000
>>
>> Wouldn’t it be better like
>> sizex = (int((sizex+(100000-1))/100000))*100000
>> (if you were trying to do a ceil?)
>>
>>
>> Cheers,
>> Miguel Ángel
>>
>>
>> On 12 Feb 2016, at 05:03, Mikael Arguedas <mikael.arguedas@xxxxxxxxx>
>> wrote:
>>
>> Hi guys,
>>
>> Here is the updated patch including changes from
>> https://lists.launchpad.net/kicad-developers/msg23059.html
>> This patch fixes the following KLC violations in the generated footprints:
>> - fixes the text size as specified in rule 6.9
>> - rounds the courtyard position on a 0.05mm grid as specified in rule 6.6
>> - set the attribute for SMD components as specified in rule 10.5
>>
>> Cheers,
>> Mikael Arguedas
>>
>> On Thu, Feb 11, 2016 at 6:54 PM, Mikael Arguedas <
>> mikael.arguedas@xxxxxxxxx> wrote:
>>
>>> Hi guys,
>>>
>>> Sorry for spamming.
>>> This patch sets the footprint attibute to SMD if needed. This allows the
>>> generated footprints to comply with KLC rule 10.5.
>>>
>>> Cheers,
>>> Mikael Arguedas
>>>
>>
>> <fixWizards.patch>_______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help : https://help.launchpad.net/ListHelp
>>
>>
>>
>
=== 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-12 02:38:32 +0000
@@ -152,5 +152,7 @@
# right pad side
self.draw.Line(-xstart, posy, -xend, yend)
+ # set attribute
+ self.module.SetAttributes(pcbnew.MOD_CMS)
FPC_FootprintWizard().register()
=== 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-12 03:38:17 +0000
@@ -86,6 +86,8 @@
self.draw.SetLayer(pcbnew.F_CrtYd)
sizex = (ssx + cmargin) * 2
sizey = (ssy + cmargin) * 2
+ sizex = (int(sizex/100000)+1)*100000
+ sizey = (int(sizey/100000)+1)*100000
# set courtyard line thickness to the one defined in KLC
self.draw.SetLineThickness(pcbnew.FromMM(0.05))
self.draw.Box(0, 0, sizex, sizey)
@@ -98,5 +100,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-12 03:39:11 +0000
@@ -113,6 +113,8 @@
self.draw.SetLayer(pcbnew.F_CrtYd)
sizex = (lim_x + cmargin) * 2 + pad_length
sizey = (lim_y + cmargin) * 2 + pad_length
+ sizex = (int(sizex/100000)+1)*100000
+ sizey = (int(sizey/100000)+1)*100000
# set courtyard line thickness to the one defined in KLC
thick = self.draw.GetLineThickness()
self.draw.SetLineThickness(pcbnew.FromMM(0.05))
@@ -127,4 +129,6 @@
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-11 15:02:37 +0000
+++ pcbnew/scripting/plugins/sdip_wizard.py 2016-02-12 03:37:26 +0000
@@ -109,6 +109,8 @@
self.draw.SetLayer(pcbnew.F_CrtYd)
sizex = (ssx + cmargin) * 2
sizey = (ssy + cmargin) * 2
+ sizex = (int(sizex/100000)+1)*100000
+ sizey = (int(sizey/100000)+1)*100000
# set courtyard line thickness to the one defined in KLC
self.draw.SetLineThickness(pcbnew.FromMM(0.05))
self.draw.Box(0, 0, sizex, sizey)
@@ -127,6 +129,11 @@
# self.draw.Value(text_px, 0, text_size, orientation_degree=90)
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-12 02:51:13 +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-12 03:31:52 +0000
@@ -106,6 +106,8 @@
thick = self.draw.GetLineThickness()
sizex = (pin1posX + cmarginx) * 2 + pad_Hsize + thick
sizey = (pin1posY + cmarginy) * 2 + pad_Vsize + thick
+ sizex = (int(sizex/100000)+1)*100000
+ sizey = (int(sizey/100000)+1)*100000
self.draw.SetLineThickness(pcbnew.FromMM(0.05))
self.draw.Box(0, 0, sizex, sizey)
# restore line thickness to previous value
@@ -118,6 +120,13 @@
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):
# ----------
References