add assembly outputs to script

This commit is contained in:
2023-03-23 18:32:52 -06:00
parent db604e8abb
commit 52c826e373
5 changed files with 1194 additions and 1 deletions

View File

@@ -115,6 +115,8 @@ with zipfile.ZipFile(dir_gerber.with_suffix(".zip"), "w") as z:
z.write(f, f.name)
# %% Assembly files
# Assembly Drawing
subprocess.run(
[
"kicad-cli",
@@ -131,6 +133,26 @@ subprocess.run(
check=True,
)
# Position Files
subprocess.run(
[
"kicad-cli",
"pcb",
"export",
"pos",
str(root_project.with_suffix(".kicad_pcb")),
"-o",
str(dir_out / f"{project_name}.pos"),
"--format",
"ascii",
"--side",
"both",
],
check=True,
)
# BOM
subprocess.run(
[
"kicad-cli",
@@ -143,8 +165,17 @@ subprocess.run(
],
check=True,
)
# TODO: post-process XML BOM into something more useful or skip XML altogether and just make an interactive HTML BOM
subprocess.run(
[
"python3",
"/home/brendan/Documents/projects/bhht/common_libraries/plugins/bom_csv_grouped_extra.py", # TODO: move this
str(dir_out / f"{project_name}_bom.xml"),
str(dir_out / f"{project_name}_bom.csv"),
],
check=True,
)
# # Interactive BOM
# subprocess.run(
# [
# "python3",