diff --git a/src/wireviz/DataClasses.py b/src/wireviz/DataClasses.py index d14e4459..e7172ce0 100644 --- a/src/wireviz/DataClasses.py +++ b/src/wireviz/DataClasses.py @@ -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 @@ def __post_init__(self) -> None: 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 diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index c4af2364..5678e4ac 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -352,7 +352,7 @@ def create_graph(self) -> Graph: 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 "")