From 9420aaad60fc77c84b99cdeae5fca229a2ba6c02 Mon Sep 17 00:00:00 2001 From: Kamil Sopko Date: Thu, 25 Feb 2016 00:03:19 +0100 Subject: [PATCH 1/5] add multidepth and depthperpass to cncjob shell command --- FlatCAMApp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 4d871376..c4138a6e 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: From 26189960ff789d0981def4e260baf3c5d07f5f4f Mon Sep 17 00:00:00 2001 From: Kamil Sopko Date: Thu, 25 Feb 2016 16:31:57 +0100 Subject: [PATCH 2/5] update help --- FlatCAMApp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index c4138a6e..95541e85 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -3221,14 +3221,17 @@ 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': { 'fcn': write_gcode, From dc374a8233b293abf8874a2ae5af33a58df80ba2 Mon Sep 17 00:00:00 2001 From: Kamil Sopko Date: Thu, 25 Feb 2016 16:33:44 +0100 Subject: [PATCH 3/5] remove blank line --- FlatCAMApp.py | 1 - 1 file changed, 1 deletion(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 95541e85..6af4afe6 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -3231,7 +3231,6 @@ class App(QtCore.QObject): ' multidepth: Use or not multidepth cnccut\n'+ ' depthperpass: Height of one layer for multidepth\n'+ ' outname: Name of the output object' - }, 'write_gcode': { 'fcn': write_gcode, From 0cc60576ab30bc6827b8aab96d222bbc89d128f2 Mon Sep 17 00:00:00 2001 From: Juan Pablo Caram Date: Mon, 29 Feb 2016 13:59:20 -0500 Subject: [PATCH 4/5] Reverted changes to read_form_item(). See #193. --- FlatCAMObj.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) 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): """ From ced43df1bc6bd19ed8b5a4e1a6ce503f6fcbb23f Mon Sep 17 00:00:00 2001 From: Juan Pablo Caram Date: Mon, 29 Feb 2016 14:18:50 -0500 Subject: [PATCH 5/5] Catch when recent file type is not supported. See #192. --- FlatCAMApp.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 6af4afe6..711a6d66 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -3428,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)