annotate pads2gpcb/writeelem.c @ 65:2b71943a311b

pads2gpcb: PART section parsing implemented, compiles
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sun, 31 Jan 2016 21:32:08 +0000
parents d0d330ae5b99
children b7f49f029bc3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
46
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 #include <stdio.h>
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 #include <stdlib.h>
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 #include "struct.h"
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 #include "gpcbout.h"
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 static void
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 emit_element_line(outf, body, strdesc, strname, strvalue, onbottom)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 FILE *outf;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 struct footprint_body *body;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10 char *strdesc, *strname, *strvalue;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 int onbottom;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12 {
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 char mx_buf[DIM_OUT_BUFSIZE], *mx_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14 char my_buf[DIM_OUT_BUFSIZE], *my_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15 char tx_buf[DIM_OUT_BUFSIZE], *tx_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16 char ty_buf[DIM_OUT_BUFSIZE], *ty_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17 char *flagstr;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 mx_str = output_gpcb_dimension(body->mark_x, mx_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20 my_str = output_gpcb_dimension(body->mark_y, my_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 tx_str = output_gpcb_dimension(body->refdes_x, tx_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 ty_str = output_gpcb_dimension(body->refdes_y, ty_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 flagstr = onbottom ? "onsolder" : "";
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 fprintf(outf,
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 "Element[\"%s\" \"%s\" \"%s\" \"%s\" %s %s %s %s %d %d \"%s\"]\n",
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 flagstr, strdesc, strname, strvalue, mx_str, my_str,
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28 tx_str, ty_str, body->refdes_dir, body->refdes_scale, flagstr);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29 }
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
31 static void
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 emit_pad_line(outf, pad, pinname, pinnumber, onbottom)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 FILE *outf;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 struct footprint_pad *pad;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35 char *pinname, *pinnumber;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 int onbottom;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37 {
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 char x1_buf[DIM_OUT_BUFSIZE], *x1_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39 char y1_buf[DIM_OUT_BUFSIZE], *y1_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 char x2_buf[DIM_OUT_BUFSIZE], *x2_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41 char y2_buf[DIM_OUT_BUFSIZE], *y2_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 char thickness_buf[DIM_OUT_BUFSIZE], *thickness_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 char clearance_buf[DIM_OUT_BUFSIZE], *clearance_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 char mask_buf[DIM_OUT_BUFSIZE], *mask_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 char *flagstr;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
47 x1_str = output_gpcb_dimension(pad->x1, x1_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
48 y1_str = output_gpcb_dimension(pad->y1, y1_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
49 x2_str = output_gpcb_dimension(pad->x2, x2_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
50 y2_str = output_gpcb_dimension(pad->y2, y2_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
51 thickness_str = output_gpcb_dimension(pad->thickness, thickness_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52 clearance_str = output_gpcb_dimension(pad->clearance, clearance_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53 mask_str = output_gpcb_dimension(pad->mask, mask_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
54
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
55 if (onbottom && !pad->shape.rounded)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56 flagstr = "onsolder,square";
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
57 else if (onbottom)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58 flagstr = "onsolder";
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59 else if (!pad->shape.rounded)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
60 flagstr = "square";
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61 else
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62 flagstr = "";
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
63
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64 fprintf(outf, "\tPad[%s %s %s %s %s %s %s \"%s\" \"%s\" \"%s\"]\n",
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 x1_str, y1_str, x2_str, y2_str,
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
66 thickness_str, clearance_str, mask_str,
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67 pinname, pinnumber, flagstr);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 }
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69
56
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
70 static void
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
71 emit_elementline_obj(outf, obj)
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
72 FILE *outf;
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
73 struct element_line *obj;
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
74 {
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
75 char x1_buf[DIM_OUT_BUFSIZE], *x1_str;
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
76 char y1_buf[DIM_OUT_BUFSIZE], *y1_str;
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
77 char x2_buf[DIM_OUT_BUFSIZE], *x2_str;
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
78 char y2_buf[DIM_OUT_BUFSIZE], *y2_str;
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
79 char thickness_buf[DIM_OUT_BUFSIZE], *thickness_str;
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
80
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
81 x1_str = output_gpcb_dimension(obj->x1, x1_buf);
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
82 y1_str = output_gpcb_dimension(obj->y1, y1_buf);
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
83 x2_str = output_gpcb_dimension(obj->x2, x2_buf);
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
84 y2_str = output_gpcb_dimension(obj->y2, y2_buf);
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
85 thickness_str = output_gpcb_dimension(obj->thickness, thickness_buf);
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
86
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
87 fprintf(outf, "\tElementLine[%s %s %s %s %s]\n",
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
88 x1_str, y1_str, x2_str, y2_str, thickness_str);
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
89 }
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
90
57
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
91 static void
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
92 emit_elementarc_obj(outf, obj)
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
93 FILE *outf;
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
94 struct element_arc *obj;
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
95 {
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
96 char centrex_buf[DIM_OUT_BUFSIZE], *centrex_str;
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
97 char centrey_buf[DIM_OUT_BUFSIZE], *centrey_str;
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
98 char width_buf[DIM_OUT_BUFSIZE], *width_str;
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
99 char height_buf[DIM_OUT_BUFSIZE], *height_str;
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
100 char thickness_buf[DIM_OUT_BUFSIZE], *thickness_str;
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
101
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
102 centrex_str = output_gpcb_dimension(obj->centre_x, centrex_buf);
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
103 centrey_str = output_gpcb_dimension(obj->centre_y, centrey_buf);
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
104 width_str = output_gpcb_dimension(obj->width, width_buf);
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
105 height_str = output_gpcb_dimension(obj->height, height_buf);
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
106 thickness_str = output_gpcb_dimension(obj->thickness, thickness_buf);
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
107
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
108 fprintf(outf, "\tElementArc[%s %s %s %s %d %d %s]\n",
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
109 centrex_str, centrey_str, width_str, height_str,
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
110 obj->start_angle, obj->delta_angle, thickness_str);
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
111 }
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
112
46
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
113 write_gpcb_element(outf, body, alpha_pins, strdesc, strname, strvalue, onbottom)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 FILE *outf;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
115 struct footprint_body *body;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
116 char **alpha_pins;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 char *strdesc, *strname, *strvalue;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118 int onbottom;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 {
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120 int i;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121 char pinnum_buf[16], *pinnum_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
123 emit_element_line(outf, body, strdesc, strname, strvalue, onbottom);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 fputs("(\n", outf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
125 for (i = 0; i < body->npins; i++) {
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
126 if (alpha_pins)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
127 pinnum_str = alpha_pins[i];
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
128 else {
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
129 sprintf(pinnum_buf, "%d", i + 1);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
130 pinnum_str = pinnum_buf;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
131 }
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
132 emit_pad_line(outf, body->pins + i, "", pinnum_str, onbottom);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
133 }
56
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
134 for (i = 0; i < body->num_silk_lines; i++)
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
135 emit_elementline_obj(outf, body->silk_lines + i);
57
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
136 for (i = 0; i < body->num_silk_arcs; i++)
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
137 emit_elementarc_obj(outf, body->silk_arcs + i);
46
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
138 fputs(")\n", outf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
139 return(0);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
140 }