This commit is contained in:
2025-12-31 11:48:04 +13:00
parent fcbb5eafc1
commit bca6632809

View File

@@ -21,14 +21,10 @@ PCB_PDF_FILE_SUFFIX = "_pcb"
SCHEMATIC_OUTPUT_PATH = "docs/"
SCHEMATIC_FILE_SUFFIX = "_schematic"
TEMP_DRC_REPORT_NAME = "_drc"
TEMP_ERC_REPORT_NAME = "_erc"
TEMP_BOM_REPORT_NAME = "_bom"
class OutputReportType(Enum):
JSON = 1
RPT = 2
@@ -82,7 +78,7 @@ class KicadProject:
if format_type == OutputReportType.RPT:
return txt.read()
def process_bom(self, return_csv : bool = False) -> None:
def process_bom(self, return_csv : bool = False) -> None | list[list[str]]:
sch_file_path = self.project_path / f"{self.project_name}.kicad_sch"
bom_output_path = Path(TEMP_FILE_PATH) / f"{self.project_name}{TEMP_DRC_REPORT_NAME}.csv"
subprocess.call(
@@ -115,11 +111,6 @@ class KicadProject:
shell=True,
)
# look i dont know what you want to do
# but here you go
def create_3d_model(self) -> None:
...
# i am not giving you the pdf to output if you want to do that yourself go ahead
def create_schmatic_pdf(self) -> None:
sch_file_path = self.project_path / f"{self.project_name}.kicad_sch"
@@ -137,18 +128,6 @@ class KicadProject:
shell=True,
)
def export_pcb(self) -> None:
...
def download_datasheets(self) -> None:
...
class Report:
def export() -> str:
...
def main() -> None:
# find all kicad project files to operate on
@@ -158,15 +137,12 @@ def main() -> None:
print(type(path.parent))
k = KicadProject(path)
k.drc_check()
print(k.erc_check(return_report=True))
print(k.process_bom(return_csv=True))
k.erc_check()
k.process_bom()
k.create_schmatic_pdf()
k.create_pcb_pdf()
k.get_image()
print("hello world");
if __name__ == "__main__":