diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 4d871376..711a6d66 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -2648,7 +2648,9 @@ class App(QtCore.QObject): 'feedrate': float, 'tooldia': float, 'outname': str, - 'spindlespeed': int + 'spindlespeed': int, + 'multidepth' : bool, + 'depthperpass' : float } for key in kwa: @@ -3219,13 +3221,15 @@ class App(QtCore.QObject): 'cncjob': { 'fcn': cncjob, 'help': 'Generates a CNC Job from a Geometry Object.\n' + - '> cncjob [-z_cut ] [-z_move ] [-feedrate ] [-tooldia ] [-spindlespeed (int)] [-outname ]\n' + + '> cncjob [-z_cut ] [-z_move ] [-feedrate ] [-tooldia ] [-spindlespeed ] [-multidepth ] [-depthperpass ] [-outname ]\n' + ' name: Name of the source object\n' + ' z_cut: Z-axis cutting position\n' + ' z_move: Z-axis moving position\n' + ' feedrate: Moving speed when cutting\n' + ' tooldia: Tool diameter to show on screen\n' + ' spindlespeed: Speed of the spindle in rpm (example: 4000)\n' + + ' multidepth: Use or not multidepth cnccut\n'+ + ' depthperpass: Height of one layer for multidepth\n'+ ' outname: Name of the output object' }, 'write_gcode': { @@ -3424,13 +3428,17 @@ class App(QtCore.QObject): for recent in self.recent: filename = recent['filename'].split('/')[-1].split('\\')[-1] - action = QtGui.QAction(QtGui.QIcon(icons[recent["kind"]]), filename, self) + try: + action = QtGui.QAction(QtGui.QIcon(icons[recent["kind"]]), filename, self) - # Attach callback - o = make_callback(openers[recent["kind"]], recent['filename']) - action.triggered.connect(o) + # Attach callback + o = make_callback(openers[recent["kind"]], recent['filename']) + action.triggered.connect(o) - self.ui.recent.addAction(action) + self.ui.recent.addAction(action) + + except KeyError: + App.log.error("Unsupported file type: %s" % recent["kind"]) # self.builder.get_object('open_recent').set_submenu(recent_menu) # self.ui.menufilerecent.set_submenu(recent_menu) diff --git a/FlatCAMObj.py b/FlatCAMObj.py index c6043026..b8315fc5 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -144,7 +144,6 @@ class FlatCAMObj(QtCore.QObject): except: self.app.log.warning("Unexpected error:", sys.exc_info()) - def build_ui(self): """ Sets up the UI/form for this object. Show the UI @@ -199,16 +198,22 @@ class FlatCAMObj(QtCore.QObject): :type option: str :return: None """ - #try read field only when option have equivalent in form_fields - if option in self.form_fields: - option_type=type(self.options[option]) - try: - value=self.form_fields[option].get_value() - #catch per option as it was ignored anyway, also when syntax error (probably uninitialized field),don't read either. - except (KeyError,SyntaxError): - self.app.log.warning("Failed to read option from field: %s" % option) - else: - self.app.log.warning("Form fied does not exists: %s" % option) + + try: + self.options[option] = self.form_fields[option].get_value() + except KeyError: + self.app.log.warning("Failed to read option from field: %s" % option) + + # #try read field only when option have equivalent in form_fields + # if option in self.form_fields: + # option_type=type(self.options[option]) + # try: + # value=self.form_fields[option].get_value() + # #catch per option as it was ignored anyway, also when syntax error (probably uninitialized field),don't read either. + # except (KeyError,SyntaxError): + # self.app.log.warning("Failed to read option from field: %s" % option) + # else: + # self.app.log.warning("Form fied does not exists: %s" % option) def plot(self): """