[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gEDA-dev: tragesym patch



Hi,

Adds 2 features:

1. If the size calculation of the symbol width is left to tragesym (sym_width=0) there is a possibility to configure increments for symbol width and height, by this feature it is easy to eliminate overlapping pin labels at the symbol corners.

2. If "package_order=yes" option is passed, the pins are placed into the symbol with counterclockwise order sorted by the pin numbers. It is good if one wants to make a symbol where the layout is similar to the package layout. (Of course it is not true for BGA and such esoteric packages).

The patch is based on the latest development version which I've found: http://geda.seul.org/devel/v1.5/1.5.0/geda-utils-1.5.0.tar.gz

Cheers,
Endre


      
25a26,34
> #
> # Changes:
> # - 2008.Nov.13 Endre Bak, endrebak@yahoo.com
> #   sym_width_inc and sym_height_inc options:
> #     only used when sym_width=0, intends to avoid overlapping pin labels
> #   package_order:
> #     if set, pins are placed from left to right on the bottom, bottom to top
> #     on the right side, right to left on the top and top to bottom on
> #     the left side. Inspired by a QFP64 package.
37a47,49
>                   "sym_width_inc":"400",
>                   "sym_height_inc":"400",
>                   "package_order":"no",
95d106
< 
266c277
< 	o_vdist=string.atoi(options["pinwidthvertical"])
---
> 		o_vdist=string.atoi(options["pinwidthvertical"])
302c313
< 	bottomlefty += pinlength
---
>         bottomlefty += pinlength
312c323
< 	print "note: use sym_width to adjust symbol width if texts overlap."
---
>         print "note: use sym_width to adjust symbol width if texts overlap."
315c326,330
< 	o_symwidth = calculated_symwidth
---
>         # e_bak: make the symbol wider to eliminate pin-label overlapping
>         o_symwidth = calculated_symwidth + string.atoi(options["sym_width_inc"])
>         height_inc = string.atoi(options["sym_height_inc"])
>     else:
>         height_inc = 0
322c337,341
<     topy = bottomlefty + high
---
>     # e_bak: make the symbol taller to eliminate pin-label overlapping
>     if height_inc:
>         high += height_inc
>     # FIXME: e_bak: Is topy not used?
>     #topy = bottomlefty + high;
325,326c344,345
<     prightx, prighty= bottomleftx + pinlength + o_symwidth, prighty + bottomlefty + o_vdist
<     pleftx, plefty= bottomleftx - pinlength, plefty + bottomlefty + o_vdist
---
>     prightx, prighty= bottomleftx + pinlength + o_symwidth, prighty + bottomlefty + o_vdist + height_inc/2
>     pleftx, plefty= bottomleftx - pinlength, plefty + bottomlefty + o_vdist + height_inc/2
328c347
<     pbottomx, pbottomy = bottomleftx + o_hdist, bottomlefty - pinlength   
---
>     pbottomx, pbottomy = bottomleftx + o_hdist, bottomlefty - pinlength
571a591,615
> def cmp_pin_num(pin0, pin1):
>     return int(pin0.nr) - int(pin1.nr)
> 
> def append(adst, asrc):
>     for val in asrc: adst.append(val)
> 
> def package_order(pins):
>     bottom = []; right = []; top = []; left = []
>     for pin in pins:
>         if pin.pos == "b":
>             bottom.append(pin)
>         elif pin.pos == "r":
>             right.append(pin)
>         elif pin.pos == "t":
>             top.append(pin)
>         elif pin.pos == "l":
>             left.append(pin)
>     bottom.sort(cmp=cmp_pin_num)
>     right.sort(cmp=cmp_pin_num, reverse=True)
>     top.sort(cmp=cmp_pin_num, reverse=True)
>     left.sort(cmp=cmp_pin_num)
>     pins = bottom; append(pins, right)
>     append(pins, top); append(pins, left)
>     return pins
> 
602a647,649
> if options["package_order"] == "yes":
>     pins = package_order(pins)
> 


_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev