Node: Element File, Next: , Previous: Layout File, Up: File Formats



Element File Format

Element files are used to describe one component which then may be used several times within one or more layouts. You will normally split the file into two parts, one for the pinout and one for the package description. Using m4 allows you to define pin names as macros in one file and include a package description file which evaluates the macros. See the resource elementCommand for more information. The pins (and pads) must appear in sequential order in the element file (new in 1.5) so that pin 1 must be the first PIN(...) in the file.

Doing things this way makes it possible to use one package file for several different circuits. See the sample files dil*.

The lowest x and y coordinates of all sub-objects of an element are used as an attachment point for the cross hair cursor of the main window.

     File            = {Element}...
     Element         = "Element(" Flags Description LayoutName Value \
     		      TextX TextY direction scale TextFlags")"
     		      "(" {ElementData}... [Mark] ")"
     ElementData     = {ElementLine | Pad | Pin | ElementArc }...
     ElementArc      = "ElementArc(" X Y Width Height
     		      StartAngle DeltaAngle Thickness ")"
     ElementLine     = "ElementLine(" X1 Y1 X2 Y2 Thickness ")"
     Mark            = "Mark(" X Y ")"
     Pad             = "Pad(" X1 Y1 X2 Y2 Thickness Name PinNumber Flags ")"
     Pin             = "Pin(" X Y Thickness DrillingHole Name PinNumber Flags ")"
     

Element
Objects of type element are determined by flags, some names, a canonical and a layout name as well as a value. Additional fields are text position, their direction counted from zero to three (n * 90 degrees counter-clockwise) and element data.

Flags
The flag field determines the state of an element. The bit values are:
                   bit 4:  the element name is hidden
                   bit 6:  element has been selected
                   bit 7:  element is located on the solder side
               

TextFlags
scale
direction
See the description of text object earlier in this chapter.
ElementLine
A line is defined by its start and end points and by its size, or width.
ElementArc
Defines an arc by its center, width, height, start angle, its length in degrees and its size. Remember the y axis on the screen grows downwards.
Mark
is just a hint to make positioning easier. The cross hair will be positioned here. Its center is passed as the two arguments.
Pad
A pad is very similar to a line except it may not be disconnected from its element and it has an associated name. Is is defined by two end point position, size, name and by some flags.
                   bit 2:  set if pad was found during a connection search
                   bit 5:  display the pads name
                   bit 6:  pad has been selected
                   bit 7:  pad is located on the solder side
               

Pin
A pin is very similar to a via except it may not be disconnected from its element.
                   bit 0:  always set
                   bit 1:  always clear
                   bit 2:  set if pin was found during a connection search
                   bit 3:  set if pin is only a mounting hole (no copper annulus)
                   bit 5:  display the pins name
                   bit 6:  pin has been selected
                   bit 8:  pin is drawn as a square
                   bit 12: set if pin is drawn with an octagonal shape