Skip to content

Commit

Permalink
Add show_wirenumbers attribute to Cable class
Browse files Browse the repository at this point in the history
  • Loading branch information
formatc1702 committed Nov 11, 2020
1 parent add963b commit a1b626a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wireviz/DataClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class Cable:
color_code: Optional[ColorScheme] = None
show_name: bool = True
show_wirecount: bool = True
show_wirenumbers: Optional[bool] = None
ignore_in_bom: bool = False
additional_components: List[AdditionalComponent] = field(default_factory=list)

Expand Down Expand Up @@ -256,6 +257,10 @@ def __post_init__(self) -> None:
else:
raise Exception('lists of part data are only supported for bundles')

# by default, show wire numbers for cables, hide for bundles
if not self.show_wirenumbers:
self.show_wirenumbers = self.category != 'bundle'

for i, item in enumerate(self.additional_components):
if isinstance(item, dict):
self.additional_components[i] = AdditionalComponent(**item)
Expand Down

0 comments on commit a1b626a

Please sign in to comment.