Index: README =================================================================== --- README (revision 1946) +++ README (revision 1947) @@ -1,6 +1,8 @@ Random collection of old/obsolete actions. Bell(): audible feedback; DumpLibrary(): print footprint library on stdout; a set of debug actions -useful for writing pcb scripts: Debug(), DebugXY(), Return(). +useful for writing pcb scripts: Debug(), DebugXY(), Return(). Old +plugin actions to toggle or set settings that are now accessible via +the unified config system (vendordrill, djopt) #state: works #default: disabled Index: oldactions.c =================================================================== --- oldactions.c (revision 1946) +++ oldactions.c (revision 1947) @@ -134,7 +134,105 @@ } +static const char djopt_sao_syntax[] = "OptAutoOnly()"; +static const char djopt_sao_help[] = "Toggles the optimize-only-autorouted flag."; + +/* %start-doc actions OptAutoOnly + +The original purpose of the trace optimizer was to clean up the traces +created by the various autorouters that have been used with PCB. When +a board has a mix of autorouted and carefully hand-routed traces, you +don't normally want the optimizer to move your hand-routed traces. +But, sometimes you do. By default, the optimizer only optimizes +autorouted traces. This action toggles that setting, so that you can +optimize hand-routed traces also. + +%end-doc */ + +int djopt_set_auto_only(int argc, char **argv, Coord x, Coord y) +{ + conf_set(CFR_DESIGN, "plugins/djopt/auto_only", -1, conf_djopt.plugins.djopt.auto_only ? "0" : "1", POL_OVERWRITE); + return 0; +} + +/* ************************************************************ */ + +static const char toggle_vendor_syntax[] = "ToggleVendor()"; + +static const char toggle_vendor_help[] = "Toggles the state of automatic drill size mapping."; + +/* %start-doc actions ToggleVendor + +@cindex vendor map +@cindex vendor drill table +@findex ToggleVendor() + +When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. To enable drill +mapping, a vendor lihata file containing a drill table must be +loaded first. + +%end-doc */ + +int ActionToggleVendor(int argc, char **argv, Coord x, Coord y) +{ + conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, conf_vendor.plugins.vendor.enable ? "0" : "1", POL_OVERWRITE); + return 0; +} + +/* ************************************************************ */ + +static const char enable_vendor_syntax[] = "EnableVendor()"; + +static const char enable_vendor_help[] = "Enables automatic drill size mapping."; + +/* %start-doc actions EnableVendor + +@cindex vendor map +@cindex vendor drill table +@findex EnableVendor() + +When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. To enable drill +mapping, a vendor lihata file containing a drill table must be +loaded first. + +%end-doc */ + +int ActionEnableVendor(int argc, char **argv, Coord x, Coord y) +{ + conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "1", POL_OVERWRITE); + return 0; +} + +/* ************************************************************ */ + +static const char disable_vendor_syntax[] = "DisableVendor()"; + +static const char disable_vendor_help[] = "Disables automatic drill size mapping."; + +/* %start-doc actions DisableVendor + +@cindex vendor map +@cindex vendor drill table +@findex DisableVendor() + +When drill mapping is enabled, new instances of pins and vias will +have their drill holes mapped to one of the allowed drill sizes +specified in the currently loaded vendor drill table. + +%end-doc */ + +int ActionDisableVendor(int argc, char **argv, Coord x, Coord y) +{ + conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE); + return 0; +} + + HID_Action oldactions_action_list[] = { {"DumpLibrary", 0, ActionDumpLibrary, dumplibrary_help, dumplibrary_syntax}, @@ -145,7 +243,15 @@ {"DebugXY", "Click X,Y for Debug", Debug, debugxy_help, debugxy_syntax}, {"Return", 0, Return, - return_help, return_syntax} + return_help, return_syntax}, + {"OptAutoOnly", 0, djopt_set_auto_only, + djopt_sao_help, djopt_sao_syntax}, + {"ToggleVendor", 0, ActionToggleVendor, + toggle_vendor_help, toggle_vendor_syntax}, + {"EnableVendor", 0, ActionEnableVendor, + enable_vendor_help, enable_vendor_syntax}, + {"DisableVendor", 0, ActionDisableVendor, + disable_vendor_help, disable_vendor_syntax} }; static const char *oldactions_cookie = "oldactions plugin";