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

📄 drc_walk.il

📁 Allegro常用skill
💻 IL
📖 第 1 页 / 共 3 页
字号:
       (fprintf helpPort "        PIN/FILMMASKTOP  - if <layer> = TOP\n")
       (fprintf helpPort "        PACKAGE GEOMETRY/ASSEMBLY_TOP  - if <layer> = TOP\n")
       (fprintf helpPort "        PIN/FILMMASKBOTTOM  - if <layer> = BOTTOM\n")
       (fprintf helpPort "        PACKAGE GEOMETRY/ASSEMBLY_BOTTOM  - if <layer> = BOTTOM\n\n")
       (fprintf helpPort "---------------------------------------------------------------------\n\n")
       (fprintf helpPort " Questions, Comments, Suggestions?\n\n")
       (fprintf helpPort " Contact\n Joe Morrison \t\t\tLoral Federal Systems-Owego\n")
       (fprintf helpPort " joe.morrison@lmco.com\t607+751-4938\n")

     close(helpPort)
     if(! isFile( helpfile) then
        axlUIConfirm( (strcat "Unable to Open Help File, Check Permissions on " _drcDir))
        (_drcEnd)
     else
        axlUIViewFileCreate( helpfile "LAP DRC Walker - Help" nil)
        (if (isFile helpfile) then
        (deleteFile helpfile)
    );end-if
     );end-if
  ) ; let
);end-defun

