skill

/*********************************************************/
/*               Title :  pal Color                     */
/*     Execute Command :  PalColor                     */
/*              Author :  tatarlxw                       */
/*       Creation Date :  2014-11-11                    */
/*              Update :                                 */
/*             Version :  1.0                            */
/*            Web site :  http://hi.baidu.com/tatarlxw   */
/*              E-mail :  [email protected]               */
/*********************************************************/
;(load "C:/PalEDA/Allegro/Display/ColorDialog/PalColor.il")
axlCmdRegister("PalColor" ‘PalColor)

newColor=0
intCPageIndex=0
;参数模块
;按钮色彩预定义
defun( clrFormSetField (curLayerName KeyName)
  if(axlIsVisibleLayer(curLayerName) then
     crblayer=axlLayerGet(curLayerName)
     axlFormSetField(frmColor KeyName crblayer->color )
	 axlFormSetField(frmColor KeyName t)
  else
	 axlFormSetField( frmColor KeyName ‘black)
	 axlFormSetField(frmColor KeyName nil)
    )
)

; 按钮色彩预定义
defun( clrGetform ()

  clrFormSetField("BOARD GEOMETRY/OUTLINE" "crbOutline")
  clrFormSetField("BOARD GEOMETRY/OUTLINE-O" "crbOutlineo")  

  clrFormSetField("BOARD GEOMETRY/TOP-L" "crbDxftopl")
  clrFormSetField("BOARD GEOMETRY/TOP-LO" "crbDxftoplo")
  clrFormSetField("BOARD GEOMETRY/TOP-N" "crbDxftopn")
  clrFormSetField("BOARD GEOMETRY/TOP-O" "crbDxftopno")
  clrFormSetField("BOARD GEOMETRY/BOT-L" "crbDxfbotl")
  clrFormSetField("BOARD GEOMETRY/BOT-LO" "crbDxfbotlo")
  clrFormSetField("BOARD GEOMETRY/BOT-N" "crbDxfbotn")
  clrFormSetField("BOARD GEOMETRY/BOT-O" "crbDxfbotno")  

  clrFormSetField("PACKAGE GEOMETRY/PLACE_BOUND_TOP" "crbPlaceBoundtop")
  clrFormSetField("PACKAGE GEOMETRY/PLACE_BOUND_BOTTOM" "crbPlaceBoundbot")
  clrFormSetField("PACKAGE KEEPOUT/ALL" "crbPackageKOAll")
  clrFormSetField("PACKAGE KEEPOUT/TOP" "crbPackageKOtop")
  clrFormSetField("PACKAGE KEEPOUT/BOTTOM" "crbPackageKObot")
  clrFormSetField("BOARD GEOMETRY/SWITCH_AREA_TOP" "crbSwitchAreatop")
  clrFormSetField("BOARD GEOMETRY/SWITCH_AREA_BOTTOM" "crbSwitchAreabot")
  clrFormSetField("BOARD GEOMETRY/BOTH_ROOMS" "crbRoomAll")
  clrFormSetField("BOARD GEOMETRY/TOP_ROOM" "crbRoomtop")
  clrFormSetField("BOARD GEOMETRY/BOTTOM_ROOM" "crbRoombot")
  clrFormSetField("MANUFACTURING/NO_PROBE_TOP" "crbNoProbetop")
  clrFormSetField("MANUFACTURING/NO_PROBE_BOTTOM" "crbNoProbebot")
  clrFormSetField("MANUFACTURING/PROBE_TOP" "crbProbetop")
  clrFormSetField("MANUFACTURING/PROBE_BOTTOM" "crbProbebot")
  clrFormSetField("PIN/FILMMASKTOP" "crbFilmmaskPintop")
  clrFormSetField("PIN/FILMMASKBOTTOM" "crbFilmmaskPinbot")
  clrFormSetField("VIA CLASS/FILMMASKTOP" "crbFilmmaskViatop")
  clrFormSetField("VIA CLASS/FILMMASKBOTTOM" "crbFilmmaskViabot")

  clrFormSetField("BOARD GEOMETRY/SOLDERMASK_TOP" 		"crbSoldermaskBDtop")
  clrFormSetField("BOARD GEOMETRY/SOLDERMASK_BOTTOM" 	"crbSoldermaskBDbot")
  clrFormSetField("PACKAGE GEOMETRY/SOLDERMASK_TOP" 	"crbSoldermaskPKGtop")
  clrFormSetField("PACKAGE GEOMETRY/SOLDERMASK_BOTTOM" 	"crbSoldermaskPKGbot")
  clrFormSetField("DRAWING FORMAT/SOLDERMASK_TOP" 		"crbSoldermaskDrwtop")
  clrFormSetField("DRAWING FORMAT/SOLDERMASK_BOTTOM" 	"crbSoldermaskDrwbot")
  clrFormSetField("PIN/SOLDERMASK_TOP" 					"crbSoldermaskPintop")
  clrFormSetField("PIN/SOLDERMASK_BOTTOM" 				"crbSoldermaskPinbot")
  clrFormSetField("VIA CLASS/SOLDERMASK_TOP" 			"crbSoldermaskViatop")
  clrFormSetField("VIA CLASS/SOLDERMASK_BOTTOM" 		"crbSoldermaskViabot")

  clrFormSetField("BOARD GEOMETRY/PASTEMASK_TOP" 		"crbPastemaskBDtop")
  clrFormSetField("BOARD GEOMETRY/PASTEMASK_BOTTOM" 	"crbPastemaskBDbot")
  clrFormSetField("PACKAGE GEOMETRY/PASTEMASK_TOP" 		"crbPastemaskPKGtop")
  clrFormSetField("PACKAGE GEOMETRY/PASTEMASK_BOTTOM"	"crbPastemaskPKGbot")
  clrFormSetField("DRAWING FORMAT/PASTEMASK_TOP" 		"crbPastemaskDrwtop")
  clrFormSetField("DRAWING FORMAT/PASTEMASK_BOTTOM" 	"crbPastemaskDrwbot")
  clrFormSetField("PIN/PASTEMASK_TOP" 					"crbPastemaskPintop")
  clrFormSetField("PIN/PASTEMASK_BOTTOM" 				"crbPastemaskPinbot")
  clrFormSetField("VIA CLASS/PASTEMASK_TOP" 			"crbPastemaskViatop")
  clrFormSetField("VIA CLASS/PASTEMASK_BOTTOM" 			"crbPastemaskViabot")  

  clrFormSetField("PACKAGE GEOMETRY/ASSEMBLY_TOP" 		"crbAssemblyPKGtop")
  clrFormSetField("PACKAGE GEOMETRY/ASSEMBLY_BOTTOM" 	"crbAssemblyPKGbot")
  clrFormSetField("REF DES/ASSEMBLY_TOP" 				"crbAssemblyReftop")
  clrFormSetField("REF DES/ASSEMBLY_BOTTOM" 			"crbAssemblyRefbot")

  clrFormSetField("PACKAGE GEOMETRY/DISPLAY_TOP" 		"crbDisplayPKGtop")
  clrFormSetField("PACKAGE GEOMETRY/DISPLAY_BOTTOM" 	"crbDisplayPKGbot")
  clrFormSetField("REF DES/DISPLAY_TOP" 				"crbDisplayReftop")
  clrFormSetField("REF DES/DISPLAY_BOTTOM" 				"crbDisplayRefbot")

  clrFormSetField("BOARD GEOMETRY/SILKSCREEN_TOP" 		"crbSilkscreenBDtop")
  clrFormSetField("BOARD GEOMETRY/SILKSCREEN_BOTTOM" 	"crbSilkscreenBDbot")
  clrFormSetField("PACKAGE GEOMETRY/SILKSCREEN_TOP" 	"crbSilkscreenPKGtop")
  clrFormSetField("PACKAGE GEOMETRY/SILKSCREEN_BOTTOM" 	"crbSilkscreenPKGbot")
  clrFormSetField("DRAWING FORMAT/SILKSCREEN_TOP" 		"crbSilkscreenDrwtop")
  clrFormSetField("DRAWING FORMAT/SILKSCREEN_BOTTOM" 	"crbSilkscreenDrwbot")
  clrFormSetField("REF DES/SILKSCREEN_TOP" 				"crbSilkscreenReftop")
  clrFormSetField("REF DES/SILKSCREEN_BOTTOM" 			"crbSilkscreenRefbot")  

    if(and(axlFormGetField(frmColor "crbSoldermaskBDtop")
         axlFormGetField(frmColor "crbSoldermaskPKGtop")
		 axlFormGetField(frmColor "crbSoldermaskDrwtop")
		 axlFormGetField(frmColor "crbSoldermaskPintop")
		 axlFormGetField(frmColor "crbSoldermaskViatop")
		 ) then
     axlFormSetField(frmColor "ckbSoldermaskTop" t)
	 else
	 axlFormSetField(frmColor "ckbSoldermaskTop" nil)
	 )
    if(and(axlFormGetField(frmColor "crbSoldermaskBDbot")
         axlFormGetField(frmColor "crbSoldermaskPKGbot")
		 axlFormGetField(frmColor "crbSoldermaskDrwbot")
		 axlFormGetField(frmColor "crbSoldermaskPinbot")
		 axlFormGetField(frmColor "crbSoldermaskViabot")
		 ) then
     axlFormSetField(frmColor "ckbSoldermaskBot" t)
	 else
	 axlFormSetField(frmColor "ckbSoldermaskBot" nil)
	 )
    if(and(axlFormGetField(frmColor "crbPastemaskViatop")
         axlFormGetField(frmColor "crbPastemaskBDtop")
		 axlFormGetField(frmColor "crbPastemaskPKGtop")
		 axlFormGetField(frmColor "crbPastemaskDrwtop")
		 axlFormGetField(frmColor "crbPastemaskPintop")

		 ) then
     axlFormSetField(frmColor "ckbPastemaskTop" t)
	 else
	 axlFormSetField(frmColor "ckbPastemaskTop" nil)
	 )
    if(and(axlFormGetField(frmColor "crbPastemaskViabot")
         axlFormGetField(frmColor "crbPastemaskBDbot")
		 axlFormGetField(frmColor "crbPastemaskPKGbot")
		 axlFormGetField(frmColor "crbPastemaskDrwbot")
		 axlFormGetField(frmColor "crbPastemaskPinbot")

		 ) then
     axlFormSetField(frmColor "ckbPastemaskBot" t)
	 else
	 axlFormSetField(frmColor "ckbPastemaskBot" nil)
	 )
    if(and(axlFormGetField(frmColor "crbAssemblyPKGtop")
         axlFormGetField(frmColor "crbAssemblyReftop")
		 ) then
     axlFormSetField(frmColor "ckbAssemblyTop" t)
	 else
	 axlFormSetField(frmColor "ckbAssemblyTop" nil)
	 )
    if(and(axlFormGetField(frmColor "crbAssemblyPKGbot")
         axlFormGetField(frmColor "crbAssemblyRefbot")
		 ) then
     axlFormSetField(frmColor "ckbAssemblyBot" t)
	 else
	 axlFormSetField(frmColor "ckbAssemblyBot" nil)
	 )
    if(and(axlFormGetField(frmColor "crbDisplayPKGtop")
         axlFormGetField(frmColor "crbDisplayReftop")
		 ) then
     axlFormSetField(frmColor "ckbDisplayTop" t)
	 else
	 axlFormSetField(frmColor "ckbDisplayTop" nil)
	 )
    if(and(axlFormGetField(frmColor "crbDisplayPKGbot")
         axlFormGetField(frmColor "crbDisplayRefbot")
		 ) then
     axlFormSetField(frmColor "ckbDisplayBot" t)
	 else
	 axlFormSetField(frmColor "ckbDisplayBot" nil)
	 )
    if(and(axlFormGetField(frmColor "crbSilkscreenBDtop")
         axlFormGetField(frmColor "crbSilkscreenPKGtop")
		 axlFormGetField(frmColor "crbSilkscreenDrwtop")
		 axlFormGetField(frmColor "crbSilkscreenReftop")
		 ) then
     axlFormSetField(frmColor "ckbSilkscreenTop" t)
	 else
	 axlFormSetField(frmColor "ckbSilkscreenTop" nil)
	 )
	 if(and(axlFormGetField(frmColor "crbSilkscreenBDbot")
         axlFormGetField(frmColor "crbSilkscreenPKGbot")
		 axlFormGetField(frmColor "crbSilkscreenDrwbot")
		 axlFormGetField(frmColor "crbSilkscreenRefbot")
		 ) then
     axlFormSetField(frmColor "ckbSilkscreenBot" t)
	 else
	 axlFormSetField(frmColor "ckbSilkscreenBot" nil)
	 )
  clrFormSetField("BOARD GEOMETRY/LOGO" "crbLogo")
  clrFormSetField("PACKAGE GEOMETRY/PIN_NUMBER" "crbPinNumber")
  clrFormSetField("DRAWING FORMAT/MOAT" "crbMoat")
  clrFormSetField("MANUFACTURING/XSECTION_CHART" "crbXsectionChart")
  clrFormSetField("MANUFACTURING/NCDRILL_FIGURE" "crbManNcdrillFigure")
  clrFormSetField("MANUFACTURING/NCDRILL_LEGEND" "crbManNcdrillLegend")
  clrFormSetField("DRAWING FORMAT/NCDRILL_LEGEND" "crbDrwNcdrillLegend")
  clrFormSetField("MANUFACTURING/PHOTOPLOT_OUTLINE" "crbPhotoplotOutline")
  clrFormSetField("PACKAGE GEOMETRY/DIMENSION" "crbDimension")  

  clrFormSetField("ROUTE KEEPIN/ALL" "crbRteKIAll")
  clrFormSetField("PACKAGE KEEPIN/ALL" "crbPkgKIAll")

 intId=0
 curLayers=axlGetParam("paramLayerGroup:ETCH")->groupMembers
   foreach( item curLayers
   intId=intId+1
   clrFormSetField(strcat("DRC ERROR CLASS/" item) 	strcat("crbDrc" sprintf(nil "%d" intId)))
   clrFormSetField(strcat("ETCH/" item) 			strcat("crbEtch" sprintf(nil "%d" intId)))
   clrFormSetField(strcat("PIN/" item) 				strcat("crbPin" sprintf(nil "%d" intId)))
   clrFormSetField(strcat("ROUTE KEEPOUT/" item) 	strcat("crbRko" sprintf(nil "%d" intId)))
   clrFormSetField(strcat("VIA CLASS/" item) 		strcat("crbVia" sprintf(nil "%d" intId)))
   clrFormSetField(strcat("VIA KEEPOUT/" item) 		strcat("crbVko" sprintf(nil "%d" intId)))
   clrFormSetField(strcat("ANTI ETCH/" item) 		strcat("crbAnt" sprintf(nil "%d" intId)))
   clrFormSetField(strcat("BOUNDARY/" item) 		strcat("crbBdy" sprintf(nil "%d" intId)))
   clrFormSetField(strcat("CONSTRAINT REGION/" item) strcat("crbCns" sprintf(nil "%d" intId)))
  ; axlUIWPrint(nil  strcat("PIN/" item ) sprintf(nil "%d" intId) )
   )
)

