- added protection against creating CNCJob from an empty Geometry object (with no geometry inside)

- changed the shortcut key for YOuTube channel from F2 to key F4
This commit is contained in:
Marius Stanciu
2019-02-21 01:14:55 +02:00
committed by Marius S
parent f62e7e51fd
commit 4ab2374903
5 changed files with 326 additions and 27 deletions

View File

@@ -3965,6 +3965,16 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
'[ERROR_NOTCL]Wrong value format for self.defaults["feedrate_probe"] '
'or self.options["feedrate_probe"]')
# make sure that trying to make a CNCJob from an empty file is not creating an app crash
if not self.solid_geometry:
a = 0
for tooluid_key in self.tools:
if self.tools[tooluid_key]['solid_geometry'] is None:
a += 1
if a == len(self.tools):
self.app.inform.emit('[ERROR_NOTCL]Cancelled. Empty file, it has no geometry...')
return 'fail'
for tooluid_key in self.sel_tools:
tool_cnt += 1
app_obj.progress.emit(20)