PCB

Library Framework

We use this framework of library folders:

  • Eagle
  • Projects
  • Ex

Schematic Draft

Draw schematic draft:

Value and Partno

Based on partlist and BOM excel sheet:

  • use: D:\EAGLE-Tools\bom-ex\value-partno\write-sheets.js.

BOM

Two websites: https://octopart.com/, DigiKey

Firefox Browser Extension

Please refer to:

  • Your first extension
  • To install: Open about:debugging in Firefox, click Load Temporary Add-on to select your extension.

RunWith

Please refer to:

Buttonize Digi-Key Part Number

We copy/modify example of "native-messaging":

  • Example extensions
  • D:\EAGLE-Tools\bom-ex\runwith-native-messaging\add-on-new: manifest.json
  • --- background.js: connect to ping_pong app
  • --- find-dknumber.js: buttonize Digi-Key part number.
  • Windows Registry for ping_pong app:
  • --- App Manifest Location
  • --- D:\EAGLE-Tools\bom-ex\runwith-native-messaging: ping-pong.reg
  • D:\EAGLE-Tools\bom-ex\runwith-native-messaging\app: ping_pong.json
  • --- which calls: ping_pong_win.bat
  • --- which calls: D:\EAGLE-Tools\bom-ex\Grab-Bag-master\Bom-ex\new-addDKPartToBom-ex.py
  • --- which adds to: D:\EAGLE-Tools\bom-ex\*-db.txt

Note: to jump to a given line number, you can directly use: $text->setCurrentLineNumber($x);.

Finalize Schematic

Finalize schematic:

  • Collect all components to D:\EAGLE-Tools\bom-ex\*-db.txt
  • Replace components with correct attributes: value, PARTNO (manufacturer)
  • PARTNO (manufacturer) is the keyword for matching items in database
  • Check with D:\EAGLE-Tools\bom-ex\mybom-ex.ulp: click Load DB

Finishing Board

Please refer to:

To smash all the parts, try:

  • display none tOrigin bOrigin;
  • group all;
  • smash (>0 0);
  • display last;

To change the font and ratio, try:

  • display none tNames bNames;
  • group all;
  • change font vector (>0 0);
  • change size 40mil (C>0 0);
  • change ratio 15 (>0 0);
  • display last;

View in Gerbv

Please refer to:

  • drill layer wrong size
  • Right click main.drd layer, and select Edit file format dialog.
  • Turn off auto detect and set 5 digit.

Text API

One of the main entity:

Important: lines is an array of string stripped from their line break character.

If you need to manipulate a simple string you can use Text::fromString:

Important: please note that upon creation, the current line number is initialized to the first line: 0 (array indexed).

Side note on Line Breaks

A StringUtil::detectLineBreak method is used to find the line break, this is done using the following rules:

  • \r\n for windows
  • \n for any other operating system
  • PHP_EOL if no line ending has been found

File API

The other main entity:

Next readings

Previous readings