;色盘初始色
defun( clrColorPage (intP)
 for(i 0 47
  ;fprintf(lstF strcat("FIELD crbColor" sprintf(nil "%d" i) "\n" "FLOC " sprintf(nil "%d" modulo(i 16)*3+3) " " sprintf(nil "%d" 40+(i/16)*2) "\n" 	"COLOR 3 1\n" 				"ENDFIELD\n"))
  axlFormSetField( frmColor strcat("crbColor" sprintf(nil "%d" i)) i+intP*48)
 )
 ) 

;自定义功能显示作业层组
defun( LayerCustom (strCustom)
axlShell("setwindow pcb")
axlShell("placementedit")
axlShell("colorview create")
axlShell("placementedit")
axlShell("setwindow form.colorview_create")
axlShell(strcat("FORM colorview_create colorview_name " strCustom))
axlShell("FORM colorview_create save ")
axlShell("FORM colorview_create done ")
axlShell("setwindow pcb")
)

;============ 主模块 ===============
defun( PalColor ()
  formFileName = "./PalColor.form"
  frmColor_create()

  spec_layerfield_table = makeTable("spec_layerfield_table" nil)
  spec_layerfield_table["crbEtch"] = list("ETCH/")
  spec_layerfield_table["crbVia"] = list("VIA CLASS/")
  spec_layerfield_table["crbPin"] = list("PIN/")
  spec_layerfield_table["crbDrc"] = list("DRC ERROR CLASS/")
  spec_layerfield_table["crbAnt"] = list("ANTI ETCH/")
  spec_layerfield_table["crbRko"] = list("ROUTE KEEPOUT/")
  spec_layerfield_table["crbVko"] = list("VIA KEEPOUT/")
  spec_layerfield_table["crbCns"] = list("CONSTRAINT REGION/")
  spec_layerfield_table["crbBdy"] = list("BOUNDARY/")
  frmColor = axlFormCreate( (gensym) formFileName `(ne inner "msglines" 2) `PalColor_action t nil)
  frmColor->spec = spec_layerfield_table
  axlFormDisplay(frmColor)
  deleteFile(formFileName)
  axlControlRaise(‘options)

  clrGetform()  ;按钮色彩预定义
  clrColorPage(intCPageIndex)

 )

 ; ===== ===== 按钮响应区 ===== =====
;参数模块
;色块按键按下与弹起。
defun( ColorAction (curLayerName KeyName)
  if(axlFormGetField( frmColor "ckbColorSetup") then

  	   axlVisibleLayer(curLayerName t)
       crblayer=axlLayerGet(curLayerName)
       axlFormSetField( frmColor KeyName crblayer->color )

   	  chgColor=axlLayerGet(curLayerName)
	  chgColor->color=newColor
	  axlLayerSet(chgColor)
	  clrGetform()
	  axlVisibleUpdate(frmColor)
	  axlShell( "redraw")
	  ;axlUIWPrint(nil curLayerName)
    else
     if(axlFormGetField( frmColor KeyName) then  ;获取字段的值,查看当前按钮是否按下,
	   axlVisibleLayer(curLayerName t)
       crblayer=axlLayerGet(curLayerName)
       axlFormSetField( frmColor KeyName crblayer->color )
	 else
	    axlVisibleLayer(curLayerName nil)
	    axlFormSetField( frmColor KeyName ‘black)
       )
	axlVisibleUpdate(nil)
	clrGetform()
    axlVisibleUpdate(frmColor)
	)
)
/*
   	            q1=axlLayerGet("PACKAGE GEOMETRY/SILKSCREEN_TOP")
	            q1->color=63
	          	axlLayerSet(q1)
*/	

