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

📄 create_thermal_flash.il

📁 skill语言在Cadence平台二次开发中大量使用
💻 IL
📖 第 1 页 / 共 2 页
字号:
; Create_Thermal_Flash.il
; Revision 0: July 31,1995
; Written by:
;	Edward B. Acheson
;	Corportate Application Engineer
;	Cadence Design Systems
;	Chelmsford MA 01824
;
;	Install this file in you master skill directory  then add load( "Create_Thermal_Flash.il")
;	to the allegro.ilinit file in you pcbenv directory. To start the command read the
;       fprintf lines in the function listed below:
;
;    Updated December 8,2000 by Ron Guthrie, Cadence Design Systems
;               Changed the code to look at the environment variable tmp instead
;               of having it hard coded to look in /tmp
;               This makes the application work on PC networks without having to
;               create /tmp subdirectories all over the place.

axlCmdRegister( "mkth" `_THRP_Start)
;Globals
tmp_path=axlGetVariable("tmp")
temphelpfile=nil
	temphelpfile = makeTempFileName(strcat(tmp_path "/THRPhelp"))
	temphelpfile = strcat(temphelpfile ".txt")
;+
;===============================================================================
; NAME:
;	_THRP_Help
;
; SYNOPSIS:
;	 _THRP_Help()
;
; DESCRIPTION:
;	This function create a temporary help file and then displayes the file to the
;	screen. The file is then deleted 
;
;	For more information see:
;	makeTempFileName, axlUIConfirm, axlUIViewFileCreate
;
;===============================================================================
;-
defun( _THRP_Help ()
let( (helpPort message)
	helpPort = outfile( temphelpfile )
  fprintf( helpPort "===============================================================================\n")
  fprintf( helpPort "\n               Create Thermal Flash                      \n\n")
  fprintf( helpPort "===============================================================================\n")
  fprintf( helpPort " This Command is used to make a board symbol representation of a thermal flash\n")
  fprintf( helpPort "apperture for artwork generation using the 274X format, or for reading the input\n")
  fprintf( helpPort "of Gerber format into Allegro to view the art work generated. This command will\n")
  fprintf( helpPort "work under Allegro release 8.1 and higher.\n\n")
  fprintf( helpPort " To execute this command, open an Allegro Mechanical Symbol drawing. Set the\n")
  fprintf( helpPort "extents of the drawing so they are large enough to fit the symbol. Next\n")
  fprintf( helpPort "set the origin of the drawing to the center. In The Allegro Symbol\n")
  fprintf( helpPort "Command window enter mkth <ret>. This will startup the command. If the drawing\n")
  fprintf( helpPort "open is not a MECHANICAL drawing, then a message will appear and the opertion\n")
  fprintf( helpPort "will end.\n\n")
  fprintf( helpPort "When the Thermal Pad Symbol Defaults form appears, enter the data into each\n")
  fprintf( helpPort "field as required. Enter the values in each field in the same units as the open\n")
  fprintf( helpPort "MECHANICAL Drawing. No conversion will take place in this form. Checks are made\n")
  fprintf( helpPort "in the diameter defintions for correct input, and appropriate messages will\n")
  fprintf( helpPort "display. After all data is input, press the OK button, and the thermal shapes\n")
  fprintf( helpPort "will be added to the MECHANICAL symbol drawing. Make any edits you may require\n")
  fprintf( helpPort "in the drawing , then create the symbol under the apporpriate name and save the\n")
  fprintf( helpPort "symbol drawing.\n\n")
  fprintf( helpPort "Definitions:\n  Inner Diameter: The diameter of the innermost ring for the\n")
  fprintf( helpPort "           Thermal Relief Pad.\n")
  fprintf( helpPort "  Outer Diameter: The diameter of the outermost ring for the\n") 
  fprintf( helpPort "           Thermal Relief Pad.\n")
  fprintf( helpPort "  Spoke Width:    The width or thickness of the contact points\n")
  fprintf( helpPort "           or spokes for the Thermal Relief Pad.\n") 
  fprintf( helpPort "  No. of Spokes:  The number of contact points or spokes in the\n")
  fprintf( helpPort "           Thermal Relief Pad. Legal values are 1,2,3, and 4.\n") 
  fprintf( helpPort "  Spoke Angle:    The start angle of the Spoke. O degrees is\n")
  fprintf( helpPort "           vertical, then rotating counter-clockwise. Legal values\n")
  fprintf( helpPort "           are 0, 30, 45, 60, and 90. A popup will allow selection\n")
  fprintf( helpPort "           of values.\n")
  fprintf( helpPort "  Add Center Dot: The center dot is circular shape added to the\n")
  fprintf( helpPort "           Thermal Relief Pad to visually display the pad center.\n")
  fprintf( helpPort "           To allow the addition of the Center Dot Toggle this\n")
  fprintf( helpPort "           button ON.\n")
  fprintf( helpPort "  Dot Diameter:   The diameter value of the center dot.\n")
  fprintf( helpPort "  OK:             This button executes the generation of the Thermal\n")
  fprintf( helpPort "            Relief Pad.\n")
  fprintf( helpPort "  Cancel:         This button closes the form and exits this Command\n")
  fprintf( helpPort "  Help:           This button displays the help message.\n")
  fprintf( helpPort "\n\n For more information on this command see the Application note entitled\n")
  fprintf( helpPort "\"Generating Flash Thermal Relief Symbols: SKILL Program Create_Thermal_Flash.il\"\n") 
  fprintf( helpPort "===============================================================================\n")
  fprintf( helpPort "                                                                      eba290895\n")
     close(helpPort) 
     if(! isFile( temphelpfile) then
      	axlUIConfirm("Unable to Open Help File, Check Permissions!")
     else
	axlUIViewFileCreate( temphelpfile "Create Themal Flash - Help" nil)
     );if
));defun

;+
;===============================================================================
; NAME:
;	_THRP_Start
;
; SYNOPSIS:
;	 _THRP_Start()
;
; DESCRIPTION:
;	This function is called upon the exection of this skill command. It will
;	check for the correct drawing type, then will create the form file and
;	call the functions to open the form. The Global Variable for the form
;	pointer (THRP_FormPtr) is also intialized.
;
;	For more information see:
;	axlDesignType, _THRP_MkForm, axlUIConfirm, _THRP_Quit, _THRP_FormDisplay.
;
;===============================================================================
;-
defun( _THRP_Start ()
let( (formname innerd outerd spoke)
    THRP_FormPtr = nil
    if( axlDesignType( t ) == "MECHANICAL" then
        formname = _THRP_MkForm()
        if(! isFile( formname) then
        	axlUIConfirm("Unable to Open Form File, Check Permissions!")
            _THRP_Quit()
        else
           _THRP_FormDisplay( formname )
        );if 
    else
      axlUIConfirm("Illegal Drawing Type. Must be a Mechanical Symbol Drawing!")
   )
));defun

;+
;===============================================================================
; NAME:
;	_THRP_RunCmd
;
; SYNOPSIS:
;	 _THRP_RunCmd()
;
; DESCRIPTION:
;	This function is called by the 'OK' button on the Thermal Pad Symbol
;	Defaults form. This function calls all the required functions to 
;	verify form data and construct the shapes for the definition of the
;	thermal relief pads.
;
;	For more information see:
;	_THRP_CheckValues, _THRP_GetCoord, _THRP_BuildMasterCoord, _THRP_BuildTHShape
;	_THRP_MkCenterDot, axlMsgPut, _THRP_Quit.
;
;===============================================================================
;-
defun( _THRP_RunCmd ()
    let( (primarypoints mastercoord values success)
        success = nil
	when( _THRP_CheckValues() == t
         	primarypoints = _THRP_GetCoord()
       		mastercoord = _THRP_BuildMasterCoord(primarypoints)
       		success = _THRP_BuildTHShape( mastercoord
				      nthelem( 4 primarypoints)
      				      nthelem( 5 primarypoints)
			       	      )
      		 when( success != nil && THRP_FormData->trgtdt == t
			success =  _THRP_MkCenterDot()
		        when(success == nil
		   	    axlMsgPut("Error - Center Dot Shape Not Added")
			);when
		 );when
         );if
	when(success == t _THRP_Quit())
));defun
       

;+
;===============================================================================
; NAME:
;	_THRP_Quit
;
; SYNOPSIS:
;	 _THRP_Quit()
;
; DESCRIPTION:
;	This function will close the form assigned to Global variable THRP_FormPtr.
;	This function is called by the success in the _THRP_RunCmd or the Cancel
;	button in the Thermal Pad Symbol Defaults form.
;
;	For more information see:
;	axlFormClose.
;
;===============================================================================
;-
defun( _THRP_Quit ()
      when( THRP_FormPtr  axlFormClose( THRP_FormPtr ))
      when( isFile( temphelpfile )
	 deleteFile( temphelpfile )
      )
);defun
 

;+
;===============================================================================
; NAME:
;	_THRP_MkCenterDot
;
; SYNOPSIS:
;	 _THRP_MkCenterDot()
;
; DESCRIPTION:
;	This function will create a shape circle at the 0X 0Y location at the
;	diameter specified in the Thermal Pad Symbol Defaults form. This data
;	is extracted from the Dot Diameter field. If the creation of the shape
;	is successful, this function returns 't', otherwise a 'nil' is returned.
;
; DEPENDENCIES:
;	The global variable THRP_FormData is required.
;
;	for more information see:
;	axlPathStartCircle, axlDBCreateOpenShape, axlDBCreateCloseShape.
;
;===============================================================================
;-
defun( _THRP_MkCenterDot ()
prog( ()
let( (path success)
	path = axlPathStartCircle( list(0.0:0.0 (THRP_FormData->trgtdia/2.0)) 0.0) 
	shapeid = axlDBCreateCloseShape(axlDBCreateOpenShape( path t  "etch/top" nil ))
	if( shapeid != nil then
	    return(t)
	else
	    return(nil)
        );
)));

;+
;===============================================================================
; NAME:
;	_THRP_CheckValues
;
; SYNOPSIS:
;	 _THRP_CheckValues()
;
; DESCRIPTION:
;	This function check for leagal values defined in the Thermal Pad Definition
;	Form. If All values entered are legal, this function will return 't'. If
;	any value is illegal, this function returns 'nil'. A message will display
;	which value is incorrect.
;
; DEPENDENCIES:
;	This function requires the global variable THRP_FormData for the form
;	pointer.
;
;	For more information see:
;	axlMsgPut
;
;===============================================================================
;-
defun( _THRP_CheckValues ()
prog( ()
let( ()
	if(THRP_FormData->indiam > 0 then
	   if(THRP_FormData->outdia  > 0 then
              if(THRP_FormData->outdia > THRP_FormData->indiam then
	         if(THRP_FormData->spkwdth > 0 then
                   if(THRP_FormData->trgtdt == nil then
			return(t)
		   else
		      if(THRP_FormData->trgtdia > 0 then
			 return(t)
		      else
			 axlMsgPut( "Invalid Value for Center Dot Size")	
		      );if
                    );if
                 else
                    axlMsgPut( "Invalid Value for Spoke Width")
		 );if
              else
                axlMsgPut( "Outer Diameter Must Be A Greater Value Than The Inner Diameter")
              );if
           else
              axlMsgPut( "Invalid Value for Outer Diameter")
           );if
        else
           axlMsgPut( "Invalid Value for Inner Diameter")
	);if
	return(nil)
)));defun

;+
;===============================================================================
; NAME:
;	_THRP_BuildTHShape
;
; SYNOPSIS:
;	 _THRP_BuildTHShape(
;			input_list
;		        start_angle
;			num_spokes
;			)
;
; DESCRIPTION:
;	This function will create the arc shapes for the thermal reliefs. This
;	function will retyrn a value of t if shape creation is successful, or a
;	nil value if all shapes cannot be created. If a shape cannot be created a

⌨️ 快捷键说明

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