This is an old revision of the document!
KiCAD 7.x for Team Configuration
Using Git Server with KiCAD
- Each functional PCB is a repository and each revision is a folder
.gitignore file
.gitignore
# Blacklist everything * # Whitelist all directories !*/ # Project files !*.kicad_pro # Schematic files !*.kicad_sch # PCB files !*.kicad_pcb # Project specific sym lib table !sym-lib-table # Project specific footprint lib table !fp-lib-table # Custom rules !*.kicad_dru # Schematic change list (user created) !SCH_Changelist.csv # PCB change list (user created) !PCB_Changelist.csv # Readme file !README.md # Ignor file !.gitignore
File types may not need to save
# For PCBs designed using KiCad: https://www.kicad.org/ # Format documentation: https://kicad.org/help/file-formats/ # Temporary files *.000 *.bak *.bck *.kicad_pcb-bak *.kicad_sch-bak *-backups *.kicad_prl *.sch-bak *~ _autosave-* *.tmp *-save.pro *-save.kicad_pcb fp-info-cache # Netlist files (exported from Eeschema) *.net # Autorouter files (exported from Pcbnew) *.dsn *.ses # Exported BOM files *.xml *.csv
Python Scripting
Hide 3D Models
from pcbnew import * board=GetBoard() c86=board.FindFootprintByReference('C86') d3=c86.Models() d3.clear() # this cleared all the 3D models - not what we want
I did (in the Scripting Console) models = fp.Models() m = models[0] m.m_Show = False pcbnew.Refresh()
Custom Rules
(version 1) (rule "Distance between different packages" (constraint courtyard_clearance (min 10mm)) (condition "A.Type == 'Footprint' && B.Type == 'Footprint' && A.Library_link == '*R_0402*' && B.Library_link == '*L_1210*'"))
Library Database Setup
Objectives
- Everyone uses the same library (symbol, footprint, 3D model)
- Only admins and librarians are allowed to create or modify library
- When a part is updated in the library, everyone gets the latest version automatically
- Fully specified parts (atomic)
- No duplications of symbols
- Automatic BOM generation without manual adjustment
- Extensible structure for new field to be added in the future
Folder Structure
- symbols - Holds generic schematic symbols in “.kicad_sym” files. Each file represents a category of parts. E.g. passives, ICs, diodes, magnetics, connectors, …
- footprints - Holds “.pretty” folders that hold footprint files (.kicad_mod files). Each “.pretty” folder represents a category of parts.
- 3dmodels - Holds “.3dshapes” folders than hold 3d model files (.step and .wrl files). Each “.3dshapes” folder represents a category of parts.
The folders shall resides on a centralized network server that is read only to most users.
MariaDB Database Structure
- create “kicad” database with utf8_general_ci collation
- create table “resistors” with columns (VARCHAR type) “epn” (key), “symbol”, “value”, “pkg”, “footprint”, “datasheet”, “mfg”, “mpn”, “descr”, “status”
- “status” can be “production”, “development”, “obsolete”, “restricted”
- “mfg” is manufacturer name
- “epn” is a unique internal part number. it is the database key
- “descr” is description
ODBC Connection
https://help.interfaceware.com/v6/connect-to-postgresql-from-windows-with-odbc
kicad_dbl file
{ "meta": { "version": 0 }, "name": "EE Components", "description": "EE Components", "source": { "type": "odbc", "dsn": "KiCad_DB", "username": "", "password": "", "timeout_seconds": 2, "connection_string": "" }, "libraries": [ { "name": "Resistors", "table": "Resistors", "key": "EPN", "symbols": "Symbol", "footprints": "Footprint", "fields": [ { "column": "MPN", "name": "MPN", "visible_on_add": false, "visible_in_chooser": true, "show_name": false }, { "column": "Value", "name": "Value", "visible_on_add": true, "visible_in_chooser": true, "show_name": false }, { "column": "Pkg", "name": "Pkg", "visible_on_add": false, "visible_in_chooser": true, "show_name": false }, { "column": "MFG", "name": "MFG", "visible_on_add": false, "visible_in_chooser": true, "show_name": false }, { "column": "Status", "name": "Status", "visible_on_add": false, "visible_in_chooser": true, "show_name": false } ], "properties": { "description": "Descr" } }, { "name": "Diodes", "table": "Diodes", "key": "EPN", "symbols": "Symbol", "footprints": "Footprint", "fields": [ { "column": "MPN", "name": "MPN", "visible_on_add": false, "visible_in_chooser": true, "show_name": false }, { "column": "Value", "name": "Value", "visible_on_add": false, "visible_in_chooser": true, "show_name": false }, { "column": "Pkg", "name": "Pkg", "visible_on_add": false, "visible_in_chooser": true, "show_name": false }, { "column": "MFG", "name": "MFG", "visible_on_add": false, "visible_in_chooser": true, "show_name": false }, { "column": "Status", "name": "Status", "visible_on_add": false, "visible_in_chooser": true, "show_name": false } ], "properties": { "description": "Descr" } }, { "name": "Capacitors", "table": "Capacitors", "key": "EPN", "symbols": "Symbol", "footprints": "Footprint", "fields": [ { "column": "MPN", "name": "MPN", "visible_on_add": false, "visible_in_chooser": true, "show_name": false }, { "column": "Value", "name": "Value", "visible_on_add": true, "visible_in_chooser": true, "show_name": false }, { "column": "Pkg", "name": "Pkg", "visible_on_add": false, "visible_in_chooser": true, "show_name": false }, { "column": "MFG", "name": "MFG", "visible_on_add": false, "visible_in_chooser": true, "show_name": false }, { "column": "Status", "name": "Status", "visible_on_add": false, "visible_in_chooser": true, "show_name": false } ], "properties": { "description": "Descr" } } ] }
Saving Configuration Files
KICAD_CONFIG_HOME - If we consider how KiCad is started and how the path variables are defined, this is the most important of those variables. Namely, every other variable can be defined from within KiCad so that they are stored into KiCad's own configuration. But naturally you can't store the location of the configuration into the configuration. This is the only variable you absolutely must set from outside KiCad itself if you want to change it. Every other variable you can change through KiCad's Configure Paths dialog, provided that the variable hasn't already been set from outside KiCad as an actual system environment variable.
References
Useful Git Options
.gitignore
# Blacklist everything * # Whitelist all directories !*/ # Whitelist the file you're interested in. !*.cocci
git clone -b mybranch --single-branch git://sub.domain.com/repo.git
How to git clone only a specific file or directory
Git does not directly support cloning only a specific file or directory from a repository. However, you can use –depth 1 to clone only one specific revision (as opposed to the entire history) and use –no-checkout followed by git sparse-checkout set to checkout not the entire file tree but only a specific file.