defun(ckbStackAllLayer1 (KeyName ClassName)
   if(axlFormGetField(frmColor KeyName) then
    ;intIdE=0
    foreach( item curLayers	 axlVisibleLayer(strcat(ClassName item) t))
	 else
    foreach( item curLayers	 axlVisibleLayer(strcat(ClassName item) nil))
	 )
	axlShell( "redraw")
    clrGetform()
   )
   /*
procedure( YourTimerCallback( window timerId elapsedTime)
    ; your time period has elapsed.  do something.
 )
*/
defun(PalColor_action (frmColor)

  let((idx ly flag hdfield crblayer hdly curLayers)
    curLayers=axlGetParam("paramLayerGroup:ETCH")->groupMembers
    foreach(ea tableToList(frmColor->spec)
      if(index(frmColor->curField car(ea)) && strlen(frmColor->curField) > strlen(car(ea)) then
        idx = atoi(substring(frmColor->curField strlen(car(ea))+1))
        ly = nthelem(idx curLayers)
        foreach(e frmColor->spec[car(ea)]
          ColorAction(strcat(e ly) frmColor->curField)
        )
      )
    )
    if(index(frmColor->curField "ckbStack") && strlen(frmColor->curField) > strlen("ckbStack") then
      flag = axlFormGetField(frmColor frmColor->curField)
      idx = atoi(substring(frmColor->curField 9))
      ly = nthelem(idx curLayers)
      foreach(ea tableToList(frmColor->spec)
        hdly = strcat(car(cadr(ea)) ly)
        hdfield = sprintf(nil "%s%d" car(ea) idx)
        if(axlFormGetField(frmColor hdfield) != flag then
          if(!flag then
            axlVisibleLayer(hdly nil)
	          axlFormSetField(frmColor hdfield ‘black)
	          axlFormSetField(frmColor hdfield nil)
	        else
	         axlVisibleLayer(hdly t)
            crblayer = axlLayerGet(hdly)
            axlFormSetField(frmColor hdfield crblayer->color)
            axlFormSetField(frmColor hdfield t)
          )
        )
      )
      axlVisibleUpdate(nil)
    );end if ‘ckbStack‘
    if(index(frmColor->curField "crbColor") && strlen(frmColor->curField) > strlen("crbColor") then
        for(i 0 47
		axlFormSetField(frmColor strcat("crbColor" sprintf(nil "%d" i+intCPageIndex*48)) nil)
		)
 	flag = axlFormGetField(frmColor frmColor->curField)
	  idx = atoi(substring(frmColor->curField 9))
	  newColor=idx;
	  ;axlUIWPrint(nil sprintf(nil "%d" idx))

	);end if ‘crbColor

  );end let

case(frmColor->curField

   ("crbOutline" ColorAction("BOARD GEOMETRY/OUTLINE" "crbOutline"))
   ("crbOutlineo" ColorAction("BOARD GEOMETRY/OUTLINE-O" "crbOutlineo"))

   ("crbDxftopl" ColorAction("BOARD GEOMETRY/TOP-L" "crbDxftopl"))
   ("crbDxftoplo" ColorAction("BOARD GEOMETRY/TOP-LO" "crbDxftoplo"))
   ("crbDxftopn" ColorAction("BOARD GEOMETRY/TOP-N" "crbDxftopn"))
   ("crbDxftopno" ColorAction("BOARD GEOMETRY/TOP-O" "crbDxftopno"))
   ("crbDxfbotl" ColorAction("BOARD GEOMETRY/BOT-L" "crbDxfbotl"))
   ("crbDxfbotlo" ColorAction("BOARD GEOMETRY/BOT-LO" "crbDxfbotlo"))
   ("crbDxfbotn" ColorAction("BOARD GEOMETRY/BOT-N" "crbDxfbotn"))
   ("crbDxfbotno" ColorAction("BOARD GEOMETRY/BOT-O" "crbDxfbotno"))

   ("crbPlaceBoundtop" ColorAction("PACKAGE GEOMETRY/PLACE_BOUND_TOP" "crbPlaceBoundtop"))
   ("crbPlaceBoundbot" ColorAction("PACKAGE GEOMETRY/PLACE_BOUND_BOTTOM" "crbPlaceBoundbot"))
   ("crbPackageKOAll" ColorAction("PACKAGE KEEPOUT/ALL" "crbPackageKOAll"))
   ("crbPackageKOtop" ColorAction("PACKAGE KEEPOUT/TOP" "crbPackageKOtop"))
   ("crbPackageKObot" ColorAction("PACKAGE KEEPOUT/BOTTOM" "crbPackageKObot"))
   ("crbSwitchAreatop" ColorAction("BOARD GEOMETRY/SWITCH_AREA_TOP" "crbSwitchAreatop"))
   ("crbSwitchAreabot" ColorAction("BOARD GEOMETRY/SWITCH_AREA_BOTTOM" "crbSwitchAreabot"))
   ("crbRoomAll" ColorAction("BOARD GEOMETRY/BOTH_ROOMS" "crbRoomAll"))
   ("crbRoomtop" ColorAction("BOARD GEOMETRY/TOP_ROOM" "crbRoomtop"))
   ("crbRoombot" ColorAction("BOARD GEOMETRY/BOTTOM_ROOM" "crbRoombot"))
   ("crbNoProbetop" ColorAction("MANUFACTURING/NO_PROBE_TOP" "crbNoProbetop"))
   ("crbNoProbebot" ColorAction("MANUFACTURING/NO_PROBE_BOTTOM" "crbNoProbebot"))
   ("crbProbetop" ColorAction("MANUFACTURING/PROBE_TOP" "crbProbetop"))
   ("crbProbebot" ColorAction("MANUFACTURING/PROBE_BOTTOM" "crbProbebot"))
   ("crbFilmmaskPintop" ColorAction("PIN/FILMMASKTOP" "crbFilmmaskPintop"))
   ("crbFilmmaskPinbot" ColorAction("PIN/FILMMASKBOTTOM" "crbFilmmaskPinbot"))
   ("crbFilmmaskViatop" ColorAction("VIA CLASS/FILMMASKTOP" "crbFilmmaskViatop"))
   ("crbFilmmaskViabot" ColorAction("VIA CLASS/FILMMASKBOTTOM" "crbFilmmaskViabot"))

   ("crbSoldermaskBDtop" ColorAction("BOARD GEOMETRY/SOLDERMASK_TOP" "crbSoldermaskBDtop"))
   ("crbSoldermaskBDbot" ColorAction("BOARD GEOMETRY/SOLDERMASK_BOTTOM" "crbSoldermaskBDbot"))
   ("crbSoldermaskPKGtop" ColorAction("PACKAGE GEOMETRY/SOLDERMASK_TOP" "crbSoldermaskPKGtop"))
   ("crbSoldermaskPKGbot" ColorAction("PACKAGE GEOMETRY/SOLDERMASK_BOTTOM" "crbSoldermaskPKGbot"))
   ("crbSoldermaskDrwtop" ColorAction("DRAWING FORMAT/SOLDERMASK_TOP" "crbSoldermaskDrwtop"))
   ("crbSoldermaskDrwbot" ColorAction("DRAWING FORMAT/SOLDERMASK_BOTTOM" "crbSoldermaskDrwbot"))
   ("crbSoldermaskPintop" ColorAction("PIN/SOLDERMASK_TOP" "crbSoldermaskPintop"))
   ("crbSoldermaskPinbot" ColorAction("PIN/SOLDERMASK_BOTTOM" "crbSoldermaskPinbot"))
   ("crbSoldermaskViatop" ColorAction("VIA CLASS/SOLDERMASK_TOP" "crbSoldermaskViatop"))
   ("crbSoldermaskViabot" ColorAction("VIA CLASS/SOLDERMASK_BOTTOM" "crbSoldermaskViabot"))

   ("crbPastemaskBDtop" ColorAction("BOARD GEOMETRY/PASTEMASK_TOP" "crbPastemaskBDtop"))
   ("crbPastemaskBDbot" ColorAction("BOARD GEOMETRY/PASTEMASK_BOTTOM" "crbPastemaskBDbot"))
   ("crbPastemaskPKGtop" ColorAction("PACKAGE GEOMETRY/PASTEMASK_TOP" "crbPastemaskPKGtop"))
   ("crbPastemaskPKGbot" ColorAction("PACKAGE GEOMETRY/PASTEMASK_BOTTOM" "crbPastemaskPKGbot"))
   ("crbPastemaskDrwtop" ColorAction("DRAWING FORMAT/PASTEMASK_TOP" "crbPastemaskDrwtop"))
   ("crbPastemaskDrwbot" ColorAction("DRAWING FORMAT/PASTEMASK_BOTTOM" "crbPastemaskDrwbot"))
   ("crbPastemaskPintop" ColorAction("PIN/PASTEMASK_TOP" "crbPastemaskPintop"))
   ("crbPastemaskPinbot" ColorAction("PIN/PASTEMASK_BOTTOM" "crbPastemaskPinbot"))
   ("crbPastemaskViatop" ColorAction("VIA CLASS/PASTEMASK_TOP" "crbPastemaskViatop"))
   ("crbPastemaskViabot" ColorAction("VIA CLASS/PASTEMASK_BOTTOM" "crbPastemaskViabot"))

   ("crbAssemblyPKGtop" ColorAction("PACKAGE GEOMETRY/ASSEMBLY_TOP" "crbAssemblyPKGtop"))
   ("crbAssemblyPKGbot" ColorAction("PACKAGE GEOMETRY/ASSEMBLY_BOTTOM" "crbAssemblyPKGbot"))
   ("crbAssemblyReftop" ColorAction("REF DES/ASSEMBLY_TOP" "crbAssemblyReftop"))
   ("crbAssemblyRefbot" ColorAction("REF DES/ASSEMBLY_BOTTOM" "crbAssemblyRefbot"))

   ("crbDisplayPKGtop" ColorAction("PACKAGE GEOMETRY/DISPLAY_TOP" "crbDisplayPKGtop"))
   ("crbDisplayPKGbot" ColorAction("PACKAGE GEOMETRY/DISPLAY_BOTTOM" "crbDisplayPKGbot"))
   ("crbDisplayReftop" ColorAction("REF DES/DISPLAY_TOP" "crbDisplayReftop"))
   ("crbDisplayRefbot" ColorAction("REF DES/DISPLAY_BOTTOM" "crbDisplayRefbot"))

   ("crbSilkscreenBDtop" ColorAction("BOARD GEOMETRY/SILKSCREEN_TOP" "crbSilkscreenBDtop"))
   ("crbSilkscreenBDbot" ColorAction("BOARD GEOMETRY/SILKSCREEN_BOTTOM" "crbSilkscreenBDbot"))
   ("crbSilkscreenPKGtop" ColorAction("PACKAGE GEOMETRY/SILKSCREEN_TOP" "crbSilkscreenPKGtop"))
   ("crbSilkscreenPKGbot" ColorAction("PACKAGE GEOMETRY/SILKSCREEN_BOTTOM" "crbSilkscreenPKGbot"))
   ("crbSilkscreenDrwtop" ColorAction("DRAWING FORMAT/SILKSCREEN_TOP" "crbSilkscreenDrwtop"))
   ("crbSilkscreenDrwbot" ColorAction("DRAWING FORMAT/SILKSCREEN_BOTTOM" "crbSilkscreenDrwbot"))
   ("crbSilkscreenReftop" ColorAction("REF DES/SILKSCREEN_TOP" "crbSilkscreenReftop"))
   ("crbSilkscreenRefbot" ColorAction("REF DES/SILKSCREEN_BOTTOM" "crbSilkscreenRefbot"))

   ("crbLogo" ColorAction("BOARD GEOMETRY/LOGO" "crbLogo"))
   ("crbPinNumber" ColorAction("PACKAGE GEOMETRY/PIN_NUMBER" "crbPinNumber"))
   ("crbMoat" ColorAction("DRAWING FORMAT/MOAT" "crbMoat"))
   ("crbXsectionChart" ColorAction("MANUFACTURING/XSECTION_CHART" "crbXsectionChart"))

   ("crbManNcdrillFigure" ColorAction("MANUFACTURING/NCDRILL_FIGURE" "crbManNcdrillFigure"))
   ("crbManNcdrillLegend" ColorAction("MANUFACTURING/NCDRILL_LEGEND" "crbManNcdrillLegend"))
   ("crbDrwNcdrillLegend" ColorAction("DRAWING FORMAT/NCDRILL_LEGEND" "crbDrwNcdrillLegend"))

   ("crbPhotoplotOutline" ColorAction("MANUFACTURING/PHOTOPLOT_OUTLINE" "crbPhotoplotOutline"))
   ("crbDimension" ColorAction("PACKAGE GEOMETRY/DIMENSION" "crbDimension"))

   ("crbRteKIAll" ColorAction("ROUTE KEEPIN/ALL" "crbRteKIAll"))
   ("crbPkgKIAll" ColorAction("PACKAGE KEEPIN/ALL" "crbPkgKIAll"))

   ("btnPalceTop"        if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("PalceTop") else actPalceTop() clrGetform()))
   ("btnPalceBot"        if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("PalceBot") else actPalceBot() clrGetform()))
   ("btnPalceAll"        if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("PalceAll") else actPalceAll() clrGetform()))
   ("btnTestPinTop"      if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("TestPinTop") else actTestPinTop() clrGetform()))
   ("btnTestPinBot"      if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("TestPinBot") else actTestPinBot() clrGetform()))
   ("btnTestPinAll"      if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("TestPinAll") else actTestPinAll() clrGetform()))
   ("btnSoldermaskTop"   if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("SoldermaskTop") else actSoldermaskTop() clrGetform()))
   ("btnSoldermaskBot"   if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("SoldermaskBot") else actSoldermaskBot() clrGetform()))
   ("btnPastemaskTop"    if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("PastemaskTop") else actPastemaskTop() clrGetform()))
   ("btnPastemaskBot"    if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("PastemaskBot") else actPastemaskBot() clrGetform()))
   ("btnAssemblyTop"     if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("AssemblyTop") else actAssemblyTop() clrGetform()))
   ("btnAssemblyBot"     if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("AssemblyBot") else actAssemblyBot() clrGetform()))
   ("btnDisplayTop"      if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("DisplayTop") else actDisplayTop() clrGetform()))
   ("btnDisplayBot"      if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("DisplayBot") else actDisplayBot() clrGetform()))
   ("btnSilkscreenTop"   if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("SilkscreenTop") else actSilkscreenTop() clrGetform()))
   ("btnSilkscreenBot"   if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("SilkscreenBot") else actSilkscreenBot() clrGetform()))
   ("btnDrill"           if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("Drill") else actDrill() clrGetform()))
   ("btnRoute"           if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("Route") else actRoute() clrGetform()))
   ("btnEtch"            if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("Etch") else actEtch() clrGetform()))
   ("btnCustom1"         if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("Custom1") else actCustom1() clrGetform()))
   ("btnCustom2"         if( axlFormGetField( frmColor "ckbLayerSetup") then LayerCustom("Custom2") else actCustom2() clrGetform()))
   ("btnNext"
     intCPageIndex=intCPageIndex+1
	 if( intCPageIndex==5 then intCPageIndex=0)
	 clrColorPage(intCPageIndex)
	 clrGetform()
	 )
	("btnPrev"
     intCPageIndex=intCPageIndex-1
	 if(intCPageIndex==0 then intCPageIndex=5)
	 clrColorPage(intCPageIndex)
	 clrGetform()

	 )
   ;ckb代码区
   ("ckbSoldermaskTop"
   if(axlFormGetField(frmColor "ckbSoldermaskTop") then
     axlVisibleLayer("BOARD GEOMETRY/SOLDERMASK_TOP" t)
     axlVisibleLayer("DRAWING FORMAT/SOLDERMASK_TOP" t)
     axlVisibleLayer("PACKAGE GEOMETRY/SOLDERMASK_TOP" t)
     axlVisibleLayer("PIN/SOLDERMASK_TOP" t)
     axlVisibleLayer("VIA CLASS/SOLDERMASK_TOP" t)
	 else
     axlVisibleLayer("BOARD GEOMETRY/SOLDERMASK_TOP" nil)
     axlVisibleLayer("DRAWING FORMAT/SOLDERMASK_TOP" nil)
     axlVisibleLayer("PACKAGE GEOMETRY/SOLDERMASK_TOP" nil)
     axlVisibleLayer("PIN/SOLDERMASK_TOP" nil)
     axlVisibleLayer("VIA CLASS/SOLDERMASK_TOP" nil)
	 )
	 axlShell( "redraw")
	 clrGetform()
	)
   ("ckbSoldermaskBot"
   if(axlFormGetField(frmColor "ckbSoldermaskBot") then
    axlVisibleLayer("BOARD GEOMETRY/SOLDERMASK_BOTTOM" t)
    axlVisibleLayer("BOARD GEOMETRY/OUTLINE" t)
    axlVisibleLayer("DRAWING FORMAT/SOLDERMASK_BOTTOM" t)
    axlVisibleLayer("PACKAGE GEOMETRY/SOLDERMASK_BOTTOM" t)
    axlVisibleLayer("PIN/SOLDERMASK_BOTTOM" t)
    axlVisibleLayer("VIA CLASS/SOLDERMASK_BOTTOM" t)
	else
    axlVisibleLayer("BOARD GEOMETRY/SOLDERMASK_BOTTOM" nil)
    axlVisibleLayer("BOARD GEOMETRY/OUTLINE" nil)
    axlVisibleLayer("DRAWING FORMAT/SOLDERMASK_BOTTOM" nil)
    axlVisibleLayer("PACKAGE GEOMETRY/SOLDERMASK_BOTTOM" nil)
    axlVisibleLayer("PIN/SOLDERMASK_BOTTOM" nil)
    axlVisibleLayer("VIA CLASS/SOLDERMASK_BOTTOM" nil)
	)
    axlShell( "redraw")
   clrGetform()
   )
   ("ckbPastemaskTop"
   if(axlFormGetField(frmColor "ckbPastemaskTop") then
    axlVisibleLayer("BOARD GEOMETRY/PASTEMASK_TOP" t)
    axlVisibleLayer("DRAWING FORMAT/PASTEMASK_TOP" t)
    axlVisibleLayer("PACKAGE GEOMETRY/PASTEMASK_TOP" t)
    axlVisibleLayer("PIN/PASTEMASK_TOP" t)
    axlVisibleLayer("VIA CLASS/PASTEMASK_TOP" t)
	else
    axlVisibleLayer("BOARD GEOMETRY/PASTEMASK_TOP" nil)
    axlVisibleLayer("DRAWING FORMAT/PASTEMASK_TOP" nil)
    axlVisibleLayer("PACKAGE GEOMETRY/PASTEMASK_TOP" nil)
    axlVisibleLayer("PIN/PASTEMASK_TOP" nil)
    axlVisibleLayer("VIA CLASS/PASTEMASK_TOP" nil)
	)
    axlShell( "redraw")
	clrGetform()
   )
   ("ckbPastemaskBot"
   if(axlFormGetField(frmColor "ckbPastemaskBot") then
     axlVisibleLayer("BOARD GEOMETRY/PASTEMASK_BOTTOM" t)
     axlVisibleLayer("DRAWING FORMAT/PASTEMASK_BOTTOM" t)
     axlVisibleLayer("PACKAGE GEOMETRY/PASTEMASK_BOTTOM" t)
     axlVisibleLayer("PIN/PASTEMASK_BOTTOM" t)
     axlVisibleLayer("VIA CLASS/PASTEMASK_BOTTOM" t)
	 else
	 axlVisibleLayer("BOARD GEOMETRY/PASTEMASK_BOTTOM" nil)
     axlVisibleLayer("DRAWING FORMAT/PASTEMASK_BOTTOM" nil)
     axlVisibleLayer("PACKAGE GEOMETRY/PASTEMASK_BOTTOM" nil)
     axlVisibleLayer("PIN/PASTEMASK_BOTTOM" nil)
     axlVisibleLayer("VIA CLASS/PASTEMASK_BOTTOM" nil)
	 )
     axlShell( "redraw")
     clrGetform()
   )
   ("ckbAssemblyTop"
   if(axlFormGetField(frmColor "ckbAssemblyTop") then
    axlVisibleLayer("BOARD GEOMETRY/ASSEMBLY_NOTES" t)
	axlVisibleLayer("REF DES/ASSEMBLY_TOP" t)
	axlVisibleLayer("PACKAGE GEOMETRY/ASSEMBLY_TOP" t)
	else
	axlVisibleLayer("BOARD GEOMETRY/ASSEMBLY_NOTES" nil)
	axlVisibleLayer("REF DES/ASSEMBLY_TOP" nil)
	axlVisibleLayer("PACKAGE GEOMETRY/ASSEMBLY_TOP" nil)
	)
   axlShell( "redraw")
   clrGetform()
   )
   ("ckbAssemblyBot"
   if(axlFormGetField(frmColor "ckbAssemblyBot") then
    axlVisibleLayer("BOARD GEOMETRY/ASSEMBLY_NOTES" t)
    axlVisibleLayer("REF DES/ASSEMBLY_BOTTOM" t)
	axlVisibleLayer("PACKAGE GEOMETRY/ASSEMBLY_BOTTOM" t)
	else
	axlVisibleLayer("BOARD GEOMETRY/ASSEMBLY_NOTES" nil)
    axlVisibleLayer("REF DES/ASSEMBLY_BOTTOM" nil)
	axlVisibleLayer("PACKAGE GEOMETRY/ASSEMBLY_BOTTOM" nil)
    )
    axlShell( "redraw")
    clrGetform()
   )
   ("ckbDisplayTop"
   if(axlFormGetField(frmColor "ckbDisplayTop") then
   axlVisibleLayer("REF DES/DISPLAY_TOP" t)
   axlVisibleLayer("PACKAGE GEOMETRY/DISPLAY_TOP" t)
   else
   axlVisibleLayer("REF DES/DISPLAY_TOP" nil)
   axlVisibleLayer("PACKAGE GEOMETRY/DISPLAY_TOP" nil)
   )
   axlShell( "redraw")
   clrGetform()
   )
   ("ckbDisplayBot"
   if(axlFormGetField(frmColor "ckbDisplayBot") then
    axlVisibleLayer("REF DES/DISPLAY_BOTTOM" t)
    axlVisibleLayer("PACKAGE GEOMETRY/DISPLAY_BOTTOM" t)
    else
	axlVisibleLayer("REF DES/DISPLAY_BOTTOM" nil)
    axlVisibleLayer("PACKAGE GEOMETRY/DISPLAY_BOTTOM" nil)
	)
   axlShell( "redraw")
   clrGetform()
   )
   ("ckbSilkscreenTop"
   if(axlFormGetField(frmColor "ckbSilkscreenTop") then
    axlVisibleLayer("REF DES/SILKSCREEN_TOP" t)
	axlVisibleLayer("BOARD GEOMETRY/SILKSCREEN_TOP" t)
	axlVisibleLayer("PACKAGE GEOMETRY/SILKSCREEN_TOP" t)
	axlVisibleLayer("DRAWING FORMAT/SILKSCREEN_TOP" t)
   else
    axlVisibleLayer("REF DES/SILKSCREEN_TOP" nil)
	axlVisibleLayer("BOARD GEOMETRY/SILKSCREEN_TOP" nil)
	axlVisibleLayer("PACKAGE GEOMETRY/SILKSCREEN_TOP" nil)
	axlVisibleLayer("DRAWING FORMAT/SILKSCREEN_TOP" nil)
   )
   axlShell( "redraw")
   clrGetform()
   )
   ("ckbSilkscreenBot"
   if(axlFormGetField(frmColor "ckbSilkscreenBot") then
    axlVisibleLayer("PACKAGE GEOMETRY/SILKSCREEN_BOTTOM" t)
	axlVisibleLayer("BOARD GEOMETRY/SILKSCREEN_BOTTOM" t)
	axlVisibleLayer("REF DES/SILKSCREEN_BOTTOM" t)
	axlVisibleLayer("DRAWING FORMAT/SILKSCREEN_BOTTOM" t)
   else
    axlVisibleLayer("PACKAGE GEOMETRY/SILKSCREEN_BOTTOM" nil)
	axlVisibleLayer("BOARD GEOMETRY/SILKSCREEN_BOTTOM" nil)
	axlVisibleLayer("REF DES/SILKSCREEN_BOTTOM" nil)
	axlVisibleLayer("DRAWING FORMAT/SILKSCREEN_BOTTOM" nil)
  )
   axlShell( "redraw")
   clrGetform()
   )

   ("ckbDrc" ckbStackAllLayer1("ckbDrc" "DRC ERROR CLASS/"))
   ("ckbEtch" ckbStackAllLayer1("ckbEtch" "ETCH/"))
   ("ckbPin" ckbStackAllLayer1("ckbPin" "PIN/"))
   ("ckbRko" ckbStackAllLayer1("ckbRko" "ROUTE KEEPOUT/"))
   ("ckbVia" ckbStackAllLayer1("ckbVia" "VIA CLASS/"))
   ("ckbVko" ckbStackAllLayer1("ckbVko" "VIA KEEPOUT/"))
   ("ckbAnt" ckbStackAllLayer1("ckbAnt" "ANTI ETCH/"))
   ("ckbBdy" ckbStackAllLayer1("ckbBdy" "BOUNDARY/"))
   ("ckbCns" ckbStackAllLayer1("ckbCns" "CONSTRAINT REGION/"))

   ("btnVisAllOn"
	 axlVisibleDesign(t)
	 clrGetform()
     axlShell( "redraw")
   )
   ("btnVisAllOff"
	 axlVisibleDesign(nil)
	 clrGetform()
     axlShell( "redraw")
   )

)) 

