|
(putd (quote prg_autoSpliting) nil)
6 G+ Y) K7 ]$ R2 t; Y(putd (quote prg_autoSplitingform) nil)
, T( v2 P: X$ G# ?(putd (quote autoSpliting_callback) nil) % x% y8 c/ m( a& X/ C% W
(axlShell "done") ) l5 O6 x9 ~6 O
(axlCmdRegister "fn_autoSpliting" (_backquote prg_autoSpliting) ?cmdType "general") ' a5 P4 I+ Q3 G0 N4 n
(setq film (axlGetParam "paramLayerGroup:etch"))9 T8 J, ~. d, B- w/ l: M% G7 U
(setq film (getq film groupMembers)) ( M0 F" O( O' Q
(setq LayerCnt (length (axlSubclassRoute)))
0 C3 [1 ~5 h6 T4 q. F(setq negFilm (quote nil)) 9 A4 A- _& n3 ?4 I! p! k0 F
(foreach film_e film (setq temp (strcat "ETCH/" film_e)) Y3 {$ V5 u9 h2 o
(if (equal (axlIsLayerNegative temp) t) then (setq negFilm (cons film_e negFilm))))
, Q% ~3 s1 s7 Q: L; c2 Z1 \(setq negFilm (reverse negFilm)) ) x1 J! a1 |: g4 f" A4 r+ z
(defun prg_autoSpliting nil (if (nequal (isFile "d:/script/I.bmp") t)
8 M6 t7 W! U! t+ ^+ z N4 M then (renameFile "d:/script/Inventec" "d:/script/I.bmp"))
6 ]6 z* h4 c1 F [% d (prg_autoSplitingform) (setq disp_autoSplitingform (axlFormCreate (gensym) "d:/script/autoSpliting.form" (_backquote ("e" "outer")) (_backquote autoSpliting_callback) t)) 9 Q. g2 ?- k$ c3 z3 A3 A1 C" b
(axlFormDisplay disp_autoSplitingform)
( b+ K0 q& W2 k; h0 A2 D# p5 x& { (axlFormSetFieldEditable disp_autoSplitingform "create" nil)
W! o! i3 P! F- @3 K0 D7 U" r (deleteFile "d:/script/autoSpliting.form")
* r7 T$ w3 w, k, S9 {; i4 g (renameFile "d:/script/Inventec.bmp" "d:/script/Inventec"))
' }/ x" ~3 x B/ A+ A8 t+ H(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) $ C* S, p/ E5 d: q; l
(axlVisibleSet layerActive) + y) B' q# I' q+ N2 G7 }
(axlWindowBoxSet windowBox) % V* n2 e9 z! f: [" V( W% P) ]
(axlUIWRedraw nil)) ("create" (setq layerActive (axlVisibleGet)) (setq windowBox (axlWindowBoxGet))
9 ^1 p1 {' V0 V( O5 u e (axlVisibleDesign nil) (setq negLayer (axlFormGetField disp_autoSplitingform "negLayer")) ' v6 B% ~3 U7 q- |5 B- i) t$ |6 k
(axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) (setq temp (strcat "ETCH/" negLayer))
+ a( a; u- N5 A1 r" h (axlVisibleLayer temp t) 7 t; \3 i) |% p8 d7 `0 O
(axlAddSelectAll) (setq sel (axlGetSelSet))
8 r" j" c8 b7 _5 b5 w, X: y8 k+ |) v( ` (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))))
% E$ w- n `( L- B7 ]0 |0 V; U (axlVisibleDesign nil) 1 k. j _+ Z% h2 k; L7 C* l
(axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) (setq temp (strcat "BOUNDARY/" negLayer)) . ^1 }6 L7 U/ Z d5 {3 ^
(axlVisibleLayer temp t) 0 f7 O8 _# @$ x7 e* ?; I8 g: a
(axlAddSelectAll) (setq sel (axlGetSelSet))
% D) R; Q3 ~! h8 { (axlDeleteObject sel) (setq temp (strcat "ETCH/" negLayer)) , I$ _7 n! {- q" N9 J& y
(axlVisibleLayer temp t) N4 p5 S s! B2 ]- n- p0 c# y! L
(axlAddSelectAll) (setq sel (axlGetSelSet))
( B+ n. o \! Z- x; l$ X (axlDeleteObject sel) ( V5 X8 g* l$ T6 b: n6 q% Q
(axlVisibleDesign nil)
* p% I p! [* \' o8 } (axlVisibleLayer "ROUTE KEEPIN" t)
J) V- X- `* }* X5 p (axlAddSelectAll) (setq sel (nth 0 (axlGetSelSet)))
x3 R. A. a1 T0 S; t5 k3 M (axlClearSelSet) (setq sel_shape (axlPolyFromDB sel)) 2 b9 M( w; C+ ?" a+ }* B" [; c
(axlVisibleDesign nil)
5 W% }3 P" Q9 v7 d (axlSetFindFilter ?enabled (list "noall" "Shapes" "Lines") ?onButtons (list "noall" "Shapes" "Lines"))
3 {8 A9 m0 I/ l; \: a0 [6 N, ^9 J (axlVisibleLayer "ANTI ETCH/ALL" t) (setq temp (strcat "ANTI ETCH/" negLayer))
# y7 k. T& S! Z5 v) V$ F (axlVisibleLayer temp t) 8 a8 L0 P) l3 j: ~
(axlAddSelectAll) (setq sel_anti (axlGetSelSet))
+ M' M8 x' p% ] (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)))) 6 L5 @3 G& ~, Y- X5 T
(axlClearSelSet) ) t2 b ?" U1 c2 o# ^, G5 ?6 Q" s
(axlVisibleDesign nil) . d( f- R2 }& b( {; V. _2 Z* t
(axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) (setq temp (strcat "BOUNDARY/" negLayer)) (axlVisibleLayer temp t) z: w- @2 k& J; B$ x0 T" {) [
(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))))
' J0 h# p7 V- d& J (axlDBRefreshId nil) 1 q$ `3 ^+ E" M( L$ G
(axlClearSelSet) 6 c5 v% G/ _' v2 i9 w. E
(axlVisibleDesign nil) + m, w+ B) o3 ~' @
(axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) 0 F, [ J9 p* N- l5 }3 ~ k
(setq temp (strcat "ETCH/" negLayer)) & n9 Z, p1 M, h2 a' |
(axlVisibleLayer temp t)
4 M5 ]8 A9 r# f8 `. G2 Y, p; i (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)
* ~% e) ]" }; k4 Q+ o (axlClearSelSet) 4 ~ E7 l4 n2 ?0 o+ S
(axlVisibleSet layerActive) ) {/ B$ m- y; W3 K) `
(axlWindowBoxSet windowBox) * z0 Y) p( W: y
(axlUIWRedraw nil) $ W+ H8 ?$ `1 A7 [, v) P
(axlUIViewFileCreate "./log/autoSpliting.txt" "Auto-generated Shape Status" nil)))) 6 p# a% t( _; z3 j
(defun prg_autoSplitingform nil (setq report (outfile "d:/script/autoSpliting.form")) 3 ?. E$ a6 v8 u' n& m
(fprintf report "FILE_TYPE=FORM_DEFN VERSION=2 \n")
# ~. _" @3 a+ z0 U# N0 a (fprintf report "FORM \n")
7 R' B' @8 ^$ _: D (fprintf report "FIXED \n")
* |0 q0 o4 l- v (fprintf report "PORT 44 20 \n")
* y" m( [+ C" G4 C (fprintf report "HEADER \"Plane Auto-Spliting Utility\" \n")
# f) |/ Q7 B( W# Z. w, e (if (geqp (length negFilm) 2) 7 `+ U( b. i- a0 B5 S" J
then (fprintf report "POPUP <negLayer>")
0 S6 a) R& M8 G% @ v! e; b (setq i 0) % C1 F5 y3 ~5 p0 \. B; `0 g z( ~. M
(foreach negFilm_e negFilm (fprintf report "\"%s\" \"%s\"" negFilm_e negFilm_e) * P: |+ e! _8 m1 U" y' k* e
(postincrement i) (if (equal i (length negFilm)) then (fprintf report ". ") else (fprintf report ", ")))) $ G p$ C- p! [1 b
(fprintf report " \n")
0 J# _8 z% J) ?) p8 B: p (fprintf report "TILE \n")
1 q$ m+ R- k$ M& T7 e" j+ o# u (fprintf report "FLOC 30 14 \n") & R$ w8 G( C- p7 Z8 S& g. T: f5 C4 V
(fprintf report "FSIZE 14 2 \n") 2 Y6 ~0 a' f j. k0 O
(fprintf report "ENDFIELD \n")
/ i5 x( w6 b$ m (fprintf report "TEXT \"Select layer for split plane creation:\" \n")
* e8 P0 w" u$ l' l2 y. t6 e) u (fprintf report "FLOC 1 1 \n")
5 n) E( M& H1 K" B: `! O. Q! M1 e (fprintf report "ENDTEXT \n") . b1 C1 A4 y+ m6 K% @# h% D5 g
(fprintf report "TEXT \"Layer will have all shapes an thermal reliefs re-built.\" \n") ' N' J7 @3 d* N0 O1 N: {, t2 `% t. Y
(fprintf report "FLOC 6 6 \n")
) a' j& e1 `2 q. q (fprintf report "ENDTEXT \n") . c9 ^$ c. {" C) y! d$ j& Z
(fprintf report "FIELD create \n") ! f7 c6 H, D3 C& ^4 A0 D) b
(fprintf report "FLOC 3 14 \n") ; w9 o8 z" @" F5 e& D
(fprintf report "MENUBUTTON \"Create\" 12 3 \n") V! O( B. D; |
(fprintf report "ENDFIELD \n") $ H8 u6 U" X; C0 \
(fprintf report "FIELD cancel \n")
- N2 `/ c$ ]1 \, e8 E* N (fprintf report "FLOC 17 14 \n") ; Y9 q1 V. M) p5 ?7 y i
(fprintf report "MENUBUTTON \"Close\" 12 3 \n") . x- ]$ F6 U$ y
(fprintf report "ENDFIELD \n")
. p. [: H s0 ?2 n- w" g, \ (if (geqp (length negFilm) 2) ) E7 n3 h) `3 e/ c$ X9 c% n" t% n
then
7 A$ C0 o- \6 o' y) W* t, j+ }5 Q1 F (fprintf report "FIELD negLayer \n") % @5 e3 r) I$ A4 w7 r
(fprintf report "FLOC 10 3 \n") 1 S; t2 n9 G L K5 t0 K
(fprintf report "ENUMSET 8 \n") + |% R, D& b/ N: g+ y: A
(fprintf report "STRFILLIN 15 15 \n")
, p* ^( R6 L/ F t+ F2 c# T. J (fprintf report "POP \"negLayer\" \n")
# ]4 Q7 w% ~1 J6 E% ?5 Q (fprintf report "ENDFIELD \n"))
9 ?9 g: R3 N& T: F (fprintf report "ENDTILE \n")
% p' ^# e7 R+ F- e: E (fprintf report "ENDFORM \n") + F- j9 S' B2 n( r, x. h3 B7 S5 ^
(fprintf report " \n")
& r3 M" i/ k4 t" l/ M (close report)) |
|