diff --git a/README.md b/README.md index ed2b4df3..e973b634 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ WireViz is a tool for easily documenting cables, wiring harnesses and connector * Human readable * Easy version control * YAML syntax + * UTF-8 input and output files for special character support * Understands and uses color abbreviations as per [IEC 60757](https://en.wikipedia.org/wiki/Electronic_color_code#Color_band_system) (black=BK, red=RD, ...) * Optionally outputs colors as abbreviation (e.g. 'YE'), full name (e.g. 'yellow') or hex value (e.g. '#ffff00'), with choice of UPPER or lower case * Auto-generates standard wire color schemes and allows custom ones if needed @@ -49,11 +50,11 @@ connectors: X1: type: D-Sub subtype: female - pinout: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI] + pinlabels: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI] X2: type: Molex KK 254 subtype: female - pinout: [GND, RX, TX] + pinlabels: [GND, RX, TX] cables: W1: diff --git a/examples/demo01.html b/examples/demo01.html index fe2fe425..f613f50f 100644 --- a/examples/demo01.html +++ b/examples/demo01.html @@ -171,4 +171,4 @@ -

Bill of Materials

ItemQtyUnitDesignators
Connector, D-Sub, female, 9 pins1X1
Connector, Molex KK 254, female, 3 pins1X2
Cable, 3 x 0.25 mm² shielded0.2mW1
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, D-Sub, female, 9 pins1X1
Connector, Molex KK 254, female, 3 pins1X2
Cable, 3 x 0.25 mm² shielded0.2mW1
\ No newline at end of file diff --git a/examples/demo01.yml b/examples/demo01.yml index ae1b4a51..56c77c11 100644 --- a/examples/demo01.yml +++ b/examples/demo01.yml @@ -2,11 +2,11 @@ connectors: X1: type: D-Sub subtype: female - pinout: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI] + pinlabels: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI] X2: type: Molex KK 254 subtype: female - pinout: [GND, RX, TX] + pinlabels: [GND, RX, TX] cables: W1: diff --git a/examples/demo02.bom.tsv b/examples/demo02.bom.tsv index bbaf4a13..c71ca775 100644 --- a/examples/demo02.bom.tsv +++ b/examples/demo02.bom.tsv @@ -1,5 +1,5 @@ Item Qty Unit Designators -Connector, Crimp ferrule, 0.25 mm² 2 +Connector, Crimp ferrule, 0.25 mm², YE 2 Connector, Molex KK 254, female, 4 pins 2 X2, X3 Connector, Molex KK 254, female, 5 pins 1 X4 Connector, Molex KK 254, female, 8 pins 1 X1 diff --git a/examples/demo02.gv b/examples/demo02.gv index cc27fe9c..746306f8 100644 --- a/examples/demo02.gv +++ b/examples/demo02.gv @@ -8,8 +8,8 @@ graph { X2 [label=<
X2
Molex KK 254female4-pin
1GND
2+5V
3SCL
4SDA
> fillcolor=white margin=0 shape=none style=filled] X3 [label=<
X3
Molex KK 254female4-pin
1GND
2+5V
3SCL
4SDA
> fillcolor=white margin=0 shape=none style=filled] X4 [label=<
X4
Molex KK 254female5-pin
1GND
2+12V
3MISO
4MOSI
5SCK
> fillcolor=white margin=0 shape=none style=filled] - _ferrule_crimp_1 [label=<
Crimp ferrule0.25 mm²
> fillcolor=white margin=0 shape=none style=filled] - _ferrule_crimp_2 [label=<
Crimp ferrule0.25 mm²
> fillcolor=white margin=0 shape=none style=filled] + _ferrule_crimp_1 [label=<
Crimp ferrule0.25 mm²YE
> fillcolor=white margin=0 shape=none style=filled] + _ferrule_crimp_2 [label=<
Crimp ferrule0.25 mm²YE
> fillcolor=white margin=0 shape=none style=filled] edge [color="#000000:#000000:#000000"] X1:p1r:e -- W1:w1:w W1:w1:e -- X2:p1l:w @@ -51,11 +51,9 @@ graph { W3 [label=<
W3
4x0.14 mm² (26 AWG)0.3 m
 
X1:1BKX4:1
X1:5BUX4:3
X1:6OGX4:4
X1:7VTX4:5
 
> fillcolor=white margin=0 shape=box style="filled,dashed"] edge [color="#000000:#000000:#000000"] _ferrule_crimp_1:e -- W4:w1:w - edge [color="#000000:#ff0000:#000000"] - _ferrule_crimp_2:e -- W4:w2:w - edge [color="#000000:#000000:#000000"] W4:w1:e -- X4:p1l:w edge [color="#000000:#ff0000:#000000"] + _ferrule_crimp_2:e -- W4:w2:w W4:w2:e -- X4:p2l:w W4 [label=<
W4
2x0.25 mm² (24 AWG)0.3 m
 
BKX4:1
RDX4:2
 
> fillcolor=white margin=0 shape=box style=""] } diff --git a/examples/demo02.html b/examples/demo02.html index b632124a..9c3d15ab 100644 --- a/examples/demo02.html +++ b/examples/demo02.html @@ -3,502 +3,510 @@ - + - + X1 - - -X1 - -Molex KK 254 - -female - -8-pin - -GND - -1 - -+5V - -2 - -SCL - -3 - -SDA - -4 - -MISO - -5 - -MOSI - -6 - -SCK - -7 - -N/C - -8 + + +X1 + +Molex KK 254 + +female + +8-pin + +GND + +1 + ++5V + +2 + +SCL + +3 + +SDA + +4 + +MISO + +5 + +MOSI + +6 + +SCK + +7 + +N/C + +8 W1 - - -W1 - -4x - -0.14 mm² (26 AWG) - -0.2 m -  -X1:1 -BK -X2:1 - - - -X1:2 -RD -X2:2 - - - -X1:3 -YE -X2:3 - - - -X1:4 -GN -X2:4 - - - -  + + +W1 + +4x + +0.14 mm² (26 AWG) + +0.2 m +  +X1:1 +BK +X2:1 + + + +X1:2 +RD +X2:2 + + + +X1:3 +YE +X2:3 + + + +X1:4 +GN +X2:4 + + + +  X1:e--W1:w - - - + + + X1:e--W1:w - - - + + + X1:e--W1:w - - - + + + X1:e--W1:w - - - + + + W2 - - -W2 - -4x - -0.14 mm² (26 AWG) - -0.4 m -  -X1:1 -BK -X3:1 - - - -X1:2 -RD -X3:2 - - - -X1:3 -YE -X3:3 - - - -X1:4 -GN -X3:4 - - - -  + + +W2 + +4x + +0.14 mm² (26 AWG) + +0.4 m +  +X1:1 +BK +X3:1 + + + +X1:2 +RD +X3:2 + + + +X1:3 +YE +X3:3 + + + +X1:4 +GN +X3:4 + + + +  X1:e--W2:w - - - + + + X1:e--W2:w - - - + + + X1:e--W2:w - - - + + + X1:e--W2:w - - - + + + W3 - - -W3 - -4x - -0.14 mm² (26 AWG) - -0.3 m -  -X1:1 -BK -X4:1 - - - -X1:5 -BU -X4:3 - - - -X1:6 -OG -X4:4 - - - -X1:7 -VT -X4:5 - - - -  + + +W3 + +4x + +0.14 mm² (26 AWG) + +0.3 m +  +X1:1 +BK +X4:1 + + + +X1:5 +BU +X4:3 + + + +X1:6 +OG +X4:4 + + + +X1:7 +VT +X4:5 + + + +  X1:e--W3:w - - - + + + X1:e--W3:w - - - + + + X1:e--W3:w - - - + + + X1:e--W3:w - - - + + + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -+5V - -3 - -SCL - -4 - -SDA + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + ++5V + +3 + +SCL + +4 + +SDA X3 - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -+5V - -3 - -SCL - -4 - -SDA + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + ++5V + +3 + +SCL + +4 + +SDA X4 - - -X4 - -Molex KK 254 - -female - -5-pin - -1 - -GND - -2 - -+12V - -3 - -MISO - -4 - -MOSI - -5 - -SCK + + +X4 + +Molex KK 254 + +female + +5-pin + +1 + +GND + +2 + ++12V + +3 + +MISO + +4 + +MOSI + +5 + +SCK _ferrule_crimp_1 - - -Crimp ferrule - -0.25 mm² + + +Crimp ferrule + +0.25 mm² + +YE + + W4 - - -W4 - -2x - -0.25 mm² (24 AWG) - -0.3 m -  -BK -X4:1 - - - -RD -X4:2 - - - -  + + +W4 + +2x + +0.25 mm² (24 AWG) + +0.3 m +  +BK +X4:1 + + + +RD +X4:2 + + + +  _ferrule_crimp_1:e--W4:w - - - + + + _ferrule_crimp_2 - - -Crimp ferrule - -0.25 mm² + + +Crimp ferrule + +0.25 mm² + +YE + + - + _ferrule_crimp_2:e--W4:w - - - + + + W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + W2:e--X3:w - - - + + + W2:e--X3:w - - - + + + W2:e--X3:w - - - + + + W2:e--X3:w - - - + + + W3:e--X4:w - - - + + + W3:e--X4:w - - - + + + W3:e--X4:w - - - + + + W3:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + W4:e--X4:w - - - + + + -

Bill of Materials

ItemQtyUnitDesignators
Connector, Crimp ferrule, 0.25 mm²2
Connector, Molex KK 254, female, 4 pins2X2, X3
Connector, Molex KK 254, female, 5 pins1X4
Connector, Molex KK 254, female, 8 pins1X1
Cable, 2 x 0.25 mm²0.3mW4
Wire, 0.14 mm², BK0.9mW1, W2, W3
Wire, 0.14 mm², BU0.3mW3
Wire, 0.14 mm², GN0.6mW1, W2
Wire, 0.14 mm², OG0.3mW3
Wire, 0.14 mm², RD0.6mW1, W2
Wire, 0.14 mm², VT0.3mW3
Wire, 0.14 mm², YE0.6mW1, W2
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Crimp ferrule, 0.25 mm², YE2
Connector, Molex KK 254, female, 4 pins2X2, X3
Connector, Molex KK 254, female, 5 pins1X4
Connector, Molex KK 254, female, 8 pins1X1
Cable, 2 x 0.25 mm²0.3mW4
Wire, 0.14 mm², BK0.9mW1, W2, W3
Wire, 0.14 mm², BU0.3mW3
Wire, 0.14 mm², GN0.6mW1, W2
Wire, 0.14 mm², OG0.3mW3
Wire, 0.14 mm², RD0.6mW1, W2
Wire, 0.14 mm², VT0.3mW3
Wire, 0.14 mm², YE0.6mW1, W2
\ No newline at end of file diff --git a/examples/demo02.png b/examples/demo02.png index 4047110d..bd5cadc9 100644 Binary files a/examples/demo02.png and b/examples/demo02.png differ diff --git a/examples/demo02.svg b/examples/demo02.svg index 469ef13e..4b2e3ec3 100644 --- a/examples/demo02.svg +++ b/examples/demo02.svg @@ -4,501 +4,509 @@ - + - + X1 - - -X1 - -Molex KK 254 - -female - -8-pin - -GND - -1 - -+5V - -2 - -SCL - -3 - -SDA - -4 - -MISO - -5 - -MOSI - -6 - -SCK - -7 - -N/C - -8 + + +X1 + +Molex KK 254 + +female + +8-pin + +GND + +1 + ++5V + +2 + +SCL + +3 + +SDA + +4 + +MISO + +5 + +MOSI + +6 + +SCK + +7 + +N/C + +8 W1 - - -W1 - -4x - -0.14 mm² (26 AWG) - -0.2 m -  -X1:1 -BK -X2:1 - - - -X1:2 -RD -X2:2 - - - -X1:3 -YE -X2:3 - - - -X1:4 -GN -X2:4 - - - -  + + +W1 + +4x + +0.14 mm² (26 AWG) + +0.2 m +  +X1:1 +BK +X2:1 + + + +X1:2 +RD +X2:2 + + + +X1:3 +YE +X2:3 + + + +X1:4 +GN +X2:4 + + + +  X1:e--W1:w - - - + + + X1:e--W1:w - - - + + + X1:e--W1:w - - - + + + X1:e--W1:w - - - + + + W2 - - -W2 - -4x - -0.14 mm² (26 AWG) - -0.4 m -  -X1:1 -BK -X3:1 - - - -X1:2 -RD -X3:2 - - - -X1:3 -YE -X3:3 - - - -X1:4 -GN -X3:4 - - - -  + + +W2 + +4x + +0.14 mm² (26 AWG) + +0.4 m +  +X1:1 +BK +X3:1 + + + +X1:2 +RD +X3:2 + + + +X1:3 +YE +X3:3 + + + +X1:4 +GN +X3:4 + + + +  X1:e--W2:w - - - + + + X1:e--W2:w - - - + + + X1:e--W2:w - - - + + + X1:e--W2:w - - - + + + W3 - - -W3 - -4x - -0.14 mm² (26 AWG) - -0.3 m -  -X1:1 -BK -X4:1 - - - -X1:5 -BU -X4:3 - - - -X1:6 -OG -X4:4 - - - -X1:7 -VT -X4:5 - - - -  + + +W3 + +4x + +0.14 mm² (26 AWG) + +0.3 m +  +X1:1 +BK +X4:1 + + + +X1:5 +BU +X4:3 + + + +X1:6 +OG +X4:4 + + + +X1:7 +VT +X4:5 + + + +  X1:e--W3:w - - - + + + X1:e--W3:w - - - + + + X1:e--W3:w - - - + + + X1:e--W3:w - - - + + + X2 - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -+5V - -3 - -SCL - -4 - -SDA + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + ++5V + +3 + +SCL + +4 + +SDA X3 - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -+5V - -3 - -SCL - -4 - -SDA + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + ++5V + +3 + +SCL + +4 + +SDA X4 - - -X4 - -Molex KK 254 - -female - -5-pin - -1 - -GND - -2 - -+12V - -3 - -MISO - -4 - -MOSI - -5 - -SCK + + +X4 + +Molex KK 254 + +female + +5-pin + +1 + +GND + +2 + ++12V + +3 + +MISO + +4 + +MOSI + +5 + +SCK _ferrule_crimp_1 - - -Crimp ferrule - -0.25 mm² + + +Crimp ferrule + +0.25 mm² + +YE + + W4 - - -W4 - -2x - -0.25 mm² (24 AWG) - -0.3 m -  -BK -X4:1 - - - -RD -X4:2 - - - -  + + +W4 + +2x + +0.25 mm² (24 AWG) + +0.3 m +  +BK +X4:1 + + + +RD +X4:2 + + + +  _ferrule_crimp_1:e--W4:w - - - + + + _ferrule_crimp_2 - - -Crimp ferrule - -0.25 mm² + + +Crimp ferrule + +0.25 mm² + +YE + + - + _ferrule_crimp_2:e--W4:w - - - + + + W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + W2:e--X3:w - - - + + + W2:e--X3:w - - - + + + W2:e--X3:w - - - + + + W2:e--X3:w - - - + + + W3:e--X4:w - - - + + + W3:e--X4:w - - - + + + W3:e--X4:w - - - + + + W3:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + W4:e--X4:w - - - + + + diff --git a/examples/demo02.yml b/examples/demo02.yml index 600b1359..5002e7d2 100644 --- a/examples/demo02.yml +++ b/examples/demo02.yml @@ -3,7 +3,7 @@ templates: # defining templates to be used later on type: Molex KK 254 subtype: female - &con_i2c - pinout: [GND, +5V, SCL, SDA] + pinlabels: [GND, +5V, SCL, SDA] - &wire_i2c category: bundle gauge: 0.14 mm2 @@ -12,7 +12,7 @@ templates: # defining templates to be used later on connectors: X1: <<: *molex_f # copying items from the template - pinout: [GND, +5V, SCL, SDA, MISO, MOSI, SCK, N/C] + pinlabels: [GND, +5V, SCL, SDA, MISO, MOSI, SCK, N/C] X2: <<: *molex_f <<: *con_i2c # it is possible to copy from more than one template @@ -21,12 +21,13 @@ connectors: <<: *con_i2c X4: <<: *molex_f - pinout: [GND, +12V, MISO, MOSI, SCK] + pinlabels: [GND, +12V, MISO, MOSI, SCK] ferrule_crimp: - category: ferrule + style: simple autogenerate: true type: Crimp ferrule subtype: 0.25 mm² + color: YE cables: W1: @@ -65,6 +66,4 @@ connections: - - ferrule_crimp - W4: [1,2] - - - - W4: [1,2] - X4: [1,2] diff --git a/examples/ex01.html b/examples/ex01.html index 3a07507e..c03eef9d 100644 --- a/examples/ex01.html +++ b/examples/ex01.html @@ -177,4 +177,4 @@ -

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins2X1, X2
Cable, Serial, 4 x 0.25 mm² shielded0.2mW1
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins2X1, X2
Cable, Serial, 4 x 0.25 mm² shielded0.2mW1
\ No newline at end of file diff --git a/examples/ex01.yml b/examples/ex01.yml index 9e4340fd..be099cc8 100644 --- a/examples/ex01.yml +++ b/examples/ex01.yml @@ -2,11 +2,11 @@ connectors: X1: type: Molex KK 254 # more information subtype: female - pinout: [GND, VCC, RX, TX] # pincount is implicit in pinout + pinlabels: [GND, VCC, RX, TX] # pincount is implicit in pinout X2: type: Molex KK 254 subtype: female - pinout: [GND, VCC, RX, TX] + pinlabels: [GND, VCC, RX, TX] cables: W1: diff --git a/examples/ex02.html b/examples/ex02.html index 83ab6d6b..1991a26b 100644 --- a/examples/ex02.html +++ b/examples/ex02.html @@ -258,4 +258,4 @@ -

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex Micro-Fit, female, 2 pins3X2, X3, X4
Connector, Molex Micro-Fit, male, 2 pins1X1
Cable, 2 x 0.25 mm²0.4mW1, W2
Cable, 2 x 20 AWG0.2mW3
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex Micro-Fit, female, 2 pins3X2, X3, X4
Connector, Molex Micro-Fit, male, 2 pins1X1
Cable, 2 x 0.25 mm²0.4mW1, W2
Cable, 2 x 20 AWG0.2mW3
\ No newline at end of file diff --git a/examples/ex02.yml b/examples/ex02.yml index 8a671e67..cdcecf9a 100644 --- a/examples/ex02.yml +++ b/examples/ex02.yml @@ -2,11 +2,11 @@ connectors: X1: &boo type: Molex Micro-Fit subtype: male - pinout: [GND, VCC] + pinlabels: [GND, VCC] X2: &con_power_f # define template type: Molex Micro-Fit subtype: female - pinout: [GND, VCC] + pinlabels: [GND, VCC] X3: <<: *con_power_f # create from template X4: diff --git a/examples/ex03.html b/examples/ex03.html index d2747051..91a79ff3 100644 --- a/examples/ex03.html +++ b/examples/ex03.html @@ -228,4 +228,4 @@ -

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex Micro-Fit, female, 2 pins3X2, X3, X4
Connector, Molex Micro-Fit, male, 2 pins1X1
Wire, 0.25 mm², BK0.6mW1
Wire, 0.25 mm², RD0.6mW1
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex Micro-Fit, female, 2 pins3X2, X3, X4
Connector, Molex Micro-Fit, male, 2 pins1X1
Wire, 0.25 mm², BK0.6mW1
Wire, 0.25 mm², RD0.6mW1
\ No newline at end of file diff --git a/examples/ex03.yml b/examples/ex03.yml index fb935a26..b658b2d1 100644 --- a/examples/ex03.yml +++ b/examples/ex03.yml @@ -2,11 +2,11 @@ connectors: X1: &boo type: Molex Micro-Fit subtype: male - pinout: [GND, VCC] + pinlabels: [GND, VCC] X2: &con_power_f type: Molex Micro-Fit subtype: female - pinout: [GND, VCC] + pinlabels: [GND, VCC] X3: <<: *con_power_f X4: diff --git a/examples/ex04.gv b/examples/ex04.gv index bbdec2f0..6bb7195e 100644 --- a/examples/ex04.gv +++ b/examples/ex04.gv @@ -18,27 +18,21 @@ graph { _ferrule_crimp_12 [label=<
Crimp ferrule
> fillcolor=white margin=0 shape=none style=filled] edge [color="#000000:#895956:#000000"] _ferrule_crimp_1:e -- W1:w1:w + W1:w1:e -- _ferrule_crimp_7:w edge [color="#000000:#ff0000:#000000"] _ferrule_crimp_2:e -- W1:w2:w + W1:w2:e -- _ferrule_crimp_8:w edge [color="#000000:#ff8000:#000000"] _ferrule_crimp_3:e -- W1:w3:w + W1:w3:e -- _ferrule_crimp_9:w edge [color="#000000:#ffff00:#000000"] _ferrule_crimp_4:e -- W1:w4:w + W1:w4:e -- _ferrule_crimp_10:w edge [color="#000000:#00ff00:#000000"] _ferrule_crimp_5:e -- W1:w5:w + W1:w5:e -- _ferrule_crimp_11:w edge [color="#000000:#0066ff:#000000"] _ferrule_crimp_6:e -- W1:w6:w - edge [color="#000000:#0066ff:#000000"] - W1:w6:e -- _ferrule_crimp_7:w - edge [color="#000000:#00ff00:#000000"] - W1:w5:e -- _ferrule_crimp_8:w - edge [color="#000000:#ffff00:#000000"] - W1:w4:e -- _ferrule_crimp_9:w - edge [color="#000000:#ff8000:#000000"] - W1:w3:e -- _ferrule_crimp_10:w - edge [color="#000000:#ff0000:#000000"] - W1:w2:e -- _ferrule_crimp_11:w - edge [color="#000000:#895956:#000000"] - W1:w1:e -- _ferrule_crimp_12:w + W1:w6:e -- _ferrule_crimp_12:w W1 [label=<
W1
6x0.25 mm² (24 AWG)0.2 m
 
BN
RD
OG
YE
GN
BU
 
> fillcolor=white margin=0 shape=box style="filled,dashed"] } diff --git a/examples/ex04.html b/examples/ex04.html index 3b3ef3d3..d77034af 100644 --- a/examples/ex04.html +++ b/examples/ex04.html @@ -68,7 +68,7 @@ Crimp ferrule - + _ferrule_crimp_2:e--W1:w @@ -82,7 +82,7 @@ Crimp ferrule - + _ferrule_crimp_3:e--W1:w @@ -96,7 +96,7 @@ Crimp ferrule - + _ferrule_crimp_4:e--W1:w @@ -110,7 +110,7 @@ Crimp ferrule - + _ferrule_crimp_5:e--W1:w @@ -124,7 +124,7 @@ Crimp ferrule - + _ferrule_crimp_6:e--W1:w @@ -133,87 +133,87 @@ _ferrule_crimp_7 - - -Crimp ferrule + + +Crimp ferrule _ferrule_crimp_8 - - -Crimp ferrule + + +Crimp ferrule _ferrule_crimp_9 - - -Crimp ferrule + + +Crimp ferrule _ferrule_crimp_10 - - -Crimp ferrule + + +Crimp ferrule _ferrule_crimp_11 - - -Crimp ferrule + + +Crimp ferrule _ferrule_crimp_12 - - -Crimp ferrule + + +Crimp ferrule - + W1:e--_ferrule_crimp_7:w - - - + + + - + W1:e--_ferrule_crimp_8:w - - - + + + - + W1:e--_ferrule_crimp_9:w - - - - - - -W1:e--_ferrule_crimp_10:w + + +W1:e--_ferrule_crimp_10:w + + + + - + W1:e--_ferrule_crimp_11:w - - - + + + W1:e--_ferrule_crimp_12:w - - - + + + -

Bill of Materials

ItemQtyUnitDesignators
Connector, Crimp ferrule12
Wire, 0.25 mm², BN0.2mW1
Wire, 0.25 mm², BU0.2mW1
Wire, 0.25 mm², GN0.2mW1
Wire, 0.25 mm², OG0.2mW1
Wire, 0.25 mm², RD0.2mW1
Wire, 0.25 mm², YE0.2mW1
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Crimp ferrule12
Wire, 0.25 mm², BN0.2mW1
Wire, 0.25 mm², BU0.2mW1
Wire, 0.25 mm², GN0.2mW1
Wire, 0.25 mm², OG0.2mW1
Wire, 0.25 mm², RD0.2mW1
Wire, 0.25 mm², YE0.2mW1
\ No newline at end of file diff --git a/examples/ex04.svg b/examples/ex04.svg index 02c2e836..62d82ae1 100644 --- a/examples/ex04.svg +++ b/examples/ex04.svg @@ -69,7 +69,7 @@ Crimp ferrule
- + _ferrule_crimp_2:e--W1:w @@ -83,7 +83,7 @@ Crimp ferrule - + _ferrule_crimp_3:e--W1:w @@ -97,7 +97,7 @@ Crimp ferrule - + _ferrule_crimp_4:e--W1:w @@ -111,7 +111,7 @@ Crimp ferrule - + _ferrule_crimp_5:e--W1:w @@ -125,7 +125,7 @@ Crimp ferrule - + _ferrule_crimp_6:e--W1:w @@ -134,86 +134,86 @@ _ferrule_crimp_7 - - -Crimp ferrule + + +Crimp ferrule _ferrule_crimp_8 - - -Crimp ferrule + + +Crimp ferrule _ferrule_crimp_9 - - -Crimp ferrule + + +Crimp ferrule _ferrule_crimp_10 - - -Crimp ferrule + + +Crimp ferrule _ferrule_crimp_11 - - -Crimp ferrule + + +Crimp ferrule _ferrule_crimp_12 - - -Crimp ferrule + + +Crimp ferrule - + W1:e--_ferrule_crimp_7:w - - - + + + - + W1:e--_ferrule_crimp_8:w - - - + + + - + W1:e--_ferrule_crimp_9:w - - - - - - -W1:e--_ferrule_crimp_10:w + + +W1:e--_ferrule_crimp_10:w + + + + - + W1:e--_ferrule_crimp_11:w - - - + + + W1:e--_ferrule_crimp_12:w - - - + + + diff --git a/examples/ex04.yml b/examples/ex04.yml index 3fe5beda..74148ecf 100644 --- a/examples/ex04.yml +++ b/examples/ex04.yml @@ -9,16 +9,12 @@ cables: connectors: ferrule_crimp: - category: ferrule + style: simple autogenerate: true type: Crimp ferrule - show_name: false - show_pincount: false connections: - - ferrule_crimp - W1: [1-6] - - - - W1: [6-1] - ferrule_crimp diff --git a/examples/ex05.html b/examples/ex05.html index 8711bc0d..b47a2917 100644 --- a/examples/ex05.html +++ b/examples/ex05.html @@ -298,4 +298,4 @@ -

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins3X1, X2, X3
Wire, I2C, 0.25 mm², PK0.4mW1, W2
Wire, I2C, 0.25 mm², TQ0.4mW1, W2
Wire, I2C, 0.25 mm², VT0.4mW1, W2
Wire, I2C, 0.25 mm², YE0.4mW1, W2
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins3X1, X2, X3
Wire, I2C, 0.25 mm², PK0.4mW1, W2
Wire, I2C, 0.25 mm², TQ0.4mW1, W2
Wire, I2C, 0.25 mm², VT0.4mW1, W2
Wire, I2C, 0.25 mm², YE0.4mW1, W2
\ No newline at end of file diff --git a/examples/ex05.yml b/examples/ex05.yml index f88815ff..fd776f98 100644 --- a/examples/ex05.yml +++ b/examples/ex05.yml @@ -3,7 +3,7 @@ templates: - &template_con type: Molex KK 254 subtype: female - pinout: [GND, VCC, SCL, SDA] + pinlabels: [GND, VCC, SCL, SDA] - &template_wire gauge: 0.25 mm2 length: 0.2 diff --git a/examples/ex06.html b/examples/ex06.html index b7ba5ffb..6f921c93 100644 --- a/examples/ex06.html +++ b/examples/ex06.html @@ -658,4 +658,4 @@
-

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins6X1, X2, X3, X4, X5, X6
Wire, 0.25 mm², PK1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², TQ1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², VT1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², YE1.0mW1, W2, W3, W4, W5
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins6X1, X2, X3, X4, X5, X6
Wire, 0.25 mm², PK1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², TQ1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², VT1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², YE1.0mW1, W2, W3, W4, W5
\ No newline at end of file diff --git a/examples/ex06.yml b/examples/ex06.yml index ea0d505c..e0a664fa 100644 --- a/examples/ex06.yml +++ b/examples/ex06.yml @@ -3,7 +3,7 @@ templates: - &template_con type: Molex KK 254 subtype: female - pinout: [GND, VCC, SCL, SDA] + pinlabels: [GND, VCC, SCL, SDA] - &template_wire gauge: 0.25 mm2 length: 0.2 diff --git a/examples/ex08.yml b/examples/ex08.yml index e65813a8..2195c4a0 100644 --- a/examples/ex08.yml +++ b/examples/ex08.yml @@ -4,8 +4,8 @@ connectors: Key: type: Phone Connector subtype: male 3.5 - pinnumbers: [T, R, S] - pinout: [Dot, Dash, Ground] + pins: [T, R, S] + pinlabels: [Dot, Dash, Ground] show_pincount: false cables: diff --git a/examples/ex09.html b/examples/ex09.html index d86c6b8b..a710467f 100644 --- a/examples/ex09.html +++ b/examples/ex09.html @@ -523,4 +523,4 @@
-

Bill of Materials

ItemQtyUnitDesignators
Connector, D-Sub, male, 25 pins1X1
Connector, F48, female, 48 pins1X2
Cable, 12 x 0.25 mm² shielded0.2mW1
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, D-Sub, male, 25 pins1X1
Connector, F48, female, 48 pins1X2
Cable, 12 x 0.25 mm² shielded0.2mW1
\ No newline at end of file diff --git a/examples/ex09.yml b/examples/ex09.yml index baef3ab6..9cce10fa 100644 --- a/examples/ex09.yml +++ b/examples/ex09.yml @@ -5,13 +5,13 @@ connectors: type: D-Sub subtype: male pincount: 25 - pinnumbers: [1,14,3,16,5,18,7,20,9,22,11,24,13] - pinout: [ SENSE_P_1, SENSE_N_1, SENSE_P_2, SENSE_N_2, SENSE_P_3, SENSE_N_3, SENSE_P_4,SENSE_N_4, SENSE_P_5, SENSE_N_5, SENSE_P_6, SENSE_N_6, GND ] + pins: [1,14,3,16,5,18,7,20,9,22,11,24,13] + pinlabels: [ SENSE_P_1, SENSE_N_1, SENSE_P_2, SENSE_N_2, SENSE_P_3, SENSE_N_3, SENSE_P_4,SENSE_N_4, SENSE_P_5, SENSE_N_5, SENSE_P_6, SENSE_N_6, GND ] X2: type: F48 subtype: female pincount: 48 - pinnumbers: [ z2,b2,d2,z4,b4,d4,z6,b6,d6,z8,b8,d8,z10,b10,d10,z12,b12,d12,z14,b14,d14,z16,b16,d16,z18,b18,d18,z20,b20,d20,z22,b22,d22,z24,b24,d24,z26,b26,d26,z28,b28,d28,z30,b30,d30,z32,b32,d32 ] + pins: [ z2,b2,d2,z4,b4,d4,z6,b6,d6,z8,b8,d8,z10,b10,d10,z12,b12,d12,z14,b14,d14,z16,b16,d16,z18,b18,d18,z20,b20,d20,z22,b22,d22,z24,b24,d24,z26,b26,d26,z28,b28,d28,z30,b30,d30,z32,b32,d32 ] cables: W1: diff --git a/examples/ex10.yml b/examples/ex10.yml index 3d0a1b73..cbd392a7 100644 --- a/examples/ex10.yml +++ b/examples/ex10.yml @@ -3,11 +3,11 @@ connectors: X1: type: Stewart Connector SS-37000-002 subtype: male - pinout: [DA+,DA-,DB+,DC+,DC-,DB-,DD+,DD-] # pincount is implicit in pinout + pinlabels: [DA+,DA-,DB+,DC+,DC-,DB-,DD+,DD-] # pincount is implicit in pinout X2: type: Stewart Connector SS-37000-002 subtype: male - pinout: [DB+,DB-,DA+,DD+,DD-,DA-,DC+,DC-] + pinlabels: [DB+,DB-,DA+,DD+,DD-,DA-,DC+,DC-] cables: W1: diff --git a/examples/readme.md b/examples/readme.md index 8093a45e..145ee5a9 100644 --- a/examples/readme.md +++ b/examples/readme.md @@ -1,61 +1,62 @@ -# Example gallery -## Example 09 -![](../../examples/ex09.png) +# Example Gallery -[Source](ex09.yml) - [Bill of Materials](../../examples/ex09.bom.tsv) +## Example 01 +![](ex01.png) +[Source](ex01.yml) - [Bill of Materials](ex01.bom.tsv) -## Example 08 -![](../../examples/ex08.png) -[Source](ex08.yml) - [Bill of Materials](../../examples/ex08.bom.tsv) +## Example 02 +![](ex02.png) +[Source](ex02.yml) - [Bill of Materials](ex02.bom.tsv) -## Example 01 -![](../../examples/ex01.png) -[Source](ex01.yml) - [Bill of Materials](../../examples/ex01.bom.tsv) +## Example 03 +![](ex03.png) +[Source](ex03.yml) - [Bill of Materials](ex03.bom.tsv) -## Example 03 -![](../../examples/ex03.png) -[Source](ex03.yml) - [Bill of Materials](../../examples/ex03.bom.tsv) +## Example 04 +![](ex04.png) +[Source](ex04.yml) - [Bill of Materials](ex04.bom.tsv) -## Example 02 -![](../../examples/ex02.png) -[Source](ex02.yml) - [Bill of Materials](../../examples/ex02.bom.tsv) +## Example 05 +![](ex05.png) + +[Source](ex05.yml) - [Bill of Materials](ex05.bom.tsv) ## Example 06 -![](../../examples/ex06.png) +![](ex06.png) -[Source](ex06.yml) - [Bill of Materials](../../examples/ex06.bom.tsv) +[Source](ex06.yml) - [Bill of Materials](ex06.bom.tsv) ## Example 07 -![](../../examples/ex07.png) +![](ex07.png) -[Source](ex07.yml) - [Bill of Materials](../../examples/ex07.bom.tsv) +[Source](ex07.yml) - [Bill of Materials](ex07.bom.tsv) -## Example 05 -![](../../examples/ex05.png) +## Example 08 +![](ex08.png) -[Source](ex05.yml) - [Bill of Materials](../../examples/ex05.bom.tsv) +[Source](ex08.yml) - [Bill of Materials](ex08.bom.tsv) -## Example 10 -![](../../examples/ex10.png) +## Example 09 +![](ex09.png) -[Source](ex10.yml) - [Bill of Materials](../../examples/ex10.bom.tsv) +[Source](ex09.yml) - [Bill of Materials](ex09.bom.tsv) -## Example 04 -![](../../examples/ex04.png) +## Example 10 +![](ex10.png) -[Source](ex04.yml) - [Bill of Materials](../../examples/ex04.bom.tsv) +[Source](ex10.yml) - [Bill of Materials](ex10.bom.tsv) diff --git a/src/wireviz/DataClasses.py b/src/wireviz/DataClasses.py index 3e01ae1d..4d41d102 100644 --- a/src/wireviz/DataClasses.py +++ b/src/wireviz/DataClasses.py @@ -13,16 +13,17 @@ class Connector: manufacturer: Optional[str] = None manufacturer_part_number: Optional[str] = None internal_part_number: Optional[str] = None + style: Optional[str] = None category: Optional[str] = None type: Optional[str] = None subtype: Optional[str] = None pincount: Optional[int] = None notes: Optional[str] = None - pinout: List[Any] = field(default_factory=list) - pinnumbers: List[Any] = field(default_factory=list) + pinlabels: List[Any] = field(default_factory=list) + pins: List[Any] = field(default_factory=list) color: Optional[str] = None - show_name: bool = True - show_pincount: bool = True + show_name: bool = None + show_pincount: bool = None hide_disconnected_pins: bool = False autogenerate: bool = False loops: List[Any] = field(default_factory=list) @@ -34,28 +35,37 @@ def __post_init__(self): self.ports_right = False self.visible_pins = {} + if self.style == 'simple': + if self.pincount and self.pincount > 1: + raise Exception('Connectors with style set to simple may only have one pin') + self.pincount = 1 + if self.pincount is None: - if self.pinout: - self.pincount = len(self.pinout) - elif self.pinnumbers: - self.pincount = len(self.pinnumbers) - elif self.category == 'ferrule': - self.pincount = 1 + if self.pinlabels: + self.pincount = len(self.pinlabels) + elif self.pins: + self.pincount = len(self.pins) else: - raise Exception('You need to specify at least one, pincount, pinout or pinnumbers') + raise Exception('You need to specify at least one, pincount, pins or pinlabels') + + if self.pinlabels and self.pins: + if len(self.pinlabels) != len(self.pins): + raise Exception('Given pins and pinlabels size mismatch') + + # create default lists for pins (sequential) and pinlabels (blank) if not specified + if not self.pins: + self.pins = list(range(1, self.pincount + 1)) + if not self.pinlabels: + self.pinlabels = [''] * self.pincount - if self.pinout and self.pinnumbers: - if len(self.pinout) != len(self.pinnumbers): - raise Exception('Given pinout and pinnumbers size mismatch') + if len(self.pins) != len(set(self.pins)): + raise Exception('Pins are not unique') - # create default lists for pinnumbers (sequential) and pinouts (blank) if not specified - if not self.pinnumbers: - self.pinnumbers = list(range(1, self.pincount + 1)) - if not self.pinout: - self.pinout = [''] * self.pincount + if self.show_name is None: + self.show_name = not self.autogenerate # hide auto-generated designators by default - if len(self.pinnumbers) != len(set(self.pinnumbers)): - raise Exception('Pin numbers are not unique') + if self.show_pincount is None: + self.show_pincount = self.style != 'simple' # hide pincount for simple (1 pin) connectors by default for loop in self.loops: # TODO: check that pins to connect actually exist diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index f4077217..752f3ba2 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -35,23 +35,23 @@ def connect(self, from_name: str, from_pin: (int, str), via_name: str, via_pin: for (name, pin) in zip([from_name, to_name], [from_pin, to_pin]): # check from and to connectors if name is not None and name in self.connectors: connector = self.connectors[name] - if pin in connector.pinnumbers and pin in connector.pinout: - if connector.pinnumbers.index(pin) == connector.pinout.index(pin): + if pin in connector.pins and pin in connector.pinlabels: + if connector.pins.index(pin) == connector.pinlabels.index(pin): # TODO: Maybe issue a warning? It's not worthy of an exception if it's unambiguous, but maybe risky? pass else: - raise Exception(f'{name}:{pin} is defined both in pinout and pinnumbers, for different pins.') - if pin in connector.pinout: - if connector.pinout.count(pin) > 1: + raise Exception(f'{name}:{pin} is defined both in pinlabels and pins, for different pins.') + if pin in connector.pinlabels: + if connector.pinlabels.count(pin) > 1: raise Exception(f'{name}:{pin} is defined more than once.') else: - index = connector.pinout.index(pin) - pin = connector.pinnumbers[index] # map pin name to pin number + index = connector.pinlabels.index(pin) + pin = connector.pins[index] # map pin name to pin number if name == from_name: from_pin = pin if name == to_name: to_pin = pin - if not pin in connector.pinnumbers: + if not pin in connector.pins: raise Exception(f'{name}:{pin} not found.') self.cables[via_name].connect(from_name, from_pin, via_pin, to_name, to_pin) @@ -86,63 +86,53 @@ def create_graph(self) -> Graph: self.connectors[connection_color.to_name].ports_left = True for key, connector in self.connectors.items(): - if connector.category == 'ferrule': - - rows = [[connector.manufacturer, - f'MPN: {connector.manufacturer_part_number}' if connector.manufacturer_part_number else None, - f'IPN: {connector.internal_part_number}' if connector.internal_part_number else None], - [html_line_breaks(connector.type), html_line_breaks(connector.subtype), connector.color, '' if connector.color else None], - [html_line_breaks(connector.notes)]] - html = nested_html_table(rows) - - if connector.color: # add color bar next to color info, if present - colorbar = f' bgcolor="{wv_colors.translate_color(connector.color, "HEX")}" width="4">' # leave out ' tag - html = html.replace('>', colorbar) - - dot.node(key, label=f'<{html}>', shape='none', margin='0', style='filled', fillcolor='white') - - else: # not a ferrule - - rows = [[connector.name if connector.show_name else None], - [connector.manufacturer, - f'MPN: {connector.manufacturer_part_number}' if connector.manufacturer_part_number else None, - f'IPN: {connector.internal_part_number}' if connector.internal_part_number else None], - [html_line_breaks(connector.type), - html_line_breaks(connector.subtype), - f'{connector.pincount}-pin' if connector.show_pincount else None], - ''] - if connector.additional_components is not None: - rows.append(["Additional components"]) - for extra in connector.additional_components: - if 'qty' in extra: - if isinstance(extra['qty'], int) or isinstance(extra['qty'], float): - qty = extra['qty'] - else: # check for special quantities - if extra['qty'] == 'pincount': - qty = connector.pincount - elif extra['qty'] == 'connectioncount': - qty = sum(1 for value in connector.visible_pins.values() if value is True) - else: - raise ValueError('invalid aty parameter') - else: - qty = 1 - rows.append([extra["type"], qty]) - rows.append([extra["manufacturer"], - f'MPN: {extra["manufacturer_part_number"]}' if "manufacturer_part_number" in extra else None, - f'IPN: {extra["internal_part_number"]}' if "internal_part_number" in extra else None],) - rows.append([html_line_breaks(connector.notes)]) - html = nested_html_table(rows) - - pinouts = [] - for pinnumber, pinname in zip(connector.pinnumbers, connector.pinout): - if connector.hide_disconnected_pins and not connector.visible_pins.get(pinnumber, False): + + rows = [[connector.name if connector.show_name else None], + [connector.manufacturer, + f'MPN: {connector.manufacturer_part_number}' if connector.manufacturer_part_number else None, + f'IPN: {connector.internal_part_number}' if connector.internal_part_number else None], + [html_line_breaks(connector.type), + html_line_breaks(connector.subtype), + f'{connector.pincount}-pin' if connector.show_pincount else None, + connector.color, '' if connector.color else None], + '' if connector.style != 'simple' else None] + if connector.additional_components is not None: + rows.append(["Additional components"]) + for extra in connector.additional_components: + if 'qty' in extra: + if isinstance(extra['qty'], int) or isinstance(extra['qty'], float): + qty = extra['qty'] + else: # check for special quantities + if extra['qty'] == 'pincount': + qty = connector.pincount + elif extra['qty'] == 'connectioncount': + qty = sum(1 for value in connector.visible_pins.values() if value is True) + else: + raise ValueError('invalid aty parameter') + else: + qty = 1 + rows.append([extra["type"], qty]) + rows.append([extra["manufacturer"], + f'MPN: {extra["manufacturer_part_number"]}' if "manufacturer_part_number" in extra else None, + f'IPN: {extra["internal_part_number"]}' if "internal_part_number" in extra else None],) + rows.append([html_line_breaks(connector.notes)]) + html = nested_html_table(rows) + + if connector.color: # add color bar next to color info, if present + colorbar = f' bgcolor="{wv_colors.translate_color(connector.color, "HEX")}" width="4">' # leave out ' tag + html = html.replace('>', colorbar) + + if connector.style != 'simple': + pinlist = [] + for pin, pinlabel in zip(connector.pins, connector.pinlabels): + if connector.hide_disconnected_pins and not connector.visible_pins.get(pin, False): continue - pinouts.append([f'{pinnumber}' if connector.ports_left else None, - f'{pinname}' if pinname else '', - f'{pinnumber}' if connector.ports_right else None]) + pinlist.append([f'{pin}' if connector.ports_left else None, + f'{pinlabel}' if pinlabel else '', + f'{pin}' if connector.ports_right else None]) pinhtml = '' - for i, pin in enumerate(pinouts): + for i, pin in enumerate(pinlist): pinhtml = f'{pinhtml}' for column in pin: if column is not None: @@ -151,21 +141,22 @@ def create_graph(self) -> Graph: pinhtml = f'{pinhtml}
' html = html.replace('', pinhtml) - dot.node(key, label=f'<{html}>', shape='none', margin='0', style='filled', fillcolor='white') - if len(connector.loops) > 0: - dot.attr('edge', color='#000000:#ffffff:#000000') - if connector.ports_left: - loop_side = 'l' - loop_dir = 'w' - elif connector.ports_right: - loop_side = 'r' - loop_dir = 'e' - else: - raise Exception('No side for loops') - for loop in connector.loops: - dot.edge(f'{connector.name}:p{loop[0]}{loop_side}:{loop_dir}', - f'{connector.name}:p{loop[1]}{loop_side}:{loop_dir}') + dot.node(key, label=f'<{html}>', shape='none', margin='0', style='filled', fillcolor='white') + + if len(connector.loops) > 0: + dot.attr('edge', color='#000000:#ffffff:#000000') + if connector.ports_left: + loop_side = 'l' + loop_dir = 'w' + elif connector.ports_right: + loop_side = 'r' + loop_dir = 'e' + else: + raise Exception('No side for loops') + for loop in connector.loops: + dot.edge(f'{connector.name}:p{loop[0]}{loop_side}:{loop_dir}', + f'{connector.name}:p{loop[1]}{loop_side}:{loop_dir}') for _, cable in self.cables.items(): @@ -191,23 +182,25 @@ def create_graph(self) -> Graph: f'{cable.length} m' if cable.length > 0 else ''] attributes = list(filter(None, attributes)) - html = '' # name+attributes table + html = '
' # main table - - html = f'{html}' # name+attributes table - if cable.show_name: - html = f'{html}' - if(len(identification) > 0): # print an identification row if values specified - html = f'{html}' # end identification row - html = f'{html}' # attribute row - for attrib in attributes: - html = f'{html}' - html = f'{html}' # attribute row - html = f'{html}
{cable.name}
' - for attrib in identification[0:-1]: - html = f'{html}' # all columns except last have a border on the right (sides="R") - if len(identification) > 0: - html = f'{html}' # last column has no border on the right because the enclosing table borders it - html = f'{html}
{attrib}{identification[-1]}
{attrib}
' # main table + + if cable.show_name or len(attributes) > 0: + html = f'{html}' # name+attributes table html = f'{html}' # spacer between attributes and wires @@ -315,20 +308,18 @@ def create_graph(self) -> Graph: # shield is shown as a thin tinned wire dot.attr('edge', color=':'.join(['#000000', wv_colors.get_color_hex('SN', pad=False)[0], '#000000'])) if connection_color.from_port is not None: # connect to left - from_ferrule = self.connectors[connection_color.from_name].category == 'ferrule' - port = f':p{connection_color.from_port}r' if not from_ferrule else '' - code_left_1 = f'{connection_color.from_name}{port}:e' + from_port = f':p{connection_color.from_port}r' if self.connectors[connection_color.from_name].style != 'simple' else '' + code_left_1 = f'{connection_color.from_name}{from_port}:e' code_left_2 = f'{cable.name}:w{connection_color.via_port}:w' dot.edge(code_left_1, code_left_2) - from_string = f'{connection_color.from_name}:{connection_color.from_port}' if not from_ferrule else '' + from_string = f'{connection_color.from_name}:{connection_color.from_port}' if self.connectors[connection_color.from_name].show_name else '' html = html.replace(f'', from_string) if connection_color.to_port is not None: # connect to right - to_ferrule = self.connectors[connection_color.to_name].category == 'ferrule' code_right_1 = f'{cable.name}:w{connection_color.via_port}:e' - to_port = f':p{connection_color.to_port}l' if not to_ferrule else '' + to_port = f':p{connection_color.to_port}l' if self.connectors[connection_color.to_name].style != 'simple' else '' code_right_2 = f'{connection_color.to_name}{to_port}:w' dot.edge(code_right_1, code_right_2) - to_string = f'{connection_color.to_name}:{connection_color.to_port}' if not to_ferrule else '' + to_string = f'{connection_color.to_name}:{connection_color.to_port}' if self.connectors[connection_color.to_name].show_name else '' html = html.replace(f'', to_string) dot.node(cable.name, label=f'<{html}>', shape='box', @@ -389,8 +380,9 @@ def output(self, filename: (str, Path), view: bool = False, cleanup: bool = True for row in listy[1:]: file.write('') for i, item in enumerate(row): + item_str = item.replace('\u00b2', '²') align = 'align="right"' if listy[0][i] == 'Qty' else '' - file.write(f'') + file.write(f'') file.write('') file.write('
' # name+attributes table + if cable.show_name: + html = f'{html}' + if(len(identification) > 0): # print an identification row if values specified + html = f'{html}' # end identification row + if(len(attributes) > 0): + html = f'{html}' # attribute row + for attrib in attributes: + html = f'{html}' + html = f'{html}' # attribute row + html = f'{html}
{cable.name}
' + for attrib in identification[0:-1]: + html = f'{html}' # all columns except last have a border on the right (sides="R") + if len(identification) > 0: + html = f'{html}' # last column has no border on the right because the enclosing table borders it + html = f'{html}
{attrib}{identification[-1]}
{attrib}
 
{item}{item_str}
') @@ -412,10 +404,10 @@ def bom(self): designators.sort() conn_type = f', {remove_line_breaks(shared.type)}' if shared.type else '' conn_subtype = f', {remove_line_breaks(shared.subtype)}' if shared.subtype else '' - conn_pincount = f', {shared.pincount} pins' if shared.category != 'ferrule' else '' + conn_pincount = f', {shared.pincount} pins' if shared.style != 'simple' else '' conn_color = f', {shared.color}' if shared.color else '' name = f'Connector{conn_type}{conn_subtype}{conn_pincount}{conn_color}' - item = {'item': name, 'qty': len(designators), 'unit': '', 'designators': designators if shared.category != 'ferrule' else '', + item = {'item': name, 'qty': len(designators), 'unit': '', 'designators': designators if shared.show_name else '', 'manufacturer': shared.manufacturer, 'manufacturer part number': shared.manufacturer_part_number, 'internal part number': shared.internal_part_number} bom_connectors.append(item) bom_connectors = sorted(bom_connectors, key=lambda k: k['item']) # https://stackoverflow.com/a/73050 diff --git a/src/wireviz/wireviz.py b/src/wireviz/wireviz.py index 1805af90..3adc0782 100755 --- a/src/wireviz/wireviz.py +++ b/src/wireviz/wireviz.py @@ -37,8 +37,8 @@ def parse(yaml_input: str, file_out: (str, Path) = None, return_types: (None, st harness = Harness() # add items - sections = ['connectors', 'cables', 'ferrules', 'connections'] - types = [dict, dict, dict, list] + sections = ['connectors', 'cables', 'connections'] + types = [dict, dict, list] for sec, ty in zip(sections, types): if sec in yaml_data and type(yaml_data[sec]) == ty: if len(yaml_data[sec]) > 0: @@ -49,8 +49,6 @@ def parse(yaml_input: str, file_out: (str, Path) = None, return_types: (None, st harness.add_connector(name=key, **attribs) elif sec == 'cables': harness.add_cable(name=key, **attribs) - elif sec == 'ferrules': - pass else: pass # section exists but is empty else: # section does not exist, create empty section diff --git a/src/wireviz/wv_colors.py b/src/wireviz/wv_colors.py index 24e80b97..41575437 100644 --- a/src/wireviz/wv_colors.py +++ b/src/wireviz/wv_colors.py @@ -33,16 +33,20 @@ 'RD': '#ff0000', 'OG': '#ff8000', 'YE': '#ffff00', + 'OL': '#708000', # olive green 'GN': '#00ff00', 'TQ': '#00ffff', + 'LB': '#a0dfff', # light blue 'BU': '#0066ff', 'VT': '#8000ff', 'BN': '#895956', + 'BG': '#ceb673', # beige + 'IV': '#f5f0d0', # ivory 'SL': '#708090', 'CU': '#d6775e', # Faux-copper look, for bare CU wire 'SN': '#aaaaaa', # Silvery look for tinned bare wire - 'AG': '#84878c', # Darker silver for silvered wire - 'AU': '#ffcf80', # Golden color for gold + 'SR': '#84878c', # Darker silver for silvered wire + 'GD': '#ffcf80', # Golden color for gold } _color_full = { @@ -53,16 +57,20 @@ 'RD': 'red', 'OG': 'orange', 'YE': 'yellow', + 'OL': 'olive green', 'GN': 'green', 'TQ': 'turquoise', + 'LB': 'light blue', 'BU': 'blue', 'VT': 'violet', 'BN': 'brown', + 'BG': 'beige', + 'IV': 'ivory', 'SL': 'slate', - 'CU': 'bare copper', - 'SN': 'tinned copper', - 'AG': 'silver wire', - 'AU': 'gold wire', + 'CU': 'copper', + 'SN': 'tin', + 'SR': 'silver', + 'GD': 'gold', } _color_ger = { @@ -73,16 +81,20 @@ 'RD': 'rt', 'OG': 'or', 'YE': 'ge', + 'OL': 'ol', # olivgrün 'GN': 'gn', 'TQ': 'tk', + 'LB': 'hb', # hellblau 'BU': 'bl', 'VT': 'vi', 'BN': 'br', - 'SL': 'si', # Slate/Schiefer? - 'CU': 'ku', # Copper/Kupfer - 'SN': 'vz', # Tinned/verzinkt - 'AG': 'ag', # Silver - 'AU': 'au', # Gold + 'BG': 'bg', # beige + 'IV': 'eb', # elfenbeinfarben + 'SL': 'si', # Schiefer + 'CU': 'ku', # Kupfer + 'SN': 'vz', # verzinkt + 'SR': 'ag', # Silber + 'GD': 'au', # Gold } @@ -107,7 +119,7 @@ def get_color_hex(input, pad=False): def translate_color(input, color_mode): if input == '' or input is None: - return color_default + return '' upper = color_mode.isupper() if not (color_mode.isupper() or color_mode.islower()): raise Exception('Unknown color mode capitalization') diff --git a/tutorial/readme.md b/tutorial/readme.md index f98cf852..4fcf0336 100644 --- a/tutorial/readme.md +++ b/tutorial/readme.md @@ -1,62 +1,33 @@ # WireViz Tutorial -## 08 - Part numbers -* Part number information can be added to parts - * Only provided fields will be added to the diagram and bom -* Bundles can have part information specified by wire +## 01 - Bare-bones example + +* Minimum working example +* Only 1-to-1 sequential wiring -[Source](tutorial08.yml): ```yaml connectors: - X1: &template1 # define a template for later use - type: Molex KK 254 + X1: pincount: 4 - subtype: female - manufacturer: Molex - manufacturer_part_number: 22013047 X2: - <<: *template1 # reuse template - internal_part_number: CON4 - X3: - <<: *template1 # reuse template + pincount: 4 cables: W1: wirecount: 4 length: 1 - gauge: 0.25 mm2 - color_code: IEC - manufacturer: CablesCo - manufacturer_part_number: ABC123 - internal_part_number: CAB1 - W2: - category: bundle - length: 1 - gauge: 0.25 mm2 - colors: [YE, BK, BK, RD] - manufacturer: [WiresCo,WiresCo,WiresCo,WiresCo] - manufacturer_part_number: [W1-YE,W1-BK,W1-BK,W1-RD] - internal_part_number: [WIRE1,WIRE2,WIRE2,WIRE3] - connections: - - X1: [1-4] - W1: [1-4] - X2: [1-4] - - - - X1: [1-4] - - W2: [1-4] - - X3: [1-4] ``` +![](tutorial01.png) -Output: - -![](tutorial../../tutorial/tutorial08.png) - -[Bill of Materials](tutorial../../tutorial/tutorial08.bom.tsv) +[Source](tutorial01.yml) - [Bill of Materials](tutorial01.bom.tsv) ## 02 - Adding parameters and colors @@ -65,7 +36,6 @@ Output: * Auto-calculate equivalent AWG from mm2 * Non-sequential wiring -[Source](tutorial02.yml): ```yaml connectors: @@ -96,12 +66,9 @@ connections: - X2: [1,2,4,3] ``` +![](tutorial02.png) -Output: - -![](tutorial../../tutorial/tutorial02.png) - -[Bill of Materials](tutorial../../tutorial/tutorial02.bom.tsv) +[Source](tutorial02.yml) - [Bill of Materials](tutorial02.bom.tsv) ## 03 - Pinouts, shielding, templates (I) @@ -112,12 +79,11 @@ Output: * Cable shielding, shield wiring * Templates -[Source](tutorial03.yml): ```yaml connectors: X1: &template1 # define a template for later use - pinout: [GND, VCC, RX, TX] # pincount implicit in pinout + pinlabels: [GND, VCC, RX, TX] # pincount implicit in pinout type: Molex KK 254 subtype: female X2: @@ -142,46 +108,9 @@ connections: - W1: s ``` +![](tutorial03.png) -Output: - -![](tutorial../../tutorial/tutorial03.png) - -[Bill of Materials](tutorial../../tutorial/tutorial03.bom.tsv) - - -## 01 - Bare-bones example - -* Minimum working example -* Only 1-to-1 sequential wiring - -[Source](tutorial01.yml): - -```yaml -connectors: - X1: - pincount: 4 - X2: - pincount: 4 - -cables: - W1: - wirecount: 4 - length: 1 - -connections: - - - - X1: [1-4] - - W1: [1-4] - - X2: [1-4] -``` - - -Output: - -![](tutorial../../tutorial/tutorial01.png) - -[Bill of Materials](tutorial../../tutorial/tutorial01.bom.tsv) +[Source](tutorial03.yml) - [Bill of Materials](tutorial03.bom.tsv) ## 04 - Templates (II), notes, American standards, daisy chaining (I) @@ -192,12 +121,11 @@ Output: * Linear daisy-chain * Convenient for shorter chains -[Source](tutorial04.yml): ```yaml connectors: X1: &template_con - pinout: [GND, VCC, SCL, SDA] + pinlabels: [GND, VCC, SCL, SDA] type: Molex KK 254 subtype: male notes: to microcontroller # add notes @@ -233,12 +161,9 @@ connections: - X3: [1-4] ``` +![](tutorial04.png) -Output: - -![](tutorial../../tutorial/tutorial04.png) - -[Bill of Materials](tutorial../../tutorial/tutorial04.bom.tsv) +[Source](tutorial04.yml) - [Bill of Materials](tutorial04.bom.tsv) ## 05 - Ferrules, wire bundles, custom wire colors @@ -255,18 +180,17 @@ Output: * Custom wire colors * Wirecount can be implicit in color list -[Source](tutorial05.yml): ```yaml connectors: X1: - pinout: [+12V, GND, GND, +5V] + pinlabels: [+12V, GND, GND, +5V] type: Molex 8981 subtype: female F1: - category: ferrule + style: simple autogenerate: true - type: Ferrule, crimp + type: Crimp ferrule subtype: 0.5 mm² color: OG # optional color @@ -278,20 +202,60 @@ cables: colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit connections: - - # attach ferrules - - F1 # no need for list of connections; one ferrule per wire is auto-generated and attached - - W1: [1-4] # a new ferrule is auto-generated for each wire - - # attach connectors (separately from ferrules) + - + - F1 # a new ferrule is auto-generated for each of the four wires - W1: [1-4] - X1: [1-4] ``` +![](tutorial05.png) -Output: +[Source](tutorial05.yml) - [Bill of Materials](tutorial05.bom.tsv) -![](tutorial../../tutorial/tutorial05.png) -[Bill of Materials](tutorial../../tutorial/tutorial05.bom.tsv) +## 06 - Custom ferrules + +* Custom ferrules + * Allows attaching more than one wire to a ferrule + * Requires defining them as regular connectors with unique designators, adding `category: ferrule` parameter + + +```yaml +connectors: + X1: + pinlabels: [+12V, GND, GND, +5V] + type: Molex 8981 + subtype: female + F_10: # this is a unique ferrule + style: simple + show_name: false # non-autogenerated connectors show their name by default; override + type: Crimp ferrule + subtype: 1.0 mm² + color: YE # optional color + F_05: # this is a ferrule that will be auto-generated on demand + style: simple + autogenerate: true + type: Crimp ferrule + subtype: 0.5 mm² + color: OG + +cables: + W1: + category: bundle # bundle + length: 0.3 + gauge: 0.5 mm2 + colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit + +connections: + - + - [F_05, F_10, F_10, F_05] + - W1: [1-4] + - X1: [1-4] +``` + +![](tutorial06.png) + +[Source](tutorial06.yml) - [Bill of Materials](tutorial06.bom.tsv) ## 07 - Daisy chaining (II) @@ -299,14 +263,13 @@ Output: * Zig-zag daisy chain * Convenient for longer chains -[Source](tutorial07.yml): ```yaml connectors: X1: &template_con type: Molex KK 254 subtype: female - pinout: [GND, VCC, SCL, SDA] + pinlabels: [GND, VCC, SCL, SDA] X2: <<: *template_con X3: @@ -356,68 +319,64 @@ connections: - X6: [1-4] ``` +![](tutorial07.png) -Output: - -![](tutorial../../tutorial/tutorial07.png) - -[Bill of Materials](tutorial../../tutorial/tutorial07.bom.tsv) +[Source](tutorial07.yml) - [Bill of Materials](tutorial07.bom.tsv) -## 06 - Custom ferrules +## 08 - Part numbers -* Custom ferrules - * Allows attaching more than one wire to a ferrule - * Requires defining them as regular connectors with unique designators, adding `category: ferrule` parameter +* Part number information can be added to parts + * Only provided fields will be added to the diagram and bom +* Bundles can have part information specified by wire -[Source](tutorial06.yml): ```yaml connectors: - X1: - pinout: [+12V, GND, GND, +5V] - type: Molex 8981 + X1: &template1 # define a template for later use + type: Molex KK 254 + pincount: 4 subtype: female - F_10_1: # manually define a ferrule (with unique designator) - category: ferrule - type: Ferrule, crimp - subtype: 1.0 mm² - color: YE - F_05: - category: ferrule - autogenerate: true - type: Ferrule, crimp - subtype: 0.5 mm² - color: OG # optional color + manufacturer: Molex + manufacturer_part_number: 22013047 + X2: + <<: *template1 # reuse template + internal_part_number: CON4 + X3: + <<: *template1 # reuse template cables: W1: - category: bundle # bundle - length: 0.3 - gauge: 0.5 mm2 - colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit + wirecount: 4 + length: 1 + gauge: 0.25 mm2 + color_code: IEC + manufacturer: CablesCo + manufacturer_part_number: ABC123 + internal_part_number: CAB1 + W2: + category: bundle + length: 1 + gauge: 0.25 mm2 + colors: [YE, BK, BK, RD] + manufacturer: [WiresCo,WiresCo,WiresCo,WiresCo] + manufacturer_part_number: [W1-YE,W1-BK,W1-BK,W1-RD] + internal_part_number: [WIRE1,WIRE2,WIRE2,WIRE3] + connections: - - # attach ferrules - - F_05 - - W1: [1,4] # a new ferrule is auto-generated for each wire - - # attach connectors (separately from ferrules) - - W1: [1-4] - - X1: [1-4] - - - F_10_1: 1 # manually defined ferrules are treated like regular connectors, - # thus requiring a pin number - - W1: 2 + - X1: [1-4] + - W1: [1-4] + - X2: [1-4] - - - F_10_1: 1 - - W1: 3 + - X1: [1-4] + - W2: [1-4] + - X3: [1-4] ``` +![](tutorial08.png) -Output: - -![](tutorial../../tutorial/tutorial06.png) - -[Bill of Materials](tutorial../../tutorial/tutorial06.bom.tsv) +[Source](tutorial08.yml) - [Bill of Materials](tutorial08.bom.tsv) diff --git a/tutorial/tutorial01.gv b/tutorial/tutorial01.gv index d81c9bc2..43bcf578 100644 --- a/tutorial/tutorial01.gv +++ b/tutorial/tutorial01.gv @@ -18,5 +18,5 @@ graph { edge [color="#000000:#ffffff:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w - W1 [label=<
W1
4x1 m
 
X1:1#ffffffX2:1
X1:2#ffffffX2:2
X1:3#ffffffX2:3
X1:4#ffffffX2:4
 
> fillcolor=white margin=0 shape=box style=""] + W1 [label=<
W1
4x1 m
 
X1:1X2:1
X1:2X2:2
X1:3X2:3
X1:4X2:4
 
> fillcolor=white margin=0 shape=box style=""] } diff --git a/tutorial/tutorial01.html b/tutorial/tutorial01.html index 2cfba08a..758af38e 100644 --- a/tutorial/tutorial01.html +++ b/tutorial/tutorial01.html @@ -3,10 +3,10 @@ - + - + X1 @@ -27,39 +27,35 @@ W1 - - -W1 - -4x - -1 m -  -X1:1 -#ffffff -X2:1 - - - -X1:2 -#ffffff -X2:2 - - - -X1:3 -#ffffff -X2:3 - - - -X1:4 -#ffffff -X2:4 - - - -  + + +W1 + +4x + +1 m +  +X1:1 +X2:1 + + + +X1:2 +X2:2 + + + +X1:3 +X2:3 + + + +X1:4 +X2:4 + + + +  @@ -92,47 +88,47 @@ X2 - - -X2 - -4-pin - -1 - -2 - -3 - -4 + + +X2 + +4-pin + +1 + +2 + +3 + +4 W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + diff --git a/tutorial/tutorial01.png b/tutorial/tutorial01.png index acf2096c..47cd8c1f 100644 Binary files a/tutorial/tutorial01.png and b/tutorial/tutorial01.png differ diff --git a/tutorial/tutorial01.svg b/tutorial/tutorial01.svg index 5be93eaa..0eb74d46 100644 --- a/tutorial/tutorial01.svg +++ b/tutorial/tutorial01.svg @@ -4,10 +4,10 @@ - + - + X1 @@ -28,39 +28,35 @@ W1 - - -W1 - -4x - -1 m -  -X1:1 -#ffffff -X2:1 - - - -X1:2 -#ffffff -X2:2 - - - -X1:3 -#ffffff -X2:3 - - - -X1:4 -#ffffff -X2:4 - - - -  + + +W1 + +4x + +1 m +  +X1:1 +X2:1 + + + +X1:2 +X2:2 + + + +X1:3 +X2:3 + + + +X1:4 +X2:4 + + + +  @@ -93,47 +89,47 @@ X2 - - -X2 - -4-pin - -1 - -2 - -3 - -4 + + +X2 + +4-pin + +1 + +2 + +3 + +4 W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + W1:e--X2:w - - - + + + diff --git a/tutorial/tutorial02.html b/tutorial/tutorial02.html index 89c5236a..54364a40 100644 --- a/tutorial/tutorial02.html +++ b/tutorial/tutorial02.html @@ -146,4 +146,4 @@
-

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins2X1, X2
Cable, 4 x 0.25 mm²1mW1
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins2X1, X2
Cable, 4 x 0.25 mm²1mW1
\ No newline at end of file diff --git a/tutorial/tutorial03.html b/tutorial/tutorial03.html index 29a97ef1..be0c951d 100644 --- a/tutorial/tutorial03.html +++ b/tutorial/tutorial03.html @@ -175,4 +175,4 @@
-

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins2X1, X2
Cable, 4 x 0.25 mm² shielded1mW1
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins2X1, X2
Cable, 4 x 0.25 mm² shielded1mW1
\ No newline at end of file diff --git a/tutorial/tutorial03.yml b/tutorial/tutorial03.yml index 46f16253..fba6e6d4 100644 --- a/tutorial/tutorial03.yml +++ b/tutorial/tutorial03.yml @@ -1,6 +1,6 @@ connectors: X1: &template1 # define a template for later use - pinout: [GND, VCC, RX, TX] # pincount implicit in pinout + pinlabels: [GND, VCC, RX, TX] # pincount implicit in pinout type: Molex KK 254 subtype: female X2: diff --git a/tutorial/tutorial04.yml b/tutorial/tutorial04.yml index 6286e94c..0080d1b2 100644 --- a/tutorial/tutorial04.yml +++ b/tutorial/tutorial04.yml @@ -1,6 +1,6 @@ connectors: X1: &template_con - pinout: [GND, VCC, SCL, SDA] + pinlabels: [GND, VCC, SCL, SDA] type: Molex KK 254 subtype: male notes: to microcontroller # add notes diff --git a/tutorial/tutorial05.bom.tsv b/tutorial/tutorial05.bom.tsv index 973d4cda..d7f405d6 100644 --- a/tutorial/tutorial05.bom.tsv +++ b/tutorial/tutorial05.bom.tsv @@ -1,5 +1,5 @@ Item Qty Unit Designators -Connector, Ferrule, crimp, 0.5 mm², OG 4 +Connector, Crimp ferrule, 0.5 mm², OG 4 Connector, Molex 8981, female, 4 pins 1 X1 Wire, 0.5 mm², BK 0.6 m W1 Wire, 0.5 mm², RD 0.3 m W1 diff --git a/tutorial/tutorial05.gv b/tutorial/tutorial05.gv index 19dc5b70..e275b2f8 100644 --- a/tutorial/tutorial05.gv +++ b/tutorial/tutorial05.gv @@ -5,25 +5,21 @@ graph { node [fillcolor=white fontname=arial shape=record style=filled] edge [fontname=arial style=bold] X1 [label=<
X1
Molex 8981female4-pin
1+12V
2GND
3GND
4+5V
> fillcolor=white margin=0 shape=none style=filled] - _F1_1 [label=<
Ferrule, crimp0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] - _F1_2 [label=<
Ferrule, crimp0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] - _F1_3 [label=<
Ferrule, crimp0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] - _F1_4 [label=<
Ferrule, crimp0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] + _F1_1 [label=<
Crimp ferrule0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] + _F1_2 [label=<
Crimp ferrule0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] + _F1_3 [label=<
Crimp ferrule0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] + _F1_4 [label=<
Crimp ferrule0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] edge [color="#000000:#ffff00:#000000"] _F1_1:e -- W1:w1:w - edge [color="#000000:#000000:#000000"] - _F1_2:e -- W1:w2:w - edge [color="#000000:#000000:#000000"] - _F1_3:e -- W1:w3:w - edge [color="#000000:#ff0000:#000000"] - _F1_4:e -- W1:w4:w - edge [color="#000000:#ffff00:#000000"] W1:w1:e -- X1:p1l:w edge [color="#000000:#000000:#000000"] + _F1_2:e -- W1:w2:w W1:w2:e -- X1:p2l:w edge [color="#000000:#000000:#000000"] + _F1_3:e -- W1:w3:w W1:w3:e -- X1:p3l:w edge [color="#000000:#ff0000:#000000"] + _F1_4:e -- W1:w4:w W1:w4:e -- X1:p4l:w W1 [label=<
W1
4x0.5 mm²0.3 m
 
YEX1:1
BKX1:2
BKX1:3
RDX1:4
 
> fillcolor=white margin=0 shape=box style="filled,dashed"] } diff --git a/tutorial/tutorial05.html b/tutorial/tutorial05.html index 49da4fd5..9b565abc 100644 --- a/tutorial/tutorial05.html +++ b/tutorial/tutorial05.html @@ -3,182 +3,182 @@ - + - + X1 - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V _F1_1 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + W1 - - -W1 - -4x - -0.5 mm² - -0.3 m -  -YE -X1:1 - - - -BK -X1:2 - - - -BK -X1:3 - - - -RD -X1:4 - - - -  + + +W1 + +4x + +0.5 mm² + +0.3 m +  +YE +X1:1 + + + +BK +X1:2 + + + +BK +X1:3 + + + +RD +X1:4 + + + +  _F1_1:e--W1:w - - - + + + _F1_2 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + - + _F1_2:e--W1:w - - - + + + _F1_3 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + - + _F1_3:e--W1:w - - - + + + _F1_4 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + - + _F1_4:e--W1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + W1:e--X1:w - - - + + + -

Bill of Materials

ItemQtyUnitDesignators
Connector, Ferrule, crimp, 0.5 mm², OG4
Connector, Molex 8981, female, 4 pins1X1
Wire, 0.5 mm², BK0.6mW1
Wire, 0.5 mm², RD0.3mW1
Wire, 0.5 mm², YE0.3mW1
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Crimp ferrule, 0.5 mm², OG4
Connector, Molex 8981, female, 4 pins1X1
Wire, 0.5 mm², BK0.6mW1
Wire, 0.5 mm², RD0.3mW1
Wire, 0.5 mm², YE0.3mW1
\ No newline at end of file diff --git a/tutorial/tutorial05.png b/tutorial/tutorial05.png index 1308af93..53c6f54c 100644 Binary files a/tutorial/tutorial05.png and b/tutorial/tutorial05.png differ diff --git a/tutorial/tutorial05.svg b/tutorial/tutorial05.svg index 30e5ab75..4dad696c 100644 --- a/tutorial/tutorial05.svg +++ b/tutorial/tutorial05.svg @@ -4,181 +4,181 @@ - + - + X1 - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V _F1_1 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + W1 - - -W1 - -4x - -0.5 mm² - -0.3 m -  -YE -X1:1 - - - -BK -X1:2 - - - -BK -X1:3 - - - -RD -X1:4 - - - -  + + +W1 + +4x + +0.5 mm² + +0.3 m +  +YE +X1:1 + + + +BK +X1:2 + + + +BK +X1:3 + + + +RD +X1:4 + + + +  _F1_1:e--W1:w - - - + + + _F1_2 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + - + _F1_2:e--W1:w - - - + + + _F1_3 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + - + _F1_3:e--W1:w - - - + + + _F1_4 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + - + _F1_4:e--W1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + W1:e--X1:w - - - + + + diff --git a/tutorial/tutorial05.yml b/tutorial/tutorial05.yml index dda905ed..e894a452 100644 --- a/tutorial/tutorial05.yml +++ b/tutorial/tutorial05.yml @@ -1,12 +1,12 @@ connectors: X1: - pinout: [+12V, GND, GND, +5V] + pinlabels: [+12V, GND, GND, +5V] type: Molex 8981 subtype: female F1: - category: ferrule + style: simple autogenerate: true - type: Ferrule, crimp + type: Crimp ferrule subtype: 0.5 mm² color: OG # optional color @@ -18,9 +18,7 @@ cables: colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit connections: - - # attach ferrules - - F1 # no need for list of connections; one ferrule per wire is auto-generated and attached - - W1: [1-4] # a new ferrule is auto-generated for each wire - - # attach connectors (separately from ferrules) + - + - F1 # a new ferrule is auto-generated for each of the four wires - W1: [1-4] - X1: [1-4] diff --git a/tutorial/tutorial06.bom.tsv b/tutorial/tutorial06.bom.tsv index c6eda88a..04ff66cc 100644 --- a/tutorial/tutorial06.bom.tsv +++ b/tutorial/tutorial06.bom.tsv @@ -1,6 +1,6 @@ Item Qty Unit Designators -Connector, Ferrule, crimp, 0.5 mm², OG 2 -Connector, Ferrule, crimp, 1.0 mm², YE 1 +Connector, Crimp ferrule, 0.5 mm², OG 2 +Connector, Crimp ferrule, 1.0 mm², YE 1 Connector, Molex 8981, female, 4 pins 1 X1 Wire, 0.5 mm², BK 0.6 m W1 Wire, 0.5 mm², RD 0.3 m W1 diff --git a/tutorial/tutorial06.gv b/tutorial/tutorial06.gv index 1437e66b..a498972b 100644 --- a/tutorial/tutorial06.gv +++ b/tutorial/tutorial06.gv @@ -5,24 +5,20 @@ graph { node [fillcolor=white fontname=arial shape=record style=filled] edge [fontname=arial style=bold] X1 [label=<
X1
Molex 8981female4-pin
1+12V
2GND
3GND
4+5V
> fillcolor=white margin=0 shape=none style=filled] - F_10_1 [label=<
Ferrule, crimp1.0 mm²YE
> fillcolor=white margin=0 shape=none style=filled] - _F_05_1 [label=<
Ferrule, crimp0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] - _F_05_2 [label=<
Ferrule, crimp0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] + F_10 [label=<
Crimp ferrule1.0 mm²YE
> fillcolor=white margin=0 shape=none style=filled] + _F_05_1 [label=<
Crimp ferrule0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] + _F_05_2 [label=<
Crimp ferrule0.5 mm²OG
> fillcolor=white margin=0 shape=none style=filled] edge [color="#000000:#ffff00:#000000"] _F_05_1:e -- W1:w1:w - edge [color="#000000:#ff0000:#000000"] - _F_05_2:e -- W1:w4:w - edge [color="#000000:#ffff00:#000000"] W1:w1:e -- X1:p1l:w edge [color="#000000:#000000:#000000"] + F_10:e -- W1:w2:w W1:w2:e -- X1:p2l:w edge [color="#000000:#000000:#000000"] + F_10:e -- W1:w3:w W1:w3:e -- X1:p3l:w edge [color="#000000:#ff0000:#000000"] + _F_05_2:e -- W1:w4:w W1:w4:e -- X1:p4l:w - edge [color="#000000:#000000:#000000"] - F_10_1:e -- W1:w2:w - edge [color="#000000:#000000:#000000"] - F_10_1:e -- W1:w3:w W1 [label=<
W1
4x0.5 mm²0.3 m
 
YEX1:1
BKX1:2
BKX1:3
RDX1:4
 
> fillcolor=white margin=0 shape=box style="filled,dashed"] } diff --git a/tutorial/tutorial06.html b/tutorial/tutorial06.html index 1b2ef340..551c93fc 100644 --- a/tutorial/tutorial06.html +++ b/tutorial/tutorial06.html @@ -3,169 +3,169 @@ - + - + X1 - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V - + -F_10_1 - - -Ferrule, crimp - -1.0 mm² - -YE - - +F_10 + + +Crimp ferrule + +1.0 mm² + +YE + + W1 - - -W1 - -4x - -0.5 mm² - -0.3 m -  -YE -X1:1 - - - -BK -X1:2 - - - -BK -X1:3 - - - -RD -X1:4 - - - -  + + +W1 + +4x + +0.5 mm² + +0.3 m +  +YE +X1:1 + + + +BK +X1:2 + + + +BK +X1:3 + + + +RD +X1:4 + + + +  - - -F_10_1:e--W1:w - - - + + +F_10:e--W1:w + + + - - -F_10_1:e--W1:w - - - + + +F_10:e--W1:w + + + _F_05_1 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + _F_05_1:e--W1:w - - - + + + _F_05_2 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + - + _F_05_2:e--W1:w - - - + + + - + W1:e--X1:w - - - + + + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + -

Bill of Materials

ItemQtyUnitDesignators
Connector, Ferrule, crimp, 0.5 mm², OG2
Connector, Ferrule, crimp, 1.0 mm², YE1
Connector, Molex 8981, female, 4 pins1X1
Wire, 0.5 mm², BK0.6mW1
Wire, 0.5 mm², RD0.3mW1
Wire, 0.5 mm², YE0.3mW1
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Crimp ferrule, 0.5 mm², OG2
Connector, Crimp ferrule, 1.0 mm², YE1
Connector, Molex 8981, female, 4 pins1X1
Wire, 0.5 mm², BK0.6mW1
Wire, 0.5 mm², RD0.3mW1
Wire, 0.5 mm², YE0.3mW1
\ No newline at end of file diff --git a/tutorial/tutorial06.png b/tutorial/tutorial06.png index 9aff69aa..3146000f 100644 Binary files a/tutorial/tutorial06.png and b/tutorial/tutorial06.png differ diff --git a/tutorial/tutorial06.svg b/tutorial/tutorial06.svg index 5102618e..2075925e 100644 --- a/tutorial/tutorial06.svg +++ b/tutorial/tutorial06.svg @@ -4,168 +4,168 @@ - + - + X1 - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V - + -F_10_1 - - -Ferrule, crimp - -1.0 mm² - -YE - - +F_10 + + +Crimp ferrule + +1.0 mm² + +YE + + W1 - - -W1 - -4x - -0.5 mm² - -0.3 m -  -YE -X1:1 - - - -BK -X1:2 - - - -BK -X1:3 - - - -RD -X1:4 - - - -  + + +W1 + +4x + +0.5 mm² + +0.3 m +  +YE +X1:1 + + + +BK +X1:2 + + + +BK +X1:3 + + + +RD +X1:4 + + + +  - - -F_10_1:e--W1:w - - - + + +F_10:e--W1:w + + + - - -F_10_1:e--W1:w - - - + + +F_10:e--W1:w + + + _F_05_1 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + _F_05_1:e--W1:w - - - + + + _F_05_2 - - -Ferrule, crimp - -0.5 mm² - -OG - - + + +Crimp ferrule + +0.5 mm² + +OG + + - + _F_05_2:e--W1:w - - - + + + - + W1:e--X1:w - - - + + + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + diff --git a/tutorial/tutorial06.yml b/tutorial/tutorial06.yml index bcf9c8c4..51431573 100644 --- a/tutorial/tutorial06.yml +++ b/tutorial/tutorial06.yml @@ -1,19 +1,20 @@ connectors: X1: - pinout: [+12V, GND, GND, +5V] + pinlabels: [+12V, GND, GND, +5V] type: Molex 8981 subtype: female - F_10_1: # manually define a ferrule (with unique designator) - category: ferrule - type: Ferrule, crimp + F_10: # this is a unique ferrule + style: simple + show_name: false # non-autogenerated connectors show their name by default; override + type: Crimp ferrule subtype: 1.0 mm² - color: YE - F_05: - category: ferrule + color: YE # optional color + F_05: # this is a ferrule that will be auto-generated on demand + style: simple autogenerate: true - type: Ferrule, crimp + type: Crimp ferrule subtype: 0.5 mm² - color: OG # optional color + color: OG cables: W1: @@ -23,16 +24,7 @@ cables: colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit connections: - - # attach ferrules - - F_05 - - W1: [1,4] # a new ferrule is auto-generated for each wire - - # attach connectors (separately from ferrules) - - W1: [1-4] - - X1: [1-4] - - - - F_10_1: 1 # manually defined ferrules are treated like regular connectors, - # thus requiring a pin number - - W1: 2 - - - - F_10_1: 1 - - W1: 3 + - + - [F_05, F_10, F_10, F_05] + - W1: [1-4] + - X1: [1-4] diff --git a/tutorial/tutorial07.html b/tutorial/tutorial07.html index fa2bb2a3..61efdca0 100644 --- a/tutorial/tutorial07.html +++ b/tutorial/tutorial07.html @@ -658,4 +658,4 @@
-

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins6X1, X2, X3, X4, X5, X6
Wire, 0.25 mm², PK1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², TQ1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², VT1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², YE1.0mW1, W2, W3, W4, W5
\ No newline at end of file +

Bill of Materials

ItemQtyUnitDesignators
Connector, Molex KK 254, female, 4 pins6X1, X2, X3, X4, X5, X6
Wire, 0.25 mm², PK1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², TQ1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², VT1.0mW1, W2, W3, W4, W5
Wire, 0.25 mm², YE1.0mW1, W2, W3, W4, W5
\ No newline at end of file diff --git a/tutorial/tutorial07.yml b/tutorial/tutorial07.yml index 2aefc833..70778ffc 100644 --- a/tutorial/tutorial07.yml +++ b/tutorial/tutorial07.yml @@ -2,7 +2,7 @@ connectors: X1: &template_con type: Molex KK 254 subtype: female - pinout: [GND, VCC, SCL, SDA] + pinlabels: [GND, VCC, SCL, SDA] X2: <<: *template_con X3: diff --git a/tutorial/tutorial08.html b/tutorial/tutorial08.html index 7c42f8b3..bd5e8240 100644 --- a/tutorial/tutorial08.html +++ b/tutorial/tutorial08.html @@ -294,4 +294,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², RD1mW2WiresCoW1-RDWIRE3
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