procedure(frmColor_create()
 lstF = outfile( formFileName "w")
 fprintf(lstF "FILE_TYPE=FORM_DEFN VERSION=2\n")
 fprintf(lstF "FORM\n")
 fprintf(lstF "FIXED\n")
 fprintf(lstF "PORT 104 30\n")
 fprintf(lstF "HEADER \"PalColor\"\n")
 fprintf(lstF "TILE\n")

;Visibility
 ;fprintf(lstF strcat("GROUP \"\" g2\n"				"FLOC 2 0\n" 	"FSIZE 24 4\n" 				"ENDGROUP\n"))

 fprintf(lstF strcat("TEXT \"Layer Group:\"\n"      "FLOC 15 0\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD ckbLayerSetup\n"  		"FLOC 15 2\n" 	"CHECKLIST \"Setup\"\n" "ENDFIELD\n"))

 fprintf(lstF strcat("TEXT \"Global Visibility:\"\n" "FLOC 2 0\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD btnVisAllOn\n"			"FLOC 2 2\n"	"MENUBUTTON \"On\" 5 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnVisAllOff\n"			"FLOC 7 2\n"	"MENUBUTTON \"Off\" 5 2\n"	"ENDFIELD\n"))

;Place
 fprintf(lstF strcat("GROUP \"\" g2\n"				"FLOC 2 3\n" 	"FSIZE 24 12\n" 			"ENDGROUP\n"))
 fprintf(lstF strcat("TEXT \"Place:\"\n"			"FLOC 15 5\n"								"ENDTEXT\n"))

 fprintf(lstF strcat("FIELD btnPalceAll\n"			"FLOC 3 5\n"	"MENUBUTTON \"A\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnPalceTop\n"			"FLOC 7 5\n"	"MENUBUTTON \"T\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnPalceBot\n"			"FLOC 11 5\n"	"MENUBUTTON \"B\" 2 2\n"	"ENDFIELD\n"))

 fprintf(lstF strcat("FIELD crbPlaceBoundtop\n"  	"FLOC 8 7\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPlaceBoundbot\n"  	"FLOC 12 7\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"PlaceBound\"\n"		"FLOC 15 7\n"								"ENDTEXT\n"))

 fprintf(lstF strcat("FIELD crbPackageKOAll\n"  	"FLOC 4 9\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPackageKOtop\n"  	"FLOC 8 9\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPackageKObot\n"  	"FLOC 12 9\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Package_KO\"\n"		"FLOC 15 9\n"								"ENDTEXT\n"))

 fprintf(lstF strcat("FIELD crbSwitchAreatop\n"  	"FLOC 8 11\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSwitchAreabot\n"  	"FLOC 12 11\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"SwitchArea\"\n"		"FLOC 15 11\n"								"ENDTEXT\n"))

 fprintf(lstF strcat("FIELD crbRoomAll\n"  			"FLOC 4 13\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbRoomtop\n"  			"FLOC 8 13\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbRoombot\n"  			"FLOC 12 13\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Room\"\n"				"FLOC 15 13\n"								"ENDTEXT\n"))

;TestPin
 fprintf(lstF strcat("GROUP \"\" g3\n"				"FLOC 2 14\n" 	"FSIZE 24 13\n" 			"ENDGROUP\n"))
 fprintf(lstF strcat("FIELD btnTestPinAll\n"		"FLOC 3 16\n"	"MENUBUTTON \"A\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnTestPinTop\n"		"FLOC 7 16\n"	"MENUBUTTON \"T\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnTestPinBot\n"		"FLOC 11 16\n"	"MENUBUTTON \"B\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"TestPin:\"\n"			"FLOC 15 16\n"								"ENDTEXT\n"))

 fprintf(lstF strcat("FIELD crbNoProbetop\n"  		"FLOC 8 18\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbNoProbebot\n"  		"FLOC 12 18\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"No Probe\"\n"			"FLOC 15 18\n"								"ENDTEXT\n"))

 fprintf(lstF strcat("FIELD crbProbetop\n"  		"FLOC 8 20\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbProbebot\n"  		"FLOC 12 20\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Probe\"\n"				"FLOC 15 20\n"								"ENDTEXT\n"))

 fprintf(lstF strcat("FIELD crbFilmmaskPintop\n"  	"FLOC 8 22\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbFilmmaskPinbot\n"  	"FLOC 12 22\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Filmmask Pin\"\n"		"FLOC 15 22\n"								"ENDTEXT\n"))

 fprintf(lstF strcat("FIELD crbFilmmaskViatop\n"  	"FLOC 8 24\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbFilmmaskViabot\n"  	"FLOC 12 24\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Filmmask Via\"\n"		"FLOC 15 24\n"								"ENDTEXT\n"))

 ;Masktable head
 fprintf(lstF strcat("GROUP \"\" g0\n"				"FLOC 26 0\n" 	"FSIZE 37 3\n" 				"ENDGROUP\n"))
 fprintf(lstF strcat("TEXT \"Manufcture;\"\n"		"FLOC 27 1\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"BD\"\n"				"FLOC 40 1\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Pkg\"\n"				"FLOC 43 1\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Drw\"\n"				"FLOC 47 1\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Ref\"\n"				"FLOC 50 1\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Pin\"\n"				"FLOC 53 1\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Via\"\n"				"FLOC 56 1\n"								"ENDTEXT\n"))
;Soldermask
 fprintf(lstF strcat("GROUP \"\" g0\n"				"FLOC 26 0\n" 	"FSIZE 37 27\n" 			"ENDGROUP\n"))
 fprintf(lstF strcat("TEXT \"Soldermask\"\n"		"FLOC 27 4\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD btnSoldermaskTop\n"		"FLOC 36 3\n"	"MENUBUTTON \"T\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnSoldermaskBot\n"		"FLOC 36 5\n"	"MENUBUTTON \"B\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSoldermaskBDtop\n"  	"FLOC 41 3\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSoldermaskBDbot\n"  	"FLOC 41 5\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSoldermaskPKGtop\n"  "FLOC 44 3\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSoldermaskPKGbot\n"  "FLOC 44 5\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSoldermaskDrwtop\n"  "FLOC 47 3\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSoldermaskDrwbot\n"  "FLOC 47 5\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSoldermaskPintop\n"  "FLOC 53 3\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSoldermaskPinbot\n"  "FLOC 53 5\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSoldermaskViatop\n"  "FLOC 56 3\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSoldermaskViabot\n"  "FLOC 56 5\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbSoldermaskTop\n"  	"FLOC 59 3\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbSoldermaskBot\n"  	"FLOC 59 5\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))

;Pastemask
 fprintf(lstF strcat("GROUP \"\" g0\n"				"FLOC 26 6\n" 	"FSIZE 37 21\n" 			"ENDGROUP\n"))
 fprintf(lstF strcat("TEXT \"Pastemask\"\n"			"FLOC 27 9\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD btnPastemaskTop\n"		"FLOC 36 8\n"	"MENUBUTTON \"T\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnPastemaskBot\n"		"FLOC 36 10\n"	"MENUBUTTON \"B\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPastemaskBDtop\n"  	"FLOC 41 8\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPastemaskBDbot\n"  	"FLOC 41 10\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPastemaskPKGtop\n"  	"FLOC 44 8\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPastemaskPKGbot\n"  	"FLOC 44 10\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPastemaskDrwtop\n"  	"FLOC 47 8\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPastemaskDrwbot\n"  	"FLOC 47 10\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPastemaskPintop\n"  	"FLOC 53 8\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPastemaskPinbot\n"  	"FLOC 53 10\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPastemaskViatop\n"  	"FLOC 56 8\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPastemaskViabot\n"  	"FLOC 56 10\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbPastemaskTop\n"  	"FLOC 59 8\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbPastemaskBot\n"  	"FLOC 59 10\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))

;Assembly
 fprintf(lstF strcat("GROUP \"\" g0\n"				"FLOC 26 11\n" 	"FSIZE 37 16\n" 			"ENDGROUP\n"))
 fprintf(lstF strcat("TEXT \"Assembly\"\n"			"FLOC 27 14\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD btnAssemblyTop\n"		"FLOC 36 13\n"	"MENUBUTTON \"T\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnAssemblyBot\n"		"FLOC 36 15\n"	"MENUBUTTON \"B\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbAssemblyPKGtop\n"  	"FLOC 44 13\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbAssemblyPKGbot\n"  	"FLOC 44 15\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbAssemblyReftop\n"  	"FLOC 50 13\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbAssemblyRefbot\n"  	"FLOC 50 15\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbAssemblyTop\n"  		"FLOC 59 13\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbAssemblyBot\n"  		"FLOC 59 15\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))

;Display
 fprintf(lstF strcat("GROUP \"\" g0\n"				"FLOC 26 16\n" 	"FSIZE 37 11\n" 			"ENDGROUP\n"))
 fprintf(lstF strcat("TEXT \"Display\"\n"			"FLOC 27 19\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD btnDisplayTop\n"		"FLOC 36 18\n"	"MENUBUTTON \"T\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnDisplayBot\n"		"FLOC 36 20\n"	"MENUBUTTON \"B\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbDisplayPKGtop\n"  	"FLOC 44 18\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbDisplayPKGbot\n"  	"FLOC 44 20\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbDisplayReftop\n"  	"FLOC 50 18\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbDisplayRefbot\n"  	"FLOC 50 20\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbDisplayTop\n"  		"FLOC 59 18\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbDisplayBot\n"  		"FLOC 59 20\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))

 ;Silkscreen
 fprintf(lstF strcat("GROUP \"\" g0\n"				"FLOC 26 21\n" 	"FSIZE 37 6\n" 				"ENDGROUP\n"))
 fprintf(lstF strcat("TEXT \"Silkscreen\"\n"		"FLOC 27 24\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD btnSilkscreenTop\n"		"FLOC 36 23\n"	"MENUBUTTON \"T\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnSilkscreenBot\n"		"FLOC 36 25\n"	"MENUBUTTON \"B\" 2 2\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSilkscreenBDtop\n"  	"FLOC 41 23\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSilkscreenBDbot\n"  	"FLOC 41 25\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSilkscreenPKGtop\n"  "FLOC 44 23\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSilkscreenPKGbot\n"  "FLOC 44 25\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSilkscreenDrwtop\n"  "FLOC 47 23\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSilkscreenDrwbot\n"  "FLOC 47 25\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSilkscreenReftop\n"  "FLOC 50 23\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbSilkscreenRefbot\n"  "FLOC 50 25\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbSilkscreenTop\n"  	"FLOC 59 23\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbSilkscreenBot\n"  	"FLOC 59 25\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))

 ;other
 fprintf(lstF strcat("GROUP \"\" g0\n"				"FLOC 2 26\n" 	"FSIZE 24 13\n" 			"ENDGROUP\n"))
; fprintf(lstF strcat("TEXT \"Other:\"\n"			"FLOC 4 34\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbLogo\n"  			"FLOC 3 28\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Logo\"\n"				"FLOC 6 28\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbMoat\n"  			"FLOC 3 30\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Moat\"\n"				"FLOC 6 30\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbPinNumber\n"  		"FLOC 12 28\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Pin Number\"\n"		"FLOC 15 28\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbXsectionChart\n"  	"FLOC 12 30\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Xsection_chart\"\n"	"FLOC 15 30\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbRteKIAll\n"			"FLOC 3 32\n"	"COLOR 2 1\n"				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Rte KI/All\"\n"		"FLOC 6 32\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbPkgKIAll\n"			"FLOC 14 32\n"	"COLOR 2 1\n"				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Pkg KI/All\"\n"		"FLOC 17 32\n"								"ENDTEXT\n"))

 ;自定义
 fprintf(lstF strcat("GROUP \"\" g0\n"				"FLOC 2 33\n" 	"FSIZE 24 6\n" 			"ENDGROUP\n"))

 fprintf(lstF strcat("FIELD crbCustom1\n"  			"FLOC 3 35\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Custom1\"\n"			"FLOC 6 35\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbCustom2\n"  			"FLOC 3 37\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Custom2\"\n"			"FLOC 6 37\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbCustom3\n"  			"FLOC 14 35\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Custom3\"\n"			"FLOC 17 35\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbCustom4\n"  			"FLOC 14 37\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Custom4\"\n"			"FLOC 17 37\n"								"ENDTEXT\n"))

;Drill
 fprintf(lstF strcat("GROUP \"\" g0\n"				"FLOC 26 26\n" 	"FSIZE 21 13\n" 			"ENDGROUP\n"))
 fprintf(lstF strcat("FIELD btnDrill\n"				"FLOC 30 27\n"	"MENUBUTTON \"A\" 3 2\n"	"ENDFIELD\n"))
 ;fprintf(lstF strcat("FIELD ckbDrill\n"  			"FLOC 31 27\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Drill:\"\n"			"FLOC 34 27\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbManNcdrillFigure\n" 	"FLOC 31 29\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Man\"\n"				"FLOC 27 29\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Ncdrill_Figure\"\n"	"FLOC 34 29\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbManNcdrillLegend\n" 	"FLOC 31 31\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Man\"\n"				"FLOC 27 31\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Ncdrill_Legend\"\n"	"FLOC 34 31\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbDrwNcdrillLegend\n" 	"FLOC 31 33\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Drw\"\n"				"FLOC 27 33\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Ncdrill_Legend\"\n"	"FLOC 34 33\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbPhotoplotOutline\n"  "FLOC 31 35\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Photoplot Outline\"\n"	"FLOC 34 35\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbDimension\n"  		"FLOC 31 37\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Dimension\"\n"			"FLOC 34 37\n"								"ENDTEXT\n"))

 ;DXF
 fprintf(lstF strcat("GROUP \"\" g2\n"				"FLOC 47 26\n" 	"FSIZE 16 13\n" 			"ENDGROUP\n"))
 fprintf(lstF strcat("TEXT \"New\"\n"				"FLOC 48 27\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Old\"\n"				"FLOC 52 27\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"< DXF >\"\n"			"FLOC 56 27\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbOutline\n"  			"FLOC 49 29\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbOutlineo\n"  		"FLOC 52 29\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Outline\"\n"			"FLOC 55 29\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbDxftopl\n"  			"FLOC 49 31\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbDxftoplo\n"  		"FLOC 52 31\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Top_lo\"\n"			"FLOC 55 31\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbDxftopn\n"  			"FLOC 49 33\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbDxftopno\n"  		"FLOC 52 33\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Top_o\"\n"				"FLOC 55 33\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbDxfbotl\n"  			"FLOC 49 35\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbDxfbotlo\n"  		"FLOC 52 35\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Bot_lo\"\n"			"FLOC 55 35\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbDxfbotn\n"  			"FLOC 49 37\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbDxfbotno\n"  		"FLOC 52 37\n" 	"COLOR 2 1\n" 				"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"Bot_o\"\n"				"FLOC 55 37\n"								"ENDTEXT\n"))

;Route
 fprintf(lstF strcat("GROUP \"\" g1\n"				"FLOC 63 0\n" 	"FSIZE 41 4\n" 				"ENDGROUP\n"))
 fprintf(lstF strcat("TEXT \"Stack-up:\"\n"			"FLOC 64 2\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD btnRoute\n"				"FLOC 73 2\n"	"MENUBUTTON \"Route\" 6 2\n" "ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnEtch\n"				"FLOC 80 2\n"	"MENUBUTTON \"Etch\" 6 2\n" "ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnCustom1\n"			"FLOC 87 2\n"	"MENUBUTTON \"Custom1\" 6 2\n" "ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnCustom2\n"			"FLOC 94 2\n"	"MENUBUTTON \"Custom2\" 6 2\n" "ENDFIELD\n"))
 fprintf(lstF strcat("GROUP \"\" g1\n"				"FLOC 63 3\n" 	"FSIZE 41 43\n" 			"ENDGROUP\n"))
 fprintf(lstF strcat("TEXT \"Etch\"\n"				"FLOC 65 4\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Via\"\n"				"FLOC 69 4\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Pin\"\n"				"FLOC 72 4\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Drc\"\n"				"FLOC 75 4\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Ant\"\n"				"FLOC 78 4\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Rko\"\n"				"FLOC 81 4\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Vko\"\n"				"FLOC 84 4\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Cns\"\n"				"FLOC 87 4\n"								"ENDTEXT\n"))
 fprintf(lstF strcat("TEXT \"Boundary\"\n"			"FLOC 90 4\n"								"ENDTEXT\n"))

 fprintf(lstF strcat("FIELD ckbEtch\n"  			"FLOC 66 6\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbVia\n"  				"FLOC 69 6\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbPin\n"  				"FLOC 72 6\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbDrc\n"  				"FLOC 75 6\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbAnt\n"  				"FLOC 78 6\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbRko\n"  				"FLOC 81 6\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbVko\n"  				"FLOC 84 6\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbCns\n"  				"FLOC 87 6\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbBdy\n"  				"FLOC 90 6\n" 	"CHECKLIST \"\"\n" 			"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \"All\"\n"				"FLOC 96 6\n"								"ENDTEXT\n"))

 intId=0  intIdE=0 intIdN=0 intNc=0 SatckTop=0
 curLayers=axlGetParam("paramLayerGroup:ETCH")->groupMembers

 foreach( item curLayers
   if(axlIsLayerNegative(strcat("ETCH/" item)) then  intNc=intNc+1)
   )
 foreach( item curLayers 

 if(axlIsLayerNegative(strcat("ETCH/" item)) then
  SatckTop=intIdN*2+8

  intIdN=intIdN +1
  else
  SatckTop=(intIdE+intNc)*2+8+1
  intIdE=intIdE +1
  )
   ;SatckTop=intId*2+8
 ;axlUIWPrint(nil sprintf(nil "%d" SatckTop))
 fprintf(lstF strcat("TEXT \"" sprintf(nil "%d" intIdE+intIdN) "\"\n" "FLOC 64 "  sprintf(nil "%d" SatckTop)  "\n"			"ENDTEXT\n"))
 fprintf(lstF strcat("FIELD crbEtch" sprintf(nil "%d" intIdE+intIdN) "\n"  			"FLOC 66 "  sprintf(nil "%d" SatckTop)  "\n" 	"COLOR 2 1\n" 		"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbVia" sprintf(nil "%d" intIdE+intIdN) "\n"  			"FLOC 69 "  sprintf(nil "%d" SatckTop)  "\n" 	"COLOR 2 1\n" 		"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbPin" sprintf(nil "%d" intIdE+intIdN) "\n"  			"FLOC 72 "  sprintf(nil "%d" SatckTop)  "\n" 	"COLOR 2 1\n" 		"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbDrc" sprintf(nil "%d" intIdE+intIdN) "\n"  			"FLOC 75 "  sprintf(nil "%d" SatckTop)  "\n" 	"COLOR 2 1\n" 		"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbAnt" sprintf(nil "%d" intIdE+intIdN) "\n"  			"FLOC 78 "  sprintf(nil "%d" SatckTop)  "\n" 	"COLOR 2 1\n" 		"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbRko" sprintf(nil "%d" intIdE+intIdN) "\n"  			"FLOC 81 "  sprintf(nil "%d" SatckTop)  "\n" 	"COLOR 2 1\n" 		"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbVko" sprintf(nil "%d" intIdE+intIdN) "\n"  			"FLOC 84 "  sprintf(nil "%d" SatckTop)  "\n" 	"COLOR 2 1\n" 		"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbCns" sprintf(nil "%d" intIdE+intIdN) "\n"  			"FLOC 87 "  sprintf(nil "%d" SatckTop)  "\n" 	"COLOR 2 1\n" 		"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD crbBdy" sprintf(nil "%d" intIdE+intIdN) "\n"  			"FLOC 90 "  sprintf(nil "%d" SatckTop)  "\n" 	"COLOR 2 1\n" 		"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD ckbStack" sprintf(nil "%d" intIdE+intIdN) "\n"  			"FLOC 93 "  sprintf(nil "%d" SatckTop)  "\n" 	"CHECKLIST \"\"\n" 	"ENDFIELD\n"))
 fprintf(lstF strcat("TEXT \""  item "\"\n"			"FLOC 96 "  sprintf(nil "%d" SatckTop)  "\n"						"ENDTEXT\n"))
)
;fprintf(lstF strcat("GROUP \"\" g1\n"				"FLOC 63 " sprintf(nil "%d" intId*2+7) "\n" 	"FSIZE 41 " sprintf(nil "%d" 43-intId*2-4) "\n" 				"ENDGROUP\n"))
intId=intId+1

;界面可放26行

;color plan
 fprintf(lstF strcat("GROUP \"\" g0\n"				"FLOC 2 38\n" 	"FSIZE 61 8\n" 				"ENDGROUP\n"))
 for(i 0 47
  fprintf(lstF strcat("FIELD crbColor" sprintf(nil "%d" i) "\n" "FLOC " sprintf(nil "%d" modulo(i 16)*3+3) " " sprintf(nil "%d" 40+(i/16)*2) "\n" 	"COLOR 3 1\n" 				"ENDFIELD\n"))
 )
 fprintf(lstF strcat("FIELD ckbColorSetup\n"  		"FLOC 52 40\n" 	"CHECKLIST \"ColorSetup\"\n" "ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnPrev\n"				"FLOC 52 42\n"	"MENUBUTTON \"<<\" 3 2\n" "ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnNext\n"				"FLOC 57 42\n"	"MENUBUTTON \">>\" 3 2\n" "ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnColor\n"				"FLOC 57 44\n"	"MENUBUTTON \"Col\" 5 2\n" "ENDFIELD\n"))

 /*
 ;tools
 fprintf(lstF strcat("GROUP \"\" g1\n"				"FLOC 63 41\n" 	"FSIZE 41 5\n" 				"ENDGROUP\n"))
 fprintf(lstF strcat("FIELD btnExchangeTB\n"		"FLOC 65 43\n"	"MENUBUTTON \"Exchange T/B\" 12 3\n"	"ENDFIELD\n"))
 fprintf(lstF strcat("FIELD btnFlicker\n"			"FLOC 77 43\n"	"MENUBUTTON \"Flicker\" 12 3\n"	"ENDFIELD\n")) ;闪烁
 fprintf(lstF strcat("FIELD btnKeyMaps\n"			"FLOC 89 43\n"	"MENUBUTTON \"KeyMaps\" 12 3\n"	"ENDFIELD\n"))
*/

 fprintf(lstF "ENDTILE\n")
 fprintf(lstF "ENDFORM\n")
 close(lstF)
)

/*

   axlGetParam("paramLayerGroup:ETCH")->groupMembers ;读取层面
   修改层面颜色
   	            q1=axlLayerGet("PACKAGE GEOMETRY/SILKSCREEN_TOP")
	            q1->color=63
	          	axlLayerSet(q1)

*/
时间: 2024-11-08 08:35:48

skill的相关文章

【转】What is an SDET? Part 2 – Skill Matrix of SDET

What is an SDET? Part 2 ---- Skill Matrix of SDET (Instead of naming it as part 2 of What is an SDET?, it would be nearer the mark to say it is a Skill Matrix of SDET.) Well, after my last post What is an SDET, here in part 2 I share some inside base

机智云在Amazon Alexa平台发布Smarthome和Custom Skill

机智云在Amazon Alexa平台率先发布了Smarthome Skill和Custom Skill,实现了亚马逊Echo直接控制机智云开源套件Gokit(包括Gokit2.0和Gokit3.0)!这也将意味着:随着机智云和亚马逊账号的打通,接入机智云的产品都可以轻松实现Amazon Echo控制功能.(下附实战篇) Amazon Echo是时下风靡全球的一款结合了Amazon人工智能助理 Alexa 的音箱,支持Wi-Fi连接,依靠语音命令进行激活,让用户以最自然的语音交互方式,连接到 Am

【技能意志矩阵-skill will matrix】工作中究竟是个人能力更重要,还是我们的积极性更能提高我们的业绩?

工作中究竟是个人能力更重要,还是我们的积极性更能提高我们的业绩? 我们可以通过建立“个人能力(即技能)”和“积极性(即意志)”的矩阵(skill will matrix),找到自己的象限,并根据指导意见对自己提出要求,从而提高自己. 第一象限(高意愿高技能):如果你具有高意愿和高技能,那么你适合收到更多艰巨的项目/任务的委派,更多授权.接受挑战,能更好地提高自己. 第二象限(高意愿低技能):如果你充满热情,但觉得门道不熟怎么办?找个有能力的导师,是个不错的选择.遇到问题,可以多请教你认为有经验的

[skill][https][ssl/tls] HTTPS相关知识汇总

结论前置: A 身份验证 证书, 服务器证书 B 密钥协商 RSA   DHE / ECDHE   PSK C 加密通信 加密通信采用对称加密,使用B阶段协商出来的密钥. B 阶段如果使用 RSA 协商,可以用服务器证书在协商过程中解密到 C过程中的密钥.从而解密通信内容.(此方式下,采用旁路方式就可以). B 阶段如果使用DHE/ECDHE协商,至少需要建立链接时的server魔数(也许还需要私钥即服务器证书)才能计算出加密密钥.简单来说协商过程也是一次一密. 于是,应该有两种情况可以解密ht

[skill][gdb] gdb 多线程调试

中文快速入门: http://coolshell.cn/articles/3643.html 进阶: 多线程怎么调试: 分 all-stop 和 non-stop 两个模式. all-stop 模式下,一个断点.所以线程全部终止运行. 使用 set non-stop on命令可以进入non-stop模式.其他线程不会受到一个线程停止的影响. 例如:non-stop模式下设置了一个中断: 其他线程正常运行. (gdb) info thread Id Target Id Frame 5 Thread

Skill of vim

用vim也有一段时间了,谨以此记下一些有意思的技巧. 跳转 hjkl,左下右上. b/e跳转到上/下一个单词 ^/$跳转到行头/尾 从{,[,(,对应的},],)相互跳转,可以用% 跳转到局部变量的定义gd,跳转到全局变量的定义gD 跳转到上一个修改过的地方 g; 注意是g+分号 跳转到下一个修改过的地方 g, 注意是g+逗号 :N ,跳转到N行 匹配的符号('', "", (), {}, [], <>)操作 ci?,di?,yi?,?为上述的匹配符号,则可以修改,剪切,复

[skill] 异或

都怪学习不好,或者老师教的不好.虽然知道异或的算法,但是始终不明白,到底有什么意义...直到今天,终于明白了. 还是应该怪我学的不好,不能怪老师. 今天有一个应用场景,写一个函数.这是一个hash表的插入函数,实现的是tcp/ip的流存储.输入是一个以太包,为了在这个表的存下双向包. 需要定义一个hashkey的生成规则.这个规则是,ip+port小的放在前面,大的放在后面,共同组成一个key.所以我需要一个外部的变量来标识 一个以太包在生成key的时候,是否做了源目的信息的对掉.用0/1表示.

[skill] C与C++对于类型转换的验证

不多说了,代码说明一切. /home/tong/Src/copyleft/test [[email protected]] [11:15] > gcc 1.c /home/tong/Src/copyleft/test [[email protected]] [11:15] > g++ 1.c 1.c: In function 'int main(int, char**)': 1.c:8:6: error: invalid conversion from 'void*' to 'int*' [-

[skill][c] *(char**)

/* scmp: string compare of *p1 and *p2 */ int scmp(const void *p1, const void *p2) { char *v1, *v2; v1 = *(char **) p1; v2 = *(char **) p2; return strcmp(v1, v2); } qsort passes to the comparing function a pointer to the elements it has to compare; s

[skill] C语言数组名到底是个啥

1. 正常情况下,数组名是个地址常量. 2. sizeof(数组名)的时候,数组名就代表数字名,其类型为 type array[], 返回数组元素个数. 3. 除了2的情况以外,可以理解为一个指针常量 !? 参考: http://www.cnblogs.com/kalo1111/p/3285955.html http://c.biancheng.net/cpp/html/492.html