⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 net_editor.il

📁 skill语言在Cadence平台二次开发中大量使用
💻 IL
📖 第 1 页 / 共 5 页
字号:
;================================================================================
;============================== Delete Package Functions ========================
;================================================================================
;---------------------Function call Ids and Deletes Pakage ----------------------
defun( _INEDel_Pkg_Commands ()
prog( ()
        _INEInitVar()
        pkgdel = nil
        pkgfound = nil
        pkgnme = nil
        _INEPopUpDelPkg()
        while( allfound == nil && ooped == nil
                axlMsgPut("Select Component To Be Deleted From Database.")
                axlSetFindFilter( ?enabled (list "noall" "components") ?onButtons (list "components"))
                axlSingleSelectPoint()
                unless(pkgfound == t pkgnme = axlGetSelSet())
                axlClearSelSet()
                if(pkgnme != nil then
                        unless( pkgnme == ""
                                axlHighlightObject(pkgnme)
                                pkgfound = t
                        );endunless
                                allfound = t
                else
                        unless( ooped == t axlMsgPut("Reference Designator Not Found, Try Again."))
                        allfound = nil
                        pkgfound = nil
                );endif
        );end-while
        axlUIPopupSet(nil)
        unless(pkgfound == nil && ooped == t
                sprintf( pmptmess "Component ReferenceDesignator\n    %s\n Will Be Deleted From The Database."
                        car(pkgnme)->name)
                pkgdel = axlUIYesNo( pmptmess )
                if(pkgdel == t then
                        pindlf = outfile("ia_net_edit_tmp_in_file.txt")
                        fprintf( pindlf "$PACKAGES\n$DELETE\n%s\n$END\n" car(pkgnme)->name)
                        close( pindlf)
                        oktorun = t
                else
                        axlDehighlightObject( pkgnme )
                        axlClearSelSet()
                );endif
                when( oktorun == t _INEDelNetIn())
        );endunless
        axlUIPopupSet(nil)
        axlClearSelSet()
        unless( doneit == t
                axlFormClose( _INESFormPtr )
                axlFlushDisplay()
                _INEStart()
        );endunless
        axlUIPopupSet(nil)
);endprog
);enddefun
;----------------------- Delete By Component RefDes Name ----------------------
;       This function will find a component by giving the Refdes name. This will
; verify if the refdes name exists first, Verify the refdes deletion, the pass the
; Refdes to the delete package section.
;-------------------------------------------------------------------------------
defun( _INEDel_Pkg_Name ()
prog( ()
        good = nil
        rfdnamelist = nil
        rfdname = nil
        axlCancelEnterFun()
        axlUIPopupSet(nil)
        axlClearSelSet()
        rfdname = axlUIPrompt( "Enter Reference Designator Name To Be Deleted" "")
        if( rfdname != nil then
                rfdname = upperCase(rfdname)
                if( rfdname == "" then
                        axlMsgPut(" No Reference Designator Selected.")
                        allfound = t
                else
                        axlSetFindFilter( ?enabled '( "noall" "components") ?onButtons '("components"))
                        axlAddSelectAll()
                        rfdnamelist = axlGetSelSet()
                        foreach( rfd rfdnamelist
                                if( rfd->name == rfdname then
                                        good = t
                                        pkgnme = list(rfd)
                                        pkgfound = t
                                );endif
                        );endeach
                        if( good == nil then
                                pkgfound = t
                                pkgnme = nil
                        );endif
                );endif
        else
                allfound = t
                pkgnme = ""
                ooped = t
                axlUIPopupSet(nil)
                axlClearSelSet()
                _INECancel()
        );endif
        axlClearSelSet()
        axlUIPopupSet(nil)
        return(pkgnme)
);endprog
);enddfun
;==============================This is the add package command set ===============
; This section will allow you to add package symbols to the Allegro database
; on the fly. The Packages are added one by one, but a group may be added by
; hitting the next command button on the menu form.
;=================================================================================
;---------------------------The startup portion ----------------------------------
defun( _INEAdd_Pkg_Commands ()
prog( ()
        newdeslist = nil
        _INEPackData = nil
        axlFormClose( _INESFormPtr )
        deleteFile( "iane_start_up.form")
        _INEInitPackForm()
);endprog
);end-defun
;---------------------------------Forminit for add package -----------------------
defun( _INEInitPackForm ()
prog( ()
(let (pform)
        if( ! isFile("iane_add_package.form") then _INEMakePackFormFile() )
        pform = nil
        pform = axlFormCreate( (gensym) "iane_add_package.form" '(c inner) '_INEPackCallBack t)
        _INESFormPtr = pform
        if( (_INEPackData == nil ) then
                setq( _INEPackData t)
                (axlFormSetField pform "newrefdes" "")
                putprop( _INEPackData "" 'newrefdes)
                (axlFormSetField pform "devfile" "")
                putprop( _INEPackData "" 'devfile)
                (axlFormSetField pform "newpkg" "")
                putprop( _INEPackData "" 'newpkg)
                (axlFormSetField pform "cmpval" "")
                putprop( _INEPackData "" 'cmpval)
                (axlFormSetField pform "cmptol" "")
                putprop( _INEPackData "" 'cmptol)
        axlFormDisplay( pform)
        );endif
);end-let
);end-prog
); enddefun
;---------------------------make netin file -------------------------------------
; This routine will verify if the defined refdes  exists already and verifies if
; the device file entered exists or not.
;--------------------------------------------------------------------------------
defun( _INEMk_Add_Pack_File ()
prog( ()
        devpthdir = nil
        good = nil
        goahead = nil
        foundone = nil
        oktogo = nil
        axlSetFindFilter( ?enabled (list "noall" "components") ?onButtons (list "components"))
        axlAddSelectAll()
        refdeslist = axlGetSelSet()
        foreach( rdlt refdeslist
                if( rdlt->name == upperCase(_INEPackData->newrefdes) then foundone = t));endforeach
                unless( newdeslist == nil
                        if( member( upperCase(_INEPackData->newrefdes) newdeslist) then foundone = t))
        if( foundone == nil then
                newdeslist = cons( upperCase(_INEPackData->newrefdes) newdeslist)
                devpthdir = parseString( axlGetVariable( "devpath") " ")
                foreach( devdir devpthdir
                        if( isFile(strcat( devdir strcat( "/" strcat( _INEPackData->devfile ".txt")))) then
                                good = t);endif
                );endforeach
                if(good == t then
                        when( _INEPackData->newpkg == "" goahead = t)
                        unless( goahead == t
                                axlSetFindFilter( ?enabled (list "noall" "symbols") ?onButtons (list "symbols"))
                                axlClearSelSet()
                                axlAddSelectAll()
                                symlist= axlGetSelSet()
                                foreach( symb symlist
                                        when( symb->type == "PACKAGE" && (upperCase(_INEPackData->newpkg) == symb->name)
                                                goahead = t);endwhen
                                );endforeach
                        );endunless
                        unless(goahead == t
                                sympthdir= parseString( axlGetVariable( "psmpath") " ")
                                foreach( psmdir sympthdir
                                        when( isFile(strcat( psmdir strcat( "/" strcat( _INEPackData->newpkg ".psm"))))
                                        goahead = t);endwhen
                                );endforeach
                        );endunless
                        if(goahead == nil then axlMsgPut("Specified Package Symbol Does Not Exist."))
                        if(good == t && ( _INEPackData->newpkg == "" || goahead == t) then
                                sprintf( pmptmess "The Following Component\nwill be added to the database:\n")
                                pmptmess = strcat( pmptmess "Refence Designator: " upperCase(_INEPackData->newrefdes))
                                pmptmess = strcat(pmptmess "\nDevice File: " upperCase(_INEPackData->devfile))
                                pmptmess = strcat(pmptmess "\n \nOptional Data:\nPackage Name: " upperCase(_INEPackData->newpkg))
                                pmptmess = strcat(pmptmess "\nComponent Value: " _INEPackData->cmpval)
                                pmptmess = strcat(pmptmess "\nComponent Tolerance: " _INEPackData->cmptol)
                                oktogo = axlUIYesNo( pmptmess )
                                unless( oktogo == nil
                                        if( ! isFile("ia_net_edit_tmp_in_file.txt") then
                                                addpkgfl = outfile("ia_net_edit_tmp_in_file.txt")
                                                fprintf( addpkgfl "$PACKAGES\n$ADD\n")
                                        );endif
                                        if( isFile("ia_net_edit_tmp_in_file.txt") then
                                                unless( _INEPackData->newpkg == "" fprintf( addpkgfl "%s"
                                                        upperCase(_INEPackData->newpkg)))
                                                fprintf( addpkgfl "! %s " upperCase(_INEPackData->devfile))
                                                if( _INEPackData->cmpval == "" && _INEPackData->cmptol != "" then
                                                        fprintf( addpkgfl "!"))
                                                unless( _INEPackData->cmpval == "" fprintf( addpkgfl "! %s "
                                                        _INEPackData->cmpval ))
                                                unless( _INEPackData->cmptol == "" fprintf( addpkgfl "! %s "
                                                        _INEPackData->cmptol))
                                                fprintf( addpkgfl "; %s \n" upperCase(_INEPackData->newrefdes))
                                        );endif
                                );endunless
                        );endif
                
                
                else
                        axlMsgPut(" No File Exists For Specified Device!")
                        good = nil
                );endif
        
 
        else
                axlFormRestoreField( _INESFormPtr "newrefdes")
                axlMsgPut(" Reference Designator Already Exists")
                foundone = nil
        );endif
 
); end-prog
); end_defun
;-------------------------------This is the Done function -----------------------
; this funtion will complete the inputed data , close the netin file then
;execute the netin process.
;---------------------------------------------------------------------------------
defun( _INEMk_Add_Pack_Done ()
prog( ()
        unless( (_INEPackData->newrefdes == "" || member( upperCase(_INEPackData->newrefdes) newdeslist))
                _INEMk_Add_Pack_File()
        );endunless
        when( isFile("ia_net_edit_tmp_in_file.txt")
                fprintf( addpkgfl "\n$END\n")
                close( addpkgfl )
                _INEDelNetIn()
        );endwhen
        axlFormClose( _INESFormPtr )
        deleteFile("iane_add_package.form")
        _INEStart()
);endprog
);enddefun
;------------------------------ Add Comp Cancel ---------------------------------
; This function will close the add comp file if open, delete the file from disk
; and cancel out of the program
;---------------------------------------------------------------------------------
defun( _INEACancel ()
prog( ()
        when( isFile("ia_net_edit_tmp_in_file.txt")
                close( addpkgfl )
                deleteFile("ia_net_edit_tmp_in_file.txt")
        );
        _INECancel()
);endprog
);enddefun
;========================This is the Start Form File =============================
;========================This is the Start Form File =============================
defun( _INEMakeFormFile ()
        frmfle = outfile("iane_start_up.form")
        fprintf( frmfle "FILE_TYPE=FORM_DEFN VERSION=2\nFORM\nFIXED\nPORT 45 14\nHEADER \"Interactive Net List Editor Form\"\n")
        fprintf( frmfle "TILE\n")
        fprintf( frmfle "GROUP \

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -