Date:2011-01-18 01:30:57 (9 years 6 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
270270--------- -------------------------------------
271271(default) copper, solder mask, and solder paste
272272bare copper and solder mask
273trace copper without solder mask opening
273274paste solder paste
274275mask solder mask
275276
277Typical 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
276284
277285Rounded pads
278286- - - - - -
dump.c
11/*
22 * dump.c - Dump objects in the native FPD format
33 *
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
66 *
77 * This program is free software; you can redistribute it and/or modify
88 * it under the terms of the GNU General Public License as published by
...... 
345345        case pt_bare:
346346            s2 = " bare";
347347            break;
348        case pt_trace:
349            s2 = " trace";
350            break;
348351        case pt_paste:
349352            s2 = " paste";
350353            break;
fpd.y
22/*
33 * fpd.y - FootPrint Definition language
44 *
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
77 *
88 * This program is free software; you can redistribute it and/or modify
99 * it under the terms of the GNU General Public License as published by
...... 
986986        {
987987            if (!strcmp($1, "bare"))
988988                $$ = pt_bare;
989            else if (!strcmp($1, "trace"))
990                $$ = pt_trace;
989991            else if (!strcmp($1, "paste"))
990992                $$ = pt_paste;
991993            else if (!strcmp($1, "mask"))
gui_inst.c
11/*
22 * gui_inst.c - GUI, instance functions
33 *
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
66 *
77 * This program is free software; you can redistribute it and/or modify
88 * it under the terms of the GNU General Public License as published by
...... 
319319    switch (layers_to_pad_type(inst->u.pad.layers)) {
320320    case pt_bare:
321321        return gc_pad_bare[get_mode(inst)];
322    case pt_trace:
323        return gc_pad_trace[get_mode(inst)];
322324    case pt_mask:
323325        *fill = FALSE;
324326        return gc_pad_mask[get_mode(inst)];
gui_status.c
11/*
22 * gui_status.c - GUI, status area
33 *
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
66 *
77 * This program is free software; you can redistribute it and/or modify
88 * it under the terms of the GNU General Public License as published by
...... 
204204    case pt_bare:
205205        s = "bare";
206206        break;
207    case pt_trace:
208        s = "trace";
209        break;
207210    case pt_paste:
208211        s = "paste";
209212        break;
gui_style.c
1/* * gui_style.c - GUI, style definitions
1/*
2 * gui_style.c - GUI, style definitions
23 *
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
56 *
67 * This program is free software; you can redistribute it and/or modify
78 * it under the terms of the GNU General Public License as published by
...... 
2627GdkGC *gc_obj[mode_n];
2728GdkGC *gc_pad[mode_n];
2829GdkGC *gc_pad_bare[mode_n];
30GdkGC *gc_pad_trace[mode_n];
2931GdkGC *gc_pad_mask[mode_n];
3032GdkGC *gc_ptext[mode_n];
3133GdkGC *gc_rim[mode_n];
...... 
6870    style(gc_obj, "#006060", "#00ffff", "#ffff80", 1);
6971    style(gc_pad, "#400000", "#ff0000", "#ffff80", 1);
7072    style(gc_pad_bare, "#402000", "#ff6000", "#ffff80", 1);
73    style(gc_pad_trace, "#304000", "#80c000", "#ffff80", 1);
7174    style(gc_pad_mask, "#000040", "#0000ff", "#ffff80", 2);
7275    style(gc_ptext, "#404040", "#ffffff", "#ffffff", 1);
7376    style(gc_hole, "#000000", "#000000", "#000000", 0);
gui_style.h
11/*
22 * gui_style.h - GUI, style definitions
33 *
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
66 *
77 * This program is free software; you can redistribute it and/or modify
88 * it under the terms of the GNU General Public License as published by
...... 
114114extern GdkGC *gc_obj[mode_n];
115115extern GdkGC *gc_pad[mode_n];
116116extern GdkGC *gc_pad_bare[mode_n];
117extern GdkGC *gc_pad_trace[mode_n];
117118extern GdkGC *gc_pad_mask[mode_n];
118119extern GdkGC *gc_ptext[mode_n];
119120extern GdkGC *gc_rim[mode_n];
inst.c
11/*
22 * inst.c - Instance structures
33 *
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
66 *
77 * This program is free software; you can redistribute it and/or modify
88 * it under the terms of the GNU General Public License as published by
...... 
896896    struct inst *inst;
897897
898898    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 ?
900901        ip_pad_copper : ip_pad_special, a);
901902    inst->obj = obj;
902903    inst->u.pad.name = stralloc(name);
layer.c
11/*
22 * layer.c - PCB layers on a pad
33 *
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
66 *
77 * This program is free software; you can redistribute it and/or modify
88 * it under the terms of the GNU General Public License as published by
...... 
5252    case pt_bare:
5353        layers |= LAYER_COPPER_TOP | LAYER_MASK_TOP;
5454        break;
55    case pt_trace:
56        layers |= LAYER_COPPER_TOP;
57        break;
5558    case pt_paste:
5659        layers = LAYER_PASTE_TOP;
5760        break;
...... 
7073    if (layers & LAYER_COPPER_TOP) {
7174        if (layers & LAYER_PASTE_TOP)
7275            return pt_normal;
73        return pt_bare;
76        if (layers & LAYER_MASK_TOP)
77            return pt_bare;
78        return pt_trace;
7479    } else {
7580        if (layers & LAYER_PASTE_TOP)
7681            return pt_paste;
layer.h
11/*
22 * layer.h - PCB layers on a pad
33 *
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
66 *
77 * This program is free software; you can redistribute it and/or modify
88 * it under the terms of the GNU General Public License as published by
...... 
5757enum pad_type {
5858    pt_normal, /* copper and solder mask */
5959    pt_bare, /* only copper (and finish) */
60    pt_trace, /* only copper, without solder mask opening */
6061    pt_paste, /* only solder paste */
6162    pt_mask, /* only solder mask */
6263    pt_n
postscript.c
11/*
22 * postscript.c - Dump objects in Postscript
33 *
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
66 *
77 * This program is free software; you can redistribute it and/or modify
88 * it under the terms of the GNU General Public License as published by
...... 
6464#define PS_HATCH mm_to_units(0.1)
6565#define PS_HATCH_LINE mm_to_units(0.015)
6666
67#define PS_STRIPE mm_to_units(0.08)
68
6769#define PS_RIM_LINE mm_to_units(0.02)
6870
6971#define PS_FONT_OUTLINE mm_to_units(0.025)
...... 
223225        return "backhatchpath";
224226    case pt_mask:
225227        return "dotpath";
228    case pt_trace:
229        return "horpath";
226230    default:
227231        abort();
228232    }
...... 
940944"/backhatchpath {\n"
941945" gsave flattenpath pathbbox clip newpath\n"
942946" /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 */
944948" llx add dup lly moveto\n"
945949" ury lly sub sub ury lineto stroke\n"
946950" } for\n"
...... 
950954"/crosspath {\n"
951955" gsave hatchpath grestore backhatchpath } def\n");
952956
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
953967    /*
954968     * Stack: font string width height factor -> factor
955969     *

Archive Download the corresponding diff file

Branches:
master



interactive