Skip to content

Commit

Permalink
Change wire padding behavior
Browse files Browse the repository at this point in the history
Addresses #131
  • Loading branch information
formatc1702 committed Jul 27, 2020
1 parent b9a4783 commit 3853672
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/wireviz/Harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ def create_graph(self) -> Graph:
dot.edge(f'{connector.name}:p{loop[0]}{loop_side}:{loop_dir}',
f'{connector.name}:p{loop[1]}{loop_side}:{loop_dir}')

# determine if there are double- or triple-colored wires in the harness;
# if so, pad single-color wires to make all wires of equal thickness
pad = any(len(colorstr) > 2 for cable in self.cables.values() for colorstr in cable.colors)

for _, cable in self.cables.items():

awg_fmt = ''
Expand Down Expand Up @@ -187,11 +191,6 @@ def create_graph(self) -> Graph:

html = f'{html}<tr><td><table border="0" cellspacing="0" cellborder="0">' # conductor table

# determine if there are double- or triple-colored wires;
# if so, pad single-color wires to make all wires of equal thickness
colorlengths = list(map(len, cable.colors))
pad = 4 in colorlengths or 6 in colorlengths

for i, connection_color in enumerate(cable.colors, 1):
p = []
p.append(f'<!-- {i}_in -->')
Expand Down

0 comments on commit 3853672

Please sign in to comment.