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