├── ulp ├── exp-lbrs.ulp ├── import-bmp.ulp ├── board_default.ulp ├── Unrouted.ulp ├── drill-exactsize.ulp ├── oshw-logo.ulp ├── mirror-board.ulp ├── autodim_mil.ulp ├── autodim_in.ulp ├── adimv4_0mm.ulp ├── bom.ulp ├── bom_sparkle.ulp └── bom_mod.ulp ├── cam ├── README.md ├── GTLONLY.cam ├── STENCILcam-GTP_GBP_ONLY.cam ├── sfe-gerb274x.cam ├── oshpark-gerb274x.cam ├── sfe-gerb274x_GP_FOR_CASTELLATED_HEADERS.cam ├── sfe-gerb274x-withGBP.cam ├── sfe-gerb274x-4layer.cam └── oshpark-gerb274x-4layer.cam ├── dru ├── README.md ├── Gold_Phoenix_Standard_Spec_2_layer.dru ├── SparkFun-2-layer.dru └── SparkFun-4-layer.dru ├── README.md ├── .gitignore └── scr └── eagle.scr /ulp/exp-lbrs.ulp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basuke/SparkFun_Eagle_Settings/master/ulp/exp-lbrs.ulp -------------------------------------------------------------------------------- /ulp/import-bmp.ulp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basuke/SparkFun_Eagle_Settings/master/ulp/import-bmp.ulp -------------------------------------------------------------------------------- /cam/README.md: -------------------------------------------------------------------------------- 1 | CAM files 2 | ======================= 3 | The cam files allow you to define which layers are assigned to each gerber file. 4 | For example, the gerber file GTL (Gerber Top Layer) usually is defined as layer 1 (or top copper). 5 | If you are using the 4-layer cam, make sure your middle layers are properly assigned. 6 | -------------------------------------------------------------------------------- /dru/README.md: -------------------------------------------------------------------------------- 1 | DRU files 2 | ======================= 3 | These are the design rules files (.dru), which define the tollerances on the PCB (this includes everything from trace width to layer construction). The PCB fab house can only manufacture up to a specific tollerance and this file makes sure you fall within their constraints. The 2-layer and 4-layer dru files are based on the [BatchPCB](https://batchpcb.com/faq#question_2) design constraints. -------------------------------------------------------------------------------- /ulp/board_default.ulp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************** 2 | * * 3 | * * 4 | ****************************************************************************************/ 5 | board(B) 6 | { 7 | B.layers(L) printf("Layer %3d %s\n", L.number, L.name); 8 | } 9 | 10 | int i; 11 | 12 | void set_defaults(void) 13 | { 14 | 15 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SparkFun Eagle Settings 2 | ======================= 3 | These are the commonly used keyboard shortcuts, CAM and DRU configuration files for SparkFun board design. We use these files at SparkFun for all our design work. 4 | 5 | For more information about using Eagle to make a PCB see these tutorials: 6 | 7 | * [How to Install and Setup EAGLE](https://learn.sparkfun.com/tutorials/how-to-install-and-setup-eagle) 8 | * [Using EAGLE: Board Layout](https://learn.sparkfun.com/tutorials/using-eagle-board-layout) 9 | * [Using EAGLE: Schematic](https://learn.sparkfun.com/tutorials/using-eagle-schematic) 10 | 11 | Be sure to checkout [SparkFun's footprints for Eagle](https://github.com/sparkfun/SparkFun-Eagle-Libraries). 12 | 13 | Repository Contents 14 | ------------------- 15 | * **/cam** - Job files to output your 2 and 4 layer designs to [Gerber](http://en.wikipedia.org/wiki/Gerber_format) files 16 | * **/dru** - Design rules for 2 and 4 layer designs 17 | * **/scr** - Scripts for assigning keyboard shortcuts, grid sizes and layer colors 18 | * **/ulp** - Commonly used user language programs for BOM generation and library export 19 | 20 | -------------------------------------------------------------------------------- /ulp/Unrouted.ulp: -------------------------------------------------------------------------------- 1 | /* 2 | * UNROUTED.ULP 3 | * 4 | * simple script to zoom to the first unrouted wire in board editor. 5 | * this might be helpful when searching for tiny left-overs. 6 | * 7 | * done by Daniel Mack , http://caiaq.de 8 | */ 9 | 10 | int gridunit; 11 | 12 | real u2u(int val) { 13 | switch (gridunit) { 14 | case GRID_UNIT_MIC : return u2mic(val); 15 | case GRID_UNIT_MM : return u2mm(val); 16 | case GRID_UNIT_MIL : return u2mil(val); 17 | case GRID_UNIT_INCH : return u2inch(val); 18 | } 19 | } 20 | 21 | string RunOnExit = ""; 22 | 23 | if (board) { 24 | board(B) { 25 | gridunit = (B.grid.unit); 26 | B.signals(S) { 27 | S.wires(W) { 28 | if (W.layer == 19) { 29 | real x1 = u2u(W.x1); 30 | real x2 = u2u(W.x2); 31 | real y1 = u2u(W.y1); 32 | real y2 = u2u(W.y2); 33 | 34 | x1 -= (x2 - x1) / 2; 35 | x2 += (x2 - x1) / 2; 36 | y1 -= (y2 - y1) / 2; 37 | y2 += (y2 - y1) / 2; 38 | 39 | sprintf(RunOnExit, "\nWINDOW (%.6f %.6f) (%.6f %.6f);\n", x1, y1, x2, y2); 40 | exit (RunOnExit); 41 | } 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ulp/drill-exactsize.ulp: -------------------------------------------------------------------------------- 1 | // ***** MODIFIED VERSION of CadSoft's drill-aid ULP!! 2 | // By MadWizard for imagedump script. See www.madwizard.org 3 | 4 | 5 | string cmd = "GRID mm;\nLayer 116 drillImage;\nchange layer 116;\n"; 6 | 7 | void center(int x, int y, int drill) { 8 | 9 | real width = u2mm(drill) / 2; 10 | real radius = width / 2 ; 11 | string h; 12 | sprintf(h, "circle %.3f (%.3f %.3f) (%.3f %.3f) ;\n", 13 | width, 14 | u2mm(x), u2mm(y), u2mm(x) + radius, u2mm(y) ); 15 | cmd += h; 16 | return; 17 | } 18 | 19 | if (board) board(B) { 20 | 21 | 22 | B.holes(L) { 23 | center(L.x, L.y, L.drill); 24 | } 25 | B.elements(E) { 26 | E.package.holes(H) { 27 | center(H.x, H.y, H.drill); 28 | } 29 | E.package.contacts(C) { 30 | if (C.pad) { 31 | center(C.pad.x, C.pad.y, C.pad.drill); 32 | } 33 | } 34 | } 35 | B.signals(S) { 36 | S.vias(V) { 37 | center(V.x, V.y, V.drill); 38 | } 39 | } 40 | exit (cmd); 41 | } 42 | 43 | else dlgMessageBox("Start this ULP in a Board!", "OK"); 44 | exit (0); 45 | -------------------------------------------------------------------------------- /cam/GTLONLY.cam: -------------------------------------------------------------------------------- 1 | [CAM Processor Job] 2 | Description[en]="\n\n\n\n\n\n\n\n\n\n\n\nSparkFun Gerber Generator

\n\nThis CAM job creates the seven needed files to have a PCB created. Based on the original Eagle gerb274x.cam file.

\nYou will get seven gerber files that contain data for:
\ngerber top layer (copper layer): *.GTL
\ngerber top overlay (silkscreen layer): *.GTO
\ngerber top soldermask (soldermask layer): *.GTS
\n\ngerber bottom layer (copper layer): *.GBL
\ngerber bottom overlay (silkscreen layer): *.GBO
\ngerber bottom soldermask (soldermask layer): *.GBS
\n\nExcellon Drill File: *.TXT

\nThese files, zipped together, are the only 7 files you need to have a PCB made at nearly any fab house.\n" 3 | Section=Sec_1 4 | 5 | [Sec_1] 6 | Name[en]="Top Copper" 7 | Prompt="" 8 | Device="GERBER_RS274X" 9 | Wheel="" 10 | Rack="" 11 | Scale=1 12 | Output=".GTL" 13 | Flags="0 0 0 1 0 1 1" 14 | Emulate="0" 15 | Offset="0.0mil 0.0mil" 16 | Sheet=1 17 | Tolerance="0 0 0 0 0 0" 18 | Pen="0.0mil 0" 19 | Page="12000.0mil 8000.0mil" 20 | Layers=" 20" 21 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 22 | -------------------------------------------------------------------------------- /cam/STENCILcam-GTP_GBP_ONLY.cam: -------------------------------------------------------------------------------- 1 | [CAM Processor Job] 2 | Description[en]="Generates Extended Gerber Format

\nThis CAM job consists of five sections that generate data for a two layer board.

\nYou will get five gerber files that contain data for:
\ncomponent side *.cmp
\nsolder side *.sol
\nsilkscreen component side *.plc
\nsolder stop component side *.stc
\nsolder stop solder sid *.sts
" 3 | Section=Sec_1 4 | Section=Sec_2 5 | 6 | [Sec_1] 7 | Name[en]="Top Paste" 8 | Prompt="" 9 | Device="GERBER_RS274X" 10 | Wheel=".whl" 11 | Rack="" 12 | Scale=1 13 | Output=".GTP" 14 | Flags="0 0 0 1 0 1 1" 15 | Emulate="0" 16 | Offset="0.0mil 0.0mil" 17 | Sheet=1 18 | Tolerance="0 0 0 0 0 0" 19 | Pen="0.0mil 0" 20 | Page="12000.0mil 8000.0mil" 21 | Layers=" 31" 22 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 23 | 24 | [Sec_2] 25 | Name[en]="Bottom Paste" 26 | Prompt="" 27 | Device="GERBER_RS274X" 28 | Wheel=".whl" 29 | Rack="" 30 | Scale=1 31 | Output=".GBP" 32 | Flags="0 0 0 1 0 1 1" 33 | Emulate="0" 34 | Offset="0.0mil 0.0mil" 35 | Sheet=1 36 | Tolerance="0 0 0 0 0 0" 37 | Pen="0.0mil 0" 38 | Page="12000.0mil 8000.0mil" 39 | Layers=" 32" 40 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 41 | -------------------------------------------------------------------------------- /dru/Gold_Phoenix_Standard_Spec_2_layer.dru: -------------------------------------------------------------------------------- 1 | description[en] = EAGLE Design Rules\n

\nThe default Design Rules have been set to cover\na wide range of applications. Your particular design\nmay have different requirements, so please make the\nnecessary adjustments and save your customized\ndesign rules under a new name. 2 | layerSetup = (1*16) 3 | mtCopper = 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 4 | mtIsolate = 1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 5 | mdWireWire = 5mil 6 | mdWirePad = 5mil 7 | mdWireVia = 5mil 8 | mdPadPad = 5mil 9 | mdPadVia = 5mil 10 | mdViaVia = 5mil 11 | mdSmdPad = 5mil 12 | mdSmdVia = 5mil 13 | mdSmdSmd = 5mil 14 | mdViaViaSameLayer = 8mil 15 | mnLayersViaInSmd = 2 16 | mdCopperDimension = 8mil 17 | mdDrill = 8mil 18 | mdSmdStop = 0mil 19 | msWidth = 5mil 20 | msDrill = 6mil 21 | msMicroVia = 9.99mm 22 | msBlindViaRatio = 0.500000 23 | rvPadTop = 0.250000 24 | rvPadInner = 0.250000 25 | rvPadBottom = 0.250000 26 | rvViaOuter = 0.250000 27 | rvViaInner = 0.250000 28 | rvMicroViaOuter = 0.250000 29 | rvMicroViaInner = 0.250000 30 | rlMinPadTop = 5mil 31 | rlMaxPadTop = 20mil 32 | rlMinPadInner = 10mil 33 | rlMaxPadInner = 20mil 34 | rlMinPadBottom = 5mil 35 | rlMaxPadBottom = 20mil 36 | rlMinViaOuter = 5mil 37 | rlMaxViaOuter = 20mil 38 | rlMinViaInner = 10mil 39 | rlMaxViaInner = 20mil 40 | rlMinMicroViaOuter = 4mil 41 | rlMaxMicroViaOuter = 20mil 42 | rlMinMicroViaInner = 4mil 43 | rlMaxMicroViaInner = 20mil 44 | psTop = -1 45 | psBottom = -1 46 | psFirst = -1 47 | psElongationLong = 100 48 | psElongationOffset = 100 49 | mvStopFrame = 1.000000 50 | mvCreamFrame = 0.000000 51 | mlMinStopFrame = 4mil 52 | mlMaxStopFrame = 4mil 53 | mlMinCreamFrame = 0mil 54 | mlMaxCreamFrame = 0mil 55 | mlViaStopLimit = 20mil 56 | srRoundness = 0.000000 57 | srMinRoundness = 0mil 58 | srMaxRoundness = 0mil 59 | slThermalIsolate = 10mil 60 | slThermalsForVias = 0 61 | dpMaxLengthDifference = 10mm 62 | dpGapFactor = 2.500000 63 | checkGrid = 0 64 | checkAngle = 1 65 | checkFont = 1 66 | checkRestrict = 1 67 | useDiameter = 13 68 | maxErrors = 50 69 | -------------------------------------------------------------------------------- /dru/SparkFun-2-layer.dru: -------------------------------------------------------------------------------- 1 | description[en] = EAGLE Design Rules\n

\nThe default Design Rules have been set to cover\na wide range of applications. Your particular design\nmay have different requirements, so please make the\nnecessary adjustments and save your customized\ndesign rules under a new name. 2 | layerSetup = (1*16) 3 | mtCopper = 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 4 | mtIsolate = 1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 5 | mdWireWire = 8mil 6 | mdWirePad = 8mil 7 | mdWireVia = 8mil 8 | mdPadPad = 8mil 9 | mdPadVia = 8mil 10 | mdViaVia = 8mil 11 | mdSmdPad = 8mil 12 | mdSmdVia = 8mil 13 | mdSmdSmd = 8mil 14 | mdViaViaSameLayer = 8mil 15 | mnLayersViaInSmd = 2 16 | mdCopperDimension = 8mil 17 | mdDrill = 8mil 18 | mdSmdStop = 0mil 19 | msWidth = 7mil 20 | msDrill = 15mil 21 | msMicroVia = 9.99mm 22 | msBlindViaRatio = 0.500000 23 | rvPadTop = 0.250000 24 | rvPadInner = 0.250000 25 | rvPadBottom = 0.250000 26 | rvViaOuter = 0.250000 27 | rvViaInner = 0.250000 28 | rvMicroViaOuter = 0.250000 29 | rvMicroViaInner = 0.250000 30 | rlMinPadTop = 12mil 31 | rlMaxPadTop = 20mil 32 | rlMinPadInner = 10mil 33 | rlMaxPadInner = 20mil 34 | rlMinPadBottom = 12mil 35 | rlMaxPadBottom = 20mil 36 | rlMinViaOuter = 10mil 37 | rlMaxViaOuter = 20mil 38 | rlMinViaInner = 10mil 39 | rlMaxViaInner = 20mil 40 | rlMinMicroViaOuter = 4mil 41 | rlMaxMicroViaOuter = 20mil 42 | rlMinMicroViaInner = 4mil 43 | rlMaxMicroViaInner = 20mil 44 | psTop = -1 45 | psBottom = -1 46 | psFirst = -1 47 | psElongationLong = 100 48 | psElongationOffset = 100 49 | mvStopFrame = 1.000000 50 | mvCreamFrame = 0.000000 51 | mlMinStopFrame = 4mil 52 | mlMaxStopFrame = 4mil 53 | mlMinCreamFrame = 0mil 54 | mlMaxCreamFrame = 0mil 55 | mlViaStopLimit = 20mil 56 | srRoundness = 0.000000 57 | srMinRoundness = 0mil 58 | srMaxRoundness = 0mil 59 | slThermalIsolate = 10mil 60 | slThermalsForVias = 0 61 | dpMaxLengthDifference = 10mm 62 | dpGapFactor = 2.500000 63 | checkGrid = 0 64 | checkAngle = 1 65 | checkFont = 1 66 | checkRestrict = 1 67 | useDiameter = 13 68 | maxErrors = 50 69 | -------------------------------------------------------------------------------- /dru/SparkFun-4-layer.dru: -------------------------------------------------------------------------------- 1 | description[en] = EAGLE Design Rules\n

\nThe default Design Rules have been set to cover\na wide range of applications. Your particular design\nmay have different requirements, so please make the\nnecessary adjustments and save your customized\ndesign rules under a new name. 2 | layerSetup = (1*2*15*16) 3 | mtCopper = 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 4 | mtIsolate = 1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 5 | mdWireWire = 6mil 6 | mdWirePad = 6mil 7 | mdWireVia = 6mil 8 | mdPadPad = 6mil 9 | mdPadVia = 6mil 10 | mdViaVia = 6mil 11 | mdSmdPad = 6mil 12 | mdSmdVia = 6mil 13 | mdSmdSmd = 6mil 14 | mdViaViaSameLayer = 8mil 15 | mnLayersViaInSmd = 2 16 | mdCopperDimension = 6mil 17 | mdDrill = 8mil 18 | mdSmdStop = 0mil 19 | msWidth = 6mil 20 | msDrill = 13mil 21 | msMicroVia = 9.99mm 22 | msBlindViaRatio = 0.500000 23 | rvPadTop = 0.250000 24 | rvPadInner = 0.250000 25 | rvPadBottom = 0.250000 26 | rvViaOuter = 0.250000 27 | rvViaInner = 0.250000 28 | rvMicroViaOuter = 0.250000 29 | rvMicroViaInner = 0.250000 30 | rlMinPadTop = 12mil 31 | rlMaxPadTop = 20mil 32 | rlMinPadInner = 10mil 33 | rlMaxPadInner = 20mil 34 | rlMinPadBottom = 12mil 35 | rlMaxPadBottom = 20mil 36 | rlMinViaOuter = 10mil 37 | rlMaxViaOuter = 20mil 38 | rlMinViaInner = 10mil 39 | rlMaxViaInner = 20mil 40 | rlMinMicroViaOuter = 4mil 41 | rlMaxMicroViaOuter = 20mil 42 | rlMinMicroViaInner = 4mil 43 | rlMaxMicroViaInner = 20mil 44 | psTop = -1 45 | psBottom = -1 46 | psFirst = -1 47 | psElongationLong = 100 48 | psElongationOffset = 100 49 | mvStopFrame = 1.000000 50 | mvCreamFrame = 0.000000 51 | mlMinStopFrame = 4mil 52 | mlMaxStopFrame = 4mil 53 | mlMinCreamFrame = 0mil 54 | mlMaxCreamFrame = 0mil 55 | mlViaStopLimit = 20mil 56 | srRoundness = 0.000000 57 | srMinRoundness = 0mil 58 | srMaxRoundness = 0mil 59 | slThermalIsolate = 12mil 60 | slThermalsForVias = 0 61 | dpMaxLengthDifference = 10mm 62 | dpGapFactor = 2.500000 63 | checkGrid = 0 64 | checkAngle = 1 65 | checkFont = 1 66 | checkRestrict = 1 67 | useDiameter = 13 68 | maxErrors = 50 69 | -------------------------------------------------------------------------------- /ulp/oshw-logo.ulp: -------------------------------------------------------------------------------- 1 | /* 2 | * oshw_logo.ulp 3 | * April 2011, By Bill Westfield (westfw@yahoo.com) 4 | * 5 | * Draw the "golden orb" Open Source Hardware logo 6 | * This is rather customizable; it can draw wires or polygons, 7 | * on any desired layer, at any desired size. 8 | */ 9 | 10 | #usage "Create an instance of the Open Source Hardware Logo

\n" 11 | " run oshw-logo [outside-diameter]\n\n

" 12 | " The logo will be centered at the current 'mark'

\n" 13 | "Author: Bill Westfield (westfw@yahoo.com) 8-Apr-2011" 14 | 15 | real linewidth = 0.015; 16 | real td=0, totaldiam = 0.45; 17 | 18 | if (argc > 1) { 19 | td = strtod(argv[1]); 20 | } 21 | if (td == 0) { 22 | td = totaldiam; /* outside diameter of teeth (total) */ 23 | } 24 | 25 | /* 26 | * derived sizes. Change to alter "the look", but probably not 27 | * as a matter of course 28 | */ 29 | real id = (td / 3.2); /* outside of wheel */ 30 | real od = (id * 2.2); /* outside of teeth */ 31 | real bgapa = 45; /* Bottom gap angle */ 32 | real tia = 26; /* Tooth inside angle */ 33 | real toa = 14; /* tooth outside angle */ 34 | real ga = (45-tia); /* Gap inside angle */ 35 | 36 | /* 37 | * Internal variables 38 | */ 39 | int i; 40 | string s, cmd; 41 | 42 | /* 43 | * Draw an orb as an outline (wire) or as a filled shape (polygon) 44 | * on a particular layer 45 | */ 46 | void draw_orb (string command, string layer) 47 | { 48 | real sa; /* Start angle for the drawing */ 49 | 50 | sprintf(s, "change layer %s; set wire_bend 7;\n", layer); cmd += s; 51 | /* 52 | * Start point 53 | */ 54 | sprintf(s, "%s %f (P %f %f)", command, linewidth, 55 | od/2, -90.0 + bgapa/2); 56 | cmd += s; 57 | 58 | sa = -90 + tia/2; 59 | 60 | for (i=0; i < 7; i++) { 61 | /* outside gap */ 62 | sprintf(s," @+%f (P %f %f)", od/2, od/2, sa + ga); 63 | cmd += s; 64 | /* to outside tooth */ 65 | sprintf(s," +0 (P %f %f)", td/2, sa + ga + (tia - toa)/2); 66 | cmd += s; 67 | /* outside of tooth */ 68 | sprintf(s," +0 (P %f %f)", td/2, sa + ga + (tia - toa)/2 + toa); 69 | cmd +=s; 70 | /* back to next gap */ 71 | sprintf(s," +0 (P %f %f)", od/2, sa + 45.0); cmd += s; 72 | sa += 45.0; 73 | } 74 | /* 75 | * End point 76 | */ 77 | sprintf(s, " @+%f (P %f %f)", od/2, od/2, -90.0 - bgapa/2); 78 | cmd +=s; 79 | /* 80 | * Inside circle 81 | * (we need to draw the circle in two steps to get the curvature 82 | * in the right direction.) 83 | */ 84 | sprintf(s, " +0 (P %f %f) @-%f (P %f %f) (P %f %f) +0 (P %f %f)", 85 | id/2, -90.0 - bgapa/2, id/2, 86 | id/2, -180.0, 87 | id/2, -90 + bgapa/2, 88 | od/2, 270 + bgapa/2); 89 | cmd +=s; 90 | cmd += ";\n"; 91 | } 92 | 93 | //draw_orb("poly", "tplace"); 94 | draw_orb("poly", "symbols"); 95 | //draw_orb("wire", "top"); 96 | 97 | exit(cmd); 98 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## SparkFun Useful stuff 3 | ################# 4 | 5 | ## AVR Development 6 | *.eep 7 | *.elf 8 | *.lst 9 | *.lss 10 | *.sym 11 | *.d 12 | *.o 13 | *.srec 14 | *.map 15 | 16 | ## Notepad++ backup files 17 | *.bak 18 | 19 | ## BOM files 20 | *bom* 21 | 22 | ################# 23 | ## Eclipse 24 | ################# 25 | 26 | *.pydevproject 27 | .project 28 | .metadata 29 | bin/ 30 | tmp/ 31 | *.tmp 32 | *.bak 33 | *.swp 34 | *~.nib 35 | local.properties 36 | .classpath 37 | .settings/ 38 | .loadpath 39 | 40 | # External tool builders 41 | .externalToolBuilders/ 42 | 43 | # Locally stored "Eclipse launch configurations" 44 | *.launch 45 | 46 | # CDT-specific 47 | .cproject 48 | 49 | # PDT-specific 50 | .buildpath 51 | 52 | 53 | ############# 54 | ## Eagle 55 | ############# 56 | 57 | # Ignore the board and schematic backup files 58 | *.b#? 59 | *.s#? 60 | 61 | 62 | ################# 63 | ## Visual Studio 64 | ################# 65 | 66 | ## Ignore Visual Studio temporary files, build results, and 67 | ## files generated by popular Visual Studio add-ons. 68 | 69 | # User-specific files 70 | *.suo 71 | *.user 72 | *.sln.docstates 73 | 74 | # Build results 75 | [Dd]ebug/ 76 | [Rr]elease/ 77 | *_i.c 78 | *_p.c 79 | *.ilk 80 | *.meta 81 | *.obj 82 | *.pch 83 | *.pdb 84 | *.pgc 85 | *.pgd 86 | *.rsp 87 | *.sbr 88 | *.tlb 89 | *.tli 90 | *.tlh 91 | *.tmp 92 | *.vspscc 93 | .builds 94 | *.dotCover 95 | 96 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 97 | #packages/ 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opensdf 104 | *.sdf 105 | 106 | # Visual Studio profiler 107 | *.psess 108 | *.vsp 109 | 110 | # ReSharper is a .NET coding add-in 111 | _ReSharper* 112 | 113 | # Installshield output folder 114 | [Ee]xpress 115 | 116 | # DocProject is a documentation generator add-in 117 | DocProject/buildhelp/ 118 | DocProject/Help/*.HxT 119 | DocProject/Help/*.HxC 120 | DocProject/Help/*.hhc 121 | DocProject/Help/*.hhk 122 | DocProject/Help/*.hhp 123 | DocProject/Help/Html2 124 | DocProject/Help/html 125 | 126 | # Click-Once directory 127 | publish 128 | 129 | # Others 130 | [Bb]in 131 | [Oo]bj 132 | sql 133 | TestResults 134 | *.Cache 135 | ClientBin 136 | stylecop.* 137 | ~$* 138 | *.dbmdl 139 | Generated_Code #added for RIA/Silverlight projects 140 | 141 | # Backup & report files from converting an old project file to a newer 142 | # Visual Studio version. Backup files are not needed, because we have git ;-) 143 | _UpgradeReport_Files/ 144 | Backup*/ 145 | UpgradeLog*.XML 146 | 147 | 148 | ############ 149 | ## Windows 150 | ############ 151 | 152 | # Windows image file caches 153 | Thumbs.db 154 | 155 | # Folder config file 156 | Desktop.ini 157 | 158 | 159 | ############# 160 | ## Python 161 | ############# 162 | 163 | *.py[co] 164 | 165 | # Packages 166 | *.egg 167 | *.egg-info 168 | dist 169 | build 170 | eggs 171 | parts 172 | bin 173 | var 174 | sdist 175 | develop-eggs 176 | .installed.cfg 177 | 178 | # Installer logs 179 | pip-log.txt 180 | 181 | # Unit test / coverage reports 182 | .coverage 183 | .tox 184 | 185 | #Translations 186 | *.mo 187 | 188 | #Mr Developer 189 | .mr.developer.cfg 190 | 191 | # Mac crap 192 | .DS_Store 193 | -------------------------------------------------------------------------------- /scr/eagle.scr: -------------------------------------------------------------------------------- 1 | # Configuration Script 2 | # 3 | # This file can be used to configure the editor windows. 4 | 5 | Assign F3 'Delete'; 6 | Assign AF3 'Grid inch 0.001 on; Grid alt inch 0.01;'; 7 | Assign F4 'Name'; 8 | Assign F5 'Value'; 9 | Assign F6 'Smash'; 10 | Assign F7 'Move'; 11 | Assign AF7 'Group'; 12 | Assign F8 'Copy'; 13 | Assign F10 'Grid inch 0.05 on; Grid alt inch 0.005;'; 14 | Assign AF10 'Grid mm 1 on; Grid alt mm 0.1;'; 15 | 16 | Grid inch 0.05 on; 17 | Grid alt inch 0.005; 18 | 19 | BRD: 20 | #Menu Add Change Copy Delete Display Grid Group Move Name Quit Rect \ 21 | # Route Script Show Signal Split Text Value Via Window ';' Wire Write Edit; 22 | 23 | #Get rid of the extra internal layers 24 | #Layer -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 25 | 26 | #Setup SparkFun Defaults 27 | Grid inch 0.05 on; 28 | Grid alt inch 0.005; 29 | Set WIRE_BEND 1; #Route with 45 degree angles 30 | Set Drill 0.02; #Make vias 0.02" 31 | Change Shape Round; #Make vias round 32 | Change Width 0.01; #Routing width default to 10mil 33 | Change Isolate 0.012; #BHW Change polygon isolate to 12mil 34 | 35 | Change Font Vector; #Make text on board in vector font 36 | Change Ratio 15; 37 | 38 | CHANGE DUNIT INCH OFF #BHW Change default units to inches [ON | OFF] [precision] 39 | 40 | #changes background color of board to black 41 | SET PALETTE BLACK; 42 | 43 | #Layer colors 44 | Set palette 16 0xFFFFFFFF; #Super white 45 | Set palette 24 0xFFC0C0C0; #Grey - color used when text is selected (anti palette location 16) 46 | Set color_layer 1 4; #Set top layer to dark red 47 | Set color_layer 16 1; #Set bottom layer to dark blue 48 | Set color_layer 17 2; #Set pads to green 49 | Set color_layer 18 2; #Set vias to green 50 | Set color_layer 19 6; #Set unrouted to dark yellow 51 | Set color_layer 20 15; #Set dimension to light gray 52 | Set color_layer 21 16; #Set tPlace to white 53 | Set color_layer 22 14; #Set bPlace to yellow 54 | Set color_layer 23 15; #Set tOrigins to light gray 55 | Set color_layer 24 15; #Set bOrigins to light gray 56 | Set color_layer 45 7; #Set Holes to dark gray 57 | Set color_layer 51 6; #Set tDocu to mellow yellow 58 | display none; display 1 16 17 18 19 20 21 22 23 24 45 51; display -25 -26 -27 -28; 59 | 60 | #Assign shortcuts 61 | Assign F8 ratsnest; 62 | Assign AF8 drc; 63 | 64 | Assign F9 'Route'; 65 | Assign AF9 'Ripup'; 66 | 67 | Assign F11 'display none; display 1 16 17 18 19 20 21 22 23 24 45 49 51; display -25 -26 -27 -28;'; 68 | Assign AF11 'display none; display 17 20 21 23 27 31 45 51; display -25 -26 -28;'; 69 | 70 | Assign F12 'show'; 71 | Assign AF12 'info'; 72 | 73 | Assign F10 'Grid inch 0.05 on; Grid alt inch 0.005;'; 74 | Assign AF10 'Grid mm 1 on; Grid alt mm 0.1;'; 75 | 76 | SCH: 77 | Grid Default; #BHW Reset the grid to the standard value 78 | Change Width 0.006; #BHW Set the 6mil rule 79 | Set XREF_LABEL_FORMAT %F%N/%S; #BHW Remove row & column from default 80 | Change XREF ON; #BHW Default to the labels we use (flag border) 81 | Change Size 0.05; #BHW Use 50mil flags (and text... exceeds minimum) 82 | 83 | Assign F9 'Net'; 84 | Assign AF9 'Label'; 85 | 86 | Assign F12 'show'; 87 | Assign AF12 'info'; 88 | 89 | Grid Default; 90 | Change Width 0.008; 91 | 92 | #Menu Add Bus Change Copy Delete Display Gateswap Grid Group Invoke Junction \ 93 | # Label Move Name Net Pinswap Quit Script Show Split Value Window ';' \ 94 | # Wire Write Edit; 95 | 96 | LBR: 97 | 98 | #Menu Close Export Open Script Write ';' Edit; 99 | 100 | Assign F10 'Grid inch 0.05 on; Grid alt inch 0.005;'; 101 | Assign AF10 'Grid mm 1 on; Grid alt mm 0.1;'; 102 | Grid mm 1 on; 103 | Grid alt mm 0.1; 104 | 105 | DEV: 106 | 107 | Grid Default; 108 | #Menu Add Change Copy Connect Delete Display Export Grid Move Name Package \ 109 | # Prefix Quit Script Show Value Window ';' Write Edit; 110 | 111 | SYM: 112 | 113 | Grid Default On; 114 | Change Width 0.010; 115 | #Menu Arc Change Copy Cut Delete Display Export Grid Group Move Name Paste \ 116 | # Pin Quit Script Show Split Text Value Window ';' Wire Write Edit; 117 | 118 | PAC: 119 | 120 | Grid Default On; 121 | Change Width 0.005; 122 | Change Size 0.050; 123 | #Menu Add Change Copy Delete Display Grid Group Move Name Pad Quit \ 124 | # Script Show Smd Split Text Window ';' Wire Write Edit; 125 | -------------------------------------------------------------------------------- /ulp/mirror-board.ulp: -------------------------------------------------------------------------------- 1 | #usage "Mirror board (with all Layers)

" 2 | "Author: support@cadsoft.de" 3 | 4 | // THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED 5 | // Version 1.01 -- 2006-09-15 alf@cadsoft.de 6 | // 2008-04-10 changed GROUP ... (>x y); alf@cadsoft.de 7 | 8 | string cmd; 9 | int lVisible[]; 10 | int useLayer[]; 11 | string lNames[] = { " " }; 12 | 13 | int maxX = INT_MIN; 14 | int minX = INT_MAX; 15 | int maxY = INT_MIN; 16 | int minY = INT_MAX; 17 | int bminx, bmaxx, bminy, bmaxy; 18 | 19 | int uval = 1; 20 | if (board) board(B) uval = B.grid.unit; 21 | string unit[] = { "Micron", "mm", "Mil", "Inch" }; 22 | int unitPrec[] = { 0, 1, 1, 3 }, RoundFactor = pow(10, unitPrec[uval]); 23 | 24 | real u2u(int v) { 25 | switch (uval) { 26 | case GRID_UNIT_MIC : return u2mic(v); 27 | break; 28 | 29 | case GRID_UNIT_MM : return u2mm(v); 30 | break; 31 | 32 | case GRID_UNIT_MIL : return u2mil(v); 33 | break; 34 | 35 | case GRID_UNIT_INCH : return u2inch(v); 36 | break; 37 | } 38 | } 39 | 40 | 41 | void checkmaxmin(int x1, int x2, int y1, int y2) { 42 | if (x1 > maxX) maxX = x1; 43 | if (x2 > maxX) maxX = x2; 44 | if (y1 > maxY) maxY = y1; 45 | if (y2 > maxY) maxY = y2; 46 | if (x1 < minX) minX = x1; 47 | if (x2 < minX) minX = x2; 48 | if (y1 < minY) minY = y1; 49 | if (y2 < minY) minY = y2; 50 | return; 51 | } 52 | 53 | void checkarc( int x1, int x2, int y1, int y2, int xc, int yc, real angle1, real angle2, real radius) { 54 | checkmaxmin( x1, x2, y1, y2 ); 55 | if ( angle2 > angle1 + 270.0) { 56 | if ( angle1 < 90 ) checkmaxmin( x1 , xc - radius, yc + radius, yc - radius ); 57 | else if( angle1 < 180 ) checkmaxmin( xc - radius, xc + radius, y1 , yc - radius ); 58 | else if( angle1 < 270 ) checkmaxmin( x1 , xc + radius, yc - radius, yc + radius ); 59 | else if( angle1 < 360 ) checkmaxmin( xc + radius, xc - radius, y1 , yc + radius ); 60 | } 61 | else if( angle2 > angle1 + 180.0) { 62 | if ( angle1 < 90 ) checkmaxmin( x1 , xc - radius, yc + radius, y2 ); 63 | else if( angle1 < 180 ) checkmaxmin( x1 , xc - radius, yc - radius, y2 ); 64 | else if( angle1 < 270 ) checkmaxmin( x1 , xc + radius, yc - radius, y2 ); 65 | else if( angle1 < 360 ) checkmaxmin( x1 , xc + radius, yc + radius, y2 ); 66 | } 67 | else if( angle2 > angle1 + 90.0 ) { 68 | if ( angle1 < 90 ) checkmaxmin( x1 , x2 , yc + radius, y2 ); 69 | else if( angle1 < 180 ) checkmaxmin( x1 , xc - radius, y1 , y2 ); 70 | else if( angle1 < 270 ) checkmaxmin( x1 , x2 , yc - radius, y2 ); 71 | else if( angle1 < 360 ) checkmaxmin( x1 , xc + radius, y1 , y2 ); 72 | } 73 | return; 74 | } 75 | 76 | real WireLength(int x1, int x2, int y1, int y2) { 77 | return sqrt( pow(u2u(x2) - u2u(x1), 2) + pow( u2u(y2) - u2u(y1), 2)); 78 | } 79 | 80 | 81 | 82 | // main 83 | if (board) { 84 | board(B) { 85 | bminx = B.area.x1; 86 | bmaxx = B.area.x2; 87 | bminy = B.area.y1; 88 | bmaxy = B.area.y2; 89 | B.layers(L) { 90 | lNames[L.number] = L.name; 91 | lVisible[L.number] = L.visible; 92 | useLayer[L.number] = L.used; 93 | } 94 | B.wires(W) { 95 | if (W.layer == 20) { 96 | if (W.arc) { 97 | checkarc(W.arc.x1, W.arc.x2, W.arc.y1, W.arc.y2, W.arc.xc, W.arc.yc, W.arc.angle1, W.arc.angle2, W.arc.radius); 98 | } 99 | else { 100 | checkmaxmin( W.x1, W.x2, W.y1, W.y2 ); 101 | } 102 | } 103 | } 104 | B.circles(C) { 105 | if (C.layer == 20) { 106 | checkmaxmin( C.x - C.radius, C.x + C.radius, C.y - C.radius, C.y + C.radius ); 107 | } 108 | } 109 | B.elements(E) { 110 | E.package.wires(W) { 111 | if (W.layer == 20) { 112 | // *** Dimension in Packages *** 113 | if (W.arc) { 114 | checkarc(W.arc.x1, W.arc.x2, W.arc.y1, W.arc.y2, W.arc.xc, W.arc.yc, W.arc.angle1, W.arc.angle2, W.arc.radius); 115 | } 116 | else { 117 | checkmaxmin( W.x1, W.x2, W.y1, W.y2 ); 118 | } 119 | } 120 | } 121 | E.package.circles(C) { 122 | if (C.layer == 20) { 123 | checkmaxmin( C.x - C.radius, C.x + C.radius, C.y - C.radius, C.y + C.radius ); 124 | } 125 | } 126 | } 127 | } 128 | string s; 129 | sprintf(s, "DISPLAY ALL;\n"); 130 | cmd += s; 131 | sprintf(s, "GROUP (%.4f %.4f) (%.4f %.4f) (%.4f %.4f) (%.4f %.4f) (>%.4f %.4f);\n", 132 | u2u(bminx-1000), u2u(bminy-1000), 133 | u2u(bmaxx+1000), u2u(bminy-1000), 134 | u2u(bmaxx+1000), u2u(bmaxy+1000), 135 | u2u(bminx-1000), u2u(bmaxy+1000), 136 | u2u(bminx-1000), u2u(bminy-1000) 137 | ); 138 | cmd += s; 139 | sprintf(s, "GRID FINEST;\nMIRROR (>%.4f %.4f);\nGRID LAST;\n", 140 | (u2u(maxX) + u2u(minX)) / 2, u2u(minY) ); 141 | cmd += s; 142 | cmd += "DISPLAY NONE "; 143 | for(int l = 1; l < 256; l++) { 144 | if (lNames[l]) { // Layer defined 145 | if (lVisible[l]) sprintf(s, " %d", l); 146 | else sprintf(s, " -%d", l); 147 | cmd += s; 148 | } 149 | } 150 | cmd += ";"; 151 | } 152 | exit(cmd); -------------------------------------------------------------------------------- /cam/sfe-gerb274x.cam: -------------------------------------------------------------------------------- 1 | [CAM Processor Job] 2 | Description[en]="\n\n\n\n\n\n\n\n\n\n\nSparkFun Gerber Generator

\n\nThis CAM job creates the seven needed files to have a PCB created. Based on the original Eagle gerb274x.cam file.

\nYou will get seven gerber files that contain data for:
\ngerber top layer (copper layer): *.GTL
\ngerber top overlay (silkscreen layer): *.GTO
\ngerber top soldermask (soldermask layer): *.GTS
\n\ngerber bottom layer (copper layer): *.GBL
\ngerber bottom overlay (silkscreen layer): *.GBO
\ngerber bottom soldermask (soldermask layer): *.GBS
\n\nExcellon Drill File: *.TXT

\nThese files, zipped together, are the only 7 files you need to have a PCB made at nearly any fab house.\n" 3 | Section=Sec_1 4 | Section=Sec_2 5 | Section=Sec_3 6 | Section=Sec_4 7 | Section=Sec_5 8 | Section=Sec_6 9 | Section=Sec_7 10 | Section=Sec_8 11 | Section=Sec_9 12 | 13 | [Sec_1] 14 | Name[en]="Top Copper" 15 | Prompt="" 16 | Device="GERBER_RS274X" 17 | Wheel="" 18 | Rack="" 19 | Scale=1 20 | Output=".GTL" 21 | Flags="0 0 0 1 0 1 1" 22 | Emulate="0" 23 | Offset="0.0mil 0.0mil" 24 | Sheet=1 25 | Tolerance="0 0 0 0 0 0" 26 | Pen="0.0mil 0" 27 | Page="12000.0mil 8000.0mil" 28 | Layers=" 1 17 18 20" 29 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 30 | 31 | [Sec_2] 32 | Name[en]="Bottom Copper" 33 | Prompt="" 34 | Device="GERBER_RS274X" 35 | Wheel=".whl" 36 | Rack="" 37 | Scale=1 38 | Output=".GBL" 39 | Flags="0 0 0 1 0 1 1" 40 | Emulate="0" 41 | Offset="0.0mil 0.0mil" 42 | Sheet=1 43 | Tolerance="0 0 0 0 0 0" 44 | Pen="0.0mil 0" 45 | Page="12000.0mil 8000.0mil" 46 | Layers=" 16 17 18" 47 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 48 | 49 | [Sec_3] 50 | Name[en]="Top Silkscreen" 51 | Prompt="" 52 | Device="GERBER_RS274X" 53 | Wheel=".whl" 54 | Rack="" 55 | Scale=1 56 | Output=".GTO" 57 | Flags="0 0 0 1 0 1 1" 58 | Emulate="0" 59 | Offset="0.0mil 0.0mil" 60 | Sheet=1 61 | Tolerance="0 0 0 0 0 0" 62 | Pen="0.0mil 0" 63 | Page="12000.0mil 8000.0mil" 64 | Layers=" 21" 65 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 66 | 67 | [Sec_4] 68 | Name[en]="Top Paste" 69 | Prompt="" 70 | Device="GERBER_RS274X" 71 | Wheel=".whl" 72 | Rack="" 73 | Scale=1 74 | Output=".GTP" 75 | Flags="0 0 0 1 0 1 1" 76 | Emulate="0" 77 | Offset="0.0mil 0.0mil" 78 | Sheet=1 79 | Tolerance="0 0 0 0 0 0" 80 | Pen="0.0mil 0" 81 | Page="12000.0mil 8000.0mil" 82 | Layers=" 31" 83 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 84 | 85 | [Sec_5] 86 | Name[en]="Bottom Silkscreen" 87 | Prompt="" 88 | Device="GERBER_RS274X" 89 | Wheel=".whl" 90 | Rack="" 91 | Scale=1 92 | Output=".GBO" 93 | Flags="0 0 0 1 0 1 1" 94 | Emulate="0" 95 | Offset="0.0mil 0.0mil" 96 | Sheet=1 97 | Tolerance="0 0 0 0 0 0" 98 | Pen="0.0mil 0" 99 | Page="12000.0mil 8000.0mil" 100 | Layers=" 22" 101 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 102 | 103 | [Sec_6] 104 | Name[en]="Top Soldermask" 105 | Prompt="" 106 | Device="GERBER_RS274X" 107 | Wheel=".whl" 108 | Rack="" 109 | Scale=1 110 | Output=".GTS" 111 | Flags="0 0 0 1 0 1 1" 112 | Emulate="0" 113 | Offset="0.0mil 0.0mil" 114 | Sheet=1 115 | Tolerance="0 0 0 0 0 0" 116 | Pen="0.0mil 0" 117 | Page="12000.0mil 8000.0mil" 118 | Layers=" 29" 119 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 120 | 121 | [Sec_7] 122 | Name[en]="Bottom Soldermask" 123 | Prompt="" 124 | Device="GERBER_RS274X" 125 | Wheel=".whl" 126 | Rack="" 127 | Scale=1 128 | Output=".GBS" 129 | Flags="0 0 0 1 0 1 1" 130 | Emulate="0" 131 | Offset="0.0mil 0.0mil" 132 | Sheet=1 133 | Tolerance="0 0 0 0 0 0" 134 | Pen="0.0mil 0" 135 | Page="12000.0mil 8000.0mil" 136 | Layers=" 30" 137 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 138 | 139 | [Sec_8] 140 | Name[en]="Drill File" 141 | Prompt="" 142 | Device="EXCELLON" 143 | Wheel="" 144 | Rack="" 145 | Scale=1 146 | Output=".TXT" 147 | Flags="0 0 0 1 0 1 1" 148 | Emulate="0" 149 | Offset="0.0mil 0.0mil" 150 | Sheet=1 151 | Tolerance="0 0 0 0 0 0" 152 | Pen="0.0mil 0" 153 | Page="12000.0mil 8000.0mil" 154 | Layers=" 44 45" 155 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 156 | 157 | [Sec_9] 158 | Name[en]="Mill Layer" 159 | Prompt="" 160 | Device="GERBER_RS274X" 161 | Wheel="" 162 | Rack="" 163 | Scale=1 164 | Output=".GML" 165 | Flags="0 0 0 1 0 1 1" 166 | Emulate="0" 167 | Offset="0.0mil 0.0mil" 168 | Sheet=1 169 | Tolerance="0 0 0 0 0 0" 170 | Pen="0.0mil 0" 171 | Page="11000.0mil 16000.0mil" 172 | Layers=" 46" 173 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 174 | -------------------------------------------------------------------------------- /cam/oshpark-gerb274x.cam: -------------------------------------------------------------------------------- 1 | [CAM Processor Job] 2 | Description[en]="\n\n\n\n\n\n\n\n\n\n\n\n\nSparkFun Gerber Generator

\n\nThis CAM job creates the seven needed files to have a PCB created. Based on the original Eagle gerb274x.cam file.

\nYou will get seven gerber files that contain data for:
\ngerber top layer (copper layer): *.GTL
\ngerber top overlay (silkscreen layer): *.GTO
\ngerber top soldermask (soldermask layer): *.GTS
\n\ngerber bottom layer (copper layer): *.GBL
\ngerber bottom overlay (silkscreen layer): *.GBO
\ngerber bottom soldermask (soldermask layer): *.GBS
\n\nExcellon Drill File: *.TXT

\nThese files, zipped together, are the only 7 files you need to have a PCB made at nearly any fab house.\n" 3 | Section=Sec_1 4 | Section=Sec_2 5 | Section=Sec_3 6 | Section=Sec_4 7 | Section=Sec_5 8 | Section=Sec_6 9 | Section=Sec_7 10 | Section=Sec_8 11 | Section=Sec_9 12 | Section=Sec_10 13 | 14 | [Sec_1] 15 | Name[en]="Outline" 16 | Prompt="" 17 | Device="GERBER_RS274X" 18 | Wheel="" 19 | Rack="" 20 | Scale=1 21 | Output=".GKO" 22 | Flags="0 0 0 1 0 1 1" 23 | Emulate="0" 24 | Offset="0.0mil 0.0mil" 25 | Sheet=1 26 | Tolerance="0 0 0 0 0 0" 27 | Pen="0.0mil 0" 28 | Page="12000.0mil 8000.0mil" 29 | Layers=" 20" 30 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 31 | 32 | [Sec_2] 33 | Name[en]="Top Copper" 34 | Prompt="" 35 | Device="GERBER_RS274X" 36 | Wheel="" 37 | Rack="" 38 | Scale=1 39 | Output=".GTL" 40 | Flags="0 0 0 1 0 1 1" 41 | Emulate="0" 42 | Offset="0.0mil 0.0mil" 43 | Sheet=1 44 | Tolerance="0 0 0 0 0 0" 45 | Pen="0.0mil 0" 46 | Page="12000.0mil 8000.0mil" 47 | Layers=" 1 17 18" 48 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 49 | 50 | [Sec_3] 51 | Name[en]="Bottom Copper" 52 | Prompt="" 53 | Device="GERBER_RS274X" 54 | Wheel=".whl" 55 | Rack="" 56 | Scale=1 57 | Output=".GBL" 58 | Flags="0 0 0 1 0 1 1" 59 | Emulate="0" 60 | Offset="0.0mil 0.0mil" 61 | Sheet=1 62 | Tolerance="0 0 0 0 0 0" 63 | Pen="0.0mil 0" 64 | Page="12000.0mil 8000.0mil" 65 | Layers=" 16 17 18" 66 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 67 | 68 | [Sec_4] 69 | Name[en]="Top Silkscreen" 70 | Prompt="" 71 | Device="GERBER_RS274X" 72 | Wheel=".whl" 73 | Rack="" 74 | Scale=1 75 | Output=".GTO" 76 | Flags="0 0 0 1 0 1 1" 77 | Emulate="0" 78 | Offset="0.0mil 0.0mil" 79 | Sheet=1 80 | Tolerance="0 0 0 0 0 0" 81 | Pen="0.0mil 0" 82 | Page="12000.0mil 8000.0mil" 83 | Layers=" 21" 84 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 85 | 86 | [Sec_5] 87 | Name[en]="Top Paste" 88 | Prompt="" 89 | Device="GERBER_RS274X" 90 | Wheel=".whl" 91 | Rack="" 92 | Scale=1 93 | Output=".GTP" 94 | Flags="0 0 0 1 0 1 1" 95 | Emulate="0" 96 | Offset="0.0mil 0.0mil" 97 | Sheet=1 98 | Tolerance="0 0 0 0 0 0" 99 | Pen="0.0mil 0" 100 | Page="12000.0mil 8000.0mil" 101 | Layers=" 31" 102 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 103 | 104 | [Sec_6] 105 | Name[en]="Top Soldermask" 106 | Prompt="" 107 | Device="GERBER_RS274X" 108 | Wheel=".whl" 109 | Rack="" 110 | Scale=1 111 | Output=".GTS" 112 | Flags="0 0 0 1 0 1 1" 113 | Emulate="0" 114 | Offset="0.0mil 0.0mil" 115 | Sheet=1 116 | Tolerance="0 0 0 0 0 0" 117 | Pen="0.0mil 0" 118 | Page="12000.0mil 8000.0mil" 119 | Layers=" 29" 120 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 121 | 122 | [Sec_7] 123 | Name[en]="Bottom Silkscreen" 124 | Prompt="" 125 | Device="GERBER_RS274X" 126 | Wheel=".whl" 127 | Rack="" 128 | Scale=1 129 | Output=".GBO" 130 | Flags="0 0 0 1 0 1 1" 131 | Emulate="0" 132 | Offset="0.0mil 0.0mil" 133 | Sheet=1 134 | Tolerance="0 0 0 0 0 0" 135 | Pen="0.0mil 0" 136 | Page="12000.0mil 8000.0mil" 137 | Layers=" 22" 138 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 139 | 140 | [Sec_8] 141 | Name[en]="Bottom Soldermask" 142 | Prompt="" 143 | Device="GERBER_RS274X" 144 | Wheel=".whl" 145 | Rack="" 146 | Scale=1 147 | Output=".GBS" 148 | Flags="0 0 0 1 0 1 1" 149 | Emulate="0" 150 | Offset="0.0mil 0.0mil" 151 | Sheet=1 152 | Tolerance="0 0 0 0 0 0" 153 | Pen="0.0mil 0" 154 | Page="12000.0mil 8000.0mil" 155 | Layers=" 30" 156 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 157 | 158 | [Sec_9] 159 | Name[en]="Drill File" 160 | Prompt="" 161 | Device="EXCELLON_24" 162 | Wheel="" 163 | Rack="" 164 | Scale=1 165 | Output=".XLN" 166 | Flags="0 0 0 1 0 1 1" 167 | Emulate="0" 168 | Offset="0.0mil 0.0mil" 169 | Sheet=1 170 | Tolerance="0 0 0 0 0 0" 171 | Pen="0.0mil 0" 172 | Page="12000.0mil 8000.0mil" 173 | Layers=" 44 45 254" 174 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 175 | 176 | [Sec_10] 177 | Name[en]="Mill Layer" 178 | Prompt="" 179 | Device="GERBER_RS274X" 180 | Wheel="" 181 | Rack="" 182 | Scale=1 183 | Output=".GML" 184 | Flags="0 0 0 1 0 1 1" 185 | Emulate="0" 186 | Offset="0.0mil 0.0mil" 187 | Sheet=1 188 | Tolerance="0 0 0 0 0 0" 189 | Pen="0.0mil 0" 190 | Page="11000.0mil 16000.0mil" 191 | Layers=" 46" 192 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 193 | -------------------------------------------------------------------------------- /cam/sfe-gerb274x_GP_FOR_CASTELLATED_HEADERS.cam: -------------------------------------------------------------------------------- 1 | [CAM Processor Job] 2 | Description[en]="\n\n\n\n\n\n\n\n\n\n\n\nSparkFun Gerber Generator

\n\nThis CAM job creates the seven needed files to have a PCB created. Based on the original Eagle gerb274x.cam file.

\nYou will get seven gerber files that contain data for:
\ngerber top layer (copper layer): *.GTL
\ngerber top overlay (silkscreen layer): *.GTO
\ngerber top soldermask (soldermask layer): *.GTS
\n\ngerber bottom layer (copper layer): *.GBL
\ngerber bottom overlay (silkscreen layer): *.GBO
\ngerber bottom soldermask (soldermask layer): *.GBS
\n\nExcellon Drill File: *.TXT

\nThese files, zipped together, are the only 7 files you need to have a PCB made at nearly any fab house.\n" 3 | Section=Sec_1 4 | Section=Sec_2 5 | Section=Sec_3 6 | Section=Sec_4 7 | Section=Sec_5 8 | Section=Sec_6 9 | Section=Sec_7 10 | Section=Sec_8 11 | Section=Sec_9 12 | Section=Sec_10 13 | 14 | [Sec_1] 15 | Name[en]="Top Copper" 16 | Prompt="" 17 | Device="GERBER_RS274X" 18 | Wheel="" 19 | Rack="" 20 | Scale=1 21 | Output=".GTL" 22 | Flags="0 0 0 1 0 1 1" 23 | Emulate="0" 24 | Offset="0.0mil 0.0mil" 25 | Sheet=1 26 | Tolerance="0 0 0 0 0 0" 27 | Pen="0.0mil 0" 28 | Page="12000.0mil 8000.0mil" 29 | Layers=" 1 17 18" 30 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 31 | 32 | [Sec_2] 33 | Name[en]="GKO-Dimension_ONLY" 34 | Prompt="" 35 | Device="GERBER_RS274X" 36 | Wheel="" 37 | Rack="" 38 | Scale=1 39 | Output=".GKO" 40 | Flags="0 0 0 1 0 1 1" 41 | Emulate="0" 42 | Offset="0.0mil 0.0mil" 43 | Sheet=1 44 | Tolerance="0 0 0 0 0 0" 45 | Pen="0.0mil 0" 46 | Page="12000.0mil 8000.0mil" 47 | Layers=" 20" 48 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 49 | 50 | [Sec_3] 51 | Name[en]="Bottom Copper" 52 | Prompt="" 53 | Device="GERBER_RS274X" 54 | Wheel=".whl" 55 | Rack="" 56 | Scale=1 57 | Output=".GBL" 58 | Flags="0 0 0 1 0 1 1" 59 | Emulate="0" 60 | Offset="0.0mil 0.0mil" 61 | Sheet=1 62 | Tolerance="0 0 0 0 0 0" 63 | Pen="0.0mil 0" 64 | Page="12000.0mil 8000.0mil" 65 | Layers=" 16 17 18" 66 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 67 | 68 | [Sec_4] 69 | Name[en]="Top Silkscreen" 70 | Prompt="" 71 | Device="GERBER_RS274X" 72 | Wheel=".whl" 73 | Rack="" 74 | Scale=1 75 | Output=".GTO" 76 | Flags="0 0 0 1 0 1 1" 77 | Emulate="0" 78 | Offset="0.0mil 0.0mil" 79 | Sheet=1 80 | Tolerance="0 0 0 0 0 0" 81 | Pen="0.0mil 0" 82 | Page="12000.0mil 8000.0mil" 83 | Layers=" 21" 84 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 85 | 86 | [Sec_5] 87 | Name[en]="Top Paste" 88 | Prompt="" 89 | Device="GERBER_RS274X" 90 | Wheel=".whl" 91 | Rack="" 92 | Scale=1 93 | Output=".GTP" 94 | Flags="0 0 0 1 0 1 1" 95 | Emulate="0" 96 | Offset="0.0mil 0.0mil" 97 | Sheet=1 98 | Tolerance="0 0 0 0 0 0" 99 | Pen="0.0mil 0" 100 | Page="12000.0mil 8000.0mil" 101 | Layers=" 31" 102 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 103 | 104 | [Sec_6] 105 | Name[en]="Bottom Silkscreen" 106 | Prompt="" 107 | Device="GERBER_RS274X" 108 | Wheel=".whl" 109 | Rack="" 110 | Scale=1 111 | Output=".GBO" 112 | Flags="0 0 0 1 0 1 1" 113 | Emulate="0" 114 | Offset="0.0mil 0.0mil" 115 | Sheet=1 116 | Tolerance="0 0 0 0 0 0" 117 | Pen="0.0mil 0" 118 | Page="12000.0mil 8000.0mil" 119 | Layers=" 22" 120 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 121 | 122 | [Sec_7] 123 | Name[en]="Top Soldermask" 124 | Prompt="" 125 | Device="GERBER_RS274X" 126 | Wheel=".whl" 127 | Rack="" 128 | Scale=1 129 | Output=".GTS" 130 | Flags="0 0 0 1 0 1 1" 131 | Emulate="0" 132 | Offset="0.0mil 0.0mil" 133 | Sheet=1 134 | Tolerance="0 0 0 0 0 0" 135 | Pen="0.0mil 0" 136 | Page="12000.0mil 8000.0mil" 137 | Layers=" 29" 138 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 139 | 140 | [Sec_8] 141 | Name[en]="Bottom Soldermask" 142 | Prompt="" 143 | Device="GERBER_RS274X" 144 | Wheel=".whl" 145 | Rack="" 146 | Scale=1 147 | Output=".GBS" 148 | Flags="0 0 0 1 0 1 1" 149 | Emulate="0" 150 | Offset="0.0mil 0.0mil" 151 | Sheet=1 152 | Tolerance="0 0 0 0 0 0" 153 | Pen="0.0mil 0" 154 | Page="12000.0mil 8000.0mil" 155 | Layers=" 30" 156 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 157 | 158 | [Sec_9] 159 | Name[en]="Drill File" 160 | Prompt="" 161 | Device="EXCELLON" 162 | Wheel="" 163 | Rack="" 164 | Scale=1 165 | Output=".TXT" 166 | Flags="0 0 0 1 0 1 1" 167 | Emulate="0" 168 | Offset="0.0mil 0.0mil" 169 | Sheet=1 170 | Tolerance="0 0 0 0 0 0" 171 | Pen="0.0mil 0" 172 | Page="12000.0mil 8000.0mil" 173 | Layers=" 44 45" 174 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 175 | 176 | [Sec_10] 177 | Name[en]="Mill Layer" 178 | Prompt="" 179 | Device="GERBER_RS274X" 180 | Wheel="" 181 | Rack="" 182 | Scale=1 183 | Output=".GML" 184 | Flags="0 0 0 1 0 1 1" 185 | Emulate="0" 186 | Offset="0.0mil 0.0mil" 187 | Sheet=1 188 | Tolerance="0 0 0 0 0 0" 189 | Pen="0.0mil 0" 190 | Page="11000.0mil 16000.0mil" 191 | Layers=" 46" 192 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 193 | -------------------------------------------------------------------------------- /cam/sfe-gerb274x-withGBP.cam: -------------------------------------------------------------------------------- 1 | [CAM Processor Job] 2 | Description="Generates Extended Gerber Format

\nThis CAM job consists of five sections that generate data for a two layer board.

\nYou will get five gerber files that contain data for:
\ncomponent side *.cmp
\nsolder side *.sol
\nsilkscreen component side *.plc
\nsolder stop component side *.stc
\nsolder stop solder sid *.sts
" 3 | Section=Sec_1 4 | Section=Sec_2 5 | Section=Sec_3 6 | Section=Sec_4 7 | Section=Sec_5 8 | Section=Sec_6 9 | Section=Sec_7 10 | Section=Sec_8 11 | Section=Sec_9 12 | Section=Sec_10 13 | 14 | [Sec_1] 15 | Name="Top Copper" 16 | Prompt="" 17 | Device="GERBER_RS274X" 18 | Wheel="" 19 | Rack="" 20 | Scale=1.000000 21 | Output=".GTL" 22 | Flags="0 0 0 1 0 1 1" 23 | Emulate="0 0 0" 24 | Offset="0.0mil 0.0mil" 25 | Sheet=1 26 | Tolerance="0.000000 0.000000 0.000000 0.000000 0.000000 0.000000" 27 | Pen="0.0mil 0.000000" 28 | Page="12000.0mil 8000.0mil" 29 | Layers=" 1 17 18 20" 30 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 31 | 32 | [Sec_2] 33 | Name="Bottom Copper" 34 | Prompt="" 35 | Device="GERBER_RS274X" 36 | Wheel=".whl" 37 | Rack="" 38 | Scale=1.000000 39 | Output=".GBL" 40 | Flags="0 0 0 1 0 1 1" 41 | Emulate="0 0 0" 42 | Offset="0.0mil 0.0mil" 43 | Sheet=1 44 | Tolerance="0.000000 0.000000 0.000000 0.000000 0.000000 0.000000" 45 | Pen="0.0mil 0.000000" 46 | Page="12000.0mil 8000.0mil" 47 | Layers=" 16 17 18" 48 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 49 | 50 | [Sec_3] 51 | Name="Top Silkscreen" 52 | Prompt="" 53 | Device="GERBER_RS274X" 54 | Wheel=".whl" 55 | Rack="" 56 | Scale=1.000000 57 | Output=".GTO" 58 | Flags="0 0 0 1 0 1 1" 59 | Emulate="0 0 0" 60 | Offset="0.0mil 0.0mil" 61 | Sheet=1 62 | Tolerance="0.000000 0.000000 0.000000 0.000000 0.000000 0.000000" 63 | Pen="0.0mil 0.000000" 64 | Page="12000.0mil 8000.0mil" 65 | Layers=" 21" 66 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 67 | 68 | [Sec_4] 69 | Name="Top Paste" 70 | Prompt="" 71 | Device="GERBER_RS274X" 72 | Wheel=".whl" 73 | Rack="" 74 | Scale=1.000000 75 | Output=".GTP" 76 | Flags="0 0 0 1 0 1 1" 77 | Emulate="0 0 0" 78 | Offset="0.0mil 0.0mil" 79 | Sheet=1 80 | Tolerance="0.000000 0.000000 0.000000 0.000000 0.000000 0.000000" 81 | Pen="0.0mil 0.000000" 82 | Page="12000.0mil 8000.0mil" 83 | Layers=" 31" 84 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 85 | 86 | [Sec_5] 87 | Name="Bottom Paste" 88 | Prompt="" 89 | Device="GERBER_RS274X" 90 | Wheel=".whl" 91 | Rack="" 92 | Scale=1.000000 93 | Output=".GBP" 94 | Flags="0 0 0 1 0 1 1" 95 | Emulate="0 0 0" 96 | Offset="0.0mil 0.0mil" 97 | Sheet=1 98 | Tolerance="0.000000 0.000000 0.000000 0.000000 0.000000 0.000000" 99 | Pen="0.0mil 0.000000" 100 | Page="12000.0mil 8000.0mil" 101 | Layers=" 32" 102 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 103 | 104 | [Sec_6] 105 | Name="Bottom Silkscreen" 106 | Prompt="" 107 | Device="GERBER_RS274X" 108 | Wheel=".whl" 109 | Rack="" 110 | Scale=1.000000 111 | Output=".GBO" 112 | Flags="0 0 0 1 0 1 1" 113 | Emulate="0 0 0" 114 | Offset="0.0mil 0.0mil" 115 | Sheet=1 116 | Tolerance="0.000000 0.000000 0.000000 0.000000 0.000000 0.000000" 117 | Pen="0.0mil 0.000000" 118 | Page="12000.0mil 8000.0mil" 119 | Layers=" 22" 120 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 121 | 122 | [Sec_7] 123 | Name="Top Soldermask" 124 | Prompt="" 125 | Device="GERBER_RS274X" 126 | Wheel=".whl" 127 | Rack="" 128 | Scale=1.000000 129 | Output=".GTS" 130 | Flags="0 0 0 1 0 1 1" 131 | Emulate="0 0 0" 132 | Offset="0.0mil 0.0mil" 133 | Sheet=1 134 | Tolerance="0.000000 0.000000 0.000000 0.000000 0.000000 0.000000" 135 | Pen="0.0mil 0.000000" 136 | Page="12000.0mil 8000.0mil" 137 | Layers=" 29" 138 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 139 | 140 | [Sec_8] 141 | Name="Bottom Soldermask" 142 | Prompt="" 143 | Device="GERBER_RS274X" 144 | Wheel=".whl" 145 | Rack="" 146 | Scale=1.000000 147 | Output=".GBS" 148 | Flags="0 0 0 1 0 1 1" 149 | Emulate="0 0 0" 150 | Offset="0.0mil 0.0mil" 151 | Sheet=1 152 | Tolerance="0.000000 0.000000 0.000000 0.000000 0.000000 0.000000" 153 | Pen="0.0mil 0.000000" 154 | Page="12000.0mil 8000.0mil" 155 | Layers=" 30" 156 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 157 | 158 | [Sec_9] 159 | Name="Drill File" 160 | Prompt="" 161 | Device="EXCELLON" 162 | Wheel="" 163 | Rack="" 164 | Scale=1.000000 165 | Output=".TXT" 166 | Flags="0 0 0 1 0 1 1" 167 | Emulate="0 0 0" 168 | Offset="0.0mil 0.0mil" 169 | Sheet=1 170 | Tolerance="0.000000 0.000000 0.000000 0.000000 0.000000 0.000000" 171 | Pen="0.0mil 0.000000" 172 | Page="12000.0mil 8000.0mil" 173 | Layers=" 44 45" 174 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 175 | 176 | [Sec_10] 177 | Name="Mill Layer" 178 | Prompt="" 179 | Device="GERBER_RS274X" 180 | Wheel="" 181 | Rack="" 182 | Scale=1.000000 183 | Output=".GML" 184 | Flags="0 0 0 1 0 1 1" 185 | Emulate="0 0 0" 186 | Offset="0.0mil 0.0mil" 187 | Sheet=1 188 | Tolerance="0.000000 0.000000 0.000000 0.000000 0.000000 0.000000" 189 | Pen="0.0mil 0.000000" 190 | Page="11000.0mil 16000.0mil" 191 | Layers=" 46" 192 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 193 | -------------------------------------------------------------------------------- /cam/sfe-gerb274x-4layer.cam: -------------------------------------------------------------------------------- 1 | [CAM Processor Job] 2 | Description[en]="Generates Extended Gerber Format

\nThis CAM job consists of five sections that generate data for a two layer board.

\nYou will get five gerber files that contain data for:
\ncomponent side *.cmp
\nsolder side *.sol
\nsilkscreen component side *.plc
\nsolder stop component side *.stc
\nsolder stop solder sid *.sts
" 3 | Section=Sec_1 4 | Section=Sec_2 5 | Section=Sec_3 6 | Section=Sec_4 7 | Section=Sec_5 8 | Section=Sec_6 9 | Section=Sec_7 10 | Section=Sec_8 11 | Section=Sec_9 12 | Section=Sec_10 13 | Section=Sec_11 14 | 15 | [Sec_1] 16 | Name[en]="Top Copper" 17 | Prompt="" 18 | Device="GERBER_RS274X" 19 | Wheel="" 20 | Rack="" 21 | Scale=1 22 | Output=".GTL" 23 | Flags="0 0 0 1 0 1 1" 24 | Emulate="0" 25 | Offset="0.0mil 0.0mil" 26 | Sheet=1 27 | Tolerance="0 0 0 0 0 0" 28 | Pen="0.0mil 0" 29 | Page="12000.0mil 8000.0mil" 30 | Layers=" 1 17 18 20" 31 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 32 | 33 | [Sec_2] 34 | Name[en]="Bottom Copper" 35 | Prompt="" 36 | Device="GERBER_RS274X" 37 | Wheel=".whl" 38 | Rack="" 39 | Scale=1 40 | Output=".GBL" 41 | Flags="0 0 0 1 0 1 1" 42 | Emulate="0" 43 | Offset="0.0mil 0.0mil" 44 | Sheet=1 45 | Tolerance="0 0 0 0 0 0" 46 | Pen="0.0mil 0" 47 | Page="12000.0mil 8000.0mil" 48 | Layers=" 16 17 18" 49 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 50 | 51 | [Sec_3] 52 | Name[en]="Layer2" 53 | Prompt="" 54 | Device="GERBER_RS274X" 55 | Wheel=".whl" 56 | Rack="" 57 | Scale=1 58 | Output=".GL2" 59 | Flags="0 0 0 1 0 1 1" 60 | Emulate="0" 61 | Offset="0.0mil 0.0mil" 62 | Sheet=1 63 | Tolerance="0 0 0 0 0 0" 64 | Pen="0.0mil 0" 65 | Page="12000.0mil 8000.0mil" 66 | Layers=" 2 17 18" 67 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 68 | 69 | [Sec_4] 70 | Name[en]="Layer3" 71 | Prompt="" 72 | Device="GERBER_RS274X" 73 | Wheel=".whl" 74 | Rack="" 75 | Scale=1 76 | Output=".GL3" 77 | Flags="0 0 0 1 0 1 1" 78 | Emulate="0" 79 | Offset="0.0mil 0.0mil" 80 | Sheet=1 81 | Tolerance="0 0 0 0 0 0" 82 | Pen="0.0mil 0" 83 | Page="12000.0mil 8000.0mil" 84 | Layers=" 15 17 18" 85 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 86 | 87 | [Sec_5] 88 | Name[en]="Top Silkscreen" 89 | Prompt="" 90 | Device="GERBER_RS274X" 91 | Wheel=".whl" 92 | Rack="" 93 | Scale=1 94 | Output=".GTO" 95 | Flags="0 0 0 1 0 1 1" 96 | Emulate="0" 97 | Offset="0.0mil 0.0mil" 98 | Sheet=1 99 | Tolerance="0 0 0 0 0 0" 100 | Pen="0.0mil 0" 101 | Page="12000.0mil 8000.0mil" 102 | Layers=" 21" 103 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 104 | 105 | [Sec_6] 106 | Name[en]="Top Paste" 107 | Prompt="" 108 | Device="GERBER_RS274X" 109 | Wheel=".whl" 110 | Rack="" 111 | Scale=1 112 | Output=".GTP" 113 | Flags="0 0 0 1 0 1 1" 114 | Emulate="0" 115 | Offset="0.0mil 0.0mil" 116 | Sheet=1 117 | Tolerance="0 0 0 0 0 0" 118 | Pen="0.0mil 0" 119 | Page="12000.0mil 8000.0mil" 120 | Layers=" 31" 121 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 122 | 123 | [Sec_7] 124 | Name[en]="Bottom Silkscreen" 125 | Prompt="" 126 | Device="GERBER_RS274X" 127 | Wheel=".whl" 128 | Rack="" 129 | Scale=1 130 | Output=".GBO" 131 | Flags="0 0 0 1 0 1 1" 132 | Emulate="0" 133 | Offset="0.0mil 0.0mil" 134 | Sheet=1 135 | Tolerance="0 0 0 0 0 0" 136 | Pen="0.0mil 0" 137 | Page="12000.0mil 8000.0mil" 138 | Layers=" 22" 139 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 140 | 141 | [Sec_8] 142 | Name[en]="Top Soldermask" 143 | Prompt="" 144 | Device="GERBER_RS274X" 145 | Wheel=".whl" 146 | Rack="" 147 | Scale=1 148 | Output=".GTS" 149 | Flags="0 0 0 1 0 1 1" 150 | Emulate="0" 151 | Offset="0.0mil 0.0mil" 152 | Sheet=1 153 | Tolerance="0 0 0 0 0 0" 154 | Pen="0.0mil 0" 155 | Page="12000.0mil 8000.0mil" 156 | Layers=" 29" 157 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 158 | 159 | [Sec_9] 160 | Name[en]="Bottom Soldermask" 161 | Prompt="" 162 | Device="GERBER_RS274X" 163 | Wheel=".whl" 164 | Rack="" 165 | Scale=1 166 | Output=".GBS" 167 | Flags="0 0 0 1 0 1 1" 168 | Emulate="0" 169 | Offset="0.0mil 0.0mil" 170 | Sheet=1 171 | Tolerance="0 0 0 0 0 0" 172 | Pen="0.0mil 0" 173 | Page="12000.0mil 8000.0mil" 174 | Layers=" 30" 175 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 176 | 177 | [Sec_10] 178 | Name[en]="Drill File" 179 | Prompt="" 180 | Device="EXCELLON" 181 | Wheel="" 182 | Rack="" 183 | Scale=1 184 | Output=".TXT" 185 | Flags="0 0 0 1 0 1 1" 186 | Emulate="0" 187 | Offset="0.0mil 0.0mil" 188 | Sheet=1 189 | Tolerance="0 0 0 0 0 0" 190 | Pen="0.0mil 0" 191 | Page="12000.0mil 8000.0mil" 192 | Layers=" 44 45" 193 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 194 | 195 | [Sec_11] 196 | Name[en]="Mill Layer" 197 | Prompt="" 198 | Device="GERBER_RS274X" 199 | Wheel="" 200 | Rack="" 201 | Scale=1 202 | Output=".GML" 203 | Flags="0 0 0 1 0 1 1" 204 | Emulate="0" 205 | Offset="0.0mil 0.0mil" 206 | Sheet=1 207 | Tolerance="0 0 0 0 0 0" 208 | Pen="0.0mil 0" 209 | Page="11000.0mil 16000.0mil" 210 | Layers=" 46" 211 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 212 | -------------------------------------------------------------------------------- /cam/oshpark-gerb274x-4layer.cam: -------------------------------------------------------------------------------- 1 | [CAM Processor Job] 2 | Description[en]="Generates Extended Gerber Format

\nThis CAM job consists of five sections that generate data for a two layer board.

\nYou will get five gerber files that contain data for:
\ncomponent side *.cmp
\nsolder side *.sol
\nsilkscreen component side *.plc
\nsolder stop component side *.stc
\nsolder stop solder sid *.sts
" 3 | Section=Sec_1 4 | Section=Sec_2 5 | Section=Sec_3 6 | Section=Sec_4 7 | Section=Sec_5 8 | Section=Sec_6 9 | Section=Sec_7 10 | Section=Sec_8 11 | Section=Sec_9 12 | Section=Sec_10 13 | Section=Sec_11 14 | Section=Sec_12 15 | 16 | [Sec_1] 17 | Name[en]="Outline" 18 | Prompt="" 19 | Device="GERBER_RS274X" 20 | Wheel="" 21 | Rack="" 22 | Scale=1 23 | Output=".GKO" 24 | Flags="0 0 0 1 0 1 1" 25 | Emulate="0" 26 | Offset="0.0mil 0.0mil" 27 | Sheet=1 28 | Tolerance="0 0 0 0 0 0" 29 | Pen="0.0mil 0" 30 | Page="12000.0mil 8000.0mil" 31 | Layers=" 20" 32 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 33 | 34 | [Sec_2] 35 | Name[en]="Top Copper" 36 | Prompt="" 37 | Device="GERBER_RS274X" 38 | Wheel="" 39 | Rack="" 40 | Scale=1 41 | Output=".GTL" 42 | Flags="0 0 0 1 0 1 1" 43 | Emulate="0" 44 | Offset="0.0mil 0.0mil" 45 | Sheet=1 46 | Tolerance="0 0 0 0 0 0" 47 | Pen="0.0mil 0" 48 | Page="12000.0mil 8000.0mil" 49 | Layers=" 1 17 18" 50 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 51 | 52 | [Sec_3] 53 | Name[en]="Bottom Copper" 54 | Prompt="" 55 | Device="GERBER_RS274X" 56 | Wheel=".whl" 57 | Rack="" 58 | Scale=1 59 | Output=".GBL" 60 | Flags="0 0 0 1 0 1 1" 61 | Emulate="0" 62 | Offset="0.0mil 0.0mil" 63 | Sheet=1 64 | Tolerance="0 0 0 0 0 0" 65 | Pen="0.0mil 0" 66 | Page="12000.0mil 8000.0mil" 67 | Layers=" 16 17 18" 68 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 69 | 70 | [Sec_4] 71 | Name[en]="Layer2" 72 | Prompt="" 73 | Device="GERBER_RS274X" 74 | Wheel=".whl" 75 | Rack="" 76 | Scale=1 77 | Output=".G2L" 78 | Flags="0 0 0 1 0 1 1" 79 | Emulate="0" 80 | Offset="0.0mil 0.0mil" 81 | Sheet=1 82 | Tolerance="0 0 0 0 0 0" 83 | Pen="0.0mil 0" 84 | Page="12000.0mil 8000.0mil" 85 | Layers=" 2 17 18" 86 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 87 | 88 | [Sec_5] 89 | Name[en]="Layer3" 90 | Prompt="" 91 | Device="GERBER_RS274X" 92 | Wheel=".whl" 93 | Rack="" 94 | Scale=1 95 | Output=".G3L" 96 | Flags="0 0 0 1 0 1 1" 97 | Emulate="0" 98 | Offset="0.0mil 0.0mil" 99 | Sheet=1 100 | Tolerance="0 0 0 0 0 0" 101 | Pen="0.0mil 0" 102 | Page="12000.0mil 8000.0mil" 103 | Layers=" 15 17 18" 104 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 105 | 106 | [Sec_6] 107 | Name[en]="Top Silkscreen" 108 | Prompt="" 109 | Device="GERBER_RS274X" 110 | Wheel=".whl" 111 | Rack="" 112 | Scale=1 113 | Output=".GTO" 114 | Flags="0 0 0 1 0 1 1" 115 | Emulate="0" 116 | Offset="0.0mil 0.0mil" 117 | Sheet=1 118 | Tolerance="0 0 0 0 0 0" 119 | Pen="0.0mil 0" 120 | Page="12000.0mil 8000.0mil" 121 | Layers=" 21" 122 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 123 | 124 | [Sec_7] 125 | Name[en]="Top Paste" 126 | Prompt="" 127 | Device="GERBER_RS274X" 128 | Wheel=".whl" 129 | Rack="" 130 | Scale=1 131 | Output=".GTP" 132 | Flags="0 0 0 1 0 1 1" 133 | Emulate="0" 134 | Offset="0.0mil 0.0mil" 135 | Sheet=1 136 | Tolerance="0 0 0 0 0 0" 137 | Pen="0.0mil 0" 138 | Page="12000.0mil 8000.0mil" 139 | Layers=" 31" 140 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 141 | 142 | [Sec_8] 143 | Name[en]="Bottom Silkscreen" 144 | Prompt="" 145 | Device="GERBER_RS274X" 146 | Wheel=".whl" 147 | Rack="" 148 | Scale=1 149 | Output=".GBO" 150 | Flags="0 0 0 1 0 1 1" 151 | Emulate="0" 152 | Offset="0.0mil 0.0mil" 153 | Sheet=1 154 | Tolerance="0 0 0 0 0 0" 155 | Pen="0.0mil 0" 156 | Page="12000.0mil 8000.0mil" 157 | Layers=" 22" 158 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 159 | 160 | [Sec_9] 161 | Name[en]="Top Soldermask" 162 | Prompt="" 163 | Device="GERBER_RS274X" 164 | Wheel=".whl" 165 | Rack="" 166 | Scale=1 167 | Output=".GTS" 168 | Flags="0 0 0 1 0 1 1" 169 | Emulate="0" 170 | Offset="0.0mil 0.0mil" 171 | Sheet=1 172 | Tolerance="0 0 0 0 0 0" 173 | Pen="0.0mil 0" 174 | Page="12000.0mil 8000.0mil" 175 | Layers=" 29" 176 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 177 | 178 | [Sec_10] 179 | Name[en]="Bottom Soldermask" 180 | Prompt="" 181 | Device="GERBER_RS274X" 182 | Wheel=".whl" 183 | Rack="" 184 | Scale=1 185 | Output=".GBS" 186 | Flags="0 0 0 1 0 1 1" 187 | Emulate="0" 188 | Offset="0.0mil 0.0mil" 189 | Sheet=1 190 | Tolerance="0 0 0 0 0 0" 191 | Pen="0.0mil 0" 192 | Page="12000.0mil 8000.0mil" 193 | Layers=" 30" 194 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 195 | 196 | [Sec_11] 197 | Name[en]="Drill File" 198 | Prompt="" 199 | Device="EXCELLON_24" 200 | Wheel="" 201 | Rack="" 202 | Scale=1 203 | Output=".XLN" 204 | Flags="0 0 0 1 0 1 1" 205 | Emulate="0" 206 | Offset="0.0mil 0.0mil" 207 | Sheet=1 208 | Tolerance="0 0 0 0 0 0" 209 | Pen="0.0mil 0" 210 | Page="12000.0mil 8000.0mil" 211 | Layers=" 44 45" 212 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 213 | 214 | [Sec_12] 215 | Name[en]="Mill Layer" 216 | Prompt="" 217 | Device="GERBER_RS274X" 218 | Wheel="" 219 | Rack="" 220 | Scale=1 221 | Output=".GML" 222 | Flags="0 0 0 1 0 1 1" 223 | Emulate="0" 224 | Offset="0.0mil 0.0mil" 225 | Sheet=1 226 | Tolerance="0 0 0 0 0 0" 227 | Pen="0.0mil 0" 228 | Page="11000.0mil 16000.0mil" 229 | Layers=" 46" 230 | Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0" 231 | -------------------------------------------------------------------------------- /ulp/autodim_mil.ulp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************** 2 | * * 3 | * AutoDimensionning of Board in mm (Version 3.0) for EAGLE 4.X only! * 4 | * * 5 | * ORIGINAL Filename: adimv2_0mm.ulp * 6 | * Written by: Michel Dagenais * 7 | * Date: September 12th 1998 * 8 | * Modified: Brain Technology (www.braintechnology.de) (* Nov 1999 *) * 9 | * Now places text on appropriate side (closer to object beeing dimensionned). * 10 | * * 11 | * Filename: adimv3_0mm.ulp * 12 | * Edited by: Jeff Moore * 13 | * Date: February 1st 2001 * 14 | * * 15 | * This ULP program will put all the necessary dimensions for holes (layer 45) and * 16 | * board outline (arcs and wires on layer 20) for your board into a .scr file of your * 17 | * choice and into the directory of your choice. * 18 | * Run the resulting script on your board to place the dimentions into the board file. * 19 | * * 20 | * Few requirements: * 21 | * * 22 | * 1. The shape of your board (board outline) is drawn on layer 20 (Dimension). * 23 | * 2. You reserve layer 47 (Measures) to dimension your board. * 24 | * * 25 | * * 26 | * * 27 | ****************************************************************************************/ 28 | 29 | real datum_dot_diameter = 5; // diameter of connecting dot on datum line 30 | 31 | real datum_wire_width = 4; // width or datum line 32 | real default_wire_width = 2.5; // default wire width for dimension extender and leader 33 | real wire_width; 34 | 35 | real extender_clearance = 25; // clearance from closest edge 36 | real text_offset = 250; // distance of dimension text from closest edge 37 | 38 | real right_top_extender_length = text_offset * 2.28; 39 | real left_bottom_extender_length = text_offset * 2.28; 40 | 41 | real right_top_datum_location = extender_clearance + (right_top_extender_length * 0.75); 42 | real left_bottom_datum_location = extender_clearance + (left_bottom_extender_length * 0.75); 43 | 44 | int right_limit; 45 | int top_limit; 46 | int left_limit; 47 | int bottom_limit; 48 | 49 | int x_points[]; 50 | string x_points_loc[]; // top or bottom 51 | int y_points[]; 52 | string y_points_loc[]; // right or left 53 | string text_location; 54 | string fileName; 55 | 56 | int lower_right; 57 | int higher_right; 58 | int lower_top; 59 | int higher_top; 60 | int lower_left; 61 | int higher_left; 62 | int lower_bottom; 63 | int higher_bottom; 64 | 65 | int count_x_points; 66 | int count_y_points; 67 | 68 | int i; 69 | int j; 70 | 71 | void check_x_points(int point_cxp, int y_point_cxp) 72 | { 73 | for (i = 0; i <= count_x_points; ++i) 74 | { 75 | if (point_cxp == x_points[i]) 76 | break; 77 | } 78 | if (i > count_x_points) 79 | { 80 | x_points[count_x_points] = point_cxp; 81 | int middle = bottom_limit + ((abs(bottom_limit) + abs(top_limit)) * 0.5); 82 | if (y_point_cxp < middle) 83 | text_location = "bottom"; 84 | else 85 | text_location = "top"; 86 | x_points_loc[count_x_points] = text_location; 87 | ++count_x_points; 88 | } 89 | } 90 | 91 | void check_y_points(int point_cxp, int x_point_cxp) 92 | { 93 | for (i = 0; i <= count_y_points; ++i) 94 | { 95 | if (point_cxp == y_points[i]) 96 | break; 97 | } 98 | if (i > count_y_points) 99 | { 100 | y_points[count_y_points] = point_cxp; 101 | int middle = left_limit + ((abs(left_limit) + abs(right_limit)) * 0.5); 102 | if (x_point_cxp < middle) 103 | text_location = "left"; 104 | else 105 | text_location = "right"; 106 | y_points_loc[count_y_points] = text_location; 107 | ++count_y_points; 108 | } 109 | } 110 | 111 | fileName = dlgFileSave("Save Dimensioning File", filesetext("inch",".scr"), "*.scr"); 112 | if (fileName == "") exit(0); 113 | 114 | output(fileName) 115 | { 116 | printf(";\n"); 117 | printf("Grid mil;\n"); 118 | printf("Change Width 50;\n"); 119 | printf("Change Size 40;\n"); 120 | printf("Change Ratio 8;\n"); 121 | printf("Display 20 44 45 47;\n"); 122 | printf("Layer 47;\n"); 123 | board(B) 124 | { 125 | B.wires(W) 126 | { 127 | if (W.layer == 20) 128 | { 129 | switch (W.y2 - W.y1) 130 | { 131 | case 0: 132 | { 133 | if (W.y2 > top_limit) 134 | top_limit = W.y2; 135 | else 136 | { 137 | if (W.y2 < bottom_limit) 138 | bottom_limit = W.y2; 139 | } 140 | } 141 | default: 142 | { 143 | if (W.y2 > W.y1) 144 | { 145 | if (W.y2 > top_limit) 146 | top_limit = W.y2; 147 | if (W.y1 < bottom_limit) 148 | bottom_limit = W.y1; 149 | } 150 | else 151 | { 152 | if (W.y1 > top_limit) 153 | top_limit = W.y1; 154 | if (W.y2 < bottom_limit) 155 | bottom_limit = W.y2; 156 | } 157 | } 158 | } 159 | switch (W.x2 - W.x1) 160 | { 161 | case 0: 162 | { 163 | if (W.x2 > right_limit) 164 | right_limit = W.x2; 165 | else 166 | { 167 | if (W.x2 < left_limit) 168 | left_limit = W.x2; 169 | } 170 | } 171 | default: 172 | { 173 | if (W.x2 > W.x1) 174 | { 175 | if (W.x2 > right_limit) 176 | right_limit = W.x2; 177 | if (W.x1 < left_limit) 178 | left_limit = W.x1; 179 | } 180 | else 181 | { 182 | if (W.x1 > right_limit) 183 | right_limit = W.x1; 184 | if (W.x2 < left_limit) 185 | left_limit = W.x2; 186 | } 187 | } 188 | } 189 | } 190 | } 191 | // B.wires(A) 192 | // { 193 | // if (A.layer == 20) 194 | // { 195 | // check_x_points(A.x1, A.y1); 196 | // check_y_points(A.y1, A.x1); 197 | // } 198 | // } 199 | B.wires(W) 200 | { 201 | if (W.layer == 20) 202 | { 203 | if(!(W.arc)) 204 | { 205 | check_y_points(W.y2, W.x2); 206 | check_y_points(W.y1, W.x1); 207 | check_x_points(W.x2, W.y2); 208 | check_x_points(W.x1, W.y1); 209 | } 210 | } 211 | } 212 | B.holes(H) 213 | { 214 | check_x_points(H.x, H.y); 215 | check_y_points(H.y, H.x); 216 | } 217 | B.elements(E) 218 | { 219 | E.package.contacts(C) 220 | { 221 | if(C.pad) 222 | { 223 | check_x_points(C.pad.x, C.pad.y); 224 | check_y_points(C.pad.y, C.pad.x); 225 | } 226 | } 227 | } 228 | // 229 | // Adding X dimensions 230 | // 231 | for (i = 0; i <= count_x_points; ++i) 232 | { 233 | if (x_points[i] == 0) 234 | { 235 | printf("Circle 0 (%.2f) (%.2f);\n", (u2mil(top_limit) + right_top_datum_location), (u2mil(top_limit) + right_top_datum_location + (datum_dot_diameter /2))); 236 | printf("Circle 0 (%.2f) (%.2f);\n", (u2mil(bottom_limit) - left_bottom_datum_location), (u2mil(bottom_limit) - left_bottom_datum_location - (datum_dot_diameter /2))); 237 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", datum_wire_width, u2mil(x_points[i]), (u2mil(top_limit) + extender_clearance), u2mil(x_points[i]), (u2mil(top_limit) + right_top_extender_length)); 238 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", datum_wire_width, u2mil(x_points[i]), (u2mil(bottom_limit) - extender_clearance), u2mil(x_points[i]), (u2mil(bottom_limit) - left_bottom_extender_length)); 239 | printf("Text '%.0f' R90 (%.2f %.2f);\n", abs(u2mil(x_points[i])), u2mil(x_points[i]), (u2mil(top_limit) + text_offset)); 240 | printf("Text '%.0f' R90 (%.2f %.2f);\n", abs(u2mil(x_points[i])), u2mil(x_points[i]), (u2mil(bottom_limit) - text_offset - 0.3)); 241 | 242 | } 243 | if (x_points_loc[i] == "top") 244 | { 245 | if (x_points[i] > higher_top) 246 | higher_top = x_points[i]; 247 | if (x_points[i] < lower_top) 248 | lower_top = x_points[i]; 249 | printf("Text '%.0f' R90 (%.2f %.2f);\n", abs(u2mil(x_points[i])), u2mil(x_points[i]), (u2mil(top_limit) + text_offset)); 250 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, u2mil(x_points[i]), (u2mil(top_limit) + extender_clearance), u2mil(x_points[i]), (u2mil(top_limit) + right_top_extender_length)); 251 | } 252 | else 253 | { 254 | if (x_points[i] > higher_bottom) 255 | higher_bottom = x_points[i]; 256 | if (x_points[i] < lower_bottom) 257 | lower_bottom = x_points[i]; 258 | printf("Text '%.0f' R90 (%f %f);\n", abs(u2mil(x_points[i])), u2mil(x_points[i]), (u2mil(bottom_limit) - text_offset - 0.3)); 259 | printf("Wire %f (%f %f) (%f %f);\n", default_wire_width, u2mil(x_points[i]), (u2mil(bottom_limit) - extender_clearance), u2mil(x_points[i]), (u2mil(bottom_limit) - left_bottom_extender_length)); 260 | } 261 | } 262 | // Join all X dimensions 263 | if (lower_top != higher_top) 264 | printf("Wire %f (%f %f) (%f %f);\n", default_wire_width, u2mil(lower_top), (u2mil(top_limit) + right_top_datum_location), u2mil(higher_top), (u2mil(top_limit) + right_top_datum_location)); 265 | if (lower_bottom != higher_bottom) 266 | printf("Wire %f (%f %f) (%f %f);\n", default_wire_width, u2mil(lower_bottom), (u2mil(bottom_limit) - left_bottom_datum_location), u2mil(higher_bottom), (u2mil(bottom_limit) - left_bottom_datum_location)); 267 | 268 | // 269 | // Adding Y dimensions 270 | // 271 | for (i = 0; i <= count_y_points; ++i) 272 | { 273 | if (y_points[i] == 0) 274 | { 275 | printf("Circle 0 (%f 0) (%f 0);\n", (u2mil(right_limit) + right_top_datum_location), (u2mil(right_limit) + right_top_datum_location + (datum_dot_diameter /2))); 276 | printf("Circle 0 (%f 0) (%f 0);\n", (u2mil(left_limit) - left_bottom_datum_location), (u2mil(left_limit) - left_bottom_datum_location - (datum_dot_diameter /2))); 277 | printf("Wire %f (%f %f) (%f %f);\n", datum_wire_width, (u2mil(right_limit) + extender_clearance), u2mil(y_points[i]), (u2mil(right_limit) + right_top_extender_length), u2mil(y_points[i])); 278 | printf("Wire %f (%f %f) (%f %f);\n", datum_wire_width, (u2mil(left_limit) - extender_clearance), u2mil(y_points[i]), (u2mil(left_limit) - left_bottom_extender_length), u2mil(y_points[i])); 279 | printf("Text '%.0f' R0 (%f %f);\n", abs(u2mil(y_points[i])), (u2mil(right_limit) + text_offset), u2mil(y_points[i])); 280 | printf("Text '%.0f' R0 (%f %f);\n", abs(u2mil(y_points[i])), (u2mil(left_limit) - text_offset - 0.3), u2mil(y_points[i])); 281 | } 282 | if (y_points_loc[i] == "right") 283 | { 284 | if (y_points[i] > higher_right) 285 | higher_right = y_points[i]; 286 | if (y_points[i] < lower_right) 287 | lower_right = y_points[i]; 288 | printf("Text '%.0f' R0 (%f %f);\n", abs(u2mil(y_points[i])), (u2mil(right_limit) + text_offset), u2mil(y_points[i])); 289 | printf("Wire %f (%f %f) (%f %f);\n", default_wire_width, (u2mil(right_limit) + extender_clearance), u2mil(y_points[i]), (u2mil(right_limit) + right_top_extender_length), u2mil(y_points[i])); 290 | } 291 | else 292 | { 293 | if (y_points[i] > higher_left) 294 | higher_left = y_points[i]; 295 | if (y_points[i] < lower_left) 296 | lower_left = y_points[i]; 297 | printf("Text '%.0f' R0 (%f %f);\n", abs(u2mil(y_points[i])), (u2mil(left_limit) - text_offset - 0.3), u2mil(y_points[i])); 298 | printf("Wire %f (%f %f) (%f %f);\n", default_wire_width, (u2mil(left_limit) - extender_clearance), u2mil(y_points[i]), (u2mil(left_limit) - left_bottom_extender_length), u2mil(y_points[i])); 299 | } 300 | } 301 | // Join all Y dimensions 302 | if (lower_right != higher_right) 303 | printf("Wire %f (%f %f) (%f %f);\n", default_wire_width, (u2mil(right_limit) + right_top_datum_location), u2mil(lower_right), (u2mil(right_limit) + right_top_datum_location), u2mil(higher_right)); 304 | if (lower_left != higher_left) 305 | printf("Wire %f (%f %f) (%f %f);\n", default_wire_width, (u2mil(left_limit) - left_bottom_datum_location), u2mil(lower_left), (u2mil(left_limit) - left_bottom_datum_location), u2mil(higher_left)); 306 | } 307 | printf("Text 'All Dimensions in mil' R0 (%f %f);\n",u2mil(right_limit),u2mil(top_limit)); 308 | printf("Text 'Spark Fun Electronics' R0 (%f %f);\n",u2mil(right_limit),u2mil(top_limit)-2); 309 | printf("Grid Last;\n"); 310 | printf("Window Fit;\n"); 311 | } 312 | -------------------------------------------------------------------------------- /ulp/autodim_in.ulp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************** 2 | * * 3 | * AutoDimensionning of Board in mm (Version 3.0) for EAGLE 4.X only! * 4 | * * 5 | * ORIGINAL Filename: adimv2_0mm.ulp * 6 | * Written by: Michel Dagenais * 7 | * Date: September 12th 1998 * 8 | * Modified: Brain Technology (www.braintechnology.de) (* Nov 1999 *) * 9 | * Now places text on appropriate side (closer to object beeing dimensionned). * 10 | * * 11 | * Filename: adimv3_0mm.ulp * 12 | * Edited by: Jeff Moore * 13 | * Date: February 1st 2001 * 14 | * * 15 | * This ULP program will put all the necessary dimensions for holes (layer 45) and * 16 | * board outline (arcs and wires on layer 20) for your board into a .scr file of your * 17 | * choice and into the directory of your choice. * 18 | * Run the resulting script on your board to place the dimentions into the board file. * 19 | * * 20 | * Few requirements: * 21 | * * 22 | * 1. The shape of your board (board outline) is drawn on layer 20 (Dimension). * 23 | * 2. You reserve layer 47 (Measures) to dimension your board. * 24 | * * 25 | * * 26 | * * 27 | ****************************************************************************************/ 28 | 29 | real datum_dot_diameter = 01.27; // diameter of connecting dot on datum line 30 | 31 | real datum_wire_width = 5; // width of datum line 32 | real default_wire_width = 5; // default wire width for dimension extender and leader 33 | real wire_width; 34 | 35 | real extender_clearance = -50; // clearance from closest edge 36 | real text_offset = 100; // distance of dimension text from closest edge 37 | 38 | real right_top_extender_length = text_offset; 39 | real left_bottom_extender_length = text_offset; 40 | 41 | real right_top_datum_location = extender_clearance + (right_top_extender_length); 42 | real left_bottom_datum_location = extender_clearance + (left_bottom_extender_length); 43 | 44 | int right_limit; 45 | int top_limit; 46 | int left_limit; 47 | int bottom_limit; 48 | 49 | int x_points[]; 50 | string x_points_loc[]; // top or bottom 51 | int y_points[]; 52 | string y_points_loc[]; // right or left 53 | string text_location; 54 | string fileName; 55 | 56 | int lower_right; 57 | int higher_right; 58 | int lower_top; 59 | int higher_top; 60 | int lower_left; 61 | int higher_left; 62 | int lower_bottom; 63 | int higher_bottom; 64 | 65 | int count_x_points; 66 | int count_y_points; 67 | 68 | int i; 69 | int j; 70 | 71 | void check_x_points(int point_cxp, int y_point_cxp) 72 | { 73 | for (i = 0; i <= count_x_points; ++i) 74 | { 75 | if (point_cxp == x_points[i]) 76 | break; 77 | } 78 | if (i > count_x_points) 79 | { 80 | x_points[count_x_points] = point_cxp; 81 | int middle = bottom_limit + ((abs(bottom_limit) + abs(top_limit)) * 0.5); 82 | if (y_point_cxp < middle) 83 | text_location = "bottom"; 84 | else 85 | text_location = "top"; 86 | x_points_loc[count_x_points] = text_location; 87 | ++count_x_points; 88 | } 89 | } 90 | 91 | void check_y_points(int point_cxp, int x_point_cxp) 92 | { 93 | for (i = 0; i <= count_y_points; ++i) 94 | { 95 | if (point_cxp == y_points[i]) 96 | break; 97 | } 98 | if (i > count_y_points) 99 | { 100 | y_points[count_y_points] = point_cxp; 101 | int middle = left_limit + ((abs(left_limit) + abs(right_limit)) * 0.5); 102 | if (x_point_cxp < middle) 103 | text_location = "left"; 104 | else 105 | text_location = "right"; 106 | y_points_loc[count_y_points] = text_location; 107 | ++count_y_points; 108 | } 109 | } 110 | 111 | fileName = dlgFileSave("Save Dimensioning File", filesetext("inch",".scr"), "*.scr"); 112 | if (fileName == "") exit(0); 113 | 114 | output(fileName) 115 | { 116 | printf(";\n"); 117 | printf("Grid mil;\n"); 118 | printf("Change Width 50;\n"); 119 | printf("Change Size 40;\n"); 120 | printf("Change Ratio 8;\n"); 121 | printf("Display 20 44 45 47;\n"); 122 | printf("Layer 47;\n"); 123 | board(B) 124 | { 125 | B.wires(W) 126 | { 127 | if (W.layer == 20) 128 | { 129 | switch (W.y2 - W.y1) 130 | { 131 | case 0: 132 | { 133 | if (W.y2 > top_limit) 134 | top_limit = W.y2; 135 | else 136 | { 137 | if (W.y2 < bottom_limit) 138 | bottom_limit = W.y2; 139 | } 140 | } 141 | default: 142 | { 143 | if (W.y2 > W.y1) 144 | { 145 | if (W.y2 > top_limit) 146 | top_limit = W.y2; 147 | if (W.y1 < bottom_limit) 148 | bottom_limit = W.y1; 149 | } 150 | else 151 | { 152 | if (W.y1 > top_limit) 153 | top_limit = W.y1; 154 | if (W.y2 < bottom_limit) 155 | bottom_limit = W.y2; 156 | } 157 | } 158 | } 159 | switch (W.x2 - W.x1) 160 | { 161 | case 0: 162 | { 163 | if (W.x2 > right_limit) 164 | right_limit = W.x2; 165 | else 166 | { 167 | if (W.x2 < left_limit) 168 | left_limit = W.x2; 169 | } 170 | } 171 | default: 172 | { 173 | if (W.x2 > W.x1) 174 | { 175 | if (W.x2 > right_limit) 176 | right_limit = W.x2; 177 | if (W.x1 < left_limit) 178 | left_limit = W.x1; 179 | } 180 | else 181 | { 182 | if (W.x1 > right_limit) 183 | right_limit = W.x1; 184 | if (W.x2 < left_limit) 185 | left_limit = W.x2; 186 | } 187 | } 188 | } 189 | } 190 | } 191 | // B.wires(A) 192 | // { 193 | // if (A.layer == 20) 194 | // { 195 | // check_x_points(A.x1, A.y1); 196 | // check_y_points(A.y1, A.x1); 197 | // } 198 | // } 199 | B.wires(W) 200 | { 201 | if (W.layer == 20) 202 | { 203 | if(!(W.arc)) 204 | { 205 | check_y_points(W.y2, W.x2); 206 | check_y_points(W.y1, W.x1); 207 | check_x_points(W.x2, W.y2); 208 | check_x_points(W.x1, W.y1); 209 | } 210 | } 211 | } 212 | B.holes(H) 213 | { 214 | check_x_points(H.x, H.y); 215 | check_y_points(H.y, H.x); 216 | } 217 | B.elements(E) 218 | { 219 | E.package.contacts(C) 220 | { 221 | if(C.pad) 222 | { 223 | check_x_points(C.pad.x, C.pad.y); 224 | check_y_points(C.pad.y, C.pad.x); 225 | } 226 | } 227 | } 228 | // 229 | // Adding X dimensions 230 | // 231 | for (i = 0; i <= count_x_points; ++i) 232 | { 233 | if (x_points[i] == 0) 234 | { 235 | printf("Circle 0 (0 %.2f) (0 %.2f);\n", (u2mil(top_limit) + right_top_datum_location), (u2mil(top_limit) + right_top_datum_location + (datum_dot_diameter /2))); 236 | printf("Circle 0 (0 %.2f) (0 %.2f);\n", (u2mil(bottom_limit) - left_bottom_datum_location), (u2mil(bottom_limit) - left_bottom_datum_location - (datum_dot_diameter /2))); 237 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", datum_wire_width, u2mil(x_points[i]), (u2mil(top_limit) + extender_clearance), u2mil(x_points[i]), (u2mil(top_limit) + right_top_extender_length)); 238 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", datum_wire_width, u2mil(x_points[i]), (u2mil(bottom_limit) - extender_clearance), u2mil(x_points[i]), (u2mil(bottom_limit) - left_bottom_extender_length)); 239 | printf("Text '%.2f' R90 (%.2f %.2f);\n", abs(u2mil(x_points[i])), u2mil(x_points[i]), (u2mil(top_limit) + text_offset)); 240 | printf("Text '%.2f' R90 (%.2f %.2f);\n", abs(u2mil(x_points[i])), u2mil(x_points[i]), (u2mil(bottom_limit) - text_offset - 0.3)); 241 | 242 | } 243 | if (x_points_loc[i] == "top") 244 | { 245 | if (x_points[i] > higher_top) 246 | higher_top = x_points[i]; 247 | if (x_points[i] < lower_top) 248 | lower_top = x_points[i]; 249 | printf("Text '%.2f' R90 (%.2f %.2f);\n", abs(u2mil(x_points[i])), u2mil(x_points[i]), (u2mil(top_limit) + text_offset)); 250 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, u2mil(x_points[i]), (u2mil(top_limit) + extender_clearance), u2mil(x_points[i]), (u2mil(top_limit) + right_top_extender_length)); 251 | } 252 | else 253 | { 254 | if (x_points[i] > higher_bottom) 255 | higher_bottom = x_points[i]; 256 | if (x_points[i] < lower_bottom) 257 | lower_bottom = x_points[i]; 258 | printf("Text '%.2f' R90 (%.2f %.2f);\n", abs(u2mil(x_points[i])), u2mil(x_points[i]), (u2mil(bottom_limit) - text_offset - 0.3)); 259 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, u2mil(x_points[i]), (u2mil(bottom_limit) - extender_clearance), u2mil(x_points[i]), (u2mil(bottom_limit) - left_bottom_extender_length)); 260 | } 261 | } 262 | // Join all X dimensions 263 | if (lower_top != higher_top) 264 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, u2mil(lower_top), (u2mil(top_limit) + right_top_datum_location), u2mil(higher_top), (u2mil(top_limit) + right_top_datum_location)); 265 | if (lower_bottom != higher_bottom) 266 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, u2mil(lower_bottom), (u2mil(bottom_limit) - left_bottom_datum_location), u2mil(higher_bottom), (u2mil(bottom_limit) - left_bottom_datum_location)); 267 | 268 | // 269 | // Adding Y dimensions 270 | // 271 | for (i = 0; i <= count_y_points; ++i) 272 | { 273 | if (y_points[i] == 0) 274 | { 275 | printf("Circle 0 (%.2f 0) (%.2f 0);\n", (u2mil(right_limit) + right_top_datum_location), (u2mil(right_limit) + right_top_datum_location + (datum_dot_diameter /2))); 276 | printf("Circle 0 (%.2f 0) (%.2f 0);\n", (u2mil(left_limit) - left_bottom_datum_location), (u2mil(left_limit) - left_bottom_datum_location - (datum_dot_diameter /2))); 277 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", datum_wire_width, (u2mil(right_limit) + extender_clearance), u2mil(y_points[i]), (u2mil(right_limit) + right_top_extender_length), u2mil(y_points[i])); 278 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", datum_wire_width, (u2mil(left_limit) - extender_clearance), u2mil(y_points[i]), (u2mil(left_limit) - left_bottom_extender_length), u2mil(y_points[i])); 279 | printf("Text '%.2f' R0 (%.2f %.2f);\n", abs(u2mil(y_points[i])), (u2mil(right_limit) + text_offset), u2mil(y_points[i])); 280 | printf("Text '%.2f' R0 (%.2f %.2f);\n", abs(u2mil(y_points[i])), (u2mil(left_limit) - text_offset - 0.3), u2mil(y_points[i])); 281 | } 282 | if (y_points_loc[i] == "right") 283 | { 284 | if (y_points[i] > higher_right) 285 | higher_right = y_points[i]; 286 | if (y_points[i] < lower_right) 287 | lower_right = y_points[i]; 288 | printf("Text '%.2f' R0 (%.2f %.2f);\n", abs(u2mil(y_points[i])), (u2mil(right_limit) + text_offset), u2mil(y_points[i])); 289 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, (u2mil(right_limit) + extender_clearance), u2mil(y_points[i]), (u2mil(right_limit) + right_top_extender_length), u2mil(y_points[i])); 290 | } 291 | else 292 | { 293 | if (y_points[i] > higher_left) 294 | higher_left = y_points[i]; 295 | if (y_points[i] < lower_left) 296 | lower_left = y_points[i]; 297 | printf("Text '%.2f' R0 (%.2f %.2f);\n", abs(u2mil(y_points[i])), (u2mil(left_limit) - text_offset - 0.3), u2mil(y_points[i])); 298 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, (u2mil(left_limit) - extender_clearance), u2mil(y_points[i]), (u2mil(left_limit) - left_bottom_extender_length), u2mil(y_points[i])); 299 | } 300 | } 301 | // Join all Y dimensions 302 | if (lower_right != higher_right) 303 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, (u2mil(right_limit) + right_top_datum_location), u2mil(lower_right), (u2mil(right_limit) + right_top_datum_location), u2mil(higher_right)); 304 | if (lower_left != higher_left) 305 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, (u2mil(left_limit) - left_bottom_datum_location), u2mil(lower_left), (u2mil(left_limit) - left_bottom_datum_location), u2mil(higher_left)); 306 | } 307 | printf("Text 'All Dimensions in mil' R0 (0 -100);\n"); 308 | printf("Text 'Spark Fun Electronics' R0 (0 -200);\n"); 309 | printf("Grid Last;\n"); 310 | printf("Window Fit;\n"); 311 | } 312 | -------------------------------------------------------------------------------- /ulp/adimv4_0mm.ulp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************** 2 | * * 3 | * AutoDimensionning of Board in mm (Version 3.0) for EAGLE 4.X only! * 4 | * * 5 | * ORIGINAL Filename: adimv2_0mm.ulp * 6 | * Written by: Michel Dagenais * 7 | * Date: September 12th 1998 * 8 | * Modified: Brain Technology (www.braintechnology.de) (* Nov 1999 *) * 9 | * Now places text on appropriate side (closer to object beeing dimensionned). * 10 | * * 11 | * Filename: adimv3_0mm.ulp * 12 | * Edited by: Jeff Moore * 13 | * Date: February 1st 2001 * 14 | * * 15 | * This ULP program will put all the necessary dimensions for holes (layer 45) and * 16 | * board outline (arcs and wires on layer 20) for your board into a .scr file of your * 17 | * choice and into the directory of your choice. * 18 | * Run the resulting script on your board to place the dimentions into the board file. * 19 | * * 20 | * Few requirements: * 21 | * * 22 | * 1. The shape of your board (board outline) is drawn on layer 20 (Dimension). * 23 | * 2. You reserve layer 47 (Measures) to dimension your board. * 24 | * * 25 | * * 26 | * * 27 | ****************************************************************************************/ 28 | 29 | real datum_dot_diameter = 01.27; // diameter of connecting dot on datum line 30 | 31 | real datum_wire_width = 0.50; // width or datum line 32 | real default_wire_width = 0.20; // default wire width for dimension extender and leader 33 | real wire_width; 34 | 35 | real extender_clearance = 1.27; // clearance from closest edge 36 | real text_offset = 12.7; // distance of dimension text from closest edge 37 | 38 | real right_top_extender_length = text_offset * 2.28; 39 | real left_bottom_extender_length = text_offset * 2.28; 40 | 41 | real right_top_datum_location = extender_clearance + (right_top_extender_length * 0.75); 42 | real left_bottom_datum_location = extender_clearance + (left_bottom_extender_length * 0.75); 43 | 44 | int right_limit; 45 | int top_limit; 46 | int left_limit; 47 | int bottom_limit; 48 | 49 | int x_points[]; 50 | string x_points_loc[]; // top or bottom 51 | int y_points[]; 52 | string y_points_loc[]; // right or left 53 | string text_location; 54 | string fileName; 55 | 56 | int lower_right; 57 | int higher_right; 58 | int lower_top; 59 | int higher_top; 60 | int lower_left; 61 | int higher_left; 62 | int lower_bottom; 63 | int higher_bottom; 64 | 65 | int count_x_points; 66 | int count_y_points; 67 | 68 | int i; 69 | int j; 70 | 71 | void check_x_points(int point_cxp, int y_point_cxp) 72 | { 73 | for (i = 0; i <= count_x_points; ++i) 74 | { 75 | if (point_cxp == x_points[i]) 76 | break; 77 | } 78 | if (i > count_x_points) 79 | { 80 | x_points[count_x_points] = point_cxp; 81 | int middle = bottom_limit + ((abs(bottom_limit) + abs(top_limit)) * 0.5); 82 | if (y_point_cxp < middle) 83 | text_location = "bottom"; 84 | else 85 | text_location = "top"; 86 | x_points_loc[count_x_points] = text_location; 87 | ++count_x_points; 88 | } 89 | } 90 | 91 | void check_y_points(int point_cxp, int x_point_cxp) 92 | { 93 | for (i = 0; i <= count_y_points; ++i) 94 | { 95 | if (point_cxp == y_points[i]) 96 | break; 97 | } 98 | if (i > count_y_points) 99 | { 100 | y_points[count_y_points] = point_cxp; 101 | int middle = left_limit + ((abs(left_limit) + abs(right_limit)) * 0.5); 102 | if (x_point_cxp < middle) 103 | text_location = "left"; 104 | else 105 | text_location = "right"; 106 | y_points_loc[count_y_points] = text_location; 107 | ++count_y_points; 108 | } 109 | } 110 | 111 | fileName = dlgFileSave("Save Dimensioning File", filesetext("millimeters",".scr"), "*.scr"); 112 | if (fileName == "") exit(0); 113 | 114 | output(fileName) 115 | { 116 | printf(";\n"); 117 | printf("Grid mm;\n"); 118 | printf("Change Width 2.0;\n"); 119 | printf("Change Size 1.77;\n"); 120 | printf("Change Ratio 8;\n"); 121 | printf("Display 20 44 45 47;\n"); 122 | printf("Layer 47;\n"); 123 | board(B) 124 | { 125 | B.wires(W) 126 | { 127 | if (W.layer == 20) 128 | { 129 | switch (W.y2 - W.y1) 130 | { 131 | case 0: 132 | { 133 | if (W.y2 > top_limit) 134 | top_limit = W.y2; 135 | else 136 | { 137 | if (W.y2 < bottom_limit) 138 | bottom_limit = W.y2; 139 | } 140 | } 141 | default: 142 | { 143 | if (W.y2 > W.y1) 144 | { 145 | if (W.y2 > top_limit) 146 | top_limit = W.y2; 147 | if (W.y1 < bottom_limit) 148 | bottom_limit = W.y1; 149 | } 150 | else 151 | { 152 | if (W.y1 > top_limit) 153 | top_limit = W.y1; 154 | if (W.y2 < bottom_limit) 155 | bottom_limit = W.y2; 156 | } 157 | } 158 | } 159 | switch (W.x2 - W.x1) 160 | { 161 | case 0: 162 | { 163 | if (W.x2 > right_limit) 164 | right_limit = W.x2; 165 | else 166 | { 167 | if (W.x2 < left_limit) 168 | left_limit = W.x2; 169 | } 170 | } 171 | default: 172 | { 173 | if (W.x2 > W.x1) 174 | { 175 | if (W.x2 > right_limit) 176 | right_limit = W.x2; 177 | if (W.x1 < left_limit) 178 | left_limit = W.x1; 179 | } 180 | else 181 | { 182 | if (W.x1 > right_limit) 183 | right_limit = W.x1; 184 | if (W.x2 < left_limit) 185 | left_limit = W.x2; 186 | } 187 | } 188 | } 189 | } 190 | } 191 | // B.wires(A) 192 | // { 193 | // if (A.layer == 20) 194 | // { 195 | // check_x_points(A.x1, A.y1); 196 | // check_y_points(A.y1, A.x1); 197 | // } 198 | // } 199 | B.wires(W) 200 | { 201 | if (W.layer == 20) 202 | { 203 | if(!(W.arc)) 204 | { 205 | check_y_points(W.y2, W.x2); 206 | check_y_points(W.y1, W.x1); 207 | check_x_points(W.x2, W.y2); 208 | check_x_points(W.x1, W.y1); 209 | } 210 | } 211 | } 212 | B.holes(H) 213 | { 214 | check_x_points(H.x, H.y); 215 | check_y_points(H.y, H.x); 216 | } 217 | B.elements(E) 218 | { 219 | E.package.contacts(C) 220 | { 221 | if(C.pad) 222 | { 223 | check_x_points(C.pad.x, C.pad.y); 224 | check_y_points(C.pad.y, C.pad.x); 225 | } 226 | } 227 | } 228 | // 229 | // Adding X dimensions 230 | // 231 | for (i = 0; i <= count_x_points; ++i) 232 | { 233 | if (x_points[i] == 0) 234 | { 235 | printf("Circle 0 (0 %.2f) (0 %.2f);\n", (u2mm(top_limit) + right_top_datum_location), (u2mm(top_limit) + right_top_datum_location + (datum_dot_diameter /2))); 236 | printf("Circle 0 (0 %.2f) (0 %.2f);\n", (u2mm(bottom_limit) - left_bottom_datum_location), (u2mm(bottom_limit) - left_bottom_datum_location - (datum_dot_diameter /2))); 237 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", datum_wire_width, u2mm(x_points[i]), (u2mm(top_limit) + extender_clearance), u2mm(x_points[i]), (u2mm(top_limit) + right_top_extender_length)); 238 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", datum_wire_width, u2mm(x_points[i]), (u2mm(bottom_limit) - extender_clearance), u2mm(x_points[i]), (u2mm(bottom_limit) - left_bottom_extender_length)); 239 | printf("Text '%.2f' R90 (%.2f %.2f);\n", abs(u2mm(x_points[i])), u2mm(x_points[i]), (u2mm(top_limit) + text_offset)); 240 | printf("Text '%.2f' R90 (%.2f %.2f);\n", abs(u2mm(x_points[i])), u2mm(x_points[i]), (u2mm(bottom_limit) - text_offset - 0.3)); 241 | 242 | } 243 | if (x_points_loc[i] == "top") 244 | { 245 | if (x_points[i] > higher_top) 246 | higher_top = x_points[i]; 247 | if (x_points[i] < lower_top) 248 | lower_top = x_points[i]; 249 | printf("Text '%.2f' R90 (%.2f %.2f);\n", abs(u2mm(x_points[i])), u2mm(x_points[i]), (u2mm(top_limit) + text_offset)); 250 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, u2mm(x_points[i]), (u2mm(top_limit) + extender_clearance), u2mm(x_points[i]), (u2mm(top_limit) + right_top_extender_length)); 251 | } 252 | else 253 | { 254 | if (x_points[i] > higher_bottom) 255 | higher_bottom = x_points[i]; 256 | if (x_points[i] < lower_bottom) 257 | lower_bottom = x_points[i]; 258 | printf("Text '%.2f' R90 (%.2f %.2f);\n", abs(u2mm(x_points[i])), u2mm(x_points[i]), (u2mm(bottom_limit) - text_offset - 0.3)); 259 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, u2mm(x_points[i]), (u2mm(bottom_limit) - extender_clearance), u2mm(x_points[i]), (u2mm(bottom_limit) - left_bottom_extender_length)); 260 | } 261 | } 262 | // Join all X dimensions 263 | if (lower_top != higher_top) 264 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, u2mm(lower_top), (u2mm(top_limit) + right_top_datum_location), u2mm(higher_top), (u2mm(top_limit) + right_top_datum_location)); 265 | if (lower_bottom != higher_bottom) 266 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, u2mm(lower_bottom), (u2mm(bottom_limit) - left_bottom_datum_location), u2mm(higher_bottom), (u2mm(bottom_limit) - left_bottom_datum_location)); 267 | 268 | // 269 | // Adding Y dimensions 270 | // 271 | for (i = 0; i <= count_y_points; ++i) 272 | { 273 | if (y_points[i] == 0) 274 | { 275 | printf("Circle 0 (%.2f 0) (%.2f 0);\n", (u2mm(right_limit) + right_top_datum_location), (u2mm(right_limit) + right_top_datum_location + (datum_dot_diameter /2))); 276 | printf("Circle 0 (%.2f 0) (%.2f 0);\n", (u2mm(left_limit) - left_bottom_datum_location), (u2mm(left_limit) - left_bottom_datum_location - (datum_dot_diameter /2))); 277 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", datum_wire_width, (u2mm(right_limit) + extender_clearance), u2mm(y_points[i]), (u2mm(right_limit) + right_top_extender_length), u2mm(y_points[i])); 278 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", datum_wire_width, (u2mm(left_limit) - extender_clearance), u2mm(y_points[i]), (u2mm(left_limit) - left_bottom_extender_length), u2mm(y_points[i])); 279 | printf("Text '%.2f' R0 (%.2f %.2f);\n", abs(u2mm(y_points[i])), (u2mm(right_limit) + text_offset), u2mm(y_points[i])); 280 | printf("Text '%.2f' R0 (%.2f %.2f);\n", abs(u2mm(y_points[i])), (u2mm(left_limit) - text_offset - 0.3), u2mm(y_points[i])); 281 | } 282 | if (y_points_loc[i] == "right") 283 | { 284 | if (y_points[i] > higher_right) 285 | higher_right = y_points[i]; 286 | if (y_points[i] < lower_right) 287 | lower_right = y_points[i]; 288 | printf("Text '%.2f' R0 (%.2f %.2f);\n", abs(u2mm(y_points[i])), (u2mm(right_limit) + text_offset), u2mm(y_points[i])); 289 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, (u2mm(right_limit) + extender_clearance), u2mm(y_points[i]), (u2mm(right_limit) + right_top_extender_length), u2mm(y_points[i])); 290 | } 291 | else 292 | { 293 | if (y_points[i] > higher_left) 294 | higher_left = y_points[i]; 295 | if (y_points[i] < lower_left) 296 | lower_left = y_points[i]; 297 | printf("Text '%.2f' R0 (%.2f %.2f);\n", abs(u2mm(y_points[i])), (u2mm(left_limit) - text_offset - 0.3), u2mm(y_points[i])); 298 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, (u2mm(left_limit) - extender_clearance), u2mm(y_points[i]), (u2mm(left_limit) - left_bottom_extender_length), u2mm(y_points[i])); 299 | } 300 | } 301 | // Join all Y dimensions 302 | if (lower_right != higher_right) 303 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, (u2mm(right_limit) + right_top_datum_location), u2mm(lower_right), (u2mm(right_limit) + right_top_datum_location), u2mm(higher_right)); 304 | if (lower_left != higher_left) 305 | printf("Wire %.2f (%.2f %.2f) (%.2f %.2f);\n", default_wire_width, (u2mm(left_limit) - left_bottom_datum_location), u2mm(lower_left), (u2mm(left_limit) - left_bottom_datum_location), u2mm(higher_left)); 306 | } 307 | printf("Text 'All Dimensions in MM' R0 (%.2f %.2f);\n",u2mm(right_limit),u2mm(top_limit)); 308 | printf("Text 'Spark Fun Electronics' R0 (%.2f %.2f);\n",u2mm(right_limit),u2mm(top_limit)-2); 309 | printf("Grid Last;\n"); 310 | printf("Window Fit;\n"); 311 | } 312 | -------------------------------------------------------------------------------- /ulp/bom.ulp: -------------------------------------------------------------------------------- 1 | #require 6.0200 2 | 3 | // 4 | // Revision: 1.06 5 | // 6 | // Revision history: 7 | // 8 | // 1.00 9 | // - Initial release 10 | // 11 | // 1.01 12 | // - Dialog mask for text or html output selection corrected 13 | // 14 | // 1.02 15 | // - CSV export added after a suggestion of Christian Schlittler 16 | // - File extension for text file output changed from .bom to .txt 17 | // 18 | // 1.03 19 | // - Added missing description column in value mode. 20 | // 21 | // 1.04 22 | // - List also Packages bei Value 23 | // 24 | // 1.05 25 | // - 2012-03-01 change PartValue[], PartDevice[], PartPackage[], PartHeadline[], PartDescription[] to normal string. alf@cadsoft.de 26 | // numeric strings with only numericasl characters, sorts up to 8 characters! 27 | // 28 | // 1.06 29 | // - 2012-05-25 support now populated variants 30 | // switch on/off attributes 31 | // is now the standard bom.ulp alf@cadsoft.de 32 | // 33 | // 1.07 34 | // - 2012-06-22 set correct variant 35 | // 36 | // 1.08 37 | // - 2012-11-08 list different values of attributes 38 | // 39 | // 1.09 40 | // - 2012-12-04 now can change the separator character for CSV files. 41 | // change the character in line Separator = ','; 42 | 43 | string Version = "1.09"; 44 | 45 | char Separator = ';'; // 2012-12-04 46 | 47 | 48 | #usage "en: Export a Bill Of Material\n" 49 | "

" 50 | "Generates a project's Bill Of Material  including the attributes introduced in" 51 | " version 5.0.0." 52 | "

" 53 | "Author: support@cadsoft.de
" 54 | "Modified to use the new attributes by Carsten Wille.
" 55 | ".csv export added by Christian Schlittler." 56 | "Select variant and switch on/off attributes alf@cadsoft.de", 57 | "de: Stückliste exportieren\n" 58 | "

" 59 | "Erzeugt die Stückliste (Bill Of Material) eines Projekts, einschließlich der" 60 | " mit Version 5.0.0 neu eingeführten Attribute." 61 | "

" 62 | "Autor: support@cadsoft.de
" 63 | "Modifiziert von Carsten Wille, um die neuen Attribute zu nutzen.
" 64 | "Export als .csv-Datei durch Christian Schlittler hinzugefügt." 65 | "Auswählen von Bestückungs-Varianten und Attribute können ein/ausgeschaltet werden alf@cadsoft.de" 66 | 67 | // THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED 68 | 69 | string HelpTextEN = 70 | "How to generate the Bill Of Material\n" 71 | "

\n" 72 | "List type\n" 73 | "

\n" 74 | "The Bill Of Material can be generated either as a list\n" 75 | "of parts (where every part is listed on a line of its own),\n" 76 | "or as a list of values, where all parts with the same value are grouped\n" 77 | "together in one line. Use the Parts and Values\n" 78 | "radio buttons to select the list type.\n" 79 | "

\n" 80 | "Output format\n" 81 | "

\n" 82 | "Choose between pure ASCII Text format, CSV or HTML.\n" 83 | ; 84 | 85 | string HelpTextDE = 86 | "Erzeugen der Stückliste\n" 87 | "

\n" 88 | "Listen-Typ\n" 89 | "

\n" 90 | "Die Stückliste kann entweder als Liste der Bauteile generiert werden\n" 91 | "(wobei jedes Bauteil in einer eigenen Zeile aufgeführt wird),\n" 92 | "oder als Liste der Werte, wobei alle Bauteile mit dem gleichen Wert in einer Zeile\n" 93 | "zusammengefasst werden. Mit den Radio-Buttons Bauteile und Werte\n" 94 | "kann zwischen den beiden Listen-Typen gewählt werden.\n" 95 | "

\n" 96 | "Ausgabeformat\n" 97 | "

\n" 98 | "Wählen Sie zwischen reinem ASCII-Text, CSV oder HTML" 99 | "-Format.\n" 100 | ; 101 | 102 | string I18N[] = { 103 | "en\v" 104 | "de\v" 105 | , 106 | "


ERROR: No schematic!

\nThis program can only work in the schematic editor.\v" 107 | "


FEHLER: Kein Schaltplan!

\nDieses Programm kann nur in einem Schaltplan verwendet" 108 | " werden.\v" 109 | , 110 | "Part\tValue\tDevice\tPackage\tDescription\v" 111 | "Bauteil\tWert\tDevice\tPackage\tDescription\v" 112 | , 113 | "Qty\tValue\tDevice\tPackage\tParts\v" // 2011-04-08 114 | "Menge\tWert\tDevice\tGehäuse\tBauteile\v" // 2011-04-08 115 | , 116 | "Partlist exported from %s at %s\v" 117 | "Stückliste exportiert aus %s am %s\v" 118 | , 119 | "Bill Of Material - Preview\v" 120 | "Stückliste - Vorschau\v" 121 | , 122 | "-Close\v" 123 | "-Schließen\v" 124 | , 125 | "Save Bill Of Material\v" 126 | "Stückliste speichern\v" 127 | , 128 | "File '\v" 129 | "Datei '\v" 130 | , 131 | "' exists\n\nOverwrite?\v" 132 | "' existiert\n\nÜberschreiben?\v" 133 | , 134 | "+&Yes\v" 135 | "+&Ja\v" 136 | , 137 | "-&No\v" 138 | "-&Nein\v" 139 | , 140 | "&No\v" 141 | "&Nein\v" 142 | , 143 | "Name already defined!\v" 144 | "Name ist bereits definiert!\v" 145 | , 146 | " Header\v" 147 | " Spaltenüberschrift\v" 148 | , 149 | "&Name:\v" 150 | "&Name:\v" 151 | , 152 | "+OK\v" 153 | "+OK\v" 154 | , 155 | "Name can't be empty!\v" 156 | "Name kann nicht leer sein!\v" 157 | , 158 | "-Cancel\v" 159 | "-Abbrechen\v" 160 | , 161 | "&Headers\v" 162 | "&Spaltenüberschriften\v" 163 | , 164 | "Bill Of Material - Help\v" 165 | "Stückliste - Hilfe\v" 166 | , 167 | "Bill Of Material\v" 168 | "Stückliste\v" 169 | , 170 | "List type\v" 171 | "Listen-Typ\v" 172 | , 173 | "&Parts\v" 174 | "&Bauteile\v" 175 | , 176 | "&Values\v" 177 | "&Werte\v" 178 | , 179 | "Output format\v" 180 | "Ausgabeformat\v" 181 | , 182 | "&Text\v" 183 | "&Text\v" 184 | , 185 | "&CSV\v" 186 | "&CSV\v" 187 | , 188 | "&HTML\v" 189 | "&HTML\v" 190 | , 191 | "+Vie&w\v" 192 | "+&Vorschau\v" 193 | , 194 | "&Save...\v" 195 | "&Speichern...\v" 196 | , 197 | "H&elp\v" 198 | "H&ilfe\v" 199 | , 200 | "Current &variant \v" 201 | "Aktuelle &Variante \v" 202 | , 203 | "List &attributes\v" 204 | "&Attribute auflisten\v" 205 | }; 206 | int Language = strstr (I18N [0], language ()) / 3; 207 | 208 | 209 | string tr (string s) 210 | { 211 | string t = lookup (I18N, s, Language, '\v'); 212 | return t ? t : s; 213 | } 214 | 215 | 216 | if (!schematic) 217 | { 218 | dlgMessageBox (usage + tr ("


ERROR: No schematic!

\nThis program can only work in" 219 | " the schematic editor.")); 220 | exit (1); 221 | } 222 | 223 | string SeparatorString; 224 | int NumParts; 225 | numeric string Lines[]; 226 | numeric string PartName[]; 227 | string PartValue[], PartDevice[], PartPackage[], PartHeadline[]; 228 | numeric string PartDescription []; 229 | int PartValueOn[]; 230 | int Selected; 231 | 232 | string CurrentVariant = ""; 233 | string Variants[] = { "" }; // 2012-04-16 234 | int cntVD = 0; 235 | int VDsel = 0; 236 | 237 | 238 | // cwi: Added arrays for an arbitraty number of attributes. 239 | int UseAttributes = 1; 240 | int FoundAttributes = 0; // # of different attribute names found in schematic. 241 | numeric string AttributesList[]; // Sorted list of all attributes found in the schematic. 242 | numeric string PartAttributes[]; // Adjusted list of attributes per part. 243 | 244 | enum { ltParts, ltValues }; // List Types 245 | enum { ofText, ofCSV, ofHTML }; // Output Formats 246 | int ListType = 0; 247 | int OutputFormat = 0; 248 | 249 | 250 | string StripWhiteSpace (string s) 251 | { 252 | while (s && isspace (s[0])) 253 | s = strsub (s, 1); 254 | while (s && isspace (s[strlen (s) - 1])) 255 | s = strsub (s, 0, strlen (s) - 1); 256 | return s; 257 | } 258 | 259 | 260 | // Collect part data from the schematic. 261 | // 262 | // Arguments: - 263 | // 264 | // Returns: NumParts - # of found parts 265 | // ParteName[] 266 | // PartValue[] 267 | // PartDevice[] 268 | // PartPackage[] 269 | // PartHeadline[] 270 | // PartDescription [] 271 | // PartValueOn[] - 0=part value off, 1= part value on, 2=override with attr. VAL 272 | // FoundAttributes - # of different attribute names found in schematic. 273 | // AttributesList[] - Sorted list of all attributes found in the schematic. 274 | // PartAttributes[] - Adjusted list of attributes per part. 275 | 276 | void CollectPartData (string var) 277 | { 278 | int Found = 0; 279 | int i; 280 | string attr[]; 281 | 282 | NumParts = 0; 283 | 284 | // First, collect the names of all available attributes. 285 | FoundAttributes = 0; 286 | if (UseAttributes) { 287 | schematic (SCH) 288 | { 289 | SCH.parts (P) 290 | { 291 | if (P.device.package) 292 | { 293 | if (P.populate) 294 | { 295 | P.attributes (A) 296 | { 297 | if (0 == FoundAttributes) 298 | { 299 | // First one 300 | AttributesList[0] = A.name; 301 | FoundAttributes = 1; 302 | } 303 | else 304 | { 305 | Found = 0; 306 | for (i = 0; i < FoundAttributes; i ++) 307 | { 308 | if (A.name == AttributesList[i]) 309 | { 310 | // Found an already listed atrribute 311 | Found = 1; 312 | break; 313 | } 314 | } 315 | if (0 == Found) 316 | { 317 | // Attribute not listed, add at the end. 318 | AttributesList[FoundAttributes] = A.name; 319 | FoundAttributes ++; 320 | } 321 | } 322 | } 323 | } 324 | } 325 | } 326 | } 327 | sort (FoundAttributes, AttributesList); 328 | } 329 | // Second, collect all data 330 | schematic (SCH) 331 | { 332 | SCH.parts (P) 333 | { 334 | if (P.device.package) 335 | { 336 | if (P.populate) 337 | { 338 | PartName[NumParts] = P.name; 339 | PartValue[NumParts] = P.value; 340 | PartDevice[NumParts] = P.device.name; 341 | PartPackage[NumParts] = P.device.package.name; 342 | PartHeadline[NumParts] = P.device.headline; 343 | if(strlen(PartHeadline[NumParts]) > 20) PartHeadline[NumParts][20] = 0; 344 | PartDescription [NumParts] = P.device.description; 345 | PartValueOn[NumParts] = P.device.value == "On"; 346 | // Zero all strings 347 | for (i = 0; i < FoundAttributes; i ++) 348 | attr[i] = ""; 349 | P.attributes(A) 350 | { 351 | for (i = 0; i < FoundAttributes; i ++) 352 | if (A.name == AttributesList[i]) 353 | { 354 | attr[i] = A.value; 355 | break; 356 | } 357 | if ("VALUE" == A.name && 0 < strlen (A.value)) 358 | // Override old fashioned value information! 359 | PartValueOn[NumParts] = 2; 360 | } 361 | PartAttributes[NumParts] = strjoin(attr, Separator); 362 | NumParts ++; 363 | } 364 | } 365 | } 366 | } 367 | } 368 | 369 | 370 | void GeneratePartList(void) 371 | { 372 | int NumLines = 0; 373 | string attr[], s; 374 | 375 | if (UseAttributes) s = strjoin(AttributesList, '\t'); 376 | Lines[NumLines ++] = tr ("Part\tValue\tDevice\tPackage\tDescription\t") + s; 377 | for (int i = 0; i < NumParts; i ++) 378 | { 379 | strsplit (attr, PartAttributes[i], Separator); 380 | if (UseAttributes) s = strjoin(attr, '\t'); 381 | Lines[NumLines] = PartName[i] + "\t" + PartValue[i] + "\t" + PartDevice[i] + "\t" + 382 | PartPackage[i] + "\t" + PartHeadline[i] + "\t" + s; 383 | NumLines ++; 384 | } 385 | Lines[NumLines] = ""; 386 | } 387 | 388 | 389 | // Generate list with one entry per value. 390 | // 'VALUE' is replaced by the value of attribute 'VAL', if existing. 391 | 392 | void GenerateValueList (void) 393 | { 394 | int NumLines = 0; 395 | int Index []; 396 | string attr[], s, s_val; 397 | 398 | if (UseAttributes) s = strjoin(AttributesList, '\t'); 399 | 400 | // 2010-04-17 cwi: Included description. 401 | Lines[NumLines ++] = tr ("Qty\tValue\tDevice\tPackage\tParts\tDescription\t") + s; // 2011-04-08 402 | sort (NumParts, Index, PartValue, PartDevice, PartPackage, PartAttributes, PartName, PartHeadline); // 2011-11-08 Partattribute jetzt nach Package alf@cadsoft.de 403 | for (int n1 = 0, n2 = 0; ++ n2 <= NumParts; ) 404 | { 405 | int i1 = Index [n1]; 406 | strsplit (attr, PartAttributes[i1], Separator); 407 | if (UseAttributes) s = strjoin(attr, '\t'); 408 | s_val = attr[i1]; 409 | if (n2 < NumParts) 410 | { 411 | int i2 = Index [n2]; // 2012-11-08 412 | strsplit (attr, PartAttributes[i2], Separator); 413 | if (PartValue[i1] == PartValue[i2] && PartDevice[i1] == PartDevice[i2] && PartAttributes[i1] == PartAttributes[i2]) // 2012-11-08 check diffent values of attributes 414 | continue; 415 | } 416 | string Quantity; 417 | sprintf (Quantity, "%d", n2 - n1); 418 | Lines[NumLines] = Quantity + "\t" + PartValue[i1] + "\t" + PartDevice[i1] + "\t" + PartPackage[i1] + "\t"; 419 | for (;;) 420 | { 421 | Lines[NumLines] += PartName[i1]; 422 | if (++n1 < n2) 423 | { 424 | i1 = Index [n1]; 425 | Lines[NumLines] += ", "; 426 | } 427 | else 428 | break; 429 | } 430 | // cwi: add extra information from attributes 431 | // 2010-04-17 cwi: Included description. 432 | Lines[NumLines] += "\t" + PartHeadline[i1] + "\t" + s; 433 | NumLines ++; 434 | } 435 | Lines[NumLines] = ""; 436 | } 437 | 438 | 439 | void GenerateList (void) 440 | { 441 | switch (ListType) 442 | { 443 | case ltParts: GeneratePartList (); break; 444 | case ltValues: GenerateValueList (); break; 445 | } 446 | } 447 | 448 | 449 | string MakeListHeader (void) 450 | { 451 | string s; 452 | schematic(SCH) 453 | sprintf (s, tr ("Partlist exported from %s at %s"), SCH.name, t2string (time ())); 454 | return s; 455 | } 456 | 457 | 458 | string MakeListText(void) 459 | { 460 | int l, Width []; 461 | string List; 462 | int numHeaders; 463 | 464 | for (l = 0; Lines[l]; l ++) 465 | { 466 | string a []; 467 | for (int n = strsplit (a, Lines[l], '\t'); n --; ) 468 | Width [n] = max (Width [n], strlen (a [n])); 469 | } 470 | 471 | List = MakeListHeader () + "\n\n"; 472 | 473 | for (l = 0; Lines[l]; l ++) 474 | { 475 | string line, a []; 476 | 477 | int n = strsplit (a, Lines[l], '\t'); 478 | if (l == 0) 479 | numHeaders = n; 480 | else 481 | n = numHeaders; // for the hidden key! 482 | for (int i = 0; i < n; i ++) 483 | { 484 | string s; 485 | 486 | sprintf (s, "%s%-*s", line ? " " : "", Width [i], a [i]); 487 | line += s; 488 | } 489 | List += line + "\n"; 490 | } 491 | return List; 492 | } 493 | 494 | 495 | // 2008-11-24 Christian Schlittler: 496 | // Make comma-serparated list, with all values double-quoted. 497 | 498 | string MakeListCSV (void) 499 | { 500 | string List; 501 | int numHeaders; 502 | 503 | for (int l = 0; Lines[l]; l ++) 504 | { 505 | string a []; 506 | int n = strsplit (a, Lines[l], '\t'); 507 | if (l == 0) 508 | numHeaders = n; 509 | else 510 | n = numHeaders; // for the hidden key! 511 | for (int i = 0; i < n; i ++) 512 | List += "\"" + a[i] + "\"" + SeparatorString; 513 | List += "\n"; 514 | } 515 | return List; 516 | } 517 | 518 | 519 | string MakeListHTML (void) 520 | { 521 | string List; 522 | int numHeaders; 523 | 524 | List = "" + MakeListHeader() + "\n

\n"; 525 | List += "\n"; 526 | for (int l = 0; Lines[l]; l++) 527 | { 528 | List += ""; 529 | string a []; 530 | int n = strsplit (a, Lines[l], '\t'); 531 | if (l == 0) 532 | numHeaders = n; 533 | else 534 | n = numHeaders; // for the hidden key! 535 | for (int i = 0; i < n; i ++) 536 | { 537 | if (l == 0) 538 | a[i] = "" + a[i] + ""; 539 | List += ""; 540 | } 541 | List += "\n"; 542 | } 543 | List += "
" + a[i] + "
\n"; 544 | return List; 545 | } 546 | 547 | 548 | string MakeList (void) 549 | { 550 | switch (OutputFormat) 551 | { 552 | case ofText: return MakeListText(); break; 553 | case ofCSV: return MakeListCSV(); break; 554 | case ofHTML: return MakeListHTML(); break; 555 | } 556 | return ""; 557 | } 558 | 559 | 560 | void ViewList (void) 561 | { 562 | dlgDialog (tr ("Bill Of Material - Preview")) 563 | { 564 | string s = MakeList (); 565 | if (OutputFormat == ofText || OutputFormat == ofCSV) 566 | s = "

" + s + "
"; 567 | dlgHBoxLayout dlgSpacing (400); 568 | dlgHBoxLayout 569 | { 570 | dlgVBoxLayout dlgSpacing (300); 571 | dlgTextView (s); 572 | } 573 | dlgHBoxLayout 574 | { 575 | dlgStretch (1); 576 | dlgPushButton (tr ("-Close")) dlgReject (); 577 | } 578 | }; 579 | } 580 | 581 | 582 | void SaveList (void) 583 | { 584 | // 2008-11-24 cwi: 585 | // - Added new format extension .csv 586 | // - Changed from .bom to .txt for text format. 587 | string FileName; 588 | string FileExt; 589 | 590 | switch (OutputFormat) 591 | { 592 | case ofText: FileExt = ".txt"; break; 593 | case ofHTML: FileExt = ".html"; break; 594 | case ofCSV: FileExt = ".csv"; break; 595 | } 596 | schematic(SCH) FileName = filesetext (SCH.name, FileExt); 597 | FileName = dlgFileSave (tr ("Save Bill Of Material"), FileName); 598 | if (FileName) 599 | { 600 | string a []; 601 | if (!fileglob (a, FileName) || dlgMessageBox (tr ("File '") + FileName + 602 | tr ("' exists\n\nOverwrite?"), tr("+&Yes"), tr("-&No")) == 0) 603 | { 604 | output (FileName, "wt") 605 | { 606 | printf ("%s", MakeList ()); // using "%s" to avoid problems if list contains any '%' 607 | } 608 | } 609 | } 610 | } 611 | 612 | 613 | void DisplayHelp (void) 614 | { 615 | dlgDialog (tr ("Bill Of Material - Help")) 616 | { 617 | dlgHBoxLayout dlgSpacing (400); 618 | dlgHBoxLayout 619 | { 620 | dlgVBoxLayout dlgSpacing (300); 621 | dlgTextView (language () == "de" ? HelpTextDE : HelpTextEN); 622 | } 623 | dlgHBoxLayout 624 | { 625 | dlgStretch (1); 626 | dlgPushButton (tr ("-Close")) 627 | dlgReject (); 628 | } 629 | }; 630 | } 631 | 632 | 633 | schematic(SCH) { 634 | sprintf(SeparatorString, "%c", Separator); 635 | CurrentVariant = variant(); 636 | SCH.variantdefs(VD) { 637 | if (CurrentVariant == VD.name) VDsel = cntVD; 638 | sprintf(Variants[cntVD], "%s", VD.name); 639 | cntVD++; 640 | } 641 | } 642 | 643 | setvariant(CurrentVariant); 644 | CollectPartData(CurrentVariant); 645 | GenerateList(); 646 | 647 | dlgDialog (tr ("Bill Of Material")) 648 | { 649 | dlgHBoxLayout { 650 | dlgLabel(tr ("Current &variant ")); 651 | dlgComboBox(Variants, VDsel) { 652 | CurrentVariant = Variants[VDsel]; 653 | setvariant(CurrentVariant); 654 | CollectPartData(CurrentVariant); 655 | GenerateList(); 656 | } 657 | dlgStretch(1); 658 | } 659 | dlgListView ("", Lines, Selected); 660 | dlgHBoxLayout 661 | { 662 | dlgGroup(tr ("List type")) 663 | { 664 | dlgRadioButton(tr ("&Parts"), ListType) GeneratePartList (); 665 | dlgRadioButton(tr ("&Values"), ListType) GenerateValueList (); 666 | dlgCheckBox(tr ("List &attributes"), UseAttributes) { 667 | if (!UseAttributes) { 668 | NumParts = 0; 669 | } 670 | CollectPartData(CurrentVariant); 671 | GenerateList(); 672 | } 673 | } 674 | dlgGroup (tr ("Output format")) 675 | { 676 | // 2008-10-09: Entries swapped for correct function. 677 | dlgRadioButton(tr ("&Text"), OutputFormat); 678 | // 2008-11-24 cwi: New format added. 679 | dlgRadioButton(tr ("&CSV"), OutputFormat); 680 | dlgRadioButton(tr ("&HTML"), OutputFormat); 681 | } 682 | dlgStretch(1); 683 | } 684 | dlgHBoxLayout { 685 | dlgPushButton (tr ("+Vie&w")) ViewList (); 686 | dlgPushButton (tr ("&Save...")) SaveList (); 687 | dlgPushButton (tr ("H&elp")) DisplayHelp (); 688 | dlgPushButton (tr ("-Close")) dlgAccept (); 689 | dlgStretch(1); 690 | dlgLabel("Version " + Version); 691 | } 692 | }; 693 | -------------------------------------------------------------------------------- /ulp/bom_sparkle.ulp: -------------------------------------------------------------------------------- 1 | #require 6.0200 2 | 3 | // 4 | // Revision: 1.06 5 | // 6 | // Revision history: 7 | // 8 | // 1.00 9 | // - Initial release 10 | // 11 | // 1.01 12 | // - Dialog mask for text or html output selection corrected 13 | // 14 | // 1.02 15 | // - CSV export added after a suggestion of Christian Schlittler 16 | // - File extension for text file output changed from .bom to .txt 17 | // 18 | // 1.03 19 | // - Added missing description column in value mode. 20 | // 21 | // 1.04 22 | // - List also Packages bei Value 23 | // 24 | // 1.05 25 | // - 2012-03-01 change PartValue[], PartDevice[], PartPackage[], PartHeadline[], PartDescription[] to normal string. alf@cadsoft.de 26 | // numeric strings with only numericasl characters, sorts up to 8 characters! 27 | // 28 | // 1.06 29 | // - 2012-05-25 support now populated variants 30 | // switch on/off attributes 31 | // is now the standard bom.ulp alf@cadsoft.de 32 | // 33 | // 1.07 34 | // - 2012-06-22 set correct variant 35 | // 36 | // 1.08 37 | // - 2012-11-08 list different values of attributes 38 | // 39 | // 1.09 40 | // - 2012-12-04 now can change the separator character for CSV files. 41 | // change the character in line Separator = ','; 42 | 43 | string Version = "1.09"; 44 | 45 | char Separator = ';'; // 2012-12-04 46 | 47 | 48 | #usage "en: Export a Bill Of Material\n" 49 | "

" 50 | "Generates a project's Bill Of Material  including the attributes introduced in" 51 | " version 5.0.0." 52 | "

" 53 | "Author: support@cadsoft.de
" 54 | "Modified to use the new attributes by Carsten Wille.
" 55 | ".csv export added by Christian Schlittler." 56 | "Select variant and switch on/off attributes alf@cadsoft.de", 57 | "de: Stückliste exportieren\n" 58 | "

" 59 | "Erzeugt die Stückliste (Bill Of Material) eines Projekts, einschließlich der" 60 | " mit Version 5.0.0 neu eingeführten Attribute." 61 | "

" 62 | "Autor: support@cadsoft.de
" 63 | "Modifiziert von Carsten Wille, um die neuen Attribute zu nutzen.
" 64 | "Export als .csv-Datei durch Christian Schlittler hinzugefügt." 65 | "Auswählen von Bestückungs-Varianten und Attribute können ein/ausgeschaltet werden alf@cadsoft.de" 66 | 67 | // THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED 68 | 69 | string HelpTextEN = 70 | "How to generate the Bill Of Material\n" 71 | "

\n" 72 | "List type\n" 73 | "

\n" 74 | "The Bill Of Material can be generated either as a list\n" 75 | "of parts (where every part is listed on a line of its own),\n" 76 | "or as a list of values, where all parts with the same value are grouped\n" 77 | "together in one line. Use the Parts and Values\n" 78 | "radio buttons to select the list type.\n" 79 | "

\n" 80 | "Output format\n" 81 | "

\n" 82 | "Choose between pure ASCII Text format, CSV or HTML.\n" 83 | ; 84 | 85 | string HelpTextDE = 86 | "Erzeugen der Stückliste\n" 87 | "

\n" 88 | "Listen-Typ\n" 89 | "

\n" 90 | "Die Stückliste kann entweder als Liste der Bauteile generiert werden\n" 91 | "(wobei jedes Bauteil in einer eigenen Zeile aufgeführt wird),\n" 92 | "oder als Liste der Werte, wobei alle Bauteile mit dem gleichen Wert in einer Zeile\n" 93 | "zusammengefasst werden. Mit den Radio-Buttons Bauteile und Werte\n" 94 | "kann zwischen den beiden Listen-Typen gewählt werden.\n" 95 | "

\n" 96 | "Ausgabeformat\n" 97 | "

\n" 98 | "Wählen Sie zwischen reinem ASCII-Text, CSV oder HTML" 99 | "-Format.\n" 100 | ; 101 | 102 | string I18N[] = { 103 | "en\v" 104 | "de\v" 105 | , 106 | "


ERROR: No schematic!

\nThis program can only work in the schematic editor.\v" 107 | "


FEHLER: Kein Schaltplan!

\nDieses Programm kann nur in einem Schaltplan verwendet" 108 | " werden.\v" 109 | , 110 | "Part\tValue\tDevice\tPackage\tDescription\v" 111 | "Bauteil\tWert\tDevice\tPackage\tDescription\v" 112 | , 113 | "Qty\tValue\tDevice\tPackage\tParts\v" // 2011-04-08 114 | "Menge\tWert\tDevice\tGehäuse\tBauteile\v" // 2011-04-08 115 | , 116 | "Partlist exported from %s at %s\v" 117 | "Stückliste exportiert aus %s am %s\v" 118 | , 119 | "Bill Of Material - Preview\v" 120 | "Stückliste - Vorschau\v" 121 | , 122 | "-Close\v" 123 | "-Schließen\v" 124 | , 125 | "Save Bill Of Material\v" 126 | "Stückliste speichern\v" 127 | , 128 | "File '\v" 129 | "Datei '\v" 130 | , 131 | "' exists\n\nOverwrite?\v" 132 | "' existiert\n\nÜberschreiben?\v" 133 | , 134 | "+&Yes\v" 135 | "+&Ja\v" 136 | , 137 | "-&No\v" 138 | "-&Nein\v" 139 | , 140 | "&No\v" 141 | "&Nein\v" 142 | , 143 | "Name already defined!\v" 144 | "Name ist bereits definiert!\v" 145 | , 146 | " Header\v" 147 | " Spaltenüberschrift\v" 148 | , 149 | "&Name:\v" 150 | "&Name:\v" 151 | , 152 | "+OK\v" 153 | "+OK\v" 154 | , 155 | "Name can't be empty!\v" 156 | "Name kann nicht leer sein!\v" 157 | , 158 | "-Cancel\v" 159 | "-Abbrechen\v" 160 | , 161 | "&Headers\v" 162 | "&Spaltenüberschriften\v" 163 | , 164 | "Bill Of Material - Help\v" 165 | "Stückliste - Hilfe\v" 166 | , 167 | "Bill Of Material\v" 168 | "Stückliste\v" 169 | , 170 | "List type\v" 171 | "Listen-Typ\v" 172 | , 173 | "&Parts\v" 174 | "&Bauteile\v" 175 | , 176 | "&Values\v" 177 | "&Werte\v" 178 | , 179 | "Output format\v" 180 | "Ausgabeformat\v" 181 | , 182 | "&Text\v" 183 | "&Text\v" 184 | , 185 | "&CSV\v" 186 | "&CSV\v" 187 | , 188 | "&HTML\v" 189 | "&HTML\v" 190 | , 191 | "+Vie&w\v" 192 | "+&Vorschau\v" 193 | , 194 | "&Save...\v" 195 | "&Speichern...\v" 196 | , 197 | "H&elp\v" 198 | "H&ilfe\v" 199 | , 200 | "Current &variant \v" 201 | "Aktuelle &Variante \v" 202 | , 203 | "List &attributes\v" 204 | "&Attribute auflisten\v" 205 | }; 206 | int Language = strstr (I18N [0], language ()) / 3; 207 | 208 | 209 | string tr (string s) 210 | { 211 | string t = lookup (I18N, s, Language, '\v'); 212 | return t ? t : s; 213 | } 214 | 215 | 216 | if (!schematic) 217 | { 218 | dlgMessageBox (usage + tr ("


ERROR: No schematic!

\nThis program can only work in" 219 | " the schematic editor.")); 220 | exit (1); 221 | } 222 | 223 | string SeparatorString; 224 | int NumParts; 225 | numeric string Lines[]; 226 | numeric string PartName[]; 227 | string PartValue[], PartDevice[], PartPackage[], PartHeadline[]; 228 | numeric string PartDescription []; 229 | int PartValueOn[]; 230 | int Selected; 231 | 232 | string CurrentVariant = ""; 233 | string Variants[] = { "" }; // 2012-04-16 234 | int cntVD = 0; 235 | int VDsel = 0; 236 | 237 | 238 | // cwi: Added arrays for an arbitraty number of attributes. 239 | int UseAttributes = 1; 240 | int FoundAttributes = 0; // # of different attribute names found in schematic. 241 | numeric string AttributesList[]; // Sorted list of all attributes found in the schematic. 242 | numeric string PartAttributes[]; // Adjusted list of attributes per part. 243 | 244 | enum { ltParts, ltValues }; // List Types 245 | enum { ofText, ofCSV, ofHTML }; // Output Formats 246 | int ListType = 0; 247 | int OutputFormat = 0; 248 | 249 | 250 | string StripWhiteSpace (string s) 251 | { 252 | while (s && isspace (s[0])) 253 | s = strsub (s, 1); 254 | while (s && isspace (s[strlen (s) - 1])) 255 | s = strsub (s, 0, strlen (s) - 1); 256 | return s; 257 | } 258 | 259 | 260 | // Collect part data from the schematic. 261 | // 262 | // Arguments: - 263 | // 264 | // Returns: NumParts - # of found parts 265 | // ParteName[] 266 | // PartValue[] 267 | // PartDevice[] 268 | // PartPackage[] 269 | // PartHeadline[] 270 | // PartDescription [] 271 | // PartValueOn[] - 0=part value off, 1= part value on, 2=override with attr. VAL 272 | // FoundAttributes - # of different attribute names found in schematic. 273 | // AttributesList[] - Sorted list of all attributes found in the schematic. 274 | // PartAttributes[] - Adjusted list of attributes per part. 275 | 276 | void CollectPartData (string var) 277 | { 278 | int Found = 0; 279 | int i; 280 | string attr[]; 281 | 282 | int PrintMe = 0; //Used to track empty PROD_IDs. Default = False 283 | 284 | NumParts = 0; 285 | 286 | // First, collect the names of all available attributes. 287 | FoundAttributes = 0; 288 | if (UseAttributes) { 289 | schematic (SCH) 290 | { 291 | SCH.parts (P) 292 | { 293 | if (P.device.package) 294 | { 295 | if (P.populate) 296 | { 297 | P.attributes (A) 298 | { 299 | if (0 == FoundAttributes) 300 | { 301 | // First one 302 | AttributesList[0] = A.name; 303 | FoundAttributes = 1; 304 | } 305 | else 306 | { 307 | Found = 0; 308 | for (i = 0; i < FoundAttributes; i ++) 309 | { 310 | if (A.name == AttributesList[i]) 311 | { 312 | // Found an already listed atrribute 313 | Found = 1; 314 | break; 315 | } 316 | } 317 | if (0 == Found) 318 | { 319 | // Attribute not listed, add at the end. 320 | AttributesList[FoundAttributes] = A.name; 321 | FoundAttributes ++; 322 | } 323 | } 324 | } 325 | } 326 | } 327 | } 328 | } 329 | sort (FoundAttributes, AttributesList); 330 | } 331 | 332 | // Second, collect all data 333 | schematic (SCH) 334 | { 335 | SCH.parts (P) 336 | { 337 | if (P.device.package) 338 | { 339 | if (P.populate) 340 | { 341 | //For importing a BOM into sparkle we only care about the PROD_ID and the qty 342 | //Ignore everything else 343 | 344 | PartName[NumParts] = P.name; 345 | //PartValue[NumParts] = P.value; 346 | //PartDevice[NumParts] = P.device.name; 347 | //PartPackage[NumParts] = P.device.package.name; 348 | //PartHeadline[NumParts] = P.device.headline; 349 | //if(strlen(PartHeadline[NumParts]) > 20) PartHeadline[NumParts][20] = 0; 350 | //PartDescription [NumParts] = P.device.description; 351 | //PartValueOn[NumParts] = P.device.value == "On"; 352 | // Zero all strings 353 | for (i = 0; i < FoundAttributes; i ++) 354 | attr[i] = ""; 355 | P.attributes(A) 356 | { 357 | 358 | 359 | for (i = 0; i < FoundAttributes; i ++) 360 | if (A.name == AttributesList[i]) 361 | { 362 | //We only need to export production IDs 363 | if(A.name == "PROD_ID") 364 | { 365 | //Sparkle only wants the numeric value, cut off all the alpha bits 366 | string myBits[]; 367 | strsplit(myBits, A.value, '-'); 368 | 369 | //We now have something like 09804 in myBits[1] 370 | //Remove leading zero (jeesh sparkle!) 371 | while(myBits[1][0] == '0') 372 | { 373 | string t = strsub(myBits[1], 1, strlen(myBits[1])); 374 | myBits[1] = t; 375 | } 376 | 377 | sprintf(attr[i], "%s,", myBits[1]); 378 | 379 | if(strlen(myBits[1]) > 0) PrintMe = 1; //Print this non-zero value 380 | 381 | break; 382 | } 383 | } 384 | } 385 | 386 | PartAttributes[NumParts] = strjoin(attr, Separator); 387 | if(PrintMe == 1) 388 | { 389 | PrintMe = 0; 390 | NumParts ++; 391 | } 392 | } 393 | } 394 | } 395 | } 396 | } 397 | 398 | 399 | void GeneratePartList(void) 400 | { 401 | int NumLines = 0; 402 | string attr[], s; 403 | 404 | if (UseAttributes) 405 | s = strjoin(AttributesList, '\t'); 406 | 407 | Lines[NumLines ++] = tr ("Part\t") + s; 408 | 409 | for (int i = 0; i < NumParts; i ++) 410 | { 411 | strsplit (attr, PartAttributes[i], Separator); 412 | if (UseAttributes) 413 | { 414 | s = strjoin(attr, '\t'); 415 | } 416 | 417 | Lines[NumLines] = s; 418 | NumLines ++; 419 | } 420 | Lines[NumLines] = ""; 421 | } 422 | 423 | 424 | // Generate list with one entry per value. 425 | // 'VALUE' is replaced by the value of attribute 'VAL', if existing. 426 | 427 | void GenerateValueList (void) 428 | { 429 | int NumLines = 0; 430 | int Index []; 431 | string attr[], s, s_val; 432 | 433 | if (UseAttributes) s = strjoin(AttributesList, '\t'); 434 | 435 | // 2010-04-17 cwi: Included description. 436 | Lines[NumLines ++] = tr ("Qty\tValue\tDevice\tPackage\tParts\tDescription\t") + s; // 2011-04-08 437 | sort (NumParts, Index, PartValue, PartDevice, PartPackage, PartAttributes, PartName, PartHeadline); // 2011-11-08 Partattribute jetzt nach Package alf@cadsoft.de 438 | for (int n1 = 0, n2 = 0; ++ n2 <= NumParts; ) 439 | { 440 | int i1 = Index [n1]; 441 | strsplit (attr, PartAttributes[i1], Separator); 442 | if (UseAttributes) s = strjoin(attr, '\t'); 443 | s_val = attr[i1]; 444 | if (n2 < NumParts) 445 | { 446 | int i2 = Index [n2]; // 2012-11-08 447 | strsplit (attr, PartAttributes[i2], Separator); 448 | if (PartValue[i1] == PartValue[i2] && PartDevice[i1] == PartDevice[i2] && PartAttributes[i1] == PartAttributes[i2]) // 2012-11-08 check diffent values of attributes 449 | continue; 450 | } 451 | string Quantity; 452 | sprintf (Quantity, "%d", n2 - n1); 453 | Lines[NumLines] = Quantity + "\t" + PartValue[i1] + "\t" + PartDevice[i1] + "\t" + PartPackage[i1] + "\t"; 454 | for (;;) 455 | { 456 | Lines[NumLines] += PartName[i1]; 457 | if (++n1 < n2) 458 | { 459 | i1 = Index [n1]; 460 | Lines[NumLines] += ", "; 461 | } 462 | else 463 | break; 464 | } 465 | // cwi: add extra information from attributes 466 | // 2010-04-17 cwi: Included description. 467 | Lines[NumLines] += "\t" + PartHeadline[i1] + "\t" + s; 468 | NumLines ++; 469 | } 470 | Lines[NumLines] = ""; 471 | } 472 | 473 | 474 | void GenerateList (void) 475 | { 476 | switch (ListType) 477 | { 478 | case ltParts: GeneratePartList (); break; 479 | case ltValues: GenerateValueList (); break; 480 | } 481 | } 482 | 483 | 484 | string MakeListHeader (void) 485 | { 486 | string s; 487 | schematic(SCH) 488 | sprintf (s, tr ("Partlist exported from %s at %s"), SCH.name, t2string (time ())); 489 | return s; 490 | } 491 | 492 | 493 | //This is where we take the stuff and save it to a text file 494 | //We want one long, comma seperated string of prod_ids 495 | string MakeListText(void) 496 | { 497 | int l; 498 | string List; 499 | 500 | for (l = 1; Lines[l] ; l++) 501 | { 502 | string line, a[]; 503 | 504 | int n = strsplit (a, Lines[l], '\t'); 505 | 506 | for (int i = 0; i < n; i ++) 507 | { 508 | string s; 509 | sprintf (s, "%s", a[i]); //Print the attributes 510 | line += s; 511 | } 512 | 513 | List += line; // Add this line to the list to report 514 | } 515 | 516 | return List; 517 | } 518 | 519 | 520 | // 2008-11-24 Christian Schlittler: 521 | // Make comma-serparated list, with all values double-quoted. 522 | 523 | string MakeListCSV (void) 524 | { 525 | string List; 526 | int numHeaders; 527 | 528 | for (int l = 0; Lines[l]; l ++) 529 | { 530 | string a []; 531 | int n = strsplit (a, Lines[l], '\t'); 532 | if (l == 0) 533 | numHeaders = n; 534 | else 535 | n = numHeaders; // for the hidden key! 536 | for (int i = 0; i < n; i ++) 537 | List += "\"" + a[i] + "\"" + SeparatorString; 538 | List += "\n"; 539 | } 540 | return List; 541 | } 542 | 543 | 544 | string MakeListHTML (void) 545 | { 546 | string List; 547 | int numHeaders; 548 | 549 | List = "" + MakeListHeader() + "\n

\n"; 550 | List += "\n"; 551 | for (int l = 0; Lines[l]; l++) 552 | { 553 | List += ""; 554 | string a []; 555 | int n = strsplit (a, Lines[l], '\t'); 556 | if (l == 0) 557 | numHeaders = n; 558 | else 559 | n = numHeaders; // for the hidden key! 560 | for (int i = 0; i < n; i ++) 561 | { 562 | if (l == 0) 563 | a[i] = "" + a[i] + ""; 564 | List += ""; 565 | } 566 | List += "\n"; 567 | } 568 | List += "
" + a[i] + "
\n"; 569 | return List; 570 | } 571 | 572 | 573 | string MakeList (void) 574 | { 575 | switch (OutputFormat) 576 | { 577 | case ofText: return MakeListText(); break; 578 | case ofCSV: return MakeListCSV(); break; 579 | case ofHTML: return MakeListHTML(); break; 580 | } 581 | return ""; 582 | } 583 | 584 | 585 | void ViewList (void) 586 | { 587 | dlgDialog (tr ("Bill Of Material - Preview")) 588 | { 589 | string s = MakeList (); 590 | if (OutputFormat == ofText || OutputFormat == ofCSV) 591 | s = "

" + s + "
"; 592 | dlgHBoxLayout dlgSpacing (400); 593 | dlgHBoxLayout 594 | { 595 | dlgVBoxLayout dlgSpacing (300); 596 | dlgTextView (s); 597 | } 598 | dlgHBoxLayout 599 | { 600 | dlgStretch (1); 601 | dlgPushButton (tr ("-Close")) dlgReject (); 602 | } 603 | }; 604 | } 605 | 606 | 607 | void SaveList (void) 608 | { 609 | // 2008-11-24 cwi: 610 | // - Added new format extension .csv 611 | // - Changed from .bom to .txt for text format. 612 | string FileName; 613 | string FileExt; 614 | 615 | switch (OutputFormat) 616 | { 617 | case ofText: FileExt = ".txt"; break; 618 | case ofHTML: FileExt = ".html"; break; 619 | case ofCSV: FileExt = ".csv"; break; 620 | } 621 | schematic(SCH) FileName = filesetext (SCH.name, FileExt); 622 | FileName = dlgFileSave (tr ("Save Bill Of Material"), FileName); 623 | if (FileName) 624 | { 625 | string a []; 626 | if (!fileglob (a, FileName) || dlgMessageBox (tr ("File '") + FileName + 627 | tr ("' exists\n\nOverwrite?"), tr("+&Yes"), tr("-&No")) == 0) 628 | { 629 | output (FileName, "wt") 630 | { 631 | printf ("%s", MakeList ()); // using "%s" to avoid problems if list contains any '%' 632 | } 633 | } 634 | } 635 | } 636 | 637 | 638 | void DisplayHelp (void) 639 | { 640 | dlgDialog (tr ("Bill Of Material - Help")) 641 | { 642 | dlgHBoxLayout dlgSpacing (400); 643 | dlgHBoxLayout 644 | { 645 | dlgVBoxLayout dlgSpacing (300); 646 | dlgTextView (language () == "de" ? HelpTextDE : HelpTextEN); 647 | } 648 | dlgHBoxLayout 649 | { 650 | dlgStretch (1); 651 | dlgPushButton (tr ("-Close")) 652 | dlgReject (); 653 | } 654 | }; 655 | } 656 | 657 | 658 | schematic(SCH) { 659 | sprintf(SeparatorString, "%c", Separator); 660 | CurrentVariant = variant(); 661 | SCH.variantdefs(VD) { 662 | if (CurrentVariant == VD.name) VDsel = cntVD; 663 | sprintf(Variants[cntVD], "%s", VD.name); 664 | cntVD++; 665 | } 666 | } 667 | 668 | setvariant(CurrentVariant); 669 | CollectPartData(CurrentVariant); 670 | GenerateList(); 671 | 672 | dlgDialog (tr ("Bill Of Material")) 673 | { 674 | dlgHBoxLayout { 675 | dlgLabel(tr ("Current &variant ")); 676 | dlgComboBox(Variants, VDsel) { 677 | CurrentVariant = Variants[VDsel]; 678 | setvariant(CurrentVariant); 679 | CollectPartData(CurrentVariant); 680 | GenerateList(); 681 | } 682 | dlgStretch(1); 683 | } 684 | dlgListView ("", Lines, Selected); 685 | dlgHBoxLayout 686 | { 687 | dlgGroup(tr ("List type")) 688 | { 689 | dlgRadioButton(tr ("&Parts"), ListType) GeneratePartList (); 690 | dlgRadioButton(tr ("&Values"), ListType) GenerateValueList (); 691 | dlgCheckBox(tr ("List &attributes"), UseAttributes) { 692 | if (!UseAttributes) { 693 | NumParts = 0; 694 | } 695 | CollectPartData(CurrentVariant); 696 | GenerateList(); 697 | } 698 | } 699 | dlgGroup (tr ("Output format")) 700 | { 701 | // 2008-10-09: Entries swapped for correct function. 702 | dlgRadioButton(tr ("&Text"), OutputFormat); 703 | // 2008-11-24 cwi: New format added. 704 | dlgRadioButton(tr ("&CSV"), OutputFormat); 705 | dlgRadioButton(tr ("&HTML"), OutputFormat); 706 | } 707 | dlgStretch(1); 708 | } 709 | dlgHBoxLayout { 710 | dlgPushButton (tr ("+Vie&w")) ViewList (); 711 | dlgPushButton (tr ("&Save...")) SaveList (); 712 | dlgPushButton (tr ("H&elp")) DisplayHelp (); 713 | dlgPushButton (tr ("-Close")) dlgAccept (); 714 | dlgStretch(1); 715 | dlgLabel("Version " + Version); 716 | } 717 | }; 718 | -------------------------------------------------------------------------------- /ulp/bom_mod.ulp: -------------------------------------------------------------------------------- 1 | #require 4.1105 2 | 3 | #usage "en: Export a Bill Of Material\n" 4 | "

" 5 | "Generates a project's Bill Of Material." 6 | "

" 7 | "A database with additional information like order codes, manufacturers " 8 | "or prices can be created and managed." 9 | "

" 10 | "Author: support@cadsoft.de", 11 | "de: Stückliste exportieren\n" 12 | "

" 13 | "Erzeugt die Stückliste (Bill Of Material) eines Projekts." 14 | "

" 15 | "Eine Datenbank mit zusätzlichen Informationen wie Bestellnummern, Herstellern " 16 | "oder Preisen kann angelegt und verwaltet werden." 17 | "

" 18 | "Autor: support@cadsoft.de" 19 | 20 | // THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED 21 | 22 | string HelpTextEN = 23 | "How to generate the Bill Of Material\n" 24 | "

\n" 25 | "List type\n" 26 | "

\n" 27 | "The Bill Of Material can be generated either as a list\n" 28 | "of parts (where every part is listed on a line of its own),\n" 29 | "or as a list of values, where all parts with the same value are grouped\n" 30 | "together in one line. Use the Parts and Values\n" 31 | "radio buttons to select the list type.\n" 32 | "

\n" 33 | "Output format\n" 34 | "

\n" 35 | "Choose between pure ASCII Text format or HTML.\n" 36 | "

\n" 37 | "Database\n" 38 | "

\n" 39 | "You can pull in additional information about the used parts by loading\n" 40 | "a database file with the Load button.\n" 41 | "

\n" 42 | "A database file must consist of lines of text, each of which contains\n" 43 | "one record consisting of CSV (Comma Separated Values)\n" 44 | "or TSV (Tab Separated Values) data.\n" 45 | "The very first line must contain a \"header\", which defines a unique name for\n" 46 | "each column, and the first column of every following line must contain\n" 47 | "a unique (non-empty) key for this record.\n" 48 | "

\n" 49 | "An example for a valid database file would be:\n" 50 | "

\n"
 51 |   "Key              Manufacturer       Order Code Price\n"
 52 |   "74LS00N          Texas Instruments  123-456    0.20\n"
 53 |   "R-EU_0204/5:4k7  Somebody           RES4k7     0.10\n"
 54 |   "
\n" 55 | "Note that the columns are separated by a tab character (you may also\n" 56 | "use a semicolon (';') to separate the columns, but then you will have to make sure\n" 57 | "none of the data items contains a semicolon).\n" 58 | "The keys for looking up records in the database are built from the\n" 59 | "parts' values. If a part's device has defined \"value on\" it means that\n" 60 | "the user needs to specify a particular value for this part, as for\n" 61 | "example with a resistor. In such a case the key consists of the device\n" 62 | "name and the user defined value, separated by a colon (':'). If the\n" 63 | "device has \"value off\", only the device name is used as key (if the\n" 64 | "user has edited the value of such a part and insisted on changing\n" 65 | "it, the edited value will be used).\n" 66 | "

\n" 67 | "Creating a new database\n" 68 | "

\n" 69 | "Click on the New button to create a new database.\n" 70 | "You will get a dialog in which you can define the names of the column headers\n" 71 | "for your new database. The first column always contains the key for database\n" 72 | "lookups and can't be deleted (you can edit it, though, to give it a different\n" 73 | "name than the default \"Key\"). This first column will not be visible in the\n" 74 | "generated list, so you don't really need to worry about it.\n" 75 | "

\n" 76 | "Editing the database\n" 77 | "

\n" 78 | "If you have loaded a database you can either double click on a line\n" 79 | "in the list, or select a line and press Enter (or click on the Edit\n" 80 | "button) to bring up a dialog in which you can edit the database entry\n" 81 | "for this part. If the database has been modified you will be asked if\n" 82 | "you want to save it before leaving the program or loading a new database.\n" 83 | "

\n" 84 | "Viewing the output\n" 85 | "

\n" 86 | "Click on the View button to get a preview of the list output.\n" 87 | "

\n" 88 | "Saving the list\n" 89 | "

\n" 90 | "Click on the Save button to save the list to disk.\n" 91 | ; 92 | 93 | string HelpTextDE = 94 | "Erzeugen der Stückliste\n" 95 | "

\n" 96 | "Listen-Typ\n" 97 | "

\n" 98 | "Die Stückliste kann entweder als Liste der Bauteile generiert werden\n" 99 | "(wobei jedes Bauteil in einer eigenen Zeile aufgeführt wird),\n" 100 | "oder als Liste der Werte, wobei alle Bauteile mit dem gleichen Wert in einer Zeile\n" 101 | "zusammengefasst werden. Mit den Radio-Buttons Bauteile und Werte\n" 102 | "kann zwischen den beiden Listen-Typen gewählt werden.\n" 103 | "

\n" 104 | "Ausgabeformat\n" 105 | "

\n" 106 | "Wählen Sie zwischen reinem ASCII-Text oder HTML-Format.\n" 107 | "

\n" 108 | "Datenbank\n" 109 | "

\n" 110 | "Mit dem Load-Button können Sie eine Datenbankdatei mit zusätzlichen\n" 111 | "Informationen über die Bauteile laden.\n" 112 | "

\n" 113 | "Eine Datenbankdatei besteht aus Textzeilen, von denen jede einen Datensatz bestehend\n" 114 | "aus CSV (Comma Separated Values) oder\n" 115 | "TSV (Tab Separated Values) Daten enthält.\n" 116 | "Die erste Zeile muß eine Titelzeile enthalten, welche einen eindeutigen Namen\n" 117 | "für jede Spalte definiert, und die erste Spalte jeder folgenden Zeile muß einen eindeutigen\n" 118 | "(nicht leeren) Schlüssel für diesen Datensatz enthalten.\n" 119 | "

\n" 120 | "Beispiel für eine gültige Datenbankdatei:\n" 121 | "

\n"
122 |   "Key              Hersteller         Best.-Nr.  Preis\n"
123 |   "74LS00N          Texas Instruments  123-456    0.20\n"
124 |   "R-EU_0204/5:4k7  Somebody           RES4k7     0.10\n"
125 |   "
\n" 126 | "Beachten Sie, daß die Spalten durch Tabulator-Zeichen getrennt sind (Sie können\n" 127 | "auch das Semikolon-Zeichen (';') als Trennzeichen verwenden, wobei Sie dann aber sicherstellen\n" 128 | "müssen, daß keines der Datenfelder ein Semikolon enthält).\n" 129 | "Die Schlüssel für die Suche nach Datensätzen in der Datenbank werden aus den Werten der\n" 130 | "Bauteile gebildet. Hat das Device eines Bauteils \"value on\" gesetzt, so bedeutet dies, daß\n" 131 | "der Benutzer einen individuellen Wert für dieses Bauteil (zum Beispiel einen Widerstand)\n" 132 | "angeben muß. In einem solchen Fall besteht der Schlüssel aus dem Device-Namen und dem vom\n" 133 | "Benutzer angegebenen Wert, getrennt durch einen Doppelpunkt (':'). Hat das\n" 134 | "Device \"value off\", so wird nur der Name des Devices als Schlüssel genommen (hat der\n" 135 | "Benutzer den Wert eines solchen Bauteils editiert und darauf bestanden, ihn zu verändern,\n" 136 | "so wird der veränderte Wert genommen).\n" 137 | "

\n" 138 | "Neue Datenbank anlegen\n" 139 | "

\n" 140 | "Klicken Sie auf Neu um eine neue Datenbank anzulegen.\n" 141 | "In einem Dialog können Sie dann die Namen der Datenfelder Ihrer neuen Datenbank\n" 142 | "festlegen. Das erste Feld enthält immer den Schlüssel für den Datenbank-Zugriff\n" 143 | "und kann nicht gelöscht werden (es kann aber editiert werden um ihm einen anderen Namen\n" 144 | "als den Standardwert \"Key\" zu geben). Dieses erste Feld wird in der generierten Liste\n" 145 | "nicht sichtbar sein, Sie brauchen sich also keine Gedanken darüber zu machen.\n" 146 | "

\n" 147 | "Bearbeiten der Datenbank\n" 148 | "

\n" 149 | "Wenn Sie eine Datenbank geladen haben können Sie entweder auf eine Zeile in der\n" 150 | "Liste doppelklicken, oder eine Zeile auswählen und die Eingabetaste drücken (oder auf Bearbeiten\n" 151 | "klicken) um einen Dialog zu erhalten in dem Sie den Datenbank-Eintrag für dieses Bauteil\n" 152 | "bearbeiten können. Wurde die Datenbank verändert so werden Sie vor dem Verlassen des Programms\n" 153 | "oder vor dem Laden einer neuen Datenbank gefragt, ob Sie diese abspeichern wollen.\n" 154 | "

\n" 155 | "Betrachten der Ausgabe\n" 156 | "

\n" 157 | "Klicken Sie auf Vorschau um eine Vorschau der Ausgabe zu erhalten.\n" 158 | "

\n" 159 | "Speichern der Liste\n" 160 | "

\n" 161 | "Klicken Sie auf Speichern um die Liste abzuspeichern.\n" 162 | ; 163 | 164 | string I18N[] = { 165 | "en\v" 166 | "de\v" 167 | , 168 | "


ERROR: No schematic!

\nThis program can only work in the schematic editor.\v" 169 | "


FEHLER: Kein Schaltplan!

\nDieses Programm kann nur in einem Schaltplan verwendet werden.\v" 170 | , 171 | "Part\tValue\tDevice\tPackage\tDescription\v" 172 | "Bauteil\tWert\tDevice\tPackage\tDescription\v" 173 | , 174 | "Qty\tValue\tDevice\tParts\v" 175 | "Menge\tWert\tDevice\tBauteile\v" 176 | , 177 | "Partlist exported from %s at %s\v" 178 | "Stückliste exportiert aus %s am %s\v" 179 | , 180 | "Bill Of Material - Preview\v" 181 | "Stückliste - Vorschau\v" 182 | , 183 | "-Close\v" 184 | "-Schließen\v" 185 | , 186 | "Save Bill Of Material\v" 187 | "Stückliste speichern\v" 188 | , 189 | "File '\v" 190 | "Datei '\v" 191 | , 192 | "' exists\n\nOverwrite?\v" 193 | "' existiert\n\nÜberschreiben?\v" 194 | , 195 | "+&Yes\v" 196 | "+&Ja\v" 197 | , 198 | "-&No\v" 199 | "-&Nein\v" 200 | , 201 | "&No\v" 202 | "&Nein\v" 203 | , 204 | "Name already defined!\v" 205 | "Name ist bereits definiert!\v" 206 | , 207 | " Header\v" 208 | " Spaltenüberschrift\v" 209 | , 210 | "&Name:\v" 211 | "&Name:\v" 212 | , 213 | "+OK\v" 214 | "+OK\v" 215 | , 216 | "Name can't be empty!\v" 217 | "Name kann nicht leer sein!\v" 218 | , 219 | "-Cancel\v" 220 | "-Abbrechen\v" 221 | , 222 | "New Database\v" 223 | "Neue Datenbank\v" 224 | , 225 | "&Headers\v" 226 | "&Spaltenüberschriften\v" 227 | , 228 | "Edit\v" 229 | "Bearbeiten\v" 230 | , 231 | "&Add\v" 232 | "&Hinzufügen\v" 233 | , 234 | "New\v" 235 | "Neu\v" 236 | , 237 | "&Del\v" 238 | "&Löschen\v" 239 | , 240 | "Can't delete the \"Key\" header!\n\nUse \"Edit\" to change it.\v" 241 | "Die Spaltenüberschrift \"Key\" kann nicht gelöscht werden!\n\nBenutzen Sie \"Bearbeiten\" um sie zu ändern.\v" 242 | , 243 | "&Edit\v" 244 | "&Bearbeiten\v" 245 | , 246 | "Edit\v" 247 | "Bearbeiten\v" 248 | , 249 | "Please add at least one header!\v" 250 | "Bitte fügen Sie mindestens eine Spaltenüberschrift hinzu!\v" 251 | , 252 | "Choose database file\v" 253 | "Datenbankdatei auswählen\v" 254 | , 255 | "Database files (*.tsv *.csv);;All files (*)\v" 256 | "Datenbankdateien (*.tsv *.csv);;Alle Dateien (*)\v" 257 | , 258 | "Save database file\v" 259 | "Datenbankdatei speichern\v" 260 | , 261 | "Database files (*\v" 262 | "Datenbankdateien (*\v" 263 | , 264 | ");;All files (*)\v" 265 | ");;Alle Dateien (*)\v" 266 | , 267 | "Edit Database\v" 268 | "Datenbank bearbeiten\v" 269 | , 270 | "Please select a list entry first!\v" 271 | "Bitte wählen Sie erst einen Listeneintrag aus!\v" 272 | , 273 | "Please load a database file first!\v" 274 | "Bitte Laden Sie zuerst eine Datenbankdatei!\v" 275 | , 276 | "Database has been modified\n\nSave?\v" 277 | "Die Datenbank wurde verändert\n\nSpeichern?\v" 278 | , 279 | "Bill Of Material - Help\v" 280 | "Stückliste - Hilfe\v" 281 | , 282 | "Bill Of Material\v" 283 | "Stückliste\v" 284 | , 285 | "Database:\v" 286 | "Datenbank:\v" 287 | , 288 | "&Load\v" 289 | "&Laden\v" 290 | , 291 | "&New\v" 292 | "&Neu\v" 293 | , 294 | "List type\v" 295 | "Listen-Typ\v" 296 | , 297 | "&Parts\v" 298 | "&Bauteile\v" 299 | , 300 | "&Values\v" 301 | "&Werte\v" 302 | , 303 | "Output format\v" 304 | "Ausgabeformat\v" 305 | , 306 | "&Text\v" 307 | "&Text\v" 308 | , 309 | "&HTML\v" 310 | "&HTML\v" 311 | , 312 | "+Edit\v" 313 | "+Bearbeiten\v" 314 | , 315 | "Vie&w\v" 316 | "&Vorschau\v" 317 | , 318 | "&Save...\v" 319 | "&Speichern...\v" 320 | , 321 | "H&elp\v" 322 | "H&ilfe\v" 323 | }; 324 | 325 | int Language = strstr(I18N[0], language()) / 3; 326 | 327 | string tr(string s) 328 | { 329 | string t = lookup(I18N, s, Language, '\v'); 330 | return t ? t : s; 331 | } 332 | 333 | if (!schematic) { 334 | dlgMessageBox(usage + tr("


ERROR: No schematic!

\nThis program can only work in the schematic editor.")); 335 | exit(1); 336 | } 337 | 338 | //XXX 339 | /* 340 | TODO: - Query user for missing database entries ("Check" button) 341 | - Allow user to define which database columns to actually use 342 | - dto. for the internal data? 343 | - store and retrieve the setup? 344 | - what if this is run in a board? 345 | */ 346 | 347 | int NumParts; 348 | numeric string Lines[]; 349 | numeric string PartName[], PartValue[], PartDevice[], PartPackage[], PartHeadline[], PartDescription[]; 350 | int PartValueOn[]; 351 | int Selected; 352 | 353 | enum { ltParts, ltValues }; // List Types 354 | enum { ofText, ofHTML }; // Output Formats 355 | int ListType = 0; 356 | int OutputFormat = 0; 357 | 358 | string DatabaseFile; 359 | string Database[]; 360 | char DatabaseSeparator = '\t'; 361 | string DatabaseFields[]; 362 | int DatabaseModified = 0; 363 | 364 | char ValueSeparator = ':'; 365 | 366 | string StripWhiteSpace(string s) 367 | { 368 | while (s && isspace(s[0])) 369 | s = strsub(s, 1); 370 | while (s && isspace(s[strlen(s) - 1])) 371 | s = strsub(s, 0, strlen(s) - 1); 372 | return s; 373 | } 374 | 375 | void CollectPartData(void) 376 | { 377 | NumParts = 0; 378 | 379 | schematic(SCH) { 380 | SCH.parts(P) { 381 | if (P.device.package) { 382 | PartName[NumParts] = P.name; 383 | PartValue[NumParts] = P.value; 384 | PartDevice[NumParts] = P.device.name; 385 | PartPackage[NumParts] = P.device.package.name; 386 | PartHeadline[NumParts] = P.device.headline; 387 | PartDescription[NumParts] = P.device.description; 388 | PartValueOn[NumParts] = P.device.value == "On"; 389 | NumParts++; 390 | } 391 | } 392 | } 393 | } 394 | 395 | string DatabaseHeader(void) 396 | { 397 | string s; 398 | 399 | if (Database[0]) { 400 | string a[]; 401 | int n = strsplit(a, Database[0], DatabaseSeparator); 402 | int i; 403 | for (i = 1; i < n; i++) { 404 | s += "\t" + a[i]; 405 | DatabaseFields[i - 1] = a[i]; 406 | } 407 | DatabaseFields[i - 1] = ""; 408 | } 409 | return s; 410 | } 411 | 412 | string DatabaseKey(int i) 413 | { 414 | string key = PartValue[i]; 415 | if (PartValueOn[i]) 416 | key = PartDevice[i] + ValueSeparator + key; 417 | return key; 418 | } 419 | 420 | string DatabaseLookup(string key, int f) 421 | { 422 | return lookup(Database, key, DatabaseFields[f], DatabaseSeparator); 423 | } 424 | 425 | void GeneratePartList(void) 426 | { 427 | int NumLines = 0; 428 | 429 | //XXX column sequence? 430 | Lines[NumLines++] = tr("Part\tValue\tDevice\tPackage\tDescription") + DatabaseHeader(); 431 | for (int i = 0; i < NumParts; i++) { 432 | Lines[NumLines] = PartName[i] + "\t" + PartValue[i] + "\t" + PartDevice[i] + "\t" + PartPackage[i] + "\t" + PartHeadline[i]; 433 | if (Database[0]) { 434 | string key = DatabaseKey(i); 435 | for (int f = 0; DatabaseFields[f]; f++) 436 | Lines[NumLines] += "\t" + DatabaseLookup(key, f); 437 | Lines[NumLines] += "\t" + key; // hidden field! 438 | } 439 | NumLines++; 440 | } 441 | Lines[NumLines] = ""; 442 | } 443 | 444 | void GenerateValueList(void) 445 | { 446 | int NumLines = 0; 447 | int Index[]; 448 | 449 | //XXX column sequence? 450 | Lines[NumLines++] = tr("Qty\tValue\tDevice\tParts") + DatabaseHeader(); 451 | sort(NumParts, Index, PartValue, PartDevice, PartName); 452 | for (int n1 = 0, n2 = 0; ++n2 <= NumParts; ) { 453 | int i1 = Index[n1]; 454 | if (n2 < NumParts) { 455 | int i2 = Index[n2]; 456 | //XXX value on/off? 457 | if (PartValue[i1] == PartValue[i2] && PartDevice[i1] == PartDevice[i2])//XXX && lname[i1] == lname[i2]) 458 | continue; 459 | } 460 | string Quantity; 461 | sprintf(Quantity, "%d", n2 - n1); 462 | Lines[NumLines] = Quantity + "\t" + PartValue[i1] + "\t" + PartDevice[i1] + "\t"; 463 | for (;;) { 464 | Lines[NumLines] += PartName[i1]; 465 | if (++n1 < n2) { 466 | i1 = Index[n1]; 467 | Lines[NumLines] += ", "; 468 | } 469 | else 470 | break; 471 | } 472 | if (Database[0]) { 473 | string key = DatabaseKey(i1); 474 | for (int f = 0; DatabaseFields[f]; f++) 475 | Lines[NumLines] += "\t" + DatabaseLookup(key, f); 476 | Lines[NumLines] += "\t" + key; // hidden field! 477 | } 478 | NumLines++; 479 | } 480 | Lines[NumLines] = ""; 481 | } 482 | 483 | void GenerateList(void) 484 | { 485 | switch (ListType) { 486 | case ltParts: GeneratePartList(); break; 487 | case ltValues: GenerateValueList(); break; 488 | } 489 | } 490 | 491 | string MakeListHeader(void) 492 | { 493 | string s; 494 | schematic(SCH) sprintf(s, tr("Partlist exported from %s at %s"), SCH.name, t2string(time())); 495 | return s; 496 | } 497 | 498 | string MakeListText(void) 499 | { 500 | int l, Width[]; 501 | for (l = 0; Lines[l]; l++) { 502 | string a[]; 503 | for (int n = strsplit(a, Lines[l], '\t'); n--; ) 504 | Width[n] = max(Width[n], strlen(a[n])); 505 | } 506 | string List; 507 | List = MakeListHeader() + "\n\n"; 508 | int numHeaders; 509 | for (l = 0; Lines[l]; l++) { 510 | string line, a[]; 511 | int n = strsplit(a, Lines[l], '\t'); 512 | if (l == 0) 513 | numHeaders = n; 514 | else 515 | n = numHeaders; // for the hidden key! 516 | for (int i = 0; i < n; i++) { 517 | string s; 518 | sprintf(s, "%s%-*s", line ? " " : "", Width[i], a[i]); 519 | line += s; 520 | } 521 | List += line + "\n"; 522 | } 523 | return List; 524 | } 525 | 526 | string MakeListHTML(void) 527 | { 528 | string List; 529 | List = "" + MakeListHeader() + "\n

\n"; 530 | List += "\n"; 531 | int numHeaders; 532 | for (int l = 0; Lines[l]; l++) { 533 | List += ""; 534 | string a[]; 535 | int n = strsplit(a, Lines[l], '\t'); 536 | if (l == 0) 537 | numHeaders = n; 538 | else 539 | n = numHeaders; // for the hidden key! 540 | for (int i = 0; i < n; i++) { 541 | if (l == 0) 542 | a[i] = "" + a[i] + ""; 543 | List += ""; 544 | } 545 | List += "\n"; 546 | } 547 | List += "
" + a[i] + "
\n"; 548 | return List; 549 | } 550 | 551 | string MakeList(void) 552 | { 553 | switch (OutputFormat) { 554 | case ofText: return MakeListText(); break; 555 | case ofHTML: return MakeListHTML(); break; 556 | } 557 | return ""; 558 | } 559 | 560 | void ViewList(void) 561 | { 562 | dlgDialog(tr("Bill Of Material - Preview")) { 563 | string s = MakeList(); 564 | if (OutputFormat == ofText) 565 | s = "

" + s + "
"; 566 | dlgHBoxLayout dlgSpacing(400); 567 | dlgHBoxLayout { 568 | dlgVBoxLayout dlgSpacing(300); 569 | dlgTextView(s); 570 | } 571 | dlgHBoxLayout { 572 | dlgStretch(1); 573 | dlgPushButton(tr("-Close")) dlgReject(); 574 | } 575 | }; 576 | } 577 | 578 | void SaveList(void) 579 | { 580 | string FileName; 581 | schematic(SCH) FileName = filesetext(SCH.name, OutputFormat == ofHTML ? ".htm" : ".bom"); 582 | FileName = dlgFileSave(tr("Save Bill Of Material"), FileName); 583 | if (FileName) { 584 | string a[]; 585 | if (!fileglob(a, FileName) || dlgMessageBox(tr("File '") + FileName + tr("' exists\n\nOverwrite?"), tr("+&Yes"), tr("-&No")) == 0) { 586 | output(FileName, "wt") { 587 | printf("%s", MakeList()); // using "%s" to avoid problems if list contains any '%' 588 | } 589 | } 590 | } 591 | } 592 | 593 | int ReadDatabase(string FileName) 594 | { 595 | string data; 596 | if (fileread(data, FileName) > 0) { 597 | strsplit(Database, data, '\n'); 598 | DatabaseSeparator = (strchr(Database[0], '\t') > -1) ? '\t' : ';'; 599 | DatabaseFile = FileName; 600 | return 1; 601 | } 602 | return 0; 603 | } 604 | 605 | // --- Create a new database ------------------------------------------------- 606 | 607 | string Headers[]; 608 | int NumHeaders; 609 | int SelectedHeader; 610 | 611 | int NewDatabaseHeaderOk(string Name) 612 | { 613 | for (int i = 0; i < NumHeaders; i++) { 614 | if (Name == Headers[i]) { 615 | dlgMessageBox(tr("Name already defined!")); 616 | return 0; 617 | } 618 | } 619 | return 1; 620 | } 621 | 622 | void NewDatabaseEdit(string Title, string Name) 623 | { 624 | int NewName = !Name; 625 | dlgDialog(Title + tr(" Header")) { 626 | dlgLabel(tr("&Name:")); 627 | dlgStringEdit(Name); 628 | dlgHBoxLayout { 629 | dlgStretch(1); 630 | dlgPushButton(tr("+OK")) { 631 | Name = StripWhiteSpace(Name); 632 | if (!NewName) { 633 | if (Name == Headers[SelectedHeader] || NewDatabaseHeaderOk(Name)) { 634 | Headers[SelectedHeader] = Name; 635 | dlgAccept(); 636 | } 637 | } 638 | else if (Name) { 639 | if (NewDatabaseHeaderOk(Name)) { 640 | SelectedHeader = NumHeaders; 641 | Headers[NumHeaders] = Name; 642 | Headers[++NumHeaders] = ""; 643 | dlgAccept(); 644 | } 645 | } 646 | else 647 | dlgMessageBox(tr("Name can't be empty!")); 648 | } 649 | dlgPushButton(tr("-Cancel")) dlgReject(); 650 | } 651 | }; 652 | } 653 | 654 | void NewDatabase(void) 655 | { 656 | DatabaseFile = ""; 657 | Database[0] = ""; 658 | GenerateList(); 659 | dlgRedisplay(); 660 | 661 | Headers[0] = "Key"; 662 | Headers[1] = ""; 663 | NumHeaders = 1; 664 | SelectedHeader = -1; 665 | int result = dlgDialog(tr("New Database")) { 666 | dlgHBoxLayout { 667 | dlgVBoxLayout { 668 | dlgLabel(tr("&Headers")); 669 | dlgListBox(Headers, SelectedHeader) NewDatabaseEdit(tr("Edit"), Headers[SelectedHeader]); 670 | } 671 | dlgVBoxLayout { 672 | dlgPushButton(tr("&Add")) NewDatabaseEdit(tr("New"), ""); 673 | dlgPushButton(tr("&Del")) { 674 | if (SelectedHeader > 0) { 675 | for (int i = SelectedHeader; i < NumHeaders - 1; i++) 676 | Headers[i] = Headers[i + 1]; 677 | Headers[--NumHeaders] = ""; 678 | if (SelectedHeader >= NumHeaders) 679 | SelectedHeader = NumHeaders - 1; 680 | } 681 | else 682 | dlgMessageBox(tr("Can't delete the \"Key\" header!\n\nUse \"Edit\" to change it.")); 683 | } 684 | dlgPushButton(tr("&Edit")) { 685 | if (SelectedHeader >= 0) 686 | NewDatabaseEdit(tr("Edit"), Headers[SelectedHeader]); 687 | else 688 | dlgMessageBox(tr("Please select a list entry first!")); 689 | } 690 | } 691 | } 692 | dlgHBoxLayout { 693 | dlgStretch(1); 694 | dlgPushButton(tr("+OK")) { 695 | if (NumHeaders > 1) 696 | dlgAccept(); 697 | else 698 | dlgMessageBox(tr("Please add at least one header!")); 699 | } 700 | dlgPushButton(tr("-Cancel")) dlgReject(); 701 | } 702 | }; 703 | if (result) { 704 | string sep; 705 | for (int i = 0; Headers[i]; i++) { 706 | Database[0] += sep + Headers[i]; 707 | sep = "\t"; 708 | } 709 | DatabaseSeparator = '\t'; 710 | DatabaseModified = 1; 711 | GenerateList(); 712 | } 713 | } 714 | 715 | // --- 716 | 717 | void LoadDatabase(void) 718 | { 719 | string FileName = dlgFileOpen(tr("Choose database file"), DatabaseFile, tr("Database files (*.tsv *.csv);;All files (*)")); 720 | if (FileName) { 721 | if (ReadDatabase(FileName)) { 722 | GenerateList(); 723 | DatabaseModified = 0; 724 | } 725 | } 726 | } 727 | 728 | int SaveDatabase(void) 729 | { 730 | if (!DatabaseFile) { 731 | string ext = (DatabaseSeparator == '\t') ? ".tsv" : ".csv"; 732 | DatabaseFile = dlgFileSave(tr("Save database file"), "", tr("Database files (*") + ext + tr(");;All files (*)")); 733 | if (!DatabaseFile) 734 | return 0; 735 | if (fileext(DatabaseFile) != ext) 736 | DatabaseFile += ext; 737 | } 738 | fileerror(); 739 | output(DatabaseFile, "wt") { 740 | for (int i = 0; Database[i]; i++) 741 | printf("%s\n", Database[i]); 742 | }; 743 | return !fileerror(); 744 | } 745 | 746 | void EditDatabaseEntry(string Key, int Entry) 747 | { 748 | string Header[]; 749 | string Data[]; 750 | int Fields = strsplit(Header, Database[0], DatabaseSeparator); 751 | strsplit(Data, Database[Entry], DatabaseSeparator); 752 | if (!Data[0]) 753 | Data[0] = Key; 754 | int result = dlgDialog(tr("Edit Database")) { 755 | dlgGridLayout { 756 | for (int f = 0; f < Fields; f++) { 757 | dlgCell(f, 0) dlgLabel(Header[f]); 758 | dlgCell(f, 1) if (f) { dlgStringEdit(Data[f]); } else { dlgLabel(Data[f]); } 759 | } 760 | } 761 | dlgHBoxLayout { 762 | dlgStretch(1); 763 | dlgPushButton(tr("+OK")) dlgAccept(); 764 | dlgPushButton(tr("-Cancel")) dlgReject(); 765 | } 766 | }; 767 | if (result) { 768 | for (int f = 0; f < Fields; f++) 769 | Data[f] = StripWhiteSpace(Data[f]); 770 | Database[Entry] = strjoin(Data, DatabaseSeparator); 771 | DatabaseModified = 1; 772 | GenerateList(); 773 | } 774 | } 775 | 776 | void EditDatabase(void) 777 | { 778 | if (Database[0]) { 779 | if (Selected) { 780 | string a[]; 781 | int KeyField = strsplit(a, Lines[0], '\t'); 782 | strsplit(a, Lines[Selected], '\t'); 783 | string key = a[KeyField]; 784 | string data; 785 | int entry; 786 | for (entry = 0; Database[entry]; entry++) { 787 | strsplit(a, Database[entry], DatabaseSeparator); 788 | if (a[0] == key) { 789 | data = Database[entry]; 790 | break; 791 | } 792 | } 793 | EditDatabaseEntry(key, entry); 794 | } 795 | else 796 | dlgMessageBox(tr("Please select a list entry first!")); 797 | } 798 | else 799 | dlgMessageBox(tr("Please load a database file first!")); 800 | } 801 | 802 | int OkToClose(void) 803 | { 804 | if (DatabaseModified) { 805 | switch (dlgMessageBox(tr("Database has been modified\n\nSave?"), tr("+&Yes"), tr("&No"), tr("-Cancel"))) { 806 | case 0: return SaveDatabase(); 807 | case 1: break; 808 | case 2: return 0; 809 | } 810 | } 811 | return 1; 812 | } 813 | 814 | void DisplayHelp(void) 815 | { 816 | dlgDialog(tr("Bill Of Material - Help")) { 817 | dlgHBoxLayout dlgSpacing(400); 818 | dlgHBoxLayout { 819 | dlgVBoxLayout dlgSpacing(300); 820 | dlgTextView(language() == "de" ? HelpTextDE : HelpTextEN); 821 | } 822 | dlgHBoxLayout { 823 | dlgStretch(1); 824 | dlgPushButton(tr("-Close")) dlgReject(); 825 | } 826 | }; 827 | } 828 | 829 | CollectPartData(); 830 | GenerateList(); 831 | 832 | dlgDialog(tr("Bill Of Material")) { 833 | dlgListView("", Lines, Selected) EditDatabase(); 834 | dlgHBoxLayout { 835 | dlgLabel(tr("Database:")); 836 | dlgLabel(DatabaseFile, 1); 837 | dlgStretch(1); 838 | dlgPushButton(tr("&Load")) if (OkToClose()) LoadDatabase(); 839 | dlgPushButton(tr("&New")) if (OkToClose()) NewDatabase(); 840 | } 841 | dlgHBoxLayout { 842 | dlgGroup(tr("List type")) { 843 | dlgRadioButton(tr("&Parts"), ListType) GeneratePartList(); 844 | dlgRadioButton(tr("&Values"), ListType) GenerateValueList(); 845 | } 846 | dlgGroup(tr("Output format")) { 847 | dlgRadioButton(tr("&Text"), OutputFormat); 848 | dlgRadioButton(tr("&HTML"), OutputFormat); 849 | } 850 | } 851 | dlgHBoxLayout { 852 | dlgStretch(1); 853 | dlgPushButton(tr("+Edit")) EditDatabase(); 854 | dlgPushButton(tr("Vie&w")) ViewList(); 855 | dlgPushButton(tr("&Save...")) SaveList(); 856 | dlgPushButton(tr("H&elp")) DisplayHelp(); 857 | dlgPushButton(tr("-Close")) if (OkToClose()) dlgAccept(); 858 | } 859 | }; 860 | --------------------------------------------------------------------------------