Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 1946) +++ trunk/src_plugins/djopt/djopt.c (revision 1947) @@ -120,28 +120,6 @@ #define LT_COMPONENT 1 #define LT_SOLDER 2 -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 char *element_name_for(corner_s * c) { ELEMENT_LOOP(PCB->Data); @@ -2705,9 +2683,6 @@ HID_Action djopt_action_list[] = { {"djopt", 0, ActionDJopt, djopt_help, djopt_syntax} - , - {"OptAutoOnly", 0, djopt_set_auto_only, - djopt_sao_help, djopt_sao_syntax} }; REGISTER_ACTIONS(djopt_action_list, djopt_cookie) Index: trunk/src_plugins/oldactions/README =================================================================== --- trunk/src_plugins/oldactions/README (revision 1946) +++ trunk/src_plugins/oldactions/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: trunk/src_plugins/oldactions/oldactions.c =================================================================== --- trunk/src_plugins/oldactions/oldactions.c (revision 1946) +++ trunk/src_plugins/oldactions/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"; Index: trunk/src_plugins/vendordrill/vendor.c =================================================================== --- trunk/src_plugins/vendordrill/vendor.c (revision 1946) +++ trunk/src_plugins/vendordrill/vendor.c (revision 1947) @@ -129,82 +129,6 @@ /* ************************************************************ */ -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; -} - -/* ************************************************************ */ - static const char unload_vendor_syntax[] = "UnloadVendor()"; static const char unload_vendor_help[] = "Unloads the current vendor drill mapping table."; @@ -782,15 +706,6 @@ {"ApplyVendor", 0, ActionApplyVendor, apply_vendor_help, apply_vendor_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} - , {"UnloadVendor", 0, ActionUnloadVendor, unload_vendor_help, unload_vendor_syntax} ,