File "dev_skill.il"
Full Path: /home/analogde/www/SKILL/dev_skill.il
File size: 10.42 KB
MIME-type: text/plain
Charset: utf-8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure(gui()
tmp2 = '()
cv = geGetWindowCellView()
terminal_list = sort(cv~>terminals~>name nil)
ordonner_terminal = sort( terminal_list 'alphalessp )
for(i 0 length(ordonner_terminal)-1
;id = leSearchHierarchy(cv cv~>bBox 0 "label" list(list("text" "==" nth(i ordonner_terminal) )))
id = leSearchHierarchy(cv cv~>bBox 0 "pin" list(list("term name" "==" nth(i ordonner_terminal) )))
tmp2 = append1(tmp2 car(id))
)
longueur = length(ordonner_terminal)
champs_datas = '()
y=0
for(i 0 longueur-1
nom = nth(i tmp2)~>net~>name
printf(" >>>>** : %s \n" nom)
id_nom = stringToSymbol(sprintf(nil "nom_%d" i))
id_nom = hiCreateLabel( ?name stringToSymbol(sprintf(nil "nom_pin_%d" i))
?labelText nom
)
champs_datas = append1(champs_datas list(id_nom 10:y+10 20:50 ))
y = y + 30
)
y=0
for(i 0 longueur-1
box = nth(i tmp2)~>bBox
x1 = car(car(box))
y1 = cadr(car(box))
x2 = car(cadr(box))
y2 = cadr(cadr(box))
largeur = abs(abs(x2) - abs(x1) )
hauteur = abs(abs(y2) - abs(y1) )
id_largeur = stringToSymbol(sprintf(nil "largeur_%d" i))
id_largeur = hiCreateFloatField(
?name stringToSymbol(sprintf(nil "largeur_pin_%d" i))
?prompt ""
?value largeur
?defValue 10.0
?callback "check_champ( Form_sec )" ;hiGetCurrentForm()
;"println(\"float changed\" )"
?range list(0 100)
)
champs_datas = append1(champs_datas list(id_largeur 100:y+20 60:50 ))
y = y + 30
)
y=0
for(i 0 longueur-1
box = nth(i tmp2)~>bBox
x1 = car(car(box))
y1 = cadr(car(box))
x2 = car(cadr(box))
y2 = cadr(cadr(box))
largeur = abs(abs(x2) - abs(x1))
hauteur = abs(abs(y2) - abs(y1))
id_hauteur = stringToSymbol(sprintf(nil "hauteur_%d" i))
id_hauteur = hiCreateFloatField(
?name stringToSymbol(sprintf(nil "hauteur_pin_%d" i))
?prompt ""
?value hauteur
?defValue 10.0
?callback "check_champ( Form_sec )"
?range list(0 100)
)
champs_datas = append1(champs_datas list(id_hauteur 180:y+20 60:50 ))
y = y + 30
)
y=0
for(i 0 longueur-1
position = "left"
id_position = stringToSymbol(sprintf(nil "position_%d" i))
id_position = hiCreateCyclicField(
?name stringToSymbol(sprintf(nil "position_pin_%d" i))
?prompt " "
?choices list("left" "right" "top" "bottom")
?value position
?callback "println( \"position change\" )"
)
champs_datas = append1(champs_datas list(id_position 350:y+20 200:50 10))
y = y + 30
)
y=0
for(i 0 longueur-1
couche = "METAL1"
id_couche = stringToSymbol(sprintf(nil "couche_%d" i))
id_couche = hiCreateCyclicField(
?name stringToSymbol(sprintf(nil "couche_pin_%d" i))
?prompt " "
?choices list("METAL1" "METAL2" "METAL3" "METAL4")
?value couche
?callback "println( \"couche change\" )"
)
champs_datas = append1(champs_datas list(id_couche 450:y+20 200:50 10))
y = y + 30
)
id_space = hiCreateFloatField(
?name 'spacing
?prompt "Espace:"
?value 0.28
?defValue 0.28
?range list(0 10000)
)
champs_datas = append1(champs_datas list(id_space 10:y+20 130:80 50))
y = y + 60
id_style = hiCreateCyclicField(
?name 'text_style
?choices '("stick" "roman" "gothic")
?prompt "Style :"
?value "stick"
?defValue "stick"
)
champs_datas = append1(champs_datas list(id_style 10:y+20 10:180 100))
id_taille = hiCreateFloatField(
?name 'taille
?prompt "Taille:"
?value 0.28
?defValue 0.28
?range list(0 10000)
)
champs_datas = append1(champs_datas list(id_taille 10:y+20 130:80 50))
y = y + 60
btn_place = hiCreateButton( ?name 'btn_place
?buttonText "Placer pins"
?callback "placer()"
)
champs_datas = append1(champs_datas list(btn_place 200:y+50 110:30 10))
Form_appli = hiCreateAppForm(
?name 'Form_sec
?formTitle "PIN Definition : @ patrice.delpy"
?fields champs_datas
?callback 'verifier_focus
?initialSize t
?unmapAfterCB nil
)
hiDisplayForm(Form_appli)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure(placer()
cpt_gauche=0
cpt_droite=0
cpt_haut=0
cpt_bas=0
espace = 0.0
H_precedent = 0.0
L_precedent = 0.0
minX=0
minY=0
maxX=200
maxY=100
tmp3 = '()
espace = Form_appli~>spacing~>value
style = Form_appli~>text_style~>value
for(i 0 length(ordonner_terminal)-1
sprintf(largeur "Form_appli~>largeur_pin_%d~>value" i)
L = evalstring(largeur)
sprintf(hauteur "Form_appli~>hauteur_pin_%d~>value" i)
H = evalstring(hauteur)
sprintf(position "Form_appli~>position_pin_%d~>value" i)
pos = evalstring(position)
sprintf(couche "Form_appli~>couche_pin_%d~>value" i)
layer = evalstring(couche)
case( pos
("left"
printf(" LEFT \n" )
if(cpt_gauche==0 then
x1=minX
y1=minY
cpt_gauche++
H_precedent=H
else
x1=x1
y1=y1+H_precedent+espace
cpt_gauche++
H_precedent=H
);if
)
("right"
printf(" right \n" )
if(cpt_droite==0 then
x1=maxX-L
y1=minY
cpt_droite++
H_precedent=H
else
x1=x1
y1=y1+H_precedent+espace
cpt_droite++
H_precedent=H
);if
)
("top"
printf(" top \n" )
if(cpt_haut==0 then
x1=minX
y1=maxY-H
cpt_haut++
L_precedent=L
else
x1=x1+L_precedent+espace
y1=maxY-H
cpt_haut++
L_precedent=L
);if
)
("bottom"
printf(" bottom \n" )
if(cpt_bas==0 then
x1=minX
y1=minY
L_precedent=L
cpt_bas++
else
x1=x1+L_precedent+espace
y1=y1
L_precedent=L
cpt_bas++
);if
)
); case
delta_x=x1+L ;x0
delta_y=y1+H ;y0
couple=list(x1:y1 delta_x:delta_y)
printf(" nouvelle taille %L \n" couple)
nth(i tmp2)~>bBox=couple
)
for(i 0 length(ordonner_terminal)-1
id = leSearchHierarchy(cv cv~>bBox 0 "label" list(list("text" "==" nth(i ordonner_terminal) )))
tmp3 = append1(tmp3 car(id))
)
for(i 0 length(ordonner_terminal)-1
box = nth(i tmp2)~>bBox
centreX=((caadr(box) - caar(box))/2.0) + caar(box)
centreY=((cadadr(box) - cadar(box))/2.0) + cadar(box)
nth(i tmp3)~>xy=list(centreX centreY)
nth(i tmp3)~>lpp = list("METAL1" "pin")
nth(i tmp3)~>height = 0.2
nth(i tmp3)~>font = style
;printf(" Centre %L %L\n" centreX centreY)
)
printf(" Placement is done ... \n" )
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure(traitement_pins()
cpt_gauche=0
cpt_droite=0
cpt_haut=0
cpt_bas=0
espace=1
position = "bottom"
minX=0
minY=0
L = 0.4
H = 0.6
cv=geGetWindowCellView()
tmp1 = '()
tmp2 = '()
terminal_list = sort(cv~>terminals~>name nil)
ordonner_terminal = sort( terminal_list 'alphalessp )
for(i 0 length(ordonner_terminal)-1
id = leSearchHierarchy(cv cv~>bBox 0 "pin" list(list("term name" "==" nth(i ordonner_terminal) )))
tmp1 = append1(tmp1 car(id))
)
for(i 0 length(ordonner_terminal)-1
printf(" ** : %s \n" nth(i tmp1)~>pin~>term~>name )
)
for(i 0 length(terminal_list)-1
case( position
("left"
if(cpt_gauche==0 then
x1=minX
y1=minY
cpt_gauche++
H_precedent=H
else
x1=x1
y1=y1+H_precedent+espace
cpt_gauche++
H_precedent=H
);if
)
("right"
if(cpt_droite==0 then
x1=maxX-L
y1=minY
cpt_droite++
H_precedent=H
else
x1=x1
y1=y1+H_precedent+espace
cpt_droite++
H_precedent=H
);if
)
("top"
if(cpt_haut==0 then
x1=minX
y1=maxY-H
cpt_haut++
L_precedent=L
else
x1=x1+L_precedent+espace
y1=maxY-H
cpt_haut++
L_precedent=L
);if
)
("bottom"
if(cpt_bas==0 then
x1=minX
y1=minY
L_precedent=L
cpt_bas++
else
x1=x1+L_precedent+espace
y1=y1
L_precedent=L
cpt_bas++
);if
)
); case
delta_x=x1+L ;x0
delta_y=y1+H ;y0
couple=list(x1:y1 delta_x:delta_y)
printf(" nouvelle taille %L \n" couple)
nth(i tmp1)~>bBox=couple
)
for(i 0 length(ordonner_terminal)-1
id = leSearchHierarchy(cv cv~>bBox 0 "label" list(list("text" "==" nth(i tmp1)~>pin~>term~>name )))
tmp2 = append1(tmp2 car(id))
)
for(i 0 length(ordonner_terminal)-1
box = nth(i tmp1)~>bBox
centreX=((caadr(box) - caar(box))/2.0) + caar(box)
centreY=((cadadr(box) - cadar(box))/2.0) + cadar(box)
nth(i tmp2)~>xy=list(centreX centreY)
nth(i tmp2)~>lpp = list("METAL1" "pin")
nth(i tmp2)~>height = 0.2
;printf(" Centre %L %L\n" centreX centreY)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure(extraire()
tmp2 = '()
cv = geGetWindowCellView()
terminal_list = sort(cv~>terminals~>name nil)
ordonner_terminal = sort( terminal_list 'alphalessp )
for(i 0 length(ordonner_terminal)-1
id = leSearchHierarchy(cv cv~>bBox 0 "label" list(list("text" "==" nth(i ordonner_terminal) )))
tmp2 = append1(tmp2 car(id))
)
;gui(tmp2)
)