(procedure lfsSingleLayer( _layer @optional (vis t))    ; _layer contains subclass of drcdbid->layer
  lyr_is_etch = nil
  lyr_is_top = nil
  lyr_is_bot = nil
  lyr_is_int = nil
  lyr_is_pkgtop = nil
  lyr_is_pkgbot = nil
  lyr_is_all = nil
  if( member( _layer etch_layer_list) then        ; TOP INTn BOTTOM
      (equal lyr_is_etch t)
  );end-if
  cond(
        (_layer == "TOP"
            (equal lyr_is_top t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "OUTLINE") t)
            (axlVisibleLayer (strcat "VIA KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "ROUTE KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "CONSTRAINT_AREA") t)
            (axlVisibleLayer (strcat "DRAWING FORMAT" "/" "REVIEW_ETCH_" _layer) t)
            (axlVisibleLayer (strcat "DRC ERROR CLASS" "/" _layer) t)
            (axlVisibleLayer (strcat "ETCH" "/" _layer) t)
            (axlVisibleLayer (strcat "PIN" "/" _layer) t)
            (axlVisibleLayer (strcat "ROUTE KEEPIN" "/" "ALL") t)
            (axlVisibleLayer (strcat "VIA CLASS" "/" _layer) t)
            (axlVisibleLayer (strcat "PIN" "/" "SOLDERMASK_" _layer) t)
            (axlVisibleLayer (strcat "VIA_CLASS" "/" "SOLDERMASK_" _layer) t)
        )
          (_layer == "BOTTOM"
            (equal lyr_is_bot t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "OUTLINE") t)
            (axlVisibleLayer (strcat "VIA KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "ROUTE KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "CONSTRAINT_AREA") t)
            (axlVisibleLayer (strcat "DRAWING FORMAT" "/" "REVIEW_ETCH_" _layer) t)
            (axlVisibleLayer (strcat "DRC ERROR CLASS" "/" _layer) t)
            (axlVisibleLayer (strcat "ETCH" "/" _layer) t)
            (axlVisibleLayer (strcat "PIN" "/" _layer) t)
            (axlVisibleLayer (strcat "ROUTE KEEPIN" "/" "ALL") t)
            (axlVisibleLayer (strcat "VIA CLASS" "/" _layer) t)
            (axlVisibleLayer (strcat "PIN" "/" "SOLDERMASK_" _layer) t)
            (axlVisibleLayer (strcat "VIA_CLASS" "/" "SOLDERMASK_" _layer) t)
        )
          ( substring( _layer 1 3 ) == "INT"
            (equal lyr_is_int t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "OUTLINE") t)
            (axlVisibleLayer (strcat "VIA KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "ROUTE KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "CONSTRAINT_AREA") t)
            (axlVisibleLayer (strcat "DRAWING FORMAT" "/" "REVIEW_ETCH_" _layer) t)
            (axlVisibleLayer (strcat "DRC ERROR CLASS" "/" _layer) t)
            (axlVisibleLayer (strcat "ETCH" "/" _layer) t)
            (axlVisibleLayer (strcat "PIN" "/" _layer) t)
            (axlVisibleLayer (strcat "ROUTE KEEPIN" "/" "ALL") t)
            (axlVisibleLayer (strcat "VIA CLASS" "/" _layer) t)
        )
        (_layer == "PACKAGE_TOP"
            (equal lyr_is_pkgtop t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "OUTLINE") t)
            (axlVisibleLayer (strcat "VIA KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "ROUTE KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "TOP_ROOM") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "PLACE_GRID_TOP") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "SILKSCREEN_TOP") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "SOLDERMASK_TOP") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "TOOLING_CORNERS") t)
            (axlVisibleLayer (strcat "DRC ERROR CLASS" "/" _layer) t)
            (axlVisibleLayer (strcat "PACKAGE GEOMETRY" "/" "ASSEMBLY_TOP" ) t)
            (axlVisibleLayer (strcat "PACKAGE GEOMETRY" "/" "BODY_CENTER") t)
            (axlVisibleLayer (strcat "PACKAGE GEOMETRY" "/" "PLACE_BOUND_TOP" ) t)
            (axlVisibleLayer (strcat "PACKAGE GEOMETRY" "/" "SILKSCREEN_TOP" ) t)
            (axlVisibleLayer (strcat "PACKAGE GEOMETRY" "/" "SOLDERMASK_TOP" ) t)
            (axlVisibleLayer (strcat "PACKAGE KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "PIN" "/" "TOP") t)
            (axlVisibleLayer (strcat "PIN" "/" "SOLDERMASK_TOP" ) t)
        )
        (_layer == "PACKAGE_BOTTOM"
            (equal lyr_is_pkgbot t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "OUTLINE") t)
            (axlVisibleLayer (strcat "VIA KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "ROUTE KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "BOTTOM_ROOM") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "PLACE_GRID_BOTTOM") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "SILKSCREEN_BOTTOM") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "SOLDERMASK_BOTTOM") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "TOOLING_CORNERS") t)
            (axlVisibleLayer (strcat "DRC ERROR CLASS" "/" _layer) t)
            (axlVisibleLayer (strcat "PACKAGE GEOMETRY" "/" "ASSEMBLY_BOTTOM" ) t)
            (axlVisibleLayer (strcat "PACKAGE GEOMETRY" "/" "BODY_CENTER") t)
            (axlVisibleLayer (strcat "PACKAGE GEOMETRY" "/" "PLACE_BOUND_BOTTOM" ) t)
            (axlVisibleLayer (strcat "PACKAGE GEOMETRY" "/" "SILKSCREEN_BOTTOM" ) t)
            (axlVisibleLayer (strcat "PACKAGE GEOMETRY" "/" "SOLDERMASK_BOTTOM" ) t)
            (axlVisibleLayer (strcat "PACKAGE KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "PIN" "/" "BOTTOM") t)
            (axlVisibleLayer (strcat "PIN" "/" "SOLDERMASK_BOTTOM" ) t)
        )
        (_layer == "ALL"
            (equal lyr_is_all t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "OUTLINE") t)
            (axlVisibleLayer (strcat "VIA KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "ROUTE KEEPOUT" "/" "ALL") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "CONSTRAINT_AREA") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "REVIEW_ETCH_TOP") t)
            (axlVisibleLayer (strcat "BOARD GEOMETRY" "/" "REVIEW_ETCH_BOTTOM") t)
            (axlVisibleLayer (strcat "DRC ERROR CLASS" "/" _layer) t)
            (axlVisibleLayer (strcat "ETCH" "/" _layer) t)
            (axlVisibleLayer (strcat "PIN" "/" "SOLDERMASK_TOP" ) t)
            (axlVisibleLayer (strcat "PIN" "/" "SOLDERMASK_BOTTOM" ) t)
            (axlVisibleLayer (strcat "ROUTE KEEPIN" "/" _layer) t)
        )
  );end-cond
  t
) ; procedure - turn one layer on or off

