Date: | 2011-01-18 01:30:57 (13 years 2 months ago) |
---|---|
Author: | werner |
Commit: | 49a1bbdd0525c12d09a365cc36998d52c0ee46ba |
Message: | Added a new pad type: trace pads, for antennas and other trace-like
elements. - layer.h (enum pad_type): added pad type pt_trace - layer.c (pad_type_to_layers, layers_to_pad_type), inst.c (inst_pad): "trace" pad instantition and conversion infrastructure - fpd.y (pad_type), dump.c (print_obj): .fpd file I/O for "trace" pads - postscript.c (prologue): added Postscript function "horpath" to produce horizontal stripes - postscript.c (hatch): show "trace" pads with horizontal stripes - gui_style.h (gc_pad_trace), gui_style.c (gc_pad_trace, gui_setup_style), gui_inst.c (pad_gc): added visualization of "trace" pads - gui_status.c (show_pad_type): added "trace" pad type - README: added description of "trace" pads - README: added usage examples for the various pad types git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5998 99fdad57-331a-0410-800a-d7fa5415bdb3 |
Files: |
README (1 diff) dump.c (2 diffs) fpd.y (2 diffs) gui_inst.c (2 diffs) gui_status.c (2 diffs) gui_style.c (3 diffs) gui_style.h (2 diffs) inst.c (2 diffs) layer.c (3 diffs) layer.h (2 diffs) postscript.c (5 diffs) |
Change Details
README | ||
---|---|---|
270 | 270 | --------- ------------------------------------- |
271 | 271 | (default) copper, solder mask, and solder paste |
272 | 272 | bare copper and solder mask |
273 | trace copper without solder mask opening | |
273 | 274 | paste solder paste |
274 | 275 | mask solder mask |
275 | 276 | |
277 | Typical uses: | |
278 | - "bare": connectors printed directly on the PCB | |
279 | - "trace": connections or antennas | |
280 | - "paste": sparse solder paste, e.g., for QFN center pads | |
281 | - "mask": non-standard mask openings, e.g., for solder mask defined | |
282 | pads | |
283 | ||
276 | 284 | |
277 | 285 | Rounded pads |
278 | 286 | - - - - - - |
dump.c | ||
---|---|---|
1 | 1 | /* |
2 | 2 | * dump.c - Dump objects in the native FPD format |
3 | 3 | * |
4 | * Written 2009, 2010 by Werner Almesberger | |
5 | * Copyright 2009, 2010 by Werner Almesberger | |
4 | * Written 2009-2011 by Werner Almesberger | |
5 | * Copyright 2009-2011 by Werner Almesberger | |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
345 | 345 | case pt_bare: |
346 | 346 | s2 = " bare"; |
347 | 347 | break; |
348 | case pt_trace: | |
349 | s2 = " trace"; | |
350 | break; | |
348 | 351 | case pt_paste: |
349 | 352 | s2 = " paste"; |
350 | 353 | break; |
fpd.y | ||
---|---|---|
2 | 2 | /* |
3 | 3 | * fpd.y - FootPrint Definition language |
4 | 4 | * |
5 | * Written 2009, 2010 by Werner Almesberger | |
6 | * Copyright 2009, 2010 by Werner Almesberger | |
5 | * Written 2009-2011 by Werner Almesberger | |
6 | * Copyright 2009-2011 by Werner Almesberger | |
7 | 7 | * |
8 | 8 | * This program is free software; you can redistribute it and/or modify |
9 | 9 | * it under the terms of the GNU General Public License as published by |
... | ... | |
986 | 986 | { |
987 | 987 | if (!strcmp($1, "bare")) |
988 | 988 | $$ = pt_bare; |
989 | else if (!strcmp($1, "trace")) | |
990 | $$ = pt_trace; | |
989 | 991 | else if (!strcmp($1, "paste")) |
990 | 992 | $$ = pt_paste; |
991 | 993 | else if (!strcmp($1, "mask")) |
gui_inst.c | ||
---|---|---|
1 | 1 | /* |
2 | 2 | * gui_inst.c - GUI, instance functions |
3 | 3 | * |
4 | * Written 2009, 2010 by Werner Almesberger | |
5 | * Copyright 2009, 2010 by Werner Almesberger | |
4 | * Written 2009-2011 by Werner Almesberger | |
5 | * Copyright 2009-2011 by Werner Almesberger | |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
319 | 319 | switch (layers_to_pad_type(inst->u.pad.layers)) { |
320 | 320 | case pt_bare: |
321 | 321 | return gc_pad_bare[get_mode(inst)]; |
322 | case pt_trace: | |
323 | return gc_pad_trace[get_mode(inst)]; | |
322 | 324 | case pt_mask: |
323 | 325 | *fill = FALSE; |
324 | 326 | return gc_pad_mask[get_mode(inst)]; |
gui_status.c | ||
---|---|---|
1 | 1 | /* |
2 | 2 | * gui_status.c - GUI, status area |
3 | 3 | * |
4 | * Written 2009, 2010 by Werner Almesberger | |
5 | * Copyright 2009, 2010 by Werner Almesberger | |
4 | * Written 2009-2011 by Werner Almesberger | |
5 | * Copyright 2009-2011 by Werner Almesberger | |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
204 | 204 | case pt_bare: |
205 | 205 | s = "bare"; |
206 | 206 | break; |
207 | case pt_trace: | |
208 | s = "trace"; | |
209 | break; | |
207 | 210 | case pt_paste: |
208 | 211 | s = "paste"; |
209 | 212 | break; |
gui_style.c | ||
---|---|---|
1 | /* * gui_style.c - GUI, style definitions | |
1 | /* | |
2 | * gui_style.c - GUI, style definitions | |
2 | 3 | * |
3 | * Written 2009, 2010 by Werner Almesberger | |
4 | * Copyright 2009, 2010 by Werner Almesberger | |
4 | * Written 2009-2011 by Werner Almesberger | |
5 | * Copyright 2009-2011 by Werner Almesberger | |
5 | 6 | * |
6 | 7 | * This program is free software; you can redistribute it and/or modify |
7 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
26 | 27 | GdkGC *gc_obj[mode_n]; |
27 | 28 | GdkGC *gc_pad[mode_n]; |
28 | 29 | GdkGC *gc_pad_bare[mode_n]; |
30 | GdkGC *gc_pad_trace[mode_n]; | |
29 | 31 | GdkGC *gc_pad_mask[mode_n]; |
30 | 32 | GdkGC *gc_ptext[mode_n]; |
31 | 33 | GdkGC *gc_rim[mode_n]; |
... | ... | |
68 | 70 | style(gc_obj, "#006060", "#00ffff", "#ffff80", 1); |
69 | 71 | style(gc_pad, "#400000", "#ff0000", "#ffff80", 1); |
70 | 72 | style(gc_pad_bare, "#402000", "#ff6000", "#ffff80", 1); |
73 | style(gc_pad_trace, "#304000", "#80c000", "#ffff80", 1); | |
71 | 74 | style(gc_pad_mask, "#000040", "#0000ff", "#ffff80", 2); |
72 | 75 | style(gc_ptext, "#404040", "#ffffff", "#ffffff", 1); |
73 | 76 | style(gc_hole, "#000000", "#000000", "#000000", 0); |
gui_style.h | ||
---|---|---|
1 | 1 | /* |
2 | 2 | * gui_style.h - GUI, style definitions |
3 | 3 | * |
4 | * Written 2009, 2010 by Werner Almesberger | |
5 | * Copyright 2009, 2010 by Werner Almesberger | |
4 | * Written 2009-2011 by Werner Almesberger | |
5 | * Copyright 2009-2011 by Werner Almesberger | |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
114 | 114 | extern GdkGC *gc_obj[mode_n]; |
115 | 115 | extern GdkGC *gc_pad[mode_n]; |
116 | 116 | extern GdkGC *gc_pad_bare[mode_n]; |
117 | extern GdkGC *gc_pad_trace[mode_n]; | |
117 | 118 | extern GdkGC *gc_pad_mask[mode_n]; |
118 | 119 | extern GdkGC *gc_ptext[mode_n]; |
119 | 120 | extern GdkGC *gc_rim[mode_n]; |
inst.c | ||
---|---|---|
1 | 1 | /* |
2 | 2 | * inst.c - Instance structures |
3 | 3 | * |
4 | * Written 2009, 2010 by Werner Almesberger | |
5 | * Copyright 2009, 2010 by Werner Almesberger | |
4 | * Written 2009-2011 by Werner Almesberger | |
5 | * Copyright 2009-2011 by Werner Almesberger | |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
896 | 896 | struct inst *inst; |
897 | 897 | |
898 | 898 | inst = add_inst(obj->u.pad.rounded ? &rpad_ops : &pad_ops, |
899 | obj->u.pad.type == pt_normal || obj->u.pad.type == pt_bare ? | |
899 | obj->u.pad.type == pt_normal || obj->u.pad.type == pt_bare || | |
900 | obj->u.pad.type == pt_trace ? | |
900 | 901 | ip_pad_copper : ip_pad_special, a); |
901 | 902 | inst->obj = obj; |
902 | 903 | inst->u.pad.name = stralloc(name); |
layer.c | ||
---|---|---|
1 | 1 | /* |
2 | 2 | * layer.c - PCB layers on a pad |
3 | 3 | * |
4 | * Written 2009, 2010 by Werner Almesberger | |
5 | * Copyright 2009, 2010 by Werner Almesberger | |
4 | * Written 2009-2011 by Werner Almesberger | |
5 | * Copyright 2009-2011 by Werner Almesberger | |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
52 | 52 | case pt_bare: |
53 | 53 | layers |= LAYER_COPPER_TOP | LAYER_MASK_TOP; |
54 | 54 | break; |
55 | case pt_trace: | |
56 | layers |= LAYER_COPPER_TOP; | |
57 | break; | |
55 | 58 | case pt_paste: |
56 | 59 | layers = LAYER_PASTE_TOP; |
57 | 60 | break; |
... | ... | |
70 | 73 | if (layers & LAYER_COPPER_TOP) { |
71 | 74 | if (layers & LAYER_PASTE_TOP) |
72 | 75 | return pt_normal; |
73 | return pt_bare; | |
76 | if (layers & LAYER_MASK_TOP) | |
77 | return pt_bare; | |
78 | return pt_trace; | |
74 | 79 | } else { |
75 | 80 | if (layers & LAYER_PASTE_TOP) |
76 | 81 | return pt_paste; |
layer.h | ||
---|---|---|
1 | 1 | /* |
2 | 2 | * layer.h - PCB layers on a pad |
3 | 3 | * |
4 | * Written 2009, 2010 by Werner Almesberger | |
5 | * Copyright 2009, 2010 by Werner Almesberger | |
4 | * Written 2009-2011 by Werner Almesberger | |
5 | * Copyright 2009-2011 by Werner Almesberger | |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
57 | 57 | enum pad_type { |
58 | 58 | pt_normal, /* copper and solder mask */ |
59 | 59 | pt_bare, /* only copper (and finish) */ |
60 | pt_trace, /* only copper, without solder mask opening */ | |
60 | 61 | pt_paste, /* only solder paste */ |
61 | 62 | pt_mask, /* only solder mask */ |
62 | 63 | pt_n |
postscript.c | ||
---|---|---|
1 | 1 | /* |
2 | 2 | * postscript.c - Dump objects in Postscript |
3 | 3 | * |
4 | * Written 2009, 2010 by Werner Almesberger | |
5 | * Copyright 2009, 2010 by Werner Almesberger | |
4 | * Written 2009-2011 by Werner Almesberger | |
5 | * Copyright 2009-2011 by Werner Almesberger | |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
64 | 64 | #define PS_HATCH mm_to_units(0.1) |
65 | 65 | #define PS_HATCH_LINE mm_to_units(0.015) |
66 | 66 | |
67 | #define PS_STRIPE mm_to_units(0.08) | |
68 | ||
67 | 69 | #define PS_RIM_LINE mm_to_units(0.02) |
68 | 70 | |
69 | 71 | #define PS_FONT_OUTLINE mm_to_units(0.025) |
... | ... | |
223 | 225 | return "backhatchpath"; |
224 | 226 | case pt_mask: |
225 | 227 | return "dotpath"; |
228 | case pt_trace: | |
229 | return "horpath"; | |
226 | 230 | default: |
227 | 231 | abort(); |
228 | 232 | } |
... | ... | |
940 | 944 | "/backhatchpath {\n" |
941 | 945 | " gsave flattenpath pathbbox clip newpath\n" |
942 | 946 | " /ury exch def /urx exch def /lly exch def /llx exch def\n" |
943 | " 0 %d ury lly sub urx llx sub add {\n" /* for 0 to urx-llx_ury-lly */ | |
947 | " 0 %d ury lly sub urx llx sub add {\n" /* for 0 to urx-llx+ury-lly */ | |
944 | 948 | " llx add dup lly moveto\n" |
945 | 949 | " ury lly sub sub ury lineto stroke\n" |
946 | 950 | " } for\n" |
... | ... | |
950 | 954 | "/crosspath {\n" |
951 | 955 | " gsave hatchpath grestore backhatchpath } def\n"); |
952 | 956 | |
957 | fprintf(file, | |
958 | "/horpath {\n" | |
959 | " gsave flattenpath pathbbox clip newpath\n" | |
960 | " /ury exch def /urx exch def /lly exch def /llx exch def\n" | |
961 | " lly %d ury {\n" /* for lly to ury */ | |
962 | " dup llx exch moveto\n" | |
963 | " urx exch lineto stroke\n" | |
964 | " } for\n" | |
965 | " grestore newpath } def\n", PS_STRIPE); | |
966 | ||
953 | 967 | /* |
954 | 968 | * Stack: font string width height factor -> factor |
955 | 969 | * |
Branches:
master