# HG changeset patch # User Mychaela Falconia # Date 1454293357 0 # Node ID be1fe110b6ab904cd40f2d7a612491005100c3b7 # Parent f640c8f005c56885b0bf640c952d006eeea0cd3d pads2gpcb: output offset implemented diff -r f640c8f005c5 -r be1fe110b6ab pads2gpcb/globals.c --- 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; diff -r f640c8f005c5 -r be1fe110b6ab pads2gpcb/globals.h --- 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; diff -r f640c8f005c5 -r be1fe110b6ab pads2gpcb/main.c --- 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, diff -r f640c8f005c5 -r be1fe110b6ab pads2gpcb/writeelem.c --- 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 #include +#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" : "";