(procedure lfsLayers( layer @rest args)        ; layer contains subclass of drcdbid->layer
;   (println  layer )
;   (println args)
   (setq _deferRedraw nil)
   (if (or  (or (equal layer "+") (equal layer "-")) (equal layer "*"))
      then
        (if (equal layer "*")
          then
           (setq _deferRedraw t)
          else
           (setq _deferRedraw nil)
;        (println "is  + or -")
        ) ; is a splat
      else
;        (println "not + or -")
        (axlVisibleDesign nil)
        (lfsSingleLayer layer t)
   ) ; turn off what's currently displayed

   (if (eq layer "-")
     then (setq visibility nil)
     else (setq visibility t)
   ) ; set visibility

   (foreach lyr args
;      (println lyr)
     (case lyr
        ("+"   (setq visibility t))
        ("-"   (setq visibility nil))
        (t     (lfsSingleLayer lyr visibility))
     ) ; case for argument stream
   ) ; foreach argument passed
   (if !_deferRedraw
     then
         (axlShell "redraw")
   ) ; if redraw not deferred
t
) ; procedure - turn on/off a set of layers


 ;;
 ;; lfsWindowExpand
 ;;
 ;; factor the size of a window
 ;;
 ;; basic function for all points is (F + 1)/2 * (point) - (F-1)/2 *opposite point
 ;; where F is the integer scaling factor
 ;;
 (procedure lfsWindowExpand( _window @optional (F 3))
     (let ((x1 (caar _window)) ; first item in first list
           (y1 (cadar _window)); second item in first list
           (x2 (caadr _window)) ; first item in second list
           (y2 (cadadr _window)); second item in second list
           f1 f2 f3 f4)
         (setq f1 (quotient (difference (times (plus F 1) x1)
                                        (times (difference F 1) x2)) 2))
         (setq f2 (quotient (difference (times (plus F 1) y1)
                                        (times (difference F 1) y2)) 2))
         (setq f3 (quotient (difference (times (plus F 1) x2)
                                        (times (difference F 1) x1)) 2))
         (setq f4 (quotient (difference (times (plus F 1) y2)
                                        (times (difference F 1) y1)) 2))
         (setq _window (list (list f1 f2) (list f3 f4)))
         (axlWindowBoxSet _window)
     ) ; let
     t
 ) ; lfsWindowExpand

