Skip to content

Commit

Permalink
Generate bom
Browse files Browse the repository at this point in the history
  • Loading branch information
laenzlinger committed Nov 2, 2024
1 parent 50576a3 commit fd51ac1
Show file tree
Hide file tree
Showing 4 changed files with 6,252 additions and 2,323 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fp-info-cache
rescue-backup/

*.tsv
*.lck
bom/

# Gerber export output
Expand Down
74 changes: 74 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.DEFAULT_GOAL := help
.PHONY: bom test step pdf pos clean

GIT_HASH = $(shell git rev-parse HEAD:sourceDirectory HEAD:file.py | git hash-object --stdin)
PROJECT_NAME = pedalboard-led-ring

test: ## Run ERC and DRC checks
mkdir -p out
kicad-cli sch erc \
--define-var GIT_HASH=$(GIT_HASH) \
--output out/erc.rpt \
--severity-warning \
--severity-error \
--exit-code-violations \
$(PROJECT_NAME).kicad_sch
kicad-cli pcb drc \
--schematic-parity \
--define-var GIT_HASH=$(GIT_HASH) \
--output out/drc.rpt \
--severity-error \
--severity-warning \
--exit-code-violations \
$(PROJECT_NAME).kicad_pcb


step: ## export 3D model
mkdir -p out
kicad-cli pcb export step \
--define-var GIT_HASH=$(GIT_HASH) \
--output out/$(PROJECT_NAME).step \
--subst-models \
--force \
$(PROJECT_NAME).kicad_pcb

pdf: ## export PDF (schematic and PCB)
mkdir -p out
kicad-cli pcb export pdf \
--define-var GIT_HASH=$(GIT_HASH) \
--output out/$(PROJECT_NAME)-pcb-front.pdf \
--layers F.Cu \
$(PROJECT_NAME).kicad_pcb
kicad-cli pcb export pdf \
--define-var GIT_HASH=$(GIT_HASH) \
--output out/$(PROJECT_NAME)-pcb-back.pdf \
--layers B.Cu \
$(PROJECT_NAME).kicad_pcb
kicad-cli sch export pdf \
--define-var GIT_HASH=$(GIT_HASH) \
--output out/$(PROJECT_NAME)-schematic.pdf \
$(PROJECT_NAME).kicad_sch

bom: ## export BOM
mkdir -p out
kicad-cli sch export bom \
--preset "pedalboard" \
--output out/$(PROJECT_NAME)-bom.csv \
$(PROJECT_NAME).kicad_sch
../dotgithub/scripts/bon2inventree out/$(PROJECT_NAME)-bom.csv out/$(PROJECT_NAME)-inventree-bom.csv

pos: ## export Position file
mkdir -p out
kicad-cli pcb export pos \
--output out/$(PROJECT_NAME).pos \
--format ascii \
--side front \
--units mm \
--smd-only \
$(PROJECT_NAME).kicad_pcb

clean:
rm -rf out

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
184 changes: 183 additions & 1 deletion pedalboard-led-ring.kicad_pro
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@
],
"zones_allow_external_fillets": false
},
"ipc2581": {
"dist": "",
"distpn": "",
"internal_id": "",
"mfg": "",
"mpn": ""
},
"layer_presets": [],
"viewports": []
},
Expand Down Expand Up @@ -459,14 +466,183 @@
"gencad": "",
"idf": "",
"netlist": "../../../../../../Applications/KiCad/KiCad.app/Contents/Applications/",
"plot": "",
"pos_files": "",
"specctra_dsn": "",
"step": "",
"svg": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"bom_export_filename": "",
"bom_fmt_presets": [],
"bom_fmt_settings": {
"field_delimiter": ",",
"keep_line_breaks": false,
"keep_tabs": false,
"name": "CSV",
"ref_delimiter": ",",
"ref_range_delimiter": "",
"string_delimiter": "\""
},
"bom_presets": [
{
"exclude_dnp": false,
"fields_ordered": [
{
"group_by": false,
"label": "Reference",
"name": "Reference",
"show": true
},
{
"group_by": true,
"label": "Value",
"name": "Value",
"show": true
},
{
"group_by": false,
"label": "Datasheet",
"name": "Datasheet",
"show": true
},
{
"group_by": false,
"label": "Footprint",
"name": "Footprint",
"show": true
},
{
"group_by": false,
"label": "Qty",
"name": "${QUANTITY}",
"show": true
},
{
"group_by": true,
"label": "DNP",
"name": "${DNP}",
"show": true
},
{
"group_by": false,
"label": "#",
"name": "${ITEM_NUMBER}",
"show": false
},
{
"group_by": false,
"label": "Sim.Device",
"name": "Sim.Device",
"show": false
},
{
"group_by": false,
"label": "Sim.Pins",
"name": "Sim.Pins",
"show": false
},
{
"group_by": false,
"label": "Supplier",
"name": "Supplier",
"show": true
},
{
"group_by": false,
"label": "Description",
"name": "Description",
"show": false
}
],
"filter_string": "",
"group_symbols": true,
"name": "pedalboard",
"sort_asc": true,
"sort_field": "Reference"
}
],
"bom_settings": {
"exclude_dnp": false,
"fields_ordered": [
{
"group_by": false,
"label": "Reference",
"name": "Reference",
"show": true
},
{
"group_by": true,
"label": "Value",
"name": "Value",
"show": true
},
{
"group_by": false,
"label": "Datasheet",
"name": "Datasheet",
"show": true
},
{
"group_by": false,
"label": "Footprint",
"name": "Footprint",
"show": true
},
{
"group_by": false,
"label": "Qty",
"name": "${QUANTITY}",
"show": true
},
{
"group_by": true,
"label": "DNP",
"name": "${DNP}",
"show": true
},
{
"group_by": false,
"label": "#",
"name": "${ITEM_NUMBER}",
"show": false
},
{
"group_by": false,
"label": "Sim.Device",
"name": "Sim.Device",
"show": false
},
{
"group_by": false,
"label": "Sim.Pins",
"name": "Sim.Pins",
"show": false
},
{
"group_by": false,
"label": "Supplier",
"name": "Supplier",
"show": true
},
{
"group_by": false,
"label": "Description",
"name": "Description",
"show": false
}
],
"filter_string": "",
"group_symbols": true,
"name": "",
"sort_asc": true,
"sort_field": "Reference"
},
"connection_grid_size": 50.0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
Expand All @@ -480,6 +656,11 @@
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.375,
"operating_point_overlay_i_precision": 3,
"operating_point_overlay_i_range": "~A",
"operating_point_overlay_v_precision": 3,
"operating_point_overlay_v_range": "~V",
"overbar_offset_ratio": 1.23,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.15
},
Expand All @@ -495,14 +676,15 @@
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_dissipations": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"02aefeb1-bdda-4e04-a64a-6cb1fcf66702",
""
"Root"
]
],
"text_variables": {}
Expand Down
Loading

0 comments on commit fd51ac1

Please sign in to comment.