diff --git a/CHANGELOG.md b/CHANGELOG.md index e9facba4..2fef9af6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ CHANGELOG for FlatCAM beta - in the 'cutout' Tcl command made sure that when an error pop-up then it returns with a "fail" string - made sure when running scripts from the interface that if a command will generate an error then the script is aborted +- added a new Tcl command named 'list_pp' which lists the available preprocessor names 17.01.2022 diff --git a/app_Main.py b/app_Main.py index 61829711..e2faa552 100644 --- a/app_Main.py +++ b/app_Main.py @@ -629,7 +629,7 @@ class App(QtCore.QObject): 'export_gcode', 'export_gerber', 'export_svg', 'ext', 'exteriors', 'follow', 'geo_union', 'geocutout', 'get_bounds', 'get_names', 'get_path', 'get_sys', 'help', 'interiors', 'isolate', 'join_excellon', - 'join_geometry', 'list_sys', 'milld', 'mills', 'milldrills', 'millslots', + 'join_geometry', 'list_sys', 'list_pp', 'milld', 'mills', 'milldrills', 'millslots', 'mirror', 'ncc', 'ncr', 'new', 'new_geometry', 'new_gerber', 'new_excellon', 'non_copper_regions', 'offset', diff --git a/tclCommands/TclCommandListPP.py b/tclCommands/TclCommandListPP.py new file mode 100644 index 00000000..7dadf1ff --- /dev/null +++ b/tclCommands/TclCommandListPP.py @@ -0,0 +1,51 @@ +# ########################################################## +# FlatCAM: 2D Post-processing for Manufacturing # +# File Author: Marius Adrian Stanciu (c) # +# Date: 1/18/2022 # +# MIT Licence # +# ########################################################## + +from tclCommands.TclCommand import * + + +class TclCommandListPP(TclCommand): + """ + Tcl shell command to get the list of available preprocessors + + example: + list_pp + """ + + # List of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon) + aliases = ['list_pp', 'listpp'] + + description = '%s %s' % ("--", "Outputs in Tcl Shell the list with the names of available preprocessors.") + + # Dictionary of types from Tcl command, needs to be ordered + arg_names = collections.OrderedDict([ + ]) + + # Dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value + option_types = collections.OrderedDict([ + ]) + + # array of mandatory options for current Tcl command: required = {'name','outname'} + required = [] + + # structured help for current command, args needs to be ordered + help = { + 'main': "Returns the list with the names of available preprocessors.\n", + 'args': collections.OrderedDict([ + ]), + 'examples': ['list_pp', 'listpp'] + } + + def execute(self, args, unnamed_args): + """ + + :param args: + :param unnamed_args: + :return: + """ + ret_val = list(self.app.preprocessors.keys()) + return str(ret_val) diff --git a/tclCommands/__init__.py b/tclCommands/__init__.py index b1d04fd6..f7845495 100644 --- a/tclCommands/__init__.py +++ b/tclCommands/__init__.py @@ -37,6 +37,7 @@ import tclCommands.TclCommandFollow import tclCommands.TclCommandJoinExcellon import tclCommands.TclCommandJoinGeometry import tclCommands.TclCommandListSys +import tclCommands.TclCommandListPP import tclCommands.TclCommandMillDrills import tclCommands.TclCommandMillSlots import tclCommands.TclCommandMirror