diff --git a/src/batch.py b/src/batch.py index 6b24189..300cd84 100644 --- a/src/batch.py +++ b/src/batch.py @@ -33,7 +33,7 @@ if tutorials: with open(os.path.abspath('../tutorial/tutorial{:02d}.md'.format(i)), 'r') as info: for line in info: - file.write(line) + file.write(line.replace('## ', '## {} - '.format(i))) file.write('\n[Source](tutorial{:02d}.yml):\n\n'.format(i)) with open(os.path.abspath('../tutorial/tutorial{:02d}.yml'.format(i)), 'r') as src: @@ -47,4 +47,4 @@ if tutorials: file.write('![](tutorial{:02d}.png)\n\n'.format(i)) - # file.write('[Bill of Materials](tutorial{:02d}.bom.tsv)\n\n\n'.format(i)) + file.write('[Bill of Materials](tutorial{:02d}.bom.tsv)\n\n\n'.format(i)) diff --git a/tutorial/readme.md b/tutorial/readme.md index 31b7c70..7b01e5b 100644 --- a/tutorial/readme.md +++ b/tutorial/readme.md @@ -1,5 +1,5 @@ # WireViz Tutorial -## Bare-bones example +## 1 - Bare-bones example * Minimum working example * Only 1-to-1 sequential wiring @@ -30,10 +30,13 @@ Output: ![](tutorial01.png) -## Adding parameters and colors +[Bill of Materials](tutorial01.bom.tsv) + + +## 2 - Adding parameters and colors * Parameters for connectors and cables -* Auto-calculate AWG from mm2 +* Auto-calculate equivalent AWG from mm2 * Non-sequential wiring [Source](tutorial02.yml): @@ -56,7 +59,7 @@ cables: # more cable parameters: length: 1 gauge: 0.25 mm2 - show_equiv: true + show_equiv: true # auto-calculate AWG equivalent colors: [WH, BN, GN, YE] connections: @@ -72,7 +75,10 @@ Output: ![](tutorial02.png) -## Pinouts, shielding, templates (I) +[Bill of Materials](tutorial02.bom.tsv) + + +## 3 - Pinouts, shielding, templates (I) * Connector pinouts * Pincount implicit in pinout @@ -115,12 +121,16 @@ Output: ![](tutorial03.png) -## Templates (II), notes,American standards, daisy chaining (I) +[Bill of Materials](tutorial03.bom.tsv) + + +## 4 - Templates (II), notes, American standards, daisy chaining (I) * Overriding template parameters -* Add nodes to connectors (and cables) +* Add nodes to connectors and cables * American standards: AWG gauge and IEC colors * Linear daisy-chain + * Convenient for shorter chains [Source](tutorial04.yml): @@ -144,7 +154,7 @@ cables: W1: &template_cbl wirecount: 4 length: 0.3 - gauge: 24 AWG # specifying guage in AWG directly + gauge: 24 AWG # specify gauge in AWG directly color_code: IEC # IEC 62 colors also supported notes: This cable is a bit longer W2: @@ -168,13 +178,21 @@ Output: ![](tutorial04.png) -## Ferrules, wire bundles, custom wire colors +[Bill of Materials](tutorial04.bom.tsv) + + +## 5 - Ferrules, wire bundles, custom wire colors * Ferrules + * Simpler than connectors + * Compact graphical representation + * Only one pin, only one connection, no designator + * Define once, auto-generate where needed * Wire bundles * Internally treated as cables - * Different treatment in BOM -* Custom colors + * Different treatment in BOM: Each wire is listed individually + * Represented with dashed outline +* Custom wire colors * Wirecount can be implicit in color list [Source](tutorial05.yml): @@ -196,12 +214,12 @@ cables: W1: category: bundle # bundle length: 0.3 - gauge: 0.5 mm + gauge: 0.5 mm2 colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit connections: - # attach ferrules - - F1 + - 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 (separetely from ferrules) - W1: [1-4] @@ -213,10 +231,14 @@ Output: ![](tutorial05.png) -## Custom ferrules +[Bill of Materials](tutorial05.bom.tsv) + + +## 6 - 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 [Source](tutorial06.yml): @@ -226,7 +248,7 @@ connectors: pinout: [+12V, GND, GND, +5V] type: Molex 8981 subtype: female - F_10_1: # manually define a ferrule (with unique identifier) + F_10_1: # manually define a ferrule (with unique designator) category: ferrule type: Ferrule, crimp subtype: 1.0 mm² @@ -242,7 +264,7 @@ cables: W1: category: bundle # budnle length: 0.3 - gauge: 0.5 mm + gauge: 0.5 mm2 colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit connections: @@ -266,9 +288,13 @@ Output: ![](tutorial06.png) -## Daisy chaining (II) +[Bill of Materials](tutorial06.bom.tsv) + + +## 7 - Daisy chaining (II) * Zig-zag daisy chain + * Convenient for longer chains [Source](tutorial07.yml): @@ -332,3 +358,6 @@ Output: ![](tutorial07.png) +[Bill of Materials](tutorial07.bom.tsv) + + diff --git a/tutorial/tutorial02.md b/tutorial/tutorial02.md index 6b58fbd..9d39bf7 100644 --- a/tutorial/tutorial02.md +++ b/tutorial/tutorial02.md @@ -1,5 +1,5 @@ ## Adding parameters and colors * Parameters for connectors and cables -* Auto-calculate AWG from mm2 +* Auto-calculate equivalent AWG from mm2 * Non-sequential wiring diff --git a/tutorial/tutorial02.yml b/tutorial/tutorial02.yml index fde5a9e..030e42e 100644 --- a/tutorial/tutorial02.yml +++ b/tutorial/tutorial02.yml @@ -15,7 +15,7 @@ cables: # more cable parameters: length: 1 gauge: 0.25 mm2 - show_equiv: true + show_equiv: true # auto-calculate AWG equivalent colors: [WH, BN, GN, YE] connections: diff --git a/tutorial/tutorial04.md b/tutorial/tutorial04.md index a2ed709..37cbe79 100644 --- a/tutorial/tutorial04.md +++ b/tutorial/tutorial04.md @@ -1,6 +1,7 @@ -## Templates (II), notes,American standards, daisy chaining (I) +## Templates (II), notes, American standards, daisy chaining (I) * Overriding template parameters -* Add nodes to connectors (and cables) +* Add nodes to connectors and cables * American standards: AWG gauge and IEC colors * Linear daisy-chain + * Convenient for shorter chains diff --git a/tutorial/tutorial04.yml b/tutorial/tutorial04.yml index b6ef9d6..6286e94 100644 --- a/tutorial/tutorial04.yml +++ b/tutorial/tutorial04.yml @@ -17,7 +17,7 @@ cables: W1: &template_cbl wirecount: 4 length: 0.3 - gauge: 24 AWG # specifying guage in AWG directly + gauge: 24 AWG # specify gauge in AWG directly color_code: IEC # IEC 62 colors also supported notes: This cable is a bit longer W2: diff --git a/tutorial/tutorial05.bom.tsv b/tutorial/tutorial05.bom.tsv index ea7ee62..973d4cd 100644 --- a/tutorial/tutorial05.bom.tsv +++ b/tutorial/tutorial05.bom.tsv @@ -1,6 +1,6 @@ Item Qty Unit Designators Connector, Ferrule, crimp, 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 -Wire, 0.5 mm, YE 0.3 m W1 +Wire, 0.5 mm², BK 0.6 m W1 +Wire, 0.5 mm², RD 0.3 m W1 +Wire, 0.5 mm², YE 0.3 m W1 diff --git a/tutorial/tutorial05.gv b/tutorial/tutorial05.gv index 3f4b791..fff2bcc 100644 --- a/tutorial/tutorial05.gv +++ b/tutorial/tutorial05.gv @@ -61,5 +61,5 @@ graph { W1:w3:e -- X1:p3l:w edge [color="#000000:#ff0000:#000000"] W1:w4:e -- X1:p4l:w - W1 [label=<
W1
4x0.5 mm0.3 m
 
YEX1:1
BKX1:2
BKX1:3
RDX1:4
 
> fillcolor=white margin=0 shape=box style="filled,dashed"] + 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 445d948..622ebc9 100644 --- a/tutorial/tutorial05.html +++ b/tutorial/tutorial05.html @@ -4,37 +4,37 @@ - + - + X1 - -X1 - -Molex 8981 - -female - -4-pin - -1 - -2 - -3 - -4 - -+12V - -GND - -GND - -+5V + +X1 + +Molex 8981 + +female + +4-pin + +1 + +2 + +3 + +4 + ++12V + +GND + +GND + ++5V @@ -50,37 +50,37 @@ 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 + + + +  @@ -146,31 +146,31 @@ 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, 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 diff --git a/tutorial/tutorial05.md b/tutorial/tutorial05.md index 244d2be..2212756 100644 --- a/tutorial/tutorial05.md +++ b/tutorial/tutorial05.md @@ -1,8 +1,13 @@ ## Ferrules, wire bundles, custom wire colors * Ferrules + * Simpler than connectors + * Compact graphical representation + * Only one pin, only one connection, no designator + * Define once, auto-generate where needed * Wire bundles * Internally treated as cables - * Different treatment in BOM -* Custom colors + * Different treatment in BOM: Each wire is listed individually + * Represented with dashed outline +* Custom wire colors * Wirecount can be implicit in color list diff --git a/tutorial/tutorial05.png b/tutorial/tutorial05.png index 6518896..8141e68 100644 Binary files a/tutorial/tutorial05.png and b/tutorial/tutorial05.png differ diff --git a/tutorial/tutorial05.svg b/tutorial/tutorial05.svg index fb6361f..fc34a3c 100644 --- a/tutorial/tutorial05.svg +++ b/tutorial/tutorial05.svg @@ -4,37 +4,37 @@ - + - + X1 - -X1 - -Molex 8981 - -female - -4-pin - -1 - -2 - -3 - -4 - -+12V - -GND - -GND - -+5V + +X1 + +Molex 8981 + +female + +4-pin + +1 + +2 + +3 + +4 + ++12V + +GND + +GND + ++5V @@ -50,37 +50,37 @@ 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 + + + +  @@ -146,30 +146,30 @@ 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 d027c57..148879b 100644 --- a/tutorial/tutorial05.yml +++ b/tutorial/tutorial05.yml @@ -14,12 +14,12 @@ cables: W1: category: bundle # bundle length: 0.3 - gauge: 0.5 mm + gauge: 0.5 mm2 colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit connections: - # attach ferrules - - F1 + - 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 (separetely from ferrules) - W1: [1-4] diff --git a/tutorial/tutorial06.bom.tsv b/tutorial/tutorial06.bom.tsv index 3776094..c6eda88 100644 --- a/tutorial/tutorial06.bom.tsv +++ b/tutorial/tutorial06.bom.tsv @@ -2,6 +2,6 @@ Item Qty Unit Designators Connector, Ferrule, crimp, 0.5 mm², OG 2 Connector, Ferrule, crimp, 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 -Wire, 0.5 mm, YE 0.3 m W1 +Wire, 0.5 mm², BK 0.6 m W1 +Wire, 0.5 mm², RD 0.3 m W1 +Wire, 0.5 mm², YE 0.3 m W1 diff --git a/tutorial/tutorial06.gv b/tutorial/tutorial06.gv index 74e80f5..965cad3 100644 --- a/tutorial/tutorial06.gv +++ b/tutorial/tutorial06.gv @@ -51,5 +51,5 @@ graph { F_10_1:e -- W1:w2:w edge [color="#000000:#000000:#000000"] F_10_1:e -- W1:w3:w - W1 [label=<
W1
4x0.5 mm0.3 m
 
YEX1:1
BKX1:2
BKX1:3
RDX1:4
 
> fillcolor=white margin=0 shape=box style="filled,dashed"] + 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 8b05c31..85af609 100644 --- a/tutorial/tutorial06.html +++ b/tutorial/tutorial06.html @@ -4,37 +4,37 @@ - + - + X1 - -X1 - -Molex 8981 - -female - -4-pin - -1 - -2 - -3 - -4 - -+12V - -GND - -GND - -+5V + +X1 + +Molex 8981 + +female + +4-pin + +1 + +2 + +3 + +4 + ++12V + +GND + +GND + ++5V @@ -50,37 +50,37 @@ 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 + + + +  @@ -135,31 +135,31 @@ 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, 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 diff --git a/tutorial/tutorial06.md b/tutorial/tutorial06.md index b15abbb..4e2a679 100644 --- a/tutorial/tutorial06.md +++ b/tutorial/tutorial06.md @@ -2,3 +2,4 @@ * Custom ferrules * Allows attaching more than one wire to a ferrule + * Requires defining them as regular connectors with unique designators, adding `category: ferrule` parameter diff --git a/tutorial/tutorial06.png b/tutorial/tutorial06.png index 2f7901d..b1314cd 100644 Binary files a/tutorial/tutorial06.png and b/tutorial/tutorial06.png differ diff --git a/tutorial/tutorial06.svg b/tutorial/tutorial06.svg index a68a0a7..75bae19 100644 --- a/tutorial/tutorial06.svg +++ b/tutorial/tutorial06.svg @@ -4,37 +4,37 @@ - + - + X1 - -X1 - -Molex 8981 - -female - -4-pin - -1 - -2 - -3 - -4 - -+12V - -GND - -GND - -+5V + +X1 + +Molex 8981 + +female + +4-pin + +1 + +2 + +3 + +4 + ++12V + +GND + +GND + ++5V @@ -50,37 +50,37 @@ 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 + + + +  @@ -135,30 +135,30 @@ 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 ee0b3de..2f2ab64 100644 --- a/tutorial/tutorial06.yml +++ b/tutorial/tutorial06.yml @@ -3,7 +3,7 @@ connectors: pinout: [+12V, GND, GND, +5V] type: Molex 8981 subtype: female - F_10_1: # manually define a ferrule (with unique identifier) + F_10_1: # manually define a ferrule (with unique designator) category: ferrule type: Ferrule, crimp subtype: 1.0 mm² @@ -19,7 +19,7 @@ cables: W1: category: bundle # budnle length: 0.3 - gauge: 0.5 mm + gauge: 0.5 mm2 colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit connections: diff --git a/tutorial/tutorial07.md b/tutorial/tutorial07.md index 6157478..8b9bfd8 100644 --- a/tutorial/tutorial07.md +++ b/tutorial/tutorial07.md @@ -1,3 +1,4 @@ ## Daisy chaining (II) * Zig-zag daisy chain + * Convenient for longer chains