Add new bom_item_number property to components

This commit is contained in:
Daniel Rojas 2021-03-23 13:04:31 +01:00
parent 6aa53f6ce4
commit 09d5496ca4
2 changed files with 4 additions and 2 deletions

View File

@ -105,6 +105,7 @@ class Connector:
hide_disconnected_pins: bool = False
autogenerate: bool = False
loops: List[List[Pin]] = field(default_factory=list)
bom_item_number: Optional[int] = None
ignore_in_bom: bool = False
additional_components: List[AdditionalComponent] = field(default_factory=list)
@ -189,6 +190,7 @@ class Cable:
show_name: bool = True
show_wirecount: bool = True
show_wirenumbers: Optional[bool] = None
bom_item_number: Optional[int] = None
ignore_in_bom: bool = False
additional_components: List[AdditionalComponent] = field(default_factory=list)

View File

@ -115,7 +115,7 @@ class Harness:
html = []
rows = [[remove_links(connector.name) if connector.show_name else None],
[bom_bubble('###') if self.show_bom_item_numbers else None, # TODO: Show actual BOM number
[bom_bubble(connector.bom_item_number) if self.show_bom_item_numbers else None, # TODO: Show actual BOM number
html_line_breaks(connector.type),
html_line_breaks(connector.subtype),
f'{connector.pincount}-pin' if connector.show_pincount else None,
@ -197,7 +197,7 @@ class Harness:
awg_fmt = f' ({mm2_equiv(cable.gauge)} mm\u00B2)'
rows = [[remove_links(cable.name) if cable.show_name else None],
[bom_bubble('###') if self.show_bom_item_numbers else None, # TODO: Show actual BOM number
[bom_bubble(cable.bom_item_number) if self.show_bom_item_numbers else None, # TODO: Show actual BOM number
html_line_breaks(cable.type),
f'{cable.wirecount}x' if cable.show_wirecount else None,
f'{cable.gauge} {cable.gauge_unit}{awg_fmt}' if cable.gauge else None,