|
(putd (quote prg_autoSpliting) nil)
+ N# \% ?" h6 M(putd (quote prg_autoSplitingform) nil)
* Q8 ^& H9 s9 e* ~/ V, e(putd (quote autoSpliting_callback) nil) + a% J$ ^( @. L3 ?- D$ j' [
(axlShell "done")
: R9 b" f4 y7 K" X(axlCmdRegister "fn_autoSpliting" (_backquote prg_autoSpliting) ?cmdType "general")
2 r( J0 L& G( S+ {7 U: {(setq film (axlGetParam "paramLayerGroup:etch"))
. X$ {# M( k0 Q5 F(setq film (getq film groupMembers)) % {' I3 t G7 B& g$ v4 W
(setq LayerCnt (length (axlSubclassRoute))) ! \( ~/ g' r( ]5 z% ~8 J
(setq negFilm (quote nil))
* | [5 q9 @& X% g- }(foreach film_e film (setq temp (strcat "ETCH/" film_e)) " A, B3 N7 U" q2 w3 ] K' e
(if (equal (axlIsLayerNegative temp) t) then (setq negFilm (cons film_e negFilm))))0 m% Y7 V! T) T4 k' }
(setq negFilm (reverse negFilm)) 5 k' x" h! B \5 k! n: g% X
(defun prg_autoSpliting nil (if (nequal (isFile "d:/script/I.bmp") t) $ h- ~: v( n2 C9 {
then (renameFile "d:/script/Inventec" "d:/script/I.bmp"))
+ W/ ^$ @, y' k4 V+ I2 y9 k (prg_autoSplitingform) (setq disp_autoSplitingform (axlFormCreate (gensym) "d:/script/autoSpliting.form" (_backquote ("e" "outer")) (_backquote autoSpliting_callback) t)) ! q" R/ W6 x0 }8 ^; _. _% g% X
(axlFormDisplay disp_autoSplitingform)
& F5 w0 U9 Q4 j7 I; [9 y2 g (axlFormSetFieldEditable disp_autoSplitingform "create" nil)
, f7 g+ V0 }' Z2 U, E( B (deleteFile "d:/script/autoSpliting.form")
B8 J2 P) `' y# j, G (renameFile "d:/script/Inventec.bmp" "d:/script/Inventec"))
7 V Z4 Q) n7 A N) U(defun autoSpliting_callback (disp_autoSplitingform) (case (getq disp_autoSplitingform curField) ("negLayer" (if (getq disp_autoSplitingform curValue) then (axlFormSetFieldEditable disp_autoSplitingform "create" t))) ("cancel" (axlFormClose disp_autoSplitingform) 3 C5 Y) J% g; m, c/ S! `
(axlVisibleSet layerActive) + s% K, J/ z3 e2 N4 u+ z
(axlWindowBoxSet windowBox)
9 C) O7 I! `% e7 F) V* q (axlUIWRedraw nil)) ("create" (setq layerActive (axlVisibleGet)) (setq windowBox (axlWindowBoxGet))
) p9 _/ ?! ~- |4 M$ } (axlVisibleDesign nil) (setq negLayer (axlFormGetField disp_autoSplitingform "negLayer"))
7 t( R6 \ ^4 i* A (axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) (setq temp (strcat "ETCH/" negLayer))
' V9 Y5 A9 A# J- P3 L (axlVisibleLayer temp t) . V7 D* l7 P- s- s3 b
(axlAddSelectAll) (setq sel (axlGetSelSet))
( F: v$ T4 d7 s9 P) [$ o4 g (axlClearSelSet) (setq old_shape_num (length sel)) (setq shape_old (quote nil)) (setq shape_oldAll (quote nil)) (foreach sel_e sel (setq sel_en (getq sel_e net)) (setq sel_en (getq sel_en name)) (if (nequal sel_en "") then (setq sel_el (length (getq sel_e connect))) (setq sel_eb (getq sel_e bBox)) (setq temp (getq sel_e connect)) (setq sel_ec (quote nil)) (foreach temp_e temp (setq sel_ec (cons (getq temp_e xy) sel_ec))) (setq shape_old (cons sel_ec shape_old)) (setq shape_old (cons sel_eb shape_old)) (setq shape_old (cons sel_el shape_old)) (setq shape_old (cons sel_en shape_old)) (setq shape_oldAll (cons shape_old shape_oldAll))))
: Q. K- G5 h: m; G: h (axlVisibleDesign nil)
. k* w: z/ _4 M O* p (axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) (setq temp (strcat "BOUNDARY/" negLayer))
V# ~9 D3 k U7 ` (axlVisibleLayer temp t)
1 o4 H3 b+ g2 |% l* R3 A6 |+ w (axlAddSelectAll) (setq sel (axlGetSelSet))
9 o+ G" P3 ]7 U' ? (axlDeleteObject sel) (setq temp (strcat "ETCH/" negLayer))
. F' Z: H' A# A3 ]7 \ (axlVisibleLayer temp t)
8 x$ y6 }* Z* u* k4 Y7 Q5 v6 _: ^3 O (axlAddSelectAll) (setq sel (axlGetSelSet)) . t8 j5 k$ N- E5 S. w) }8 X
(axlDeleteObject sel)
$ s- U F) i3 n, M) r+ s (axlVisibleDesign nil)
: k7 p& y. A, ?% z (axlVisibleLayer "ROUTE KEEPIN" t) 6 ?# T3 P7 ?6 O& }+ f1 N" C. I
(axlAddSelectAll) (setq sel (nth 0 (axlGetSelSet))) 1 y5 A4 D7 Z5 l: c; t, k% l. v' A9 R
(axlClearSelSet) (setq sel_shape (axlPolyFromDB sel))
& Q1 ]5 u& _9 K: i) x; m (axlVisibleDesign nil)
) ]9 \! A8 ]' o (axlSetFindFilter ?enabled (list "noall" "Shapes" "Lines") ?onButtons (list "noall" "Shapes" "Lines"))
8 P4 t# @; o& N" d$ h9 q (axlVisibleLayer "ANTI ETCH/ALL" t) (setq temp (strcat "ANTI ETCH/" negLayer))
+ ^0 s3 f% c4 m( X. B% o5 R (axlVisibleLayer temp t) ) T. G7 l; A0 x( z
(axlAddSelectAll) (setq sel_anti (axlGetSelSet)) . m. r I/ K% _! |* ^3 z; D
(axlClearSelSet) (setq sel_antiEtch nil) (foreach sel_anti_e sel_anti (setq antiElmPoly (axlPolyFromDB sel_anti_e ?endCapType (quote ROUND))) (setq sel_antiEtch (append antiElmPoly sel_antiEtch))) (setq splitPolyList (axlPolyOperation sel_shape sel_antiEtch (quote ANDNOT))) (if splitPolyList then (setq temp (strcat "BOUNDARY/" negLayer)) (foreach resPoly splitPolyList (axlDBCreateShape resPoly t temp nil nil)) else ((axlMsgPut list (axlPolyErrorGet)))) , r4 p* n# s; X5 Z
(axlClearSelSet) ' C7 l# d5 `" Z) u4 }
(axlVisibleDesign nil)
$ a( R9 s9 q" C0 `& A" |# `0 Z* C (axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) (setq temp (strcat "BOUNDARY/" negLayer)) (axlVisibleLayer temp t) * [& |% i* |! }+ x( E& q/ I
(axlAddSelectAll) (setq sel (axlGetSelSet)) (setq new_shape_num (length sel)) (foreach sel_e sel (foreach shape_oldAll_e shape_oldAll (setq flag 0) (setq shape_oldAll_en (nth 0 shape_oldAll_e)) (setq shape_oldAll_ec (nth 3 shape_oldAll_e)) (setq flag_i 0) (setq flag_o 0) (foreach shape_oldAll_ece shape_oldAll_ec (if (equal (axlGeoPointInShape shape_oldAll_ece sel_e) t) then (postincrement flag_i) else (postincrement flag_o))) (if (greaterp flag_i flag_o) then (axlDBAssignNet sel_e shape_oldAll_en t)))) ; o" p4 k( q- V* j
(axlDBRefreshId nil)
( n! O/ H* E) a; g, M6 y/ r( V8 H+ | (axlClearSelSet)
, G8 M; m F8 N$ C/ v (axlVisibleDesign nil) ; N" k. T, ?, j4 u, ~, [ Y
(axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) . d+ E @+ Q0 s4 F
(setq temp (strcat "ETCH/" negLayer)) # _5 c. }0 l$ j( o. ^8 H" T
(axlVisibleLayer temp t) / W1 I6 p0 O7 R: @& R0 p
(axlAddSelectAll) (setq sel (axlGetSelSet)) (setq new_shape_num (length sel)) (setq shape_new (quote nil)) (setq shape_newAll (quote nil)) (setq flag_dummyShape 0) (foreach sel_e sel (setq sel_en (getq sel_e net)) (setq sel_en (getq sel_en name)) (if (nequal sel_en "") then (setq sel_el (length (getq sel_e connect))) (setq sel_eb (getq sel_e bBox)) (setq temp (getq sel_e connect)) (setq sel_ec (quote nil)) (foreach temp_e temp (setq sel_ec (cons (getq temp_e xy) sel_ec))) (setq shape_new (cons sel_ec shape_new)) (setq shape_new (cons sel_eb shape_new)) (setq shape_new (cons sel_el shape_new)) (setq shape_new (cons sel_en shape_new)) (setq shape_newAll (cons shape_new shape_newAll)) else (postincrement flag_dummyShape) (axlHighlightObject (getq sel_e net) t))) (setq dir (getWorkingDir)) (setq dir (strcat dir "\\log")) (createDir dir) (setq dir (strcat dir "\\autoSpliting.txt")) (setq report (outfile dir)) (setq i 0) (foreach shape_newAll_e shape_newAll (postincrement i) (fprintf report "#%2d shape is assigned to net \"%s\"\n" i (nth 0 shape_newAll_e))) (foreach shape_newAll_e shape_newAll (foreach shape_oldAll_e shape_oldAll (if (and (equal (nth 0 shape_newAll_e) (nth 0 shape_oldAll_e)) (equal (nth 1 shape_newAll_e) (nth 1 shape_oldAll_e))) then (setq shape_newAll (remove shape_newAll_e shape_newAll)) (setq shape_oldAll (remove shape_oldAll_e shape_oldAll))))) (fprintf report "\nSummary:\n\n") (fprintf report "Total shape(s) before: %d\n" old_shape_num) (fprintf report "Total shape(s) after : %d\n" new_shape_num) (fprintf report "\n") (fprintf report "Total dummy shape(s) : %d\n" flag_dummyShape) (fprintf report "\n") (if (nequal shape_newAll nil) then (foreach shape_newAll_e shape_newAll (fprintf report "Via quantity is changed in a %s shape. \n" (nth 0 shape_newAll_e)) (foreach sel_e sel (setq sel_en (getq sel_e net)) (if (equal (getq sel_en name) (nth 0 shape_newAll_e)) then (axlHighlightObject (getq sel_en net) t))))) (fprintf report "\nNote: Please check each highlighted shape after running this program.\n") (close report)
7 ? s. i3 L* }" c8 p5 z (axlClearSelSet) 6 l6 A% {% t8 j8 h9 @+ b+ t9 I
(axlVisibleSet layerActive)
7 B$ x. ?) S1 I1 B (axlWindowBoxSet windowBox)
( E' q% j9 A, I0 @! I& `" @ (axlUIWRedraw nil)
/ ]* F* s# b4 v3 D2 q+ v" q (axlUIViewFileCreate "./log/autoSpliting.txt" "Auto-generated Shape Status" nil)))) ! L; [+ e' J4 F5 y+ Y
(defun prg_autoSplitingform nil (setq report (outfile "d:/script/autoSpliting.form")) 4 v, B% d/ D9 F( D: z' @1 B5 V& t
(fprintf report "FILE_TYPE=FORM_DEFN VERSION=2 \n")
5 [# b C; H$ x: D, D (fprintf report "FORM \n")
: ^! |3 j+ v7 K e+ \; F! W (fprintf report "FIXED \n")
8 y+ V4 z }5 d/ k) p3 X4 h (fprintf report "PORT 44 20 \n") 6 X8 ?& ~6 T( K- ]
(fprintf report "HEADER \"Plane Auto-Spliting Utility\" \n")
7 y) D" q; Y2 F! _; C: R (if (geqp (length negFilm) 2)
3 f& ~7 E+ E* r: p then (fprintf report "POPUP <negLayer>") 6 q/ q! `! Y+ w3 e' D
(setq i 0) . B2 t- { W4 y B
(foreach negFilm_e negFilm (fprintf report "\"%s\" \"%s\"" negFilm_e negFilm_e) - I) U$ [; q. y$ o
(postincrement i) (if (equal i (length negFilm)) then (fprintf report ". ") else (fprintf report ", "))))
3 N0 L8 i. W0 r5 J/ R* H (fprintf report " \n") 5 w- |+ r7 A9 r; B' a
(fprintf report "TILE \n")
2 x/ H- ~9 T& ^9 O (fprintf report "FLOC 30 14 \n")
) V# z+ D( Z! F3 E% |- q9 n/ a (fprintf report "FSIZE 14 2 \n")
5 h1 x9 P/ T# I* c9 |( E L (fprintf report "ENDFIELD \n")
" t# g! Y! Y8 S! \ W (fprintf report "TEXT \"Select layer for split plane creation:\" \n") & M+ K" u r) v7 m8 P; G
(fprintf report "FLOC 1 1 \n")
3 L8 v4 A7 a- c- H (fprintf report "ENDTEXT \n") 3 J1 ]& G0 B- G" u5 |, J
(fprintf report "TEXT \"Layer will have all shapes an thermal reliefs re-built.\" \n") % A5 K' {3 L8 M# [+ `% g
(fprintf report "FLOC 6 6 \n")
3 }1 h* O6 R; I' X (fprintf report "ENDTEXT \n")
) i1 `0 l M$ | (fprintf report "FIELD create \n")
1 L; {; ^1 D4 k- m2 F (fprintf report "FLOC 3 14 \n") ) N8 L5 d/ D: @5 z% }
(fprintf report "MENUBUTTON \"Create\" 12 3 \n")
7 L# N& q5 m0 E5 f" @2 ? (fprintf report "ENDFIELD \n")
* G6 J; C4 ?3 ]9 u3 C6 E (fprintf report "FIELD cancel \n") 0 c+ w. s7 |7 ~ g
(fprintf report "FLOC 17 14 \n")
" D' N8 X) k* I n (fprintf report "MENUBUTTON \"Close\" 12 3 \n")
3 e' B8 G$ V. W/ m9 v" M/ h (fprintf report "ENDFIELD \n")
( _& U# T. @1 M (if (geqp (length negFilm) 2)
1 ^' A: c' m, S. C then
0 z2 c# y. Q; L) q (fprintf report "FIELD negLayer \n")
4 K* `8 ]6 p, t: s& I5 _4 p (fprintf report "FLOC 10 3 \n")
I: K* \! j7 V8 } (fprintf report "ENUMSET 8 \n") 8 Q8 ` p% |% r. \. y) V
(fprintf report "STRFILLIN 15 15 \n") 9 W8 s& @ v- ~
(fprintf report "POP \"negLayer\" \n") & U3 P2 O4 a( Z: Q8 n7 Q* ~# }
(fprintf report "ENDFIELD \n"))
1 m& n. |- x) D1 {. T. v0 r (fprintf report "ENDTILE \n") & H4 h! Y0 v: _; \; z0 T
(fprintf report "ENDFORM \n")
/ z O6 V- l* w( t: s (fprintf report " \n") , ?* C5 s' K( y+ F9 T2 V/ ^3 j& }3 ^/ [
(close report)) |
|