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 4cd7c1b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/wireviz/Harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ 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
for _, cable in self.cables.items():
colorlengths = list(map(len, cable.colors))
if 4 in colorlengths or 6 in colorlengths:
pad = True
break
else:
pad = False

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

awg_fmt = ''
Expand Down Expand Up @@ -187,11 +197,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 4cd7c1b

Please sign in to comment.