(defun _ASsetsymmaster ( )
(prog ()
_ASPopUpA()
setq( efound nil)
while( (efound == nil) && (fini == nil)
axlMsgPut("Select Key Component.")
good = nil
mpinl = nil
pnloc = nil
axlSetFindFilter( ?enabled (list "symbols" )
?onButtons (list "symbols"))
axlOpenFindFilter()
if( fini == nil && axlSingleSelectPoint( ) then
elem = axlGetSelSet()
axlMsgPut( "Key Component %L Selected." car(elem)->refdes)
else
if( fini == nil then axlMsgPut( "Nothing Found, Select Again."))
);end-if
if( fini == nil then
axlHighlightObject( elem)
if(_ASFormData->top == t && (car elem)->isMirrored == nil then
good = t
);endif
if(_ASFormData->bottom == t && (car elem)->isMirrored == t then
good = t
);endif
if(_ASFormData->both == t then good = t)
if(good == t then
;---------stor current data
setq(locat (car elem)->xy)
setq(cmpid (car elem)->refdes)
setq(cmpname (car elem)->name)
setq(cmptype (car elem)->type)
setq(cmprot (car elem)->rotation)
setq(cmpmir (car elem)->isMirrored)
efound = t
if( _ASFormData->pin == t then
r = 1
setq( mpinl car(elem)->pins)
while( nthelem( r mpinl) != nil
if( nthelem( r mpinl)->number == "1" then
setq( pnloc nthelem( r mpinl)->xy)
)
++r
)
if( pnloc == nil then
efound == nil
axlMsgPut("Component Selected Has No Pin 1.")
axlMsgPut("Reset Parameters And Try Again.")
)
)
else
axlDehighlightObject( elem)
axlMsgPut( "Selected Component is not on Selected Layer.")
axlSubSelectAll()
);endif
);endif
);end-while
axlCancelEnterFun()
);end-prog
);end-defun
;-------------------select components by group-----------------------
(defun _ASselectGrp ()
(prog ()
if( efound == t && cmpgrp == nil then
grsel = nil
_ASPopUpB()
axlSetFindFilter( ?enabled (list "symbols" )
?onButtons (list "symbols"))
axlOpenFindFilter()
while( (grsel == nil && efound == t)
axlMsgPut("Select Component to be Aligned.")
good = nil
if( grsel == nil then
if( axlSingleSelectPoint( ) then
setq( gelem axlGetSelSet())
axlMsgPut( "Component %L Group Selected." car(gelem)->refdes)
else
if( grsel == nil then axlMsgPut( "Nothing Found, Select Again."))
);end-if
);end-if
if(_ASFormData->top == t && (car gelem)->isMirrored == nil then
good = t
);endif
if(_ASFormData->bottom == t && (car gelem)->isMirrored == t then
good = t
);endif
if(_ASFormData->both == t then good = t)
if( grsel == nil then
if(good == t then
if( (car gelem)->type == "PACKAGE" then
cmpgrp=cons( nthelem( 1 gelem) cmpgrp)
axlHighlightObject( cons( car(elem) cmpgrp))
else
axlMsgPut( "Component Not A PACKAGE Type")
axlDehighlightObject( gelem)
);end-if
else
axlMsgPut( "Component Is Not On Appropriate Layer")
axlDehighlightObject( gelem)
);endif
);endif
);end-while
return( cmpgrp)
);end-if
axlCancelEnterFun()
);end-prog
);end-defun
;-------------------select by vertical orientation------------------
(defun _ASVertSelTol ()
(prog ()
if( efound == t then
i = 1
good = nil
if( _ASFormData->pin == t then
mlocat = pnloc
else
mlocat = locat
)
setq(allsym axlDBGetDesign()->symbols)
setq(allcmp axlDBGetDesign()->components)
while( nthelem( i allsym) != nil
if( nthelem( i allsym)->type == "PACKAGE" && nthelem( i allsym)->refdes != car(elem)->refdes then
if( _ASFormData->pin == t then
r = 1
setq( tpinl nthelem( i allsym)->pins)
while( nthelem( r tpinl) != nil
if( nthelem( r tpinl)->number == "1" then
setq( tlocat nthelem( r tpinl)->xy)
)
++r
)
else
setq( tlocat (nthelem(i allsym)->xy))
)
if( (car tlocat) <= ( car mlocat)+_ASFormData->tol && (car tlocat) >= ( car mlocat)-_ASFormData->tol then
if(_ASFormData->top == t && (car gelem)->isMirrored == nil then
good = t
);endif
if(_ASFormData->bottom == t && (car gelem)->isMirrored == t then
good = t
);endif
if(_ASFormData->both == t then good = t)
setq( srefdes (nthelem(i allsym)->refdes))
h = 1
while( nthelem( h allcmp) != nil
if( (nthelem( h allcmp)->name) == srefdes && good == t then
if( _ASFormData->class == "Any" || nthelem( h allcmp)->class == _ASFormData->class then
cmpgrp=cons(nthelem( i allsym) cmpgrp)
axlHighlightObject( cons( car(elem) cmpgrp))
axlMsgPut( "Component %L Selected." srefdes)
);end-if
);endif
++h
);end-while
);end-if
good = nil
);end-if
++i
);endwhile
efound = nil
fini = nil
);end-if
return( cmpgrp)
);end-prog
);end-defun
;-------------------select by horizontal orientation------------------
(defun _ASHorzSelTol ()
(prog ()
i = 1
good = nil
if( _ASFormData->pin == t then
mlocat = pnloc
else
mlocat = locat
)
setq(allsym axlDBGetDesign()->symbols)
setq(allcmp axlDBGetDesign()->components)
while( nthelem( i allsym) != nil
if( nthelem( i allsym)->type == "PACKAGE" then
if( _ASFormData->pin == t then
r = 1
setq( tpinl nthelem( i allsym)->pins)
while( nthelem( r tpinl) != nil
if( nthelem( r tpinl)->number == "1" then
setq( tlocat nthelem( r tpinl)->xy)
)
++r
)
else
setq( tlocat (nthelem(i allsym)->xy))
)
if((cadr tlocat) <= ( cadr locat)+_ASFormData->tol && (cadr tlocat) >= ( cadr locat)-_ASFormData->tol then
if(_ASFormData->top == t && (car gelem)->isMirrored == nil then
good = t
);endif
if(_ASFormData->bottom == t && (car gelem)->isMirrored == t then
good = t
);endif
if(_ASFormData->both == t then good = t)
setq( srefdes (nthelem(i allsym)->refdes))
h = 1
while( nthelem( h allcmp) != nil
if( ( nthelem( h allcmp)->name) == srefdes && good == t then
if( _ASFormData->class == "Any" || nthelem( h allcmp)->class == _ASFormData->class then
cmpgrp=cons(nthelem( i allsym) cmpgrp)
axlHighlightObject( cons( car(elem) cmpgrp))
axlMsgPut( "Component %L Selected" srefdes)
);end-if
);end-if
++h
);end-while
);end-if
);end-if
++i
);end-while
efound = nil
fini = nil
return( cmpgrp)
);end-prog
);end-defun
;-------------------select by window ---------------------------------
(defun _ASWindSel ()
(prog ()
if( efound == t then
i = 1
good = nil
axlSetFindFilter( ?enabled (list "symbols" )
?onButtons (list "symbols"))
axlOpenFindFilter()
axlSingleSelectBox()
allsym = axlGetSelSet()
if( allsym == nil then axlMsgPut( "No Elements Found."))
setq(allcmp axlDBGetDesign()->components)
while( nthelem( i allsym) != nil
if( nthelem( i allsym)->type == "PACKAGE" then
if(_ASFormData->top == t && (car gelem)->isMirrored == nil then
good = t
);endif
if(_ASFormData->bottom == t && (car gelem)->isMirrored == t then
good = t
);endif
if(_ASFormData->both == t then good = t)
setq( srefdes (nthelem(i allsym)->refdes))
h = 1
while( nthelem( h allcmp) != nil
if( ( nthelem( h allcmp)->name) == srefdes && good == t then
if( _ASFormData->class == "Any" || nthelem( h allcmp)->class == _ASFormData->class then
cmpgrp=cons(nthelem( i allsym) cmpgrp)
axlHighlightObject( nthelem( i allsym))
axlMsgPut( "Component %L Window Selected." srefdes)
);end-if
);end-if
++h
);end-while
);end-if
good = nil
++i
);end-while
);endif
efound = nil
return( cmpgrp)
);end-prog
);end-defun
;-------------------relocate vertical position -----------------------
(defun _ASMoveVertComp (cmpgrp)
(prog ()
i = 1
tmpnew= nil
ocmpdata=nil
ocmpmir=nil
ocmprot=nil
olocat=nil
while( nthelem( i cmpgrp) != nil
if( nthelem( i cmpgrp)->refdes != cmpid then
cmpdata=nil
tlocat = nil
setq(tlocat nthelem( i cmpgrp)->xy)
setq(tcmpid nthelem( i cmpgrp)->refdes)
setq(tcmpname nthelem( i cmpgrp)->name)
setq(tcmptype nthelem( i cmpgrp)->type)
setq(tcmprot nthelem( i cmpgrp)->rotation)
setq(tcmpmir nthelem( i cmpgrp)->isMirrored)
cmpdata=cons(tcmpid cmpdata)
cmpdata=cons(tcmptype cmpdata)
cmpdata=cons(tcmpname cmpdata)
ocmpdata = cons( cmpdata ocmpdata)
ocmpmir = cons( tcmpmir ocmpmir)
olocat = cons( tlocat olocat)
ocmprot = cons( tcmprot ocmprot)
nlocat=nil
plocat = nil
npinl = nil
axlMsgPut("%L " npinl)
;-------------define the new vertical orientation
if( _ASFormData->pin == t then
r = 1
npinl=nthelem( i cmpgrp)->pins
while( nthelem( r npinl) != nil
if( nthelem( r npinl)->number == "1" then
plocat= nthelem( r npinl)->xy
nlocat=cons(nthelem( 2 tlocat) nlocat)
voffs = (nthelem( 1 tlocat) - nthelem(1 plocat))
nlocat=cons(( car(pnloc) + voffs) nlocat)
)
++r
)
else;
nlocat=cons(nthelem( 2 tlocat) nlocat)
nlocat=cons(nthelem( 1 locat) nlocat)
)
;-------------delete present stuff
z = 1
setq( pindat nthelem( i cmpgrp)->pins)
while( nthelem( z pindat) != nil
h=1
setq(pinsel nthelem( z pindat)->branch->children)
while( nthelem( h pinsel) != nil
if( nthelem( h pinsel)->objType == "via" then
dellst = cons( nthelem( h pinsel) dellst)
)
if( nthelem( h pinsel)->objType == "path" then
dellst = cons( nthelem( h pinsel) dellst)
)
++h
);endwhile
axlDeleteObject(dellst)
dellst = nil
++z
);endwhile
axlDehighlightObject(nthelem( i cmpgrp))
axlDeleteObject(nthelem( i cmpgrp))
if( _ASFormData->pin == t then
r = 1
while( nthelem( r npinl) != nil
axlDBRefreshId( nthelem( r npinl))
++r
);end-while
)
;-------------add newer symbol
tmpnew = cons( car(axlDBCreateSymbol( cmpdata nlocat tcmpmir tcmprot)) tmpnew)
);endif
++i
);endwhile
axlDehighlightObject( elem)
setq( elem nil)
setq( grsel nil)
setq( cmpgrp nil)
);end-prog
);end-defun
;-------------------relocate Hoizontal position ----------------------
(defun _ASMoveHorzComp (cmpgrp)
(prog ()
i = 1
tmpnew= nil
ocmpdata=nil
ocmpmir=nil
ocmprot=nil
olocat=nil
while( nthelem( i cmpgrp) != nil
if( nthelem( i cmpgrp)->refdes != cmpid then
cmpdata=nil
setq(tlocat nthelem( i cmpgrp)->xy)
setq(tcmpid nthelem( i cmpgrp)->refdes)
setq(tcmpname nthelem( i cmpgrp)->name)
setq(tcmptype nthelem( i cmpgrp)->type)
setq(tcmprot nthelem( i cmpgrp)->rotation)
setq(tcmpmir nthelem( i cmpgrp)->isMirrored)
cmpdata=cons(tcmpid cmpdata)
cmpdata=cons(tcmptype cmpdata)
cmpdata=cons(tcmpname cmpdata)
ocmpdata = cons( cmpdata ocmpdata)
ocmpmir = cons( tcmpmir ocmpmir)
olocat = cons( tlocat olocat)
ocmprot = cons( tcmprot ocmprot)
nlocat=nil
;-------------define the new horizontal orientation
if( _ASFormData->pin == t then
r = 1
setq( npinl nthelem( i cmpgrp)->pins)
while( nthelem( r npinl) != nil
if( nthelem( r npinl)->number == "1" then
setq( plocat nthelem( r npinl)->xy)
voffs= nthelem( 2 tlocat) - nthelem(2 plocat)
nlocat=cons( ( cadr(pnloc) + voffs ) nlocat)
nlocat=cons( nthelem( 1 tlocat) nlocat)
);endif
++r
);endwhile
else
nlocat=cons(nthelem( 2 locat) nlocat)
nlocat=cons(nthelem( 1 tlocat) nlocat)
);endif
;-------------delete present stuff
z = 1
setq( pindat nthelem( i cmpgrp)->pins)
while( nthelem( z pindat) != nil
h=1
setq(pinsel nthelem( z pindat)->branch->children)
while( nthelem( h pinsel) != nil
if( nthelem( h pinsel)->objType == "via" then
dellst = cons( nthelem( h pinsel) dellst)
)
if( nthelem( h pinsel)->objType == "path" then
dellst = cons( nthelem( h pinsel) dellst)
)
++h
)
axlDeleteObject(dellst)
dellst = nil
++z
)
axlDehighlightObject(nthelem( i cmpgrp))
axlDeleteObject(nthelem( i cmpgrp))
if( _ASFormData->pin == t then
r = 1
while( nthelem( r npinl) != nil
axlDBRefreshId( nthelem( r npinl))
++r
);end-while
)
;-------------add newer symbol
tmpnew = cons( car(axlDBCreateSymbol( cmpdata nlocat tcmpmir tcmprot)) tmpnew)
);endif
++i
);endwhile
axlDehighlightObject( elem)
setq( elem nil)
setq( grsel nil)
);end-prog
);end-defun
;-------------------Parameter form data ------------------
defun( _ASInitParmForm () ;
(prog ()
(let ( form)
form = axlFormCreate( (gensym) "align_sym.form" '(se outer) '_ASParmCallBk t )
_ASFormPtr = form
if( ( _ASFormData == nil ) then
setq( _ASFormData t)
(axlFormBuildPopup form "class" '(("Any" "Any") ("IC" "IC") ("IO" "IO") ("DISCRETE" "DISCRETE")))
(axlFormSetField form "class" "Any")
putprop( _ASFormData "Any" 'class)
(axlFormSetField form "horizontal" t)
putprop( _ASFormData t 'horizontal)
(axlFormSetField form "vertical" nil)
putprop( _ASFormData nil 'vertical)
(axlFormSetField form "pin" nil)
putprop( _ASFormData nil 'pin)
(axlFormSetField form "origin" t)
putprop( _ASFormData t 'origin)
(axlFormSetField form "top" t)
putprop( _ASFormData t 'top)
(axlFormSetField form "bottom" nil)
putprop( _ASFormData nil 'bottom)
(axlFormSetField form "both" nil)
putprop( _ASFormData nil 'both)
(axlFormSetField form "group" t)
putprop( _ASFormData t 'group)
(axlFormSetField form "window" nil)
putprop( _ASFormData nil 'window)
(axlFormSetField form "tolerance" nil)
putprop( _ASFormData nil 'tolerance)
(axlFormSetField form "tol" 250.000 )
putprop( _ASFormData 250.000 'tol)
axlFormDisplay( form)
);end-if
);end-let
);end-prog
);end-defun