📄 place_symbols.il
字号:
;------------ Cut Here and save to file as: place_symbols.il ---------------
;###########################################################################
;# #
;# Comment Section #
;# #
;###########################################################################
; Author: Larry Bowman - Cadence Technical Services
; Email: bowman@cadence.com
; Product: Allegro
; Version: 11.0
; Date: February 29, 1996
; Command: place symbols
; Revision Date: May 13, 1996
; Description: Changed the Allegro command for this program from
; "place symbols" to "place_symbols" to work around a bug
; in BoardQuest.
; This program was inspired by the "Place List" Allegro Skill program. This
; program includes that functionality along with access to the other Allegro
; symbols. Since this was an extensive addition, I did not want to corrupt
; the original "Place List" program.
; This program will open a form which will display the MECHANICAL (.bsm),
; the FORMAT (.osm), the PACKAGE (.psm), and the REFERENCE DESIGNATORS
; that may be placed in an Allegro database. The MECHANICAL,FORMAT, and
; PACKAGE symbols are located via the PSMPATH variable.
; The order of the symbols in the menu lists are in the same order
; as the directory paths as defined by the PSMPATH variable. If there
; are any duplicate entries, then that means the same symbol name exists
; in duplicate library directories.
; When the user selects a symbol or reference designator from the list,
; it is attached to the cursor in "place" mode. All of the standard
; middle mouse button operations are available (as in the standard place by refdes)
; except the "next" and "oops" buttons. The equivalent to "next" or "oops" is
; to merely select a new symbol(or reference designator) from the list.
; The list of Reference Designators will update upon the next selection from
; the Reference Designator list or by hitting the "Refresh RefDes" button.
; The "Place Symbols" form may be left open and accessed at any time, regardless
; of the current Allegro mode.
; To run this program in the Allegro editor at the command line, you would
; type in the command, "place symbols".
;
; For example:
; Allegro> place symbols
; You may also modify an Allegro menu to include this command as a menu
; selection.
;
; This Allegro Skill program may be loaded automatically
; when Allegro is invoked by creating an allegro.ilinit
; file in the user's pcbenv directory (i.e., ~/pcbenv/allegro.ilinit).
;
; The allegro.ilinit file could look like the following:
;----------- Start of allegro.ilinit file -----------------------------
;setSkillPath(". ~/scripts/SKILL.sav /cds/9502/ibm/tools/pcb/etc/skill")
;load("place_symbols.il")
;----------- End of allegro.ilinit file --------------------------------
;
; Where this file, place_symbols.il, is located in one of the directory paths
; as defined by the setSkillPath function.
;
; Note: If you ever change the Allegro Skill path with the setSkillPath
; function as noted above, ALWAYS be sure to include the period(.),
; which is the current working directory, as part of the search path
; definition. There are some Allegro commands that expect to see the
; current working directory as part of the search path and will fail
; if it is not part of the search path.
;
; Also, most of the Skill functions that do file access will use the
; setSkillPath value as the directory paths to perform their file
; reads and writes.
;###########################################################################
;# #
;# End Of Comment Section #
;# #
;###########################################################################
axlCmdRegister("place_symbols" 'place_sym)
(defun place_sym ()
;**************************************************
;* Function Subroutines *
;**************************************************
;##################################
;# Function Form CallBack #
;##################################
;---------------------------------------------------
;| |
;| This function determines what Allegro commands |
;| to execute, based on the user's selection from |
;| the Place Symbols form. |
;| |
;---------------------------------------------------
(defun Form_Action (Form)
(case Form->curField
("Mechanical_List"
_refreshRefDes()
if( car(mechlist) != "No Symbols Found" then
axlUIWPrint(Form "Placing Mechanical Symbol %s" Form->curValue)
Command=strcat("add symbol mechanical " Form->curValue)
axlShell(Command)
t
else
axlUIWPrint(Form "No MECHANICAL Symbols Found.")
); endif
); end Mechanical_List
("Format_List"
_refreshRefDes()
if( car(formatlist) != "No Symbols Found" then
axlUIWPrint(Form "Placing Format Symbol %s" Form->curValue)
Command=strcat("add symbol format " Form->curValue)
axlShell(Command)
t
else
axlUIWPrint(Form "No FORMAT Symbols Found.")
); end if
); end Format_List
("Package_List"
_refreshRefDes()
if( car(psmlist) != "No Symbols Found" then
axlUIWPrint(Form "Placing Package Symbol %s" Form->curValue)
Command=strcat("add symbol package " Form->curValue)
axlShell(Command)
t
else
axlUIWPrint(Form "No PACKAGE Symbols Found.")
); endif
); end Package_List
("Unplaced_List"
_refreshRefDes()
if(car(l_unplaced) != "No Netlist Loaded" && car(l_unplaced) != "All RefDes Placed" then
axlUIWPrint(Form "Placing Reference Designator %s" Form->curValue)
Command=strcat("place refdes " Form->curValue)
axlShell(Command)
t
else
axlUIWPrint(Form "No More Reference Designators")
); endif
); end Unplaced_List
("Refresh_List"
_refreshRefDes()
) ; end Refresh_List
("refdestot"
axlUIWPrint(Form "There are %n Components to Place." refcount)
axlFormSetField(Form "refdestot" refcount)
); end refdestot
("close"
if(axlOKToProceed() then
(axlCancelEnterFun)
(axlFormClose Form)
); endif
); end close
("cancel"
axlUIWPrint(Form ">> Select Symbol or Reference Designator")
axlShell("cancel")
t
); end cancel
); end case
); end defun Form_Action
;##################################
;# End Function Form CallBack #
;##################################
;##################################
;# Function _getUnplacedRefDes #
;##################################
(defun _getUnplacedRefDes ()
prog( (l_unplacedRefDes)
l_unplacedRefDes = list()
refcount = 0
axlDBRefreshId(axlDBGetDesign())
if( (l_components = axlDBGetDesign()->components) == nil then
no_netlist = list("No Netlist Loaded")
axlFormSetField(Form "refdestot" refcount)
return(no_netlist)
);endif
placedRefDes = t
foreach(component l_components
if(component->symbol == nil then
placedRefDes = nil
l_unplacedRefDes = cons(component->name l_unplacedRefDes)
); end if
refcount = length(l_unplacedRefDes)
); endforeach
if(placedRefDes then
axlFormSetField(Form "refdestot" refcount)
return(list("All RefDes Placed"))
else
axlFormSetField(Form "refdestot" refcount)
return(sort(l_unplacedRefDes nil))
); endif
); end of prog
); end defun
;##################################
;# End Of _getUnplacedRefDes #
;##################################
;##################################
;# _refreshRefDes #
;##################################
(defun _refreshRefDes ()
cur_refcount = refcount
l_unplaced = _getUnplacedRefDes()
if(cur_refcount != refcount then
_loadRefDes()
); endif
); end defun
;##################################
;# End of _refreshRefDes #
;##################################
;##################################
;# _loadRefDes #
;##################################
(defun _loadRefDes ()
axlFormListDeleteAll(Form "Unplaced_List")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -