changeset 56:dbf999b71c53

pads2gpcb/writeelem.c: ElementLine writing implemented
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sun, 31 Jan 2016 02:25:15 +0000
parents e93375570f91
children d0d330ae5b99
files pads2gpcb/writeelem.c
diffstat 1 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pads2gpcb/writeelem.c	Sun Jan 31 02:14:57 2016 +0000
+++ b/pads2gpcb/writeelem.c	Sun Jan 31 02:25:15 2016 +0000
@@ -67,6 +67,27 @@
 		pinname, pinnumber, flagstr);
 }
 
+static void
+emit_elementline_obj(outf, obj)
+	FILE *outf;
+	struct element_line *obj;
+{
+	char x1_buf[DIM_OUT_BUFSIZE], *x1_str;
+	char y1_buf[DIM_OUT_BUFSIZE], *y1_str;
+	char x2_buf[DIM_OUT_BUFSIZE], *x2_str;
+	char y2_buf[DIM_OUT_BUFSIZE], *y2_str;
+	char thickness_buf[DIM_OUT_BUFSIZE], *thickness_str;
+
+	x1_str = output_gpcb_dimension(obj->x1, x1_buf);
+	y1_str = output_gpcb_dimension(obj->y1, y1_buf);
+	x2_str = output_gpcb_dimension(obj->x2, x2_buf);
+	y2_str = output_gpcb_dimension(obj->y2, y2_buf);
+	thickness_str = output_gpcb_dimension(obj->thickness, thickness_buf);
+
+	fprintf(outf, "\tElementLine[%s %s %s %s %s]\n",
+		x1_str, y1_str, x2_str, y2_str, thickness_str);
+}
+
 write_gpcb_element(outf, body, alpha_pins, strdesc, strname, strvalue, onbottom)
 	FILE *outf;
 	struct footprint_body *body;
@@ -88,6 +109,8 @@
 		}
 		emit_pad_line(outf, body->pins + i, "", pinnum_str, onbottom);
 	}
+	for (i = 0; i < body->num_silk_lines; i++)
+		emit_elementline_obj(outf, body->silk_lines + i);
 	fputs(")\n", outf);
 	return(0);
 }