From 4796c7cc9748d3208e4d5ed0cd3189b1c4500453 Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Thu, 2 Jul 2020 19:45:28 +0200 Subject: [PATCH] Fix bug of non-bundle wires appearing in BOM --- src/wireviz/Harness.py | 2 +- tutorial/tutorial08.bom.tsv | 4 ---- tutorial/tutorial08.html | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index c0df0aa..4d1693b 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -350,7 +350,7 @@ class Harness: # bundles (ignores wirecount) wirelist = [] # 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']) for group in groups: items = {k: v for k, v in self.cables.items() if bundle_group(v) == group} diff --git a/tutorial/tutorial08.bom.tsv b/tutorial/tutorial08.bom.tsv index 01e17ba..682dd4a 100644 --- a/tutorial/tutorial08.bom.tsv +++ b/tutorial/tutorial08.bom.tsv @@ -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 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², 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², YE 1 m W1 Wire, 0.25 mm², YE 1 m W2 WiresCo W1-YE WIRE1 diff --git a/tutorial/tutorial08.html b/tutorial/tutorial08.html index 20615ca..a031af8 100644 --- a/tutorial/tutorial08.html +++ b/tutorial/tutorial08.html @@ -292,4 +292,4 @@ -

Bill of Materials

ItemQtyUnitDesignatorsManufacturerManufacturer part numberInternal part number
Connector, Molex KK 254, female, 4 pins2X1, X3Molex22013047
Connector, Molex KK 254, female, 4 pins1X2Molex22013047CON4
Cable, 4 x 0.25 mm²1mW1CablesCoABC123CAB1
Wire, 0.25 mm², BK2mW2WiresCoW1-BKWIRE2
Wire, 0.25 mm², BN1mW1
Wire, 0.25 mm², OG1mW1
Wire, 0.25 mm², RD1mW1
Wire, 0.25 mm², RD1mW2WiresCoW1-RDWIRE3
Wire, 0.25 mm², YE1mW1
Wire, 0.25 mm², YE1mW2WiresCoW1-YEWIRE1
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignatorsManufacturerManufacturer part numberInternal part number
Connector, Molex KK 254, female, 4 pins2X1, X3Molex22013047
Connector, Molex KK 254, female, 4 pins1X2Molex22013047CON4
Cable, 4 x 0.25 mm²1mW1CablesCoABC123CAB1
Wire, 0.25 mm², BK2mW2WiresCoW1-BKWIRE2
Wire, 0.25 mm², RD1mW2WiresCoW1-RDWIRE3
Wire, 0.25 mm², YE1mW2WiresCoW1-YEWIRE1
\ No newline at end of file