-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
224 lines (183 loc) · 7.97 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
Description:
FritzingCreateFzpConnectors.py is a python script which creates the
connectors section of an fzp file to partially automate modifying fzp files
used by the Fritzing EDA program (fritzing.org). The intent is to make it
easier to add or renumber the connector section of an existing fzp file (it
does not create a complete fzp file, although it could be modified to do so).
One use is to correct a fzp file which has the connectors out of order (not
starting with connector 0) or out of sequence (not starting at connector 0
and increasing by one til the last connector). Another use is to add new
connectors to the end of an existing fzp file. The new connectors have to then
be manually added to the associated svg files, but this makes adding the
necessary xml to the fzp file easier. To accommodate adding connectors to an
existing file, you can optionally add a starting connector number on the
command line.
FritzingCreateFzpConnectors.py Output-file Number-of-connectors
is the minimimal command. It defaults to no breadboard terminalId and starts
at connector0. You can optionally add a starting connector number by adding it
to the end of the command:
FritzingCreateFzpConnectors.py Out 2 2
which will produce a 2 connector file starting at connector2 (so connector2 and
connector3)
getopt type option flags will modify the script behaviour as follows:
-b | --breadboard-terminalId : Emit breadboard TerminalId
By default the script does not emit the breadboard terminalId field because
it is not normally used. If you need the field using the -b flag will
cause the script to emit it.
-o | --overwrite : Overwrite the output file if it exists
By default the script will print
Error: File t already exists.
followed by the usage message if the output file already exists to prevent
overwriting a previous run. The -o flag causes the file to be overwritten
without comment.
-p | --no-pcb-layer : omit pcb layer
In cases where you don't want a pcb view, this flag will supress all of
the pcbview xml in the connnector definition. You should still manually
remove the pcbview definition from before the connectors section in the
fzp file (although not doing so will still work fine but will then output
the silkscreen layer if it is present in the pcb svg which may be
undesireable).
-s | --no-schematic-terminalId : Don't emit schematic terminalId
Although I can't think of a case where I would want to supress the
schematic termanalId, if you should need to do so setting this flag will
supress the terminalId field in the schematic section of the connector.
Some examples of commands followed by their output:
default case:
FritzingCreateFzpConnectors.py t 2
creates a file t which contains:
<connector id="connector0" type="male" name="">
<description></description>
<views>
<breadboardView>
<p svgId="connector0pin" layer="breadboard"/>
</breadboardView>
<schematicView>
<p svgId="connector0pin" layer="schematic" terminalId="connector0terminal"/>
</schematicView>
<pcbView>
<p svgId="connector0pin" layer="copper0"/>
<p svgId="connector0pin" layer="copper1"/>
</pcbView>
</views>
</connector>
<connector id="connector1" type="male" name="">
<description></description>
<views>
<breadboardView>
<p svgId="connector1pin" layer="breadboard"/>
</breadboardView>
<schematicView>
<p svgId="connector1pin" layer="schematic" terminalId="connector1terminal"/>
</schematicView>
<pcbView>
<p svgId="connector1pin" layer="copper0"/>
<p svgId="connector1pin" layer="copper1"/>
</pcbView>
</views>
</connector>
which may then be added or substituted to the connectors section of an existing
fzp file to add or modify connectors. Of note is that the name and description
fields are blank and thus need to be addedi or copied from the current
connector definitions. By default the breadboard terminalId is omitted
(although there is an option for adding it).
Examples of the output from the various options:
Optional starting connector number (connectors start at 2) to add new
connectors to an existing file (or correct the sequence after a certain point
in the file). This would be inserted after connectors 0 and 1:
FritzingCreateFzpConnectors.py t 2 2
creates a file t which contains:
<connector id="connector2" type="male" name="">
<description></description>
<views>
<breadboardView>
<p svgId="connector2pin" layer="breadboard"/>
</breadboardView>
<schematicView>
<p svgId="connector2pin" layer="schematic" terminalId="connector2terminal"/>
</schematicView>
<pcbView>
<p svgId="connector2pin" layer="copper0"/>
<p svgId="connector2pin" layer="copper1"/>
</pcbView>
</views>
</connector>
<connector id="connector3" type="male" name="">
<description></description>
<views>
<breadboardView>
<p svgId="connector3pin" layer="breadboard"/>
</breadboardView>
<schematicView>
<p svgId="connector3pin" layer="schematic" terminalId="connector3terminal"/>
</schematicView>
<pcbView>
<p svgId="connector3pin" layer="copper0"/>
<p svgId="connector3pin" layer="copper1"/>
</pcbView>
</views>
</connector>
Default single connector output for comparison:
FritzingCreateFzpConnectors.py t 1
<connector id="connector0" type="male" name="">
<description></description>
<views>
<breadboardView>
<p svgId="connector0pin" layer="breadboard"/>
</breadboardView>
<schematicView>
<p svgId="connector0pin" layer="schematic" terminalId="connector0terminal"/>
</schematicView>
<pcbView>
<p svgId="connector0pin" layer="copper0"/>
<p svgId="connector0pin" layer="copper1"/>
</pcbView>
</views>
</connector>
Add the breadboard terminalId back in:
FritzingCreateFzpConnectors.py -b t 1
<connector id="connector0" type="male" name="">
<description></description>
<views>
<breadboardView>
<p svgId="connector0pin" layer="breadboard" terminalId="connector0terminal"/>
</breadboardView>
<schematicView>
<p svgId="connector0pin" layer="schematic" terminalId="connector0terminal"/>
</schematicView>
<pcbView>
<p svgId="connector0pin" layer="copper0"/>
<p svgId="connector0pin" layer="copper1"/>
</pcbView>
</views>
</connector>
Remove pcb view (noting that you need to manually remove the pcbview definition
earlier in the fzp file as well):
FritzingCreateFzpConnectors.py -p t 1
<connector id="connector0" type="male" name="">
<description></description>
<views>
<breadboardView>
<p svgId="connector0pin" layer="breadboard"/>
</breadboardView>
<schematicView>
<p svgId="connector0pin" layer="schematic" terminalId="connector0terminal"/>
</schematicView>
</views>
</connector>
Remove schematic terminalId:
FritzingCreateFzpConnectors.py -s t 1
<connector id="connector0" type="male" name="">
<description></description>
<views>
<breadboardView>
<p svgId="connector0pin" layer="breadboard"/>
</breadboardView>
<schematicView>
<p svgId="connector0pin" layer="schematic"/>
</schematicView>
<pcbView>
<p svgId="connector0pin" layer="copper0"/>
<p svgId="connector0pin" layer="copper1"/>
</pcbView>
</views>
</connector>