(procedure lfsDRCFilterList(lfsLayerFilt lfsDRCFilt)
;=> lfsFilteredDRCs
lyrPart = ""
typPart = ""
(let ( lfsLayerClause lfsDRCClause tmpStr ctr drc_entry)
   (if (equal lfsLayerFilt "ALL") then
      (setq lfsLayerClause t)
      (setq lyrPart "")
    else
      (if (equal lfsLayerFilt "Approved") then
          (setq lfsLayerClause t)
          (setq lyrPart "")
       else
          (setq lfsLayerClause '(equal (cadr (parseString d1->layer "/")) lfsLayerFilt))
          (setq lyrPart (strcat " on " lfsLayerFilt))
      );end-if
   );end-if

   (if (equal lfsDRCFilt "ALL non-approved DRCs") then
          (setq lfsDRCClause t)
          (setq typPart "")
          (setq lfsDRCWorkingList (setof d1 nonapproved_drcs_list (and (eval lfsDRCClause) (eval lfsLayerClause))))
    else
        (if (equal lfsDRCFilt "Approved") then
            (setq lfsDRCClause t)
            (setq typPart "")
            (setq lfsDRCWorkingList (setof d1 approved_drcs_list (and (eval lfsDRCClause) (eval lfsLayerClause))))
        else
            (setq lfsDRCClause '(equal d1->name lfsDRCFilt))
            (setq typPart (strcat " " lfsDRCFilt))
            (setq lfsDRCWorkingList (setof d1 nonapproved_drcs_list (and (eval lfsDRCClause) (eval lfsLayerClause))))
        );end-if
   ) ; end if
   (setq lfsNumberDRCs (length lfsDRCWorkingList))
   if( lfsNumberDRCs == 0 then
       (axlFormSetFieldEditable _drcForm "lapprove" 0)    ; lock button
       (axlFormSetFieldEditable _drcForm "drc_prev" 0)    ; lock button
       (axlFormSetFieldEditable _drcForm "drc_next" 0)    ; lock button
   );end-if
   if( lfsNumberDRCs == 1 then
       (axlFormSetFieldEditable _drcForm "lapprove" 1)    ; unlock button
       (axlFormSetFieldEditable _drcForm "drc_prev" 0)    ; lock button
       (axlFormSetFieldEditable _drcForm "drc_next" 0)    ; lock button
   );end-if
   if( lfsNumberDRCs  > 1 then
       (axlFormSetFieldEditable _drcForm "lapprove" 1)    ; unlock button
       (axlFormSetFieldEditable _drcForm "drc_prev" 1)    ; unlock button
       (axlFormSetFieldEditable _drcForm "drc_next" 1)    ; unlock button
   );end-if
);end-let
   t
);end-defun

(defun lfsMarkPoint (loc)
; returns a list of dbids used to mark this location
; mark point using a diamond with extended points
(let  ((x (car loc))
       (y (cadr loc))
       (n (axlMKSConvert 1 "MILS"))
       (c (axlMKSConvert 75 "MILS"))
       (f (axlMKSConvert 500 "MILS"))
       (wid (axlMKSConvert 5 "MILS"))
       (dbid_list (list))
       pts)
 (if (nequal loc nil) then    ; valid location
     (setq pts (list x+c:y+1 x+1:y+c x:y+f x-1:y+c x-c:y+1 x-f:y
                  x-c:y-1 x-1:y-c x:y-f x+1:y-c x+c:y-1 x+f:y x+c:y+1))
     (setq db1 (axlDBCreateLine pts wid lfsShowLayer))
     (setq dbid_list (list (caar db1)))
     dbid_list
 else
     null( nil)
 );end-if
) ; end let for local variables
) ; defun mark a location for user attention

(defun _drcEnd ()
(axlFormClose _drcForm)
(axlDehighlightObject _drcHilites)
(axlDeleteObject _drcMarker)
(setq _drcHilites nil)
(setq _drcMarker nil)
(if (isFile _drcFormFile) then
    (deleteFile _drcFormFile)
);end-if

);end-defun

(procedure _drcShow( dbid)
(if (neq dbid nil) then
    (setq _drcMarker (lfsMarkPoint dbid->xy))
    (if _drcZoom then
        (lfsWindowExpand dbid->bBox _drcZoomSize)
    else
        (if _drcZoomDo then
            (axlWindowFit)
            (setq _drcZoomDo nil)
        );end-if
    );end-if
    (if (nequal _drcLastLayer dbid->layer) then
        (lfsLayers  (cadr (parseString dbid->layer "/")))
        (axlVisibleLayer lfsShowLayer t)
        (axlVisibleLayer "BOARD GEOMETRY/APPROVED_DRCS" t)
        (axlShell "redraw")
    );end-if
    (setq _drcLastLayer dbid->layer)
    (setq _drcHilites (list dbid))
    (foreach _viol dbid->violations
        (if (axlIsDBIDType _viol) then
            (setq _drcHilites (cons _viol _drcHilites))
        );end-if
    );end-foreach
    (axlHighlightObject _drcHilites)

⌨️ 快捷键说明

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