Merge 5e4271df1c22e5f73b81ef2b34f915657d4bbb25 into e4fe099f8c7b86736aee7b4227cc794b6e8b36f0
This commit is contained in:
commit
6e0db88962
@ -253,6 +253,7 @@ class Cable:
|
||||
spn: Union[MultilineHypertext, List[MultilineHypertext], None] = None
|
||||
pn: Union[Hypertext, List[Hypertext], None] = None
|
||||
category: Optional[str] = None
|
||||
style: Optional[str] = None
|
||||
type: Optional[MultilineHypertext] = None
|
||||
gauge: Optional[float] = None
|
||||
gauge_unit: Optional[str] = None
|
||||
@ -270,6 +271,7 @@ class Cable:
|
||||
show_name: Optional[bool] = None
|
||||
show_wirecount: bool = True
|
||||
show_wirenumbers: Optional[bool] = None
|
||||
show_colorname: bool = True
|
||||
ignore_in_bom: bool = False
|
||||
additional_components: List[AdditionalComponent] = field(default_factory=list)
|
||||
|
||||
@ -362,9 +364,14 @@ class Cable:
|
||||
else:
|
||||
raise Exception("lists of part data are only supported for bundles")
|
||||
|
||||
|
||||
if self.show_name is None:
|
||||
# hide designators for auto-generated cables by default
|
||||
self.show_name = self.name[0:2] != "__"
|
||||
# hide designators for simple and for auto-generated cables by default
|
||||
self.show_name = self.style != "simple" and self.name[0:2] != "__"
|
||||
|
||||
if self.show_wirecount is None:
|
||||
# hide wirecount for simple (1 pin) connectors by default
|
||||
self.show_wirecount = self.style != "simple"
|
||||
|
||||
if self.show_wirenumbers is None:
|
||||
# by default, show wire numbers for cables, hide for bundles
|
||||
|
||||
@ -352,7 +352,7 @@ class Harness:
|
||||
colorstr = wv_colors.translate_color(
|
||||
connection_color, self.options.color_mode
|
||||
)
|
||||
if colorstr:
|
||||
if colorstr and cable.show_colorname:
|
||||
wireinfo.append(colorstr)
|
||||
if cable.wirelabels:
|
||||
wireinfo.append(wirelabel if wirelabel is not None else "")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user