Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 34520) +++ trunk/scconfig/Rev.h (revision 34521) @@ -1 +1 @@ -static const int myrev = 34509; +static const int myrev = 34521; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 34520) +++ trunk/scconfig/Rev.tab (revision 34521) @@ -1,3 +1,4 @@ +34521 configure export_lpr: configurable default scales 34509 configure librnd: moving box-box intersection code to librnd 34375 configure librnd: make sure the local .so symlinks are updated on make all so they don't point to old version .so's 34292 configure move djopt and puller menus from central menufile to plugin menu files Index: trunk/src/Makefile.dep =================================================================== --- trunk/src/Makefile.dep (revision 34520) +++ trunk/src/Makefile.dep (revision 34521) @@ -2974,7 +2974,7 @@ ../src_3rd/librnd-local/src/../src_3rd/puplug/libs.h \ ../src_3rd/librnd-local/src/librnd/core/plugins.h \ ../src_3rd/librnd-local/src/../src_3rd/puplug/error.h -../src_plugins/export_lpr/lpr.o: ../src_plugins/export_lpr/lpr.c \ +../src_plugins/export_lpr/lpr.o: ../src_plugins/export_lpr/lpr.c ../src_plugins/export_lpr/export_lpr_conf_fields.h \ ../config.h ../src_3rd/librnd-local/src/librnd/config.h data.h \ globalconst.h ../src_3rd/librnd-local/src/librnd/core/globalconst.h \ ../src_3rd/librnd-local/src/librnd/core/global_typedefs.h \ Index: trunk/src_plugins/export_lpr/Plug.tmpasm =================================================================== --- trunk/src_plugins/export_lpr/Plug.tmpasm (revision 34520) +++ trunk/src_plugins/export_lpr/Plug.tmpasm (revision 34521) @@ -1,5 +1,6 @@ put /local/pcb/mod {export_lpr} put /local/pcb/mod/OBJS [@ $(PLUGDIR)/export_lpr/lpr.o @] +put /local/pcb/mod/CONF {$(PLUGDIR)/export_lpr/export_lpr_conf.h} switch /local/pcb/export_lpr/controls case {buildin} include /local/pcb/tmpasm/buildin; end; Index: trunk/src_plugins/export_lpr/export_lpr_conf.h =================================================================== --- trunk/src_plugins/export_lpr/export_lpr_conf.h (nonexistent) +++ trunk/src_plugins/export_lpr/export_lpr_conf.h (revision 34521) @@ -0,0 +1,15 @@ +#ifndef PCB_EXPORT_LPR_CONF_H +#define PCB_EXPORT_LPR_CONF_H + +#include + +typedef struct { + const struct { + const struct { + RND_CFT_REAL default_xcalib; /* Initialize xcalib to this value on start - should be a printer specific calibration value */ + RND_CFT_REAL default_ycalib; /* Initialize ycalib to this value on start - should be a printer specific calibration value */ + } export_lpr; + } plugins; +} conf_export_lpr_t; + +#endif Index: trunk/src_plugins/export_lpr/lpr.c =================================================================== --- trunk/src_plugins/export_lpr/lpr.c (revision 34520) +++ trunk/src_plugins/export_lpr/lpr.c (revision 34521) @@ -18,9 +18,13 @@ #include #include +#include "export_lpr_conf.h" const char *lpr_cookie = "lpr HID"; static rnd_hid_t lpr_hid; +conf_export_lpr_t conf_export_lpr; + + static const rnd_export_opt_t base_lpr_options[] = { /* %start-doc options "98 lpr Printing Options" @@ -44,6 +48,21 @@ static int num_lpr_options = 0; static rnd_hid_attr_val_t lpr_values[NUM_OPTIONS]; +static void lpr_maybe_set_value(const char *name, double new_val) +{ + int n; + + if (new_val <= 0) + return; + + for(n = 0; n < num_lpr_options; n++) { + if (strcmp(name, lpr_options[n].name) == 0) { + lpr_values[n].dbl = new_val; + break; + } + } +} + static const rnd_export_opt_t *lpr_get_export_options(rnd_hid_t *hid, int *n) { const char *val; @@ -56,6 +75,9 @@ memcpy(lpr_options, base_lpr_options, sizeof(base_lpr_options)); rnd_hid_load_defaults(&lpr_hid, lpr_options, num_lpr_options); + + lpr_maybe_set_value("xcalib", conf_export_lpr.plugins.export_lpr.default_xcalib); + lpr_maybe_set_value("ycalib", conf_export_lpr.plugins.export_lpr.default_ycalib); } /* @@ -125,6 +147,7 @@ { rnd_remove_actions_by_cookie(lpr_cookie); rnd_hid_remove_hid(&lpr_hid); + rnd_conf_unreg_fields("plugins/export_lpr/"); } int pplg_init_export_lpr(void) @@ -151,5 +174,9 @@ rnd_hid_register_hid(&lpr_hid); rnd_hid_load_defaults(&lpr_hid, base_lpr_options, NUM_OPTIONS); +#define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ + rnd_conf_reg_field(conf_export_lpr, field,isarray,type_name,cpath,cname,desc,flags); +#include "export_lpr_conf_fields.h" + return 0; }