diff --git a/tutorial/readme.md b/tutorial/readme.md index 56f9cce..e7caa90 100644 --- a/tutorial/readme.md +++ b/tutorial/readme.md @@ -417,3 +417,72 @@ additional_bom_items: [Source](tutorial08.yml) - [Bill of Materials](tutorial08.bom.tsv) +## 09 - Shorts/Loops/Jumpers + +* Short and Loops + * with optional additional component + +```yaml +connectors: # This is based on tutorial3(ex1) and adds some Shorts to the connectors + X1: # An example of Shorts + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + shorts: # A List(Dict) of shorts is created + - SH1: [1, 5, 7] # First is the designator than a list of pins to be shorted + - SH2: [2, 6] + additional_components: # Some Additional Components to describe the short in more detail, they are not necessary if no further detail is needed + - references: SH1 + color: PK # The color of the short, can also be multicolor + manufacturer: WireViz + mpn: 42XCD42A5 + type: shortPartA + qty: 42 # The length or some other quantity + unit: mm # The unit of the qty, in this example the length + - references: SH2 + color: RD + manufacturer: WireViz + mpn: 42XCD42A5 + type: shortPartB + + X2: # An example of Loops and how an Additional Component can describe more than one Short or Loop + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + loops: + - LO1: [1, 5, 7] + - LO2: [2, 6] + additional_components: + - references: [LO1, LO2] # example to show how one additional_components can reference more than one short or loop + color: PK + manufacturer: WireViz + mpn: 42XCD42A5 + type: loopPartC + qty: 21 + unit: mm + +cables: + W1: + color_code: IEC + wirecount: 4 + gauge: 0.25 mm2 + show_equiv: true + length: 0.2 + shield: true + type: Serial + +connections: + - + - X1: [1-4] + - W1: [1-4] + - X2: [1,2,4,3] + - + - X1: 1 + - W1: s +``` + +![](tutorial09.png) + +[Source](tutorial09.yml) - [Bill of Materials](tutorial09.bom.tsv) + + diff --git a/tutorial/tutorial09.bom.tsv b/tutorial/tutorial09.bom.tsv new file mode 100644 index 0000000..bb6f063 --- /dev/null +++ b/tutorial/tutorial09.bom.tsv @@ -0,0 +1,6 @@ +Id Description Qty Unit Designators Manufacturer MPN +1 Cable, Serial, 4 x 0.25 mm² shielded 0.2 m W1 +2 Connector, Molex KK 254, female, 7 pins 2 X1, X2 +3 loopPartC 21 mm X2-LO1; X2-LO2 WireViz 42XCD42A5 +4 shortPartA 42 mm X1-SH1 WireViz 42XCD42A5 +5 shortPartB 1 X1-SH2 WireViz 42XCD42A5 diff --git a/tutorial/tutorial09.gv b/tutorial/tutorial09.gv new file mode 100644 index 0000000..046988e --- /dev/null +++ b/tutorial/tutorial09.gv @@ -0,0 +1,266 @@ +graph { +// Graph generated by WireViz 0.5-dev +// https://github.com/formatc1702/WireViz + graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] + node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] + edge [fontname=arial style=bold] + edge [color="#FF66CC" headclip=false style="solid,bold" tailclip=false] + X1:p1j:c -- X1:p5j:c [addPTS=.18 colorPTS="#FF66CC" straight=straight] + X1:p5j:c -- X1:p7j:c [addPTS=.18 colorPTS="#FF66CC" straight=straight] + edge [color="#FF0000" headclip=false style="solid,bold" tailclip=false] + X1:p2j:c -- X1:p6j:c [addPTS=.18 colorPTS="#FF0000" straight=straight] + edge [headclip=true style=bold tailclip=true] + X1 [label=< + + + + + + + +
+ + +
X1
+
+ + + + +
Molex KK 254female7-pin
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SH1SH2
GND1
VCC2
RX3
TX4
GND5
VCC6
GND7
+
+ + +
Additional components
+
+ + +
42 mm x SH1 x #4 (shortPartA)
+
+ + +
1 x SH2 x #5 (shortPartB)
+
+> fillcolor="#FFFFFF" shape=box style=filled] + edge [headclip=true style=bold tailclip=true] + X2 [label=< + + + + + + +
+ + +
X2
+
+ + + + +
Molex KK 254female7-pin
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1GND
2VCC
3RX
4TX
5GND
6VCC
7GND
+
+ + +
Additional components
+
+ + +
42 mm x LO1; LO2 x #3 (loopPartC)
+
+> fillcolor="#FFFFFF" shape=box style=filled] + edge [color="#000000:#FF66CC:#000000"] + X2:p1l:w -- X2:p5l:w [label=" "] + X2:p5l:w -- X2:p7l:w [label=" "] + edge [color="#000000:#FF66CC:#000000"] + X2:p2l:w -- X2:p6l:w [label=" "] + edge [color="#000000:#895956:#000000"] + X1:p1r:e -- W1:w1:w + W1:w1:e -- X2:p1l:w + W1:w1:w -- W1:w1:e [straight=straight] + edge [color="#000000:#ff0000:#000000"] + X1:p2r:e -- W1:w2:w + W1:w2:e -- X2:p2l:w + W1:w2:w -- W1:w2:e [straight=straight] + edge [color="#000000:#ff8000:#000000"] + X1:p3r:e -- W1:w3:w + W1:w3:e -- X2:p4l:w + W1:w3:w -- W1:w3:e [straight=straight] + edge [color="#000000:#ffff00:#000000"] + X1:p4r:e -- W1:w4:w + W1:w4:e -- X2:p3l:w + W1:w4:w -- W1:w4:e [straight=straight] + edge [color="#000000"] + X1:p1r:e -- W1:ws:w + W1:ws:w -- W1:ws:e [straight=straight] + W1 [label=< + + + + +
+ + +
W1
+
+ + + + + + +
Serial4x0.25 mm² (24 AWG)+ S0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND + 1:BN + X2:1:GND
+ + +
+
X1:2:VCC + 2:RD + X2:2:VCC
+ + +
+
X1:3:RX + 3:OG + X2:4:TX
+ + +
+
X1:4:TX + 4:YE + X2:3:RX
+ + +
+
 
X1:1:GNDShield
 
+
+> fillcolor="#FFFFFF" shape=box style=filled] +} diff --git a/tutorial/tutorial09.html b/tutorial/tutorial09.html new file mode 100644 index 0000000..7e6176b --- /dev/null +++ b/tutorial/tutorial09.html @@ -0,0 +1,420 @@ + + + + + tutorial09 + + +

tutorial09

+

Diagram

+ +
+ +
+ +
+ + + + + + + + +X1 + + +X1 + +Molex KK 254 + +female + +7-pin + + +SH1 + +SH2 + + +GND + + + +1 + +VCC + + + +2 + +RX + + + +3 + +TX + + + +4 + +GND + + + +5 + +VCC + + + +6 + +GND + + + +7 + +Additional components + +42 mm x SH1 x #4 (shortPartA) + +1 x SH2 x #5 (shortPartB) + + + +X1:c--X1:c + + + + +X1:c--X1:c + + + + +X1:c--X1:c + + + + +W1 + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  +X1:1:GND +     1:BN     +X2:1:GND +X1:2:VCC +     2:RD     +X2:2:VCC +X1:3:RX +     3:OG     +X2:4:TX +X1:4:TX +     4:YE     +X2:3:RX +  +X1:1:GND +Shield +  + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + +W1:w--W1:e + + + + + + +W1:w--W1:e + + + + + + +W1:w--W1:e + + + + + + +W1:w--W1:e + + + + + + +W1:w--W1:e + + + + +X2 + + +X2 + +Molex KK 254 + +female + +7-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX + +5 + +GND + +6 + +VCC + +7 + +GND + +Additional components + +42 mm x LO1; LO2 x #3 (loopPartC) + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +X2:w--X2:w + + + + + + + +X2:w--X2:w + + + + + + + +X2:w--X2:w + + + + + + + +__CIRCLE__1 + + + + +__CIRCLE__2 + + + + +__CIRCLE__3 + + + + +__CIRCLE__4 + + + + +__CIRCLE__5 + + + + +__CIRCLE__6 + + + + + +
+ +
+ +
+ +

Bill of Materials

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdDescriptionQtyUnitDesignatorsManufacturerMPN
1Cable, Serial, 4 x 0.25 mm² shielded0.2mW1
2Connector, Molex KK 254, female, 7 pins2X1, X2
3loopPartC21mmX2-LO1; X2-LO2WireViz42XCD42A5
4shortPartA42mmX1-SH1WireViz42XCD42A5
5shortPartB1X1-SH2WireViz42XCD42A5
+ +
+ + diff --git a/tutorial/tutorial09.md b/tutorial/tutorial09.md new file mode 100644 index 0000000..f895321 --- /dev/null +++ b/tutorial/tutorial09.md @@ -0,0 +1,4 @@ +## Shorts/Loops/Jumpers + +* Short and Loops + * with optional additional component \ No newline at end of file diff --git a/tutorial/tutorial09.png b/tutorial/tutorial09.png new file mode 100644 index 0000000..3b2a645 Binary files /dev/null and b/tutorial/tutorial09.png differ diff --git a/tutorial/tutorial09.svg b/tutorial/tutorial09.svg new file mode 100644 index 0000000..d79d05f --- /dev/null +++ b/tutorial/tutorial09.svg @@ -0,0 +1,321 @@ + + + + + + + + + +X1 + + +X1 + +Molex KK 254 + +female + +7-pin + + +SH1 + +SH2 + + +GND + + + +1 + +VCC + + + +2 + +RX + + + +3 + +TX + + + +4 + +GND + + + +5 + +VCC + + + +6 + +GND + + + +7 + +Additional components + +42 mm x SH1 x #4 (shortPartA) + +1 x SH2 x #5 (shortPartB) + + + +X1:c--X1:c + + + + +X1:c--X1:c + + + + +X1:c--X1:c + + + + +W1 + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  +X1:1:GND +     1:BN     +X2:1:GND +X1:2:VCC +     2:RD     +X2:2:VCC +X1:3:RX +     3:OG     +X2:4:TX +X1:4:TX +     4:YE     +X2:3:RX +  +X1:1:GND +Shield +  + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + +W1:w--W1:e + + + + + + +W1:w--W1:e + + + + + + +W1:w--W1:e + + + + + + +W1:w--W1:e + + + + + + +W1:w--W1:e + + + + +X2 + + +X2 + +Molex KK 254 + +female + +7-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX + +5 + +GND + +6 + +VCC + +7 + +GND + +Additional components + +42 mm x LO1; LO2 x #3 (loopPartC) + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +X2:w--X2:w + + + + + + + +X2:w--X2:w + + + + + + + +X2:w--X2:w + + + + + + + +__CIRCLE__1 + + + + +__CIRCLE__2 + + + + +__CIRCLE__3 + + + + +__CIRCLE__4 + + + + +__CIRCLE__5 + + + + +__CIRCLE__6 + + + + diff --git a/tutorial/tutorial09.yml b/tutorial/tutorial09.yml new file mode 100644 index 0000000..48a5e1f --- /dev/null +++ b/tutorial/tutorial09.yml @@ -0,0 +1,56 @@ +connectors: # This is based on tutorial3(ex1) and adds some Shorts to the connectors + X1: # An example of Shorts + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + shorts: # A List(Dict) of shorts is created + - SH1: [1, 5, 7] # First is the designator than a list of pins to be shorted + - SH2: [2, 6] + additional_components: # Some Additional Components to describe the short in more detail, they are not necessary if no further detail is needed + - references: SH1 + color: PK # The color of the short, can also be multicolor + manufacturer: WireViz + mpn: 42XCD42A5 + type: shortPartA + qty: 42 # The length or some other quantity + unit: mm # The unit of the qty, in this example the length + - references: SH2 + color: RD + manufacturer: WireViz + mpn: 42XCD42A5 + type: shortPartB + + X2: # An example of Loops and how an Additional Component can describe more than one Short or Loop + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + loops: + - LO1: [1, 5, 7] + - LO2: [2, 6] + additional_components: + - references: [LO1, LO2] # example to show how one additional_components can reference more than one short or loop + color: PK + manufacturer: WireViz + mpn: 42XCD42A5 + type: loopPartC + qty: 21 + unit: mm + +cables: + W1: + color_code: IEC + wirecount: 4 + gauge: 0.25 mm2 + show_equiv: true + length: 0.2 + shield: true + type: Serial + +connections: + - + - X1: [1-4] + - W1: [1-4] + - X2: [1,2,4,3] + - + - X1: 1 + - W1: s diff --git a/tutorial/tutorial09_pin2pin.gvpr b/tutorial/tutorial09_pin2pin.gvpr new file mode 100644 index 0000000..4c4e287 --- /dev/null +++ b/tutorial/tutorial09_pin2pin.gvpr @@ -0,0 +1,57 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file