1
0
mirror of git://projects.qi-hardware.com/xue.git synced 2024-11-16 08:18:06 +02:00

kccomp.py has been fixed

This commit is contained in:
Andres Calderon 2011-01-14 20:47:21 -05:00
parent eea70b29e4
commit 61118e4895

View File

@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from datetime import datetime
from math import ceil
class KcLibrary:
def __init__(self, name):
@ -69,9 +71,10 @@ class KcUnit:
ll = max(self.left_pins, key=lambda KcPin: len(KcPin.name))
lr = max(self.right_pins, key=lambda KcPin: len(KcPin.name))
sl = (len( ll.name + " " + part + " " + lr.name))/2
H = max(len(self.left_pins),len(self.right_pins),10)/2*100
W = max(len(self.top_pins)+6,len(self.bot_pins)+6,sl)/2*100
W = max(len(self.top_pins)*60+len(ll.name)*40+40,len(self.bot_pins)*60+len(lr.name)*40+40,sl/2*100)
W = int(ceil(W/100.0)*100)
of.writelines('S ' + str(-W) + ' ' + str(-H-100) + ' ' + str(W) + ' ' + str(H+100) + ' ' + str(self.id_unit) +' 1 0 f\n')