wireviz / WireViz

Easily document cables and wiring harnesses.
GNU General Public License v3.0
4.31k stars 220 forks source link

[feature] Alphanumeric pin designators #336

Closed martinrieder closed 4 months ago

martinrieder commented 4 months ago

I have been working with the latest release of WireViz quite happily, not realizing the huge amount of improvement done in the dev branch. For my work with some connectors that are using alphanumeric pin designators, I needed to make a minor change in the DataClasses by simply replacing the int with str:

Pin = Union[str, PlainText] # Pin identifier

Then, in order to make Graphviz properly assign the wires, I also had to replace {pinindex+1} by the {pinname} in the HTML table output. Due to #229, this probably will not be necessary, but please let me know if I am missing something.

pinhtml.append(f' <td port="p{pinname}r">{pinname}</td>')

I cannot see that it was possible to create pin identifiers from a string like suggeted in #160 without the suggested change above. See the example that it works well for my use case:

Example-Harness-Adapter

martinrieder commented 4 months ago

Sorry for this report by mistake. I wanted to confirm my statements by freshly reinstalling 0.3.2 from PyPy, but could not reproduce the issue. Not sure what I was doing wrong in the first place.