📄 upd_fe_height.il
字号:
layer = "BOTTOM"
else
layer = "TOP"
);
sprintf( sel_field "%s %s %L" refdes, layer, xy)
axlFormSetField(Height_Form "Comp_List_Field" sel_field)
);end-foreach
show_confirm = nil
(if length(height_list_none) >= 1 then
;; generate report for components with no height property
show_confirm = t
time = getCurrentTime()
rexCompile(" ")
time = rexReplace(time "_" 0)
rexCompile(":")
time = rexReplace(time "_" 0)
sprintf(filename "Components_No_Height_%s.dat" time)
oport = outfile(filename "w")
fprintf(oport "*****************************************************\n")
fprintf(oport "* R E P O R T *\n")
fprintf(oport "* Components with missing HEIGHT property *\n")
fprintf(oport "* (Please forward this file to the EDA Librarian) *\n")
fprintf(oport "*****************************************************\n\n")
fprintf(oport "Filename: %s\n\n" filename);
fprintf(oport "-----------------------------------------------------\n")
(foreach item height_list_none
sym_name = nth(0 item)
part_num = nth(1 item)
refdes = nth(3 item)
layer = nth(6 item)
fprintf(oport "LTX Partnumber : %s\n" part_num)
fprintf(oport "Allegro Symbol : %s\n" sym_name)
fprintf(oport "Layer : %s\n" layer)
fprintf(oport "Refdes : %s\n" refdes)
fprintf(oport "-----------------------------------------------------\n")
);
close(oport)
);
axlFormTreeViewSet(Height_Form "Tree_Single" 'TV_NOEDITLABEL nil)
(if show_confirm == t then
(if axlUIYesNo("Found Components with missing HEIGHT property\n\nDo you want to see the log file?") then
(if isFile(filename) then
(if neq(logWindow nil)
logWindow = axlUIWClose(logWindow)
); end if
logWindow = axlUIViewFileCreate(filename "Report - Comps No Height" nil)
);
);
);
axlFormDisplay(Height_Form) ; display the form
);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Height_Form_Action (height_form)
case(Height_Form->curField ; contains name of field that has been touched
("Comp_List_Field"
sel = (Height_Form->curValue) ; stores value user put in field to program variable
selidx = (Height_Form->curValueInt); stores index of selection on list
axlFormSetFieldEditable( Height_Form "Update_Height_Mult" 0 )
;; dehiglight highlighted place bounds
axlDehighlightObject(hilite_list nil)
hilite_list = nil
(if sel == nil then ; no more stubs in list, lock buttons
printf("%s\n" "nothing selected")
else
item = nth(selidx height_list_mult)
sym_name = nth(0 item)
part_num = nth(1 item)
height = nth(2 item)
refdes = nth(3 item)
comp_dbid = nth(4 item)
plcb_list = nth(5 item)
layer = nth(6 item)
xy = comp_dbid->symbol->xy
Bbox = comp_dbid->symbol->bBox
cnt = 1
Zoom(Bbox)
axlFormListDeleteAll(Height_Form "PLCB_List_Field")
foreach(plcb plcb_list
plcb_bbox = nth(0 plcb)->bBox
plcb_height = nth(1 plcb)
sprintf( sel_field "%d %L" cnt, plcb_bbox)
axlFormSetField(Height_Form "PLCB_List_Field" sel_field)
cnt = cnt + 1
);
axlFormSetField(Height_Form "PLCB_List_Field" nil)
axlFormSetInfo( Height_Form "Comp_Height_Msg_Field" height)
);
);
("PLCB_List_Field"
sel = (Height_Form->curValue) ; stores value user put in field to program variable
plcbidx = (Height_Form->curValueInt)
axlFormSetFieldEditable( Height_Form "Update_Height_Mult" 1 )
;; dehiglight highlighted place bounds
axlDehighlightObject(hilite_list nil)
hilite_list = nil
(if sel == nil then ; no more stubs in list, lock buttons
printf("%s\n" "nothing selected")
else
item = nth(selidx height_list_mult)
plcb_list = nth(5 item)
plcb = nth(plcbidx plcb_list)
plcb_dbid = nth(0 plcb)
plcb_bbox = plcb_dbid->bBox
plcb_height = nth(1 plcb)
axlFormSetInfo( Height_Form "PLCB_Height_Msg_Field" plcb_height)
Zoom(plcb_bbox)
;; highlite the place_bound
hilite_list = cons(plcb_dbid hilite_list)
axlHighlightObject(hilite_list nil)
);
);
("Exit_Field"
;; dehiglight highlighted place bounds
axlDehighlightObject(hilite_list nil)
hilite_list = nil
axlFlushDisplay() ; forces screen refresh so dehighlight takes effect
axlFinishEnterFun()
axlFormClose(Height_Form)
t
);
("Update_Height_Single"
AK_get_tree_items(); this function stores all selected items in single_data_list
show_confirm = t
time = getCurrentTime()
rexCompile(" ")
time = rexReplace(time "_" 0)
rexCompile(":")
time = rexReplace(time "_" 0)
sprintf(filename "upd_fe_height_single_PLCB_%s.log" time)
oport = outfile(filename "w")
fprintf(oport "*****************************************************\n")
fprintf(oport "* *\n")
fprintf(oport "* Update Front-End Height Log *\n")
fprintf(oport "* *\n")
fprintf(oport "*****************************************************\n\n")
(foreach item single_data_list
ftp_name = nth(0 item)
pn_num = nth(1 item)
(foreach item height_list_single
sym_name = nth(0 item)
(if ftp_name == sym_name then
part_num = nth(1 item)
(if pn_num == part_num then
height = nth(2 item)
refdes = nth(3 item)
comp_id = nth(4 item)
plcb_list = nth(5 item)
layer = nth(6 item)
proppair = list("PACKAGE_HEIGHT_MAX" axlMKSConvert(height car(axlDBGetDesignUnits())))
plcb_dbid = nth(0 car(plcb_list))
pkg_height = nth(1 car(plcb_list))
(if pkg_height == nil then
pkg_height = "NONE"
);
(if axlDBAddProp(plcb_dbid proppair) then
fprintf(oport "Component : %s\n" refdes)
fprintf(oport "LTX Partnumber : %s\n" part_num)
fprintf(oport "Allegro Symbol : %s\n" sym_name)
fprintf(oport "Layer : %s\n" layer)
fprintf(oport "Height changed from %s -> %s\n" pkg_height,height);
fprintf(oport "-----------------------------------------------------\n")
);
);
);
);
);
close(oport)
;; need to refresh ids in order for changes to take affect
axlDBRefreshId(nil)
(if isFile(filename) then
(if neq(logWindow nil)
logWindow = axlUIWClose(logWindow)
); end if
logWindow = axlUIViewFileCreate(filename "Update Heigth Log" nil)
);
);
("Update_Height_Mult"
proppair = list("PACKAGE_HEIGHT_MAX" axlMKSConvert(height car(axlDBGetDesignUnits())))
plcb_dbid = nth(0 car(plcb_list))
pkg_height = nth(1 car(plcb_list))
(if pkg_height == nil then
pkg_height = "NONE"
);
(if axlDBAddProp(plcb_dbid proppair) then
;; remove comp from list
axlFormListDeleteItem(Height_Form "Comp_List_Field" selidx)
axlFormListDeleteAll(Height_Form "PLCB_List_Field")
axlFormSetField(Height_Form "PLCB_List_Field" nil)
else
axlUIConfirm("Failed to update HEIGHT value")
);
;; need to refresh ids in order for changes to take affect
axlDBRefreshId(nil)
);
("Reread_Db"
;; dehiglight highlighted place bounds
axlDehighlightObject(hilite_list nil)
hilite_list = nil
axlFormTreeViewSet(Height_Form "Tree_Single" 'TV_REMOVEALL nil)
AK_upd_height()
Height_Form_Routine()
axlWindowFit()
);
("Select_All_Single"
(foreach treeitem sym_tree_list
id = nth(1 treeitem)
axlFormTreeViewSetSelectState(Height_Form "Tree_Single" id t)
pn_list = nth(2 treeitem)
(foreach item pn_list
id = nth(1 item)
axlFormTreeViewSetSelectState(Height_Form "Tree_Single" id t)
);foreach
);
);
("DeSelect_All_Single"
(foreach treeitem sym_tree_list
id = nth(1 treeitem)
axlFormTreeViewSetSelectState(Height_Form "Tree_Single" id nil)
pn_list = nth(2 treeitem)
(foreach item pn_list
id = nth(1 item)
axlFormTreeViewSetSelectState(Height_Form "Tree_Single" id nil)
);foreach
);
);
(t
case(Height_Form->treeViewSelState
(0
label = axlFormTreeViewGetLabel(Height_Form "Tree_Single" Height_Form->curValueInt)
(foreach treeitem sym_tree_list
sym_name = nth(0 treeitem)
pn_list = nth(2 treeitem)
(if sym_name == label then
(foreach item pn_list
id = nth(1 item)
axlFormTreeViewSetSelectState(Height_Form "Tree_Single" id nil)
);foreach
);if
(foreach item pn_list
pn = nth(0 item)
id = nth(1 item)
(if pn == label then
parents = axlFormTreeViewGetParents(Height_Form "Tree_Single" id)
(foreach prt parents
AK_tree_all_children_off(prt)
);
);
);
);foreach
);0
(1
label = axlFormTreeViewGetLabel(Height_Form "Tree_Single" Height_Form->curValueInt)
(foreach treeitem sym_tree_list
sym_name = nth(0 treeitem)
pn_list = nth(2 treeitem)
(if sym_name == label then
(foreach item pn_list
id = nth(1 item)
axlFormTreeViewSetSelectState(Height_Form "Tree_Single" id t)
);foreach
);if
(foreach item pn_list
pn = nth(0 item)
id = nth(1 item)
(if pn == label then
parents = axlFormTreeViewGetParents(Height_Form "Tree_Single" id)
(foreach prt parents
axlFormTreeViewSetSelectState(Height_Form "Tree_Single" prt t)
);
);
);
);foreach
);1
);case
);t
);case
);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun AK_tree_all_children_off (parent)
pl = axlFormTreeViewGetLabel(Height_Form "Tree_Single" parent)
alloff = t
(foreach treeitem sym_tree_list
sym_name = nth(0 treeitem)
(if sym_name == pl then
pn_list = nth(2 treeitem)
(foreach item pn_list
pn = nth(0 item)
id = nth(1 item)
state = axlFormTreeViewGetSelectState(Height_Form "Tree_Single" id)
(if state == 1 then
alloff = nil
);
);foreach
);
);foreach
(if alloff == t then
axlFormTreeViewSetSelectState(Height_Form "Tree_Single" parent nil)
);
);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun AK_get_tree_items ()
single_data_list = nil
(foreach treeitem sym_tree_list
name = nth(0 treeitem)
id = nth(1 treeitem)
pn_list = nth(2 treeitem)
(if axlFormTreeViewGetSelectState(Height_Form "Tree_Single" id) == 1 then
;; root tis selected -> get selected children
(foreach item pn_list
pn = nth(0 item)
pid = nth(1 item)
(if axlFormTreeViewGetSelectState(Height_Form "Tree_Single" pid) == 1 then
data_set = list(name pn)
single_data_list = cons(data_set single_data_list)
);
);foreach
);
);foreach
);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Zoom (bbox)
axlWindowBoxSet(bbox)
);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun AK_upd_height_main ()
vis_list = axlVisibleGet() ;saves color settings
hilite_list = nil
Height_Form = nil
logWindow = nil
;;remove existing logfile
axlTempFileRemove("./upd_fe_height.log")
AK_CreateForm()
AK_upd_height()
Height_Form_Routine()
axlDehighlightObject(hilite_list nil)
axlVisibleSet(vis_list) ;restores color settings
deleteFile(form_file) ;deletes form file
axlWindowFit()
(if neq(logWindow nil)
logWindow = axlUIWClose(logWindow)
); end if
(if axlUIYesNo("Do you want to update DRC's ?") then
axlShell("drc update")
);
);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
axlCmdRegister( "upd_fe_height" `AK_upd_height_main)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -