📄 zrconnections.il
字号:
else
; Wildcard
selnet = netpick
axlFormSetField(zrconnections_Form "selectednet" selnet)
;; ## Assume all fields will be set for:
;; Refdes ToLayer MinVia MaxVia
sprintf(zrconnline "%s %s %s %s %s" defrefdes selnet deftargetlayer defminvia defmaxvia)
;; Set info into Form for Connections File Name
axlFormSetField(zrconnections_Form "assigned_nets" zrconnline)
;; Write data to Connections File
_lcb_zrWriteToFile(zrconnline)
;; Remove selection from Nets in the Form.
axlFormListDeleteAll(zrconnections_Form "av_nets")
;; highlight all pins with the selected net name.
compdbid = nthelem(2 assoc(defrefdes lcompdbids))
lcompindbids = compdbid->pins
foreach(cpin lcompindbids
if(cpin->net->name != "" then
axlHighlightObject(cpin)
); endif
); end foreach
;; Remove all net names from the list of net names
if(final_lnetnames then
final_lnetnames = list()
) ;endif
);endif
); end defun
;###########################################################
;# #
;# End of _lcb_zrSelectNetFromFormAndLayout #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_zrWriteToFile #
;# #
;###########################################################
defun( _lcb_zrWriteToFile (dataline)
h1 = "# RefDes"
h2 = "NetName"
h3 = "ToLayer"
h4 = "MinVia"
h5 = "MaxVia"
hyphen = "-"
hyphen1 = "# -"
lheader = list(h1 h2 h3 h4 h5)
ldata = parseString(dataline)
d1 = nthelem(1 ldata)
d2 = nthelem(2 ldata)
d3 = nthelem(3 ldata)
d4 = nthelem(4 ldata)
d5 = nthelem(5 ldata)
for(y 1 length(ldata)
if(strlen(nthelem(y ldata)) >= strlen(nthelem(y lheader)) then
long = strlen(nthelem(y ldata))
else
long = strlen(nthelem(y lheader))
); endif
if(y == 1 then
for(i 3 long
hyphen1 = strcat(hyphen1 "-")
); endfor
;hyphen1 = _lcb_zrgetformat(hyphen1 long)
else
for(i 1 long
hyphen = strcat(hyphen "-")
); endfor
); endif
long = long + 4
case(y
(1
h1 = _lcb_zrgetformat(h1 long)
d1 = _lcb_zrgetformat(d1 long)
hyphen1 = _lcb_zrgetformat(hyphen1 long)
)
(2
h2 = _lcb_zrgetformat(h2 long)
d2 = _lcb_zrgetformat(d2 long)
hyphen2 = _lcb_zrgetformat(hyphen long)
)
(3
h3 = _lcb_zrgetformat(h3 long)
d3 = _lcb_zrgetformat(d3 long)
hyphen3 = _lcb_zrgetformat(hyphen long)
)
(4
h4 = _lcb_zrgetformat(h4 long)
d4 = _lcb_zrgetformat(d4 long)
hyphen4 = _lcb_zrgetformat(hyphen long)
)
(5
h5 = _lcb_zrgetformat(h5 long)
d5 = _lcb_zrgetformat(d5 long)
hyphen5 = _lcb_zrgetformat(hyphen long)
)
); endcase
hyphen = "-"
); end for
; Only file writable should be zroutport
sprintf(header "%s%s%s%s%s" h1 h2 h3 h4 h5)
sprintf(data "%s%s%s%s%s" d1 d2 d3 d4 d5)
sprintf(h "%s%s%s%s%s" hyphen1 hyphen2 hyphen3 hyphen4 hyphen5)
fprintf(zroutport "%s\n" header)
fprintf(zroutport "%s\n" h)
fprintf(zroutport "%s\n\n" data)
drain(zroutport)
axlUIViewFileReuse(zrviewfile zrconnectionsfile zrconnectionsfile nil)
); end defun
;###########################################################
;# #
;# End of _lcb_zrWriteToFile #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_zrOpenFile #
;# #
;###########################################################
defun( _lcb_zrOpenFile (zrout)
;; ## Check to see if output file already open.
;; If it is then close it to make for way for new file.
;; Dehighlight the pins if the variable exists and if dbid is not out of scope.
if(boundp('lcompindbids) && nthelem(1 lcompindbids)->objType then
axlDehighlightObject(lcompindbids)
); endif
if(fileused == "" then
fileused = zrout
else
axlUIWPrint(nil " - Closing %L" zroutport)
close(zroutport)
); endif
sprintf(file_error "*** Error, cannot open or create file, ->%s<-." zrout)
;file_error = "*** Error, cannot open or create file."
f1err = " 1.) Check spelling (maybe non-existent folder)."
f2err = "2.) Check Permissions."
sprintf(f3err "%s And/Or %s" f1err f2err)
if(isFile(zrout) then
axlUIWPrint(nil " - Opening file \"%s\" for appending." zrout)
; open it and get ready to append to the bottom of the file.
; We also need to read it first and merge the data in the
; file with the database.
axlUIWPrint(nil " - Opening file \"%s\" for appending." zrout)
zroutport = outfile(zrout "a")
if(zroutport == nil then
axlUIWPrint(nil file_error)
;axlUIWPrint(nil f1err)
axlUIWPrint(nil f3err)
if(boundp('prevzrconnfile) then
zrout = prevzrconnfile
;axlFormSetField(zrconnections_Form "zroutputfile" zrout)
zroutport = outfile(zrout "a")
axlUIWPrint(nil " - ReOpening file \"%s\" for appending." zrout)
); endif
); endif
else
;; This will be a new file.
axlUIWPrint(nil " - Opening file \"%s\" for writing." zrout)
zroutport = outfile(zrout "a")
if(zroutport == nil then
axlUIWPrint(nil file_error)
;axlUIWPrint(nil f1err)
axlUIWPrint(nil f3err)
if(boundp('prevzrconnfile) then
zrout = prevzrconnfile
;axlFormSetField(zrconnections_Form "zroutputfile" zrout)
zroutport = outfile(zrout "a")
axlUIWPrint(nil " - ReOpening file \"%s\" for appending." zrout)
); endif
); endif
); endif
zrviewfile = axlUIViewFileCreate(zrout zrout nil list(62 5) '(se outer))
zrconnectionsfile = zrout
formfilename = nthelem(3 axlDMFileParts(zrout))
axlFormSetField(zrconnections_Form "zroutputfile" formfilename)
;formfilename = zrout
axlCancelEnterFun() ;; Allows the RMB Popup to have the Temp Group selection.
_lcb_zrPopUp()
;; Reload the form with all nets for the current refdes selected.
foreach(one lcomps
if(one->name == defrefdes then
axlFormListDeleteAll(zrconnections_Form "av_nets")
_lcb_zrFindNets(one)
) ;endif
); end foreach
;; Reset the Selected Net Name field
axlFormSetField(zrconnections_Form "selectednet" "")
); end defun
;###########################################################
;# #
;# End of _lcb_zrOpenFile #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_zrCancel #
;# #
;###########################################################
defun( _lcb_zrCancel ()
;; Dehighlight the pins if the variable exists and if dbid is not out of scope.
if(boundp('lcompindbids) && nthelem(1 lcompindbids)->objType then
axlDehighlightObject(lcompindbids)
); endif
if(nomini then
axlFormClose(zrconnections_Form)
); endif
notdone = nil
axlCancelEnterFun()
axlUIWClose(zrviewfile)
); end defun
;###########################################################
;# #
;# End of _lcb_zrCancel #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_zrPopUp #
;# #
;###########################################################
defun( _lcb_zrPopUp ()
sprintf(pm1 "Exit and Save ->%s<-" formfilename)
popupzr = axlUIPopupDefine( nil (list
(list pm1 '_lcb_zrCancel)
(list "Cancel (same as above)" '_lcb_zrCancel)
))
axlUIPopupSet(popupzr)
); end defun
;###########################################################
;# #
;# End of _lcb_zrPopUp #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_zrinit #
;# #
;###########################################################
defun( _lcb_zrinit ()
lhighpinsdbids = list()
lzrpins = list()
zlog = "zrouter.log"
line = ""
compline = ""
lpopstack = list()
lpopcomp = list()
fileused = ""
allrefdes = list()
lstackpopup = list()
lcomponentpopup = list()
llayers = list()
lrefdes = list()
;### Check for logic in database ###
root = axlDBGetDesign()
lcomps = root->components
if(lcomps == nil then
;## No logical netlist in database ##
axlUIWPrint(nil "*** Error, No Reference Designators. Exiting ***")
notdone = nil
axlCancelEnterFun()
else
notdone = t
); endif
; Get layers
etchparam = axlGetParam("paramLayerGroup:ETCH")
l_layers = etchparam->groupMembers
; Create line for stackup popup in the form.
fbegin = "POPUP <stackup>"
fend = "."
slash = " \\"
poplinelength = 20
_zr_refinit = "U1"
_zr_layerinit = "SURFACE"
zrlayerline = strcat(fbegin "\"" _zr_layerinit "\"\"" _zr_layerinit "\".")
lpopstack = list(zrlayerline)
foreach(lname l_layers
;; Build a list of list for axlFormBuildPopup to change items in the form
;; for Refdes and ToLayer. This is because axlMiniStatusLoad does not re-read
;; the form file unless APD is brought down and back up.
lstackpopup = append(lstackpopup list(list(lname lname)))
llayers = cons(lname llayers)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -