[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gEDA-dev: tragesym patch
Hi Endre,
On Donnerstag, 13. November 2008, Endre Bak wrote:
> 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.
That's a nice feature.
> 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).
Not sure about that one because of the following reasons:
1. It is easy to write the input file already in the required ordering.
2. The ordering will fail if you have a PLCC package, where the top pin
row isn't ordered in increasing order.
3. Personally I'm not a fan of package order style of symbols.
I also saw that your sort function is quite complicated.
Here's the code I'd use for it: (untested)
--------
def compare_func(pin_a, pin_b):
if pin_a.pos != pin_b.pos:
return cmp(pin_a.pos, pin_b.pos)
if pin_a.pos in ['r','t']:
return cmp(-int(pin_a.nr, -int(pin_b.nr))
else:
return cmp(int(pin_a.nr, int(pin_b.nr))
pins.sort(compare_func)
--------
Maybe it's even possible to define different __cmp__ functions for the
pin object. Thus the compare function would be part of the pin class.
> 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
applied to my local git repo. Not yet sure how I will proceed.
Regards
Werner
PS: Please use the unified diff format to create patches (diff -u)
_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev