1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-25 21:50:37 +02:00

- added solder mask pad type (patch by Rene Harder)

git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5627 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner 2009-09-11 18:34:51 +00:00
parent 5c37256c09
commit 76c3c1c1d0
9 changed files with 37 additions and 4 deletions

1
README
View File

@ -227,6 +227,7 @@ Type Layers
(default) copper, solder mask, and solder paste (default) copper, solder mask, and solder paste
bare copper and solder mask bare copper and solder mask
paste solder paste paste solder paste
mask solder mask
Rounded pads Rounded pads

3
dump.c
View File

@ -328,6 +328,9 @@ char *print_obj(const struct obj *obj, const struct vec *prev)
case pt_paste: case pt_paste:
s2 = " paste"; s2 = " paste";
break; break;
case pt_mask:
s2 = " mask";
break;
default: default:
abort(); abort();
} }

2
fpd.y
View File

@ -521,6 +521,8 @@ pad_type:
$$ = pt_bare; $$ = pt_bare;
else if (!strcmp($1, "paste")) else if (!strcmp($1, "paste"))
$$ = pt_paste; $$ = pt_paste;
else if (!strcmp($1, "mask"))
$$ = pt_mask;
else { else {
yyerrorf("unknown pad type \"%s\"", $1); yyerrorf("unknown pad type \"%s\"", $1);
YYABORT; YYABORT;

View File

@ -263,8 +263,17 @@ void gui_draw_pad(struct inst *self)
struct coord max = translate(self->u.pad.other); struct coord max = translate(self->u.pad.other);
GdkGC *gc; GdkGC *gc;
gc = self->obj->u.pad.type == pt_bare ? switch (self->obj->u.pad.type) {
gc_pad_bare[get_mode(self)] : gc_pad[get_mode(self)]; case pt_bare:
gc = gc_pad_bare[get_mode(self)];
break;
case pt_mask:
gc = gc_pad_mask[get_mode(self)];
break;
default:
gc = gc_pad[get_mode(self)];
break;
}
sort_coord(&min, &max); sort_coord(&min, &max);
gdk_draw_rectangle(DA, gc, TRUE, gdk_draw_rectangle(DA, gc, TRUE,
min.x, min.y, max.x-min.x, max.y-min.y); min.x, min.y, max.x-min.x, max.y-min.y);
@ -280,8 +289,17 @@ void gui_draw_rpad(struct inst *self)
GdkGC *gc; GdkGC *gc;
unit_type h, w, r; unit_type h, w, r;
gc = self->obj->u.pad.type == pt_bare ? switch (self->obj->u.pad.type) {
gc_pad_bare[get_mode(self)] : gc_pad[get_mode(self)]; case pt_bare:
gc = gc_pad_bare[get_mode(self)];
break;
case pt_mask:
gc = gc_pad_mask[get_mode(self)];
break;
default:
gc = gc_pad[get_mode(self)];
break;
}
sort_coord(&min, &max); sort_coord(&min, &max);
h = max.y-min.y; h = max.y-min.y;
w = max.x-min.x; w = max.x-min.x;

View File

@ -26,6 +26,7 @@ GdkGC *gc_vec[mode_n];
GdkGC *gc_obj[mode_n]; GdkGC *gc_obj[mode_n];
GdkGC *gc_pad[mode_n]; GdkGC *gc_pad[mode_n];
GdkGC *gc_pad_bare[mode_n]; GdkGC *gc_pad_bare[mode_n];
GdkGC *gc_pad_mask[mode_n];
GdkGC *gc_ptext[mode_n]; GdkGC *gc_ptext[mode_n];
GdkGC *gc_meas[mode_n]; GdkGC *gc_meas[mode_n];
GdkGC *gc_frame[mode_n]; GdkGC *gc_frame[mode_n];
@ -65,6 +66,7 @@ void gui_setup_style(GdkDrawable *drawable)
style(gc_obj, "#006060", "#00ffff", "#ffff80"); style(gc_obj, "#006060", "#00ffff", "#ffff80");
style(gc_pad, "#400000", "#ff0000", "#ffff80"); style(gc_pad, "#400000", "#ff0000", "#ffff80");
style(gc_pad_bare, "#402000", "#ff6000", "#ffff80"); style(gc_pad_bare, "#402000", "#ff6000", "#ffff80");
style(gc_pad_mask, "#000040", "#0000ff", "#ffff80");
style(gc_ptext, "#404040", "#ffffff", "#ffffff"); style(gc_ptext, "#404040", "#ffffff", "#ffffff");
style(gc_meas, "#280040", "#ff00ff", "#ffff80"); style(gc_meas, "#280040", "#ff00ff", "#ffff80");
style(gc_frame, "#005000", "#009000", "#ffff80"); style(gc_frame, "#005000", "#009000", "#ffff80");

View File

@ -110,6 +110,7 @@ extern GdkGC *gc_vec[mode_n];
extern GdkGC *gc_obj[mode_n]; extern GdkGC *gc_obj[mode_n];
extern GdkGC *gc_pad[mode_n]; extern GdkGC *gc_pad[mode_n];
extern GdkGC *gc_pad_bare[mode_n]; extern GdkGC *gc_pad_bare[mode_n];
extern GdkGC *gc_pad_mask[mode_n];
extern GdkGC *gc_ptext[mode_n]; extern GdkGC *gc_ptext[mode_n];
extern GdkGC *gc_meas[mode_n]; extern GdkGC *gc_meas[mode_n];
extern GdkGC *gc_frame[mode_n]; extern GdkGC *gc_frame[mode_n];

View File

@ -98,6 +98,9 @@ static void kicad_pad(FILE *file, const struct inst *inst)
case pt_paste: case pt_paste:
layers = 1 << layer_paste_top; layers = 1 << layer_paste_top;
break; break;
case pt_mask:
layers = 1 << layer_mask_top;
break;
default: default:
abort(); abort();
} }

1
obj.h
View File

@ -143,6 +143,7 @@ enum pad_type {
pt_normal, /* copper and solder mask */ pt_normal, /* copper and solder mask */
pt_bare, /* only copper (and finish) */ pt_bare, /* only copper (and finish) */
pt_paste, /* only solder paste */ pt_paste, /* only solder paste */
pt_mask, /* only solder mask */
}; };
struct frame_ref { struct frame_ref {

View File

@ -198,6 +198,8 @@ static const char *hatch(enum pad_type type)
return "hatchpath"; return "hatchpath";
case pt_paste: case pt_paste:
return "backhatchpath"; return "backhatchpath";
case pt_mask:
return "dotpath";
default: default:
abort(); abort();
} }