annotate pads2gpcb/writeelem.c @ 135:25634b3977a9

ueda: unet2tedax added
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 07 Sep 2020 01:22:36 +0000
parents be1fe110b6ab
children
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>
78
be1fe110b6ab pads2gpcb: output offset implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 69
diff changeset
3 #include "globals.h"
46
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 #include "struct.h"
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5 #include "gpcbout.h"
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 static void
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 emit_element_line(outf, body, strdesc, strname, strvalue, onbottom)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 FILE *outf;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10 struct footprint_body *body;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 char *strdesc, *strname, *strvalue;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12 int onbottom;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 {
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14 char mx_buf[DIM_OUT_BUFSIZE], *mx_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15 char my_buf[DIM_OUT_BUFSIZE], *my_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16 char tx_buf[DIM_OUT_BUFSIZE], *tx_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17 char ty_buf[DIM_OUT_BUFSIZE], *ty_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18 char *flagstr;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19
78
be1fe110b6ab pads2gpcb: output offset implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 69
diff changeset
20 mx_str = output_gpcb_dimension(body->mark_x + output_x_offset, mx_buf);
be1fe110b6ab pads2gpcb: output offset implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 69
diff changeset
21 my_str = output_gpcb_dimension(-body->mark_y + output_y_offset, my_buf);
46
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 tx_str = output_gpcb_dimension(body->refdes_x, tx_buf);
68
b7f49f029bc3 pads2gpcb: use Cartesian Y axis direction internally
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 57
diff changeset
23 ty_str = output_gpcb_dimension(-body->refdes_y, ty_buf);
46
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 flagstr = onbottom ? "onsolder" : "";
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 fprintf(outf,
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 "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
28 flagstr, strdesc, strname, strvalue, mx_str, my_str,
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29 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
30 }
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
31
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 static void
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 emit_pad_line(outf, pad, pinname, pinnumber, onbottom)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 FILE *outf;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35 struct footprint_pad *pad;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 char *pinname, *pinnumber;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37 int onbottom;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 {
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39 char x1_buf[DIM_OUT_BUFSIZE], *x1_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 char y1_buf[DIM_OUT_BUFSIZE], *y1_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41 char x2_buf[DIM_OUT_BUFSIZE], *x2_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 char y2_buf[DIM_OUT_BUFSIZE], *y2_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 char thickness_buf[DIM_OUT_BUFSIZE], *thickness_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 char clearance_buf[DIM_OUT_BUFSIZE], *clearance_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 char mask_buf[DIM_OUT_BUFSIZE], *mask_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46 char *flagstr;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
47
69
a7f0e9bb3fb7 pads2gpcb: struct coord_pair introduced
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 68
diff changeset
48 x1_str = output_gpcb_dimension(pad->end1.x, x1_buf);
a7f0e9bb3fb7 pads2gpcb: struct coord_pair introduced
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 68
diff changeset
49 y1_str = output_gpcb_dimension(-pad->end1.y, y1_buf);
a7f0e9bb3fb7 pads2gpcb: struct coord_pair introduced
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 68
diff changeset
50 x2_str = output_gpcb_dimension(pad->end2.x, x2_buf);
a7f0e9bb3fb7 pads2gpcb: struct coord_pair introduced
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 68
diff changeset
51 y2_str = output_gpcb_dimension(-pad->end2.y, y2_buf);
46
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52 thickness_str = output_gpcb_dimension(pad->thickness, thickness_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53 clearance_str = output_gpcb_dimension(pad->clearance, clearance_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
54 mask_str = output_gpcb_dimension(pad->mask, mask_buf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
55
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56 if (onbottom && !pad->shape.rounded)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
57 flagstr = "onsolder,square";
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58 else if (onbottom)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59 flagstr = "onsolder";
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
60 else if (!pad->shape.rounded)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61 flagstr = "square";
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62 else
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
63 flagstr = "";
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 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
66 x1_str, y1_str, x2_str, y2_str,
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67 thickness_str, clearance_str, mask_str,
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 pinname, pinnumber, flagstr);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69 }
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
70
56
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
71 static void
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
72 emit_elementline_obj(outf, obj)
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
73 FILE *outf;
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
74 struct element_line *obj;
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
75 {
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
76 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
77 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
78 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
79 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
80 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
81
69
a7f0e9bb3fb7 pads2gpcb: struct coord_pair introduced
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 68
diff changeset
82 x1_str = output_gpcb_dimension(obj->end1.x, x1_buf);
a7f0e9bb3fb7 pads2gpcb: struct coord_pair introduced
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 68
diff changeset
83 y1_str = output_gpcb_dimension(-obj->end1.y, y1_buf);
a7f0e9bb3fb7 pads2gpcb: struct coord_pair introduced
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 68
diff changeset
84 x2_str = output_gpcb_dimension(obj->end2.x, x2_buf);
a7f0e9bb3fb7 pads2gpcb: struct coord_pair introduced
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 68
diff changeset
85 y2_str = output_gpcb_dimension(-obj->end2.y, y2_buf);
56
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
86 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
87
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
88 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
89 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
90 }
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
91
57
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
92 static void
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
93 emit_elementarc_obj(outf, obj)
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
94 FILE *outf;
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
95 struct element_arc *obj;
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
96 {
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
97 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
98 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
99 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
100 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
101 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
102
69
a7f0e9bb3fb7 pads2gpcb: struct coord_pair introduced
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 68
diff changeset
103 centrex_str = output_gpcb_dimension(obj->centre.x, centrex_buf);
a7f0e9bb3fb7 pads2gpcb: struct coord_pair introduced
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 68
diff changeset
104 centrey_str = output_gpcb_dimension(-obj->centre.y, centrey_buf);
57
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
105 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
106 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
107 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
108
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
109 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
110 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
111 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
112 }
d0d330ae5b99 pads2gpcb/writeelem.c: ElementArc writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 56
diff changeset
113
46
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 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
115 FILE *outf;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
116 struct footprint_body *body;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 char **alpha_pins;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118 char *strdesc, *strname, *strvalue;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 int onbottom;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120 {
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121 int i;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122 char pinnum_buf[16], *pinnum_str;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
123
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 emit_element_line(outf, body, strdesc, strname, strvalue, onbottom);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
125 fputs("(\n", outf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
126 for (i = 0; i < body->npins; i++) {
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
127 if (alpha_pins)
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
128 pinnum_str = alpha_pins[i];
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
129 else {
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
130 sprintf(pinnum_buf, "%d", i + 1);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
131 pinnum_str = pinnum_buf;
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
132 }
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
133 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
134 }
56
dbf999b71c53 pads2gpcb/writeelem.c: ElementLine writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 46
diff changeset
135 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
136 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
137 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
138 emit_elementarc_obj(outf, body->silk_arcs + i);
46
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
139 fputs(")\n", outf);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
140 return(0);
c81aba92cb5e pads2gpcb: generic element writing implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
141 }