Index: trunk/doc/TODO =================================================================== --- trunk/doc/TODO (revision 7257) +++ trunk/doc/TODO (revision 7258) @@ -27,6 +27,7 @@ - pin outeredge, inneredge - sheet - hexagon net label (record=18) + - enable the plugin by default, announce - BUG: bug_files/TODO/breakcrash.rs (self-described) [report: Majenko] 2. 1.0.2 ================================================================== Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 7257) +++ trunk/scconfig/Rev.h (revision 7258) @@ -1 +1 @@ -static const int myrev = 6946; +static const int myrev = 7257; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 7257) +++ trunk/scconfig/Rev.tab (revision 7258) @@ -1,3 +1,4 @@ +7257 configure plugin config for io_altium 6946 configure removed excess librnd detection 6740 configure new dialog box: project properties edit 6720 configure new libcschem source file for project support Index: trunk/src/plugins/io_altium/Plug.tmpasm =================================================================== --- trunk/src/plugins/io_altium/Plug.tmpasm (revision 7257) +++ trunk/src/plugins/io_altium/Plug.tmpasm (revision 7258) @@ -7,6 +7,10 @@ ../../src_3rd/libucdf/ucdf.o @] +put /local/rnd/mod/CONFFILE {io_altium.conf} +put /local/rnd/mod/CONF {$(PLUGDIR)/io_altium/io_altium_conf.h} +put /local/rnd/mod/CONFVAR {io_altium_conf_internal} + put /local/rnd/mod/SPHASH {$(PLUGDIR)/io_altium/altium_kw.sphash} put /local/rnd/mod/SPHASH_ARGS {--prefix altium_kw --multi -i} Index: trunk/src/plugins/io_altium/io_altium.c =================================================================== --- trunk/src/plugins/io_altium/io_altium.c (revision 7257) +++ trunk/src/plugins/io_altium/io_altium.c (revision 7258) @@ -32,6 +32,12 @@ #include #include "read.h" +#include "io_altium_conf.h" +#include "conf_internal.c" + +conf_io_altium_t io_altium_conf; +static char altium_cookie[] = "io_altium"; + static csch_plug_io_t altium_bin, altium_ascii; static int io_altium_common_load_prio(const char *fn, const char *fmt, csch_plug_io_type_t type) @@ -51,6 +57,7 @@ { csch_plug_io_unregister(&altium_bin); csch_plug_io_unregister(&altium_ascii); + rnd_conf_plug_unreg("plugins/io_altium/", io_altium_conf_internal, altium_cookie); } int pplg_init_io_altium(void) @@ -73,6 +80,10 @@ altium_ascii.ext_save_sheet = "SchDoc"; csch_plug_io_register(&altium_ascii); + rnd_conf_plug_reg(io_altium_conf, io_altium_conf_internal, altium_cookie); +#define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ + rnd_conf_reg_field(io_altium_conf, field,isarray,type_name,cpath,cname,desc,flags); +#include "io_altium_conf_fields.h" return 0; } Index: trunk/src/plugins/io_altium/io_altium.conf =================================================================== --- trunk/src/plugins/io_altium/io_altium.conf (nonexistent) +++ trunk/src/plugins/io_altium/io_altium.conf (revision 7258) @@ -0,0 +1,15 @@ +li:pcb-rnd-conf-v1 { + ha:overwrite { + ha:plugins { + ha:io_altium { + coord_mult = 400 + auto_normalize = 1 + emulate_text_ang_180 = 0 + li:postproc_sheet_load { + {(@.a.Package != "")}; {propset(@, rename/a/Package, footprint)} + {(@.type == TEXT) && (@.text == "%../A.Package%")}; {propset(@, p/text/text, "%../A.footprint%")} + } + } + } + } +} Index: trunk/src/plugins/io_altium/io_altium_conf.h =================================================================== --- trunk/src/plugins/io_altium/io_altium_conf.h (nonexistent) +++ trunk/src/plugins/io_altium/io_altium_conf.h (revision 7258) @@ -0,0 +1,19 @@ +#ifndef SCH_RND_IO_ALTIUM_CONF_H +#define SCH_RND_IO_ALTIUM_CONF_H + +#include + +typedef struct { + const struct { + const struct { + RND_CFT_REAL coord_mult; /* all altium coordinates are multiplied by this value to get sch-rnd coords */ + RND_CFT_BOOLEAN emulate_text_ang_180; /* gschem displays text objects with angle==180 with an extra 180 degree rotation; it's a display hack sch-rnd doesn't have; when this emulation is enabled, the loader adds a +180 degree rotation in such text (changing data!) to match the behavior */ + RND_CFT_BOOLEAN auto_normalize; /* move all objects so that starting coords are near 0;0 */ + RND_CFT_LIST postproc_sheet_load; /* pattern;action pairs for object transformations after a succesful load; mostly used for attribute editing */ + } io_altium; + } plugins; +} conf_io_altium_t; + +extern conf_io_altium_t io_altium_conf; + +#endif Index: trunk/src/sch-rnd/Makefile.dep =================================================================== --- trunk/src/sch-rnd/Makefile.dep (revision 7257) +++ trunk/src/sch-rnd/Makefile.dep (revision 7258) @@ -203,7 +203,10 @@ ../../src_3rd/libuundo/uundo.h ../../src_3rd/libminuid/libminuid.h \ ../../src_3rd/gengeo2d/typecfg_long_double.h ../../src_3rd/opc89.h \ ../../src_3rd/gengeo2d/common.h ../../src_3rd/gengeo2d/prim.h \ - ../libcschem/abstract.h ../libcschem/TODO.h ../plugins/io_altium/read.h + ../libcschem/abstract.h ../libcschem/TODO.h ../plugins/io_altium/read.h \ + ../plugins/io_altium/io_altium_conf.h \ + ../plugins/io_altium/conf_internal.c \ + ../plugins/io_altium/io_altium_conf_fields.h ../plugins/io_altium/pcbdoc_ascii.o: ../plugins/io_altium/pcbdoc_ascii.c \ ../libcschem/config.h ../plugins/io_altium/pcbdoc_ascii.h \ ../libcschem/plug_io.h ../libcschem/concrete.h \ @@ -213,7 +216,14 @@ ../../src_3rd/gengeo2d/typecfg_long_double.h ../../src_3rd/opc89.h \ ../../src_3rd/gengeo2d/common.h ../../src_3rd/gengeo2d/prim.h \ ../libcschem/abstract.h ../libcschem/TODO.h \ - ../plugins/io_altium/altium_kw_sphash.h ../plugins/io_altium/schdoc.c + ../plugins/io_altium/altium_kw_sphash.h \ + ../plugins/lib_alien/read_helper.h ../plugins/io_altium/schdoc.c \ + ../libcschem/cnc_grp.h ../libcschem/cnc_grp_child.h \ + ../libcschem/cnc_any_obj.h ../libcschem/concrete.h ../libcschem/rotate.h \ + ../../src_3rd/gengeo2d/xform.h ../../src_3rd/gengeo2d/vect.h \ + ../libcschem/cnc_line.h ../libcschem/cnc_text.h \ + ../libcschem/cnc_text_dyn.h ../libcschem/cnc_poly.h \ + ../libcschem/vtcoutline.h ../libcschem/cnc_arc.h ../libcschem/cnc_pen.h ../plugins/io_altium/read.o: ../plugins/io_altium/read.c \ ../libcschem/config.h ../../src_3rd/libucdf/ucdf.h \ ../plugins/io_altium/pcbdoc_ascii.h ../libcschem/plug_io.h \ @@ -223,8 +233,10 @@ ../../src_3rd/gengeo2d/typecfg_long_double.h ../../src_3rd/opc89.h \ ../../src_3rd/gengeo2d/common.h ../../src_3rd/gengeo2d/prim.h \ ../libcschem/abstract.h ../libcschem/TODO.h \ - ../plugins/io_altium/altium_kw_sphash.h ../plugins/io_altium/read.h \ - ../plugins/io_altium/binlen2txt.c ../plugins/io_altium/binlen2txt.h + ../plugins/io_altium/altium_kw_sphash.h \ + ../plugins/lib_alien/read_helper.h ../plugins/io_altium/schdoc.h \ + ../plugins/io_altium/read.h ../plugins/io_altium/binlen2txt.c \ + ../plugins/io_altium/binlen2txt.h ../plugins/io_geda/io_geda.o: ../plugins/io_geda/io_geda.c \ ../libcschem/config.h ../libcschem/plug_io.h ../libcschem/concrete.h \ ../libcschem/common_types.h ../libcschem/rtree.h ../libcschem/attrib.h \