Fix bug of non-bundle wires appearing in BOM

This commit is contained in:
Daniel Rojas 2020-07-02 19:45:28 +02:00
parent 21b3c9e59b
commit 4796c7cc97
3 changed files with 2 additions and 6 deletions

View File

@ -350,7 +350,7 @@ class Harness:
# bundles (ignores wirecount) # bundles (ignores wirecount)
wirelist = [] wirelist = []
# list all cables again, since bundles are represented as wires internally, with the category='bundle' set # list all cables again, since bundles are represented as wires internally, with the category='bundle' set
bundle_group = lambda b: (b.type, b.gauge, b.gauge_unit, b.length) # TODO: Why is b.length included? bundle_group = lambda b: (b.category, b.type, b.gauge, b.gauge_unit, b.length) # TODO: Why is b.length included?
groups = Counter([bundle_group(v) for v in self.cables.values() if v.category == 'bundle']) groups = Counter([bundle_group(v) for v in self.cables.values() if v.category == 'bundle'])
for group in groups: for group in groups:
items = {k: v for k, v in self.cables.items() if bundle_group(v) == group} items = {k: v for k, v in self.cables.items() if bundle_group(v) == group}

View File

@ -3,9 +3,5 @@ Connector, Molex KK 254, female, 4 pins 2 X1, X3 Molex 22013047
Connector, Molex KK 254, female, 4 pins 1 X2 Molex 22013047 CON4 Connector, Molex KK 254, female, 4 pins 1 X2 Molex 22013047 CON4
Cable, 4 x 0.25 mm² 1 m W1 CablesCo ABC123 CAB1 Cable, 4 x 0.25 mm² 1 m W1 CablesCo ABC123 CAB1
Wire, 0.25 mm², BK 2 m W2 WiresCo W1-BK WIRE2 Wire, 0.25 mm², BK 2 m W2 WiresCo W1-BK WIRE2
Wire, 0.25 mm², BN 1 m W1
Wire, 0.25 mm², OG 1 m W1
Wire, 0.25 mm², RD 1 m W1
Wire, 0.25 mm², RD 1 m W2 WiresCo W1-RD WIRE3 Wire, 0.25 mm², RD 1 m W2 WiresCo W1-RD WIRE3
Wire, 0.25 mm², YE 1 m W1
Wire, 0.25 mm², YE 1 m W2 WiresCo W1-YE WIRE1 Wire, 0.25 mm², YE 1 m W2 WiresCo W1-YE WIRE1

1 Item Qty Unit Designators Manufacturer Manufacturer part number Internal part number
3 Connector, Molex KK 254, female, 4 pins 1 X2 Molex 22013047 CON4
4 Cable, 4 x 0.25 mm² 1 m W1 CablesCo ABC123 CAB1
5 Wire, 0.25 mm², BK 2 m W2 WiresCo W1-BK WIRE2
Wire, 0.25 mm², BN 1 m W1
Wire, 0.25 mm², OG 1 m W1
Wire, 0.25 mm², RD 1 m W1
6 Wire, 0.25 mm², RD 1 m W2 WiresCo W1-RD WIRE3
Wire, 0.25 mm², YE 1 m W1
7 Wire, 0.25 mm², YE 1 m W2 WiresCo W1-YE WIRE1

File diff suppressed because one or more lines are too long