changeset 78:be1fe110b6ab

pads2gpcb: output offset implemented
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Mon, 01 Feb 2016 02:22:37 +0000
parents f640c8f005c5
children ac13abc7dc0d
files pads2gpcb/globals.c pads2gpcb/globals.h pads2gpcb/main.c pads2gpcb/writeelem.c
diffstat 4 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pads2gpcb/globals.c	Mon Feb 01 02:18:06 2016 +0000
+++ b/pads2gpcb/globals.c	Mon Feb 01 02:22:37 2016 +0000
@@ -6,3 +6,4 @@
 struct part_instance *part_inst_list;
 int do_footprint_silk;
 int write_footprint_files;
+long output_x_offset, output_y_offset;
--- a/pads2gpcb/globals.h	Mon Feb 01 02:18:06 2016 +0000
+++ b/pads2gpcb/globals.h	Mon Feb 01 02:22:37 2016 +0000
@@ -6,6 +6,7 @@
 extern struct part_instance *part_inst_list;
 extern int do_footprint_silk;
 extern int write_footprint_files;
+extern long output_x_offset, output_y_offset;
 
 /* readpads.c */
 extern char *input_filename;
--- a/pads2gpcb/main.c	Mon Feb 01 02:18:06 2016 +0000
+++ b/pads2gpcb/main.c	Mon Feb 01 02:22:37 2016 +0000
@@ -39,7 +39,7 @@
 	extern int optind;
 	extern char *optarg;
 
-	while ((c = getopt(argc, argv, "c:fm:s:")) != EOF)
+	while ((c = getopt(argc, argv, "c:fm:s:x:y:")) != EOF)
 		switch (c) {
 		case 'c':
 			clearance_setting = cmdline_dim_arg(optarg);
@@ -54,6 +54,12 @@
 			do_footprint_silk = 1;
 			select_drawlevel_for_silk(atoi(optarg));
 			continue;
+		case 'x':
+			output_x_offset = cmdline_dim_arg(optarg);
+			continue;
+		case 'y':
+			output_y_offset = cmdline_dim_arg(optarg);
+			continue;
 		default:
 		usage:
 			fprintf(stderr,
--- a/pads2gpcb/writeelem.c	Mon Feb 01 02:18:06 2016 +0000
+++ b/pads2gpcb/writeelem.c	Mon Feb 01 02:22:37 2016 +0000
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include "globals.h"
 #include "struct.h"
 #include "gpcbout.h"
 
@@ -16,8 +17,8 @@
 	char ty_buf[DIM_OUT_BUFSIZE], *ty_str;
 	char *flagstr;
 
-	mx_str = output_gpcb_dimension(body->mark_x, mx_buf);
-	my_str = output_gpcb_dimension(-body->mark_y, my_buf);
+	mx_str = output_gpcb_dimension(body->mark_x + output_x_offset, mx_buf);
+	my_str = output_gpcb_dimension(-body->mark_y + output_y_offset, my_buf);
 	tx_str = output_gpcb_dimension(body->refdes_x, tx_buf);
 	ty_str = output_gpcb_dimension(-body->refdes_y, ty_buf);
 	flagstr = onbottom ? "onsolder" : "";