- solved issue #355 - when the tool diameter field in the Edit → Preferences → Geometry → Geometry General → Tools → Tool dia is only one the app failed to read it

This commit is contained in:
Marius
2019-12-23 23:32:32 +02:00
parent b1b140634b
commit 9e8536ab9f
3 changed files with 30 additions and 24 deletions

View File

@@ -3879,15 +3879,18 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
if def_key == opt_key:
self.default_data[def_key] = deepcopy(opt_val)
try:
temp_tools = self.options["cnctooldia"].split(",")
tools_list = [
float(eval(dia)) for dia in temp_tools if dia != ''
]
except Exception as e:
log.error("At least one tool diameter needed. Verify in Edit -> Preferences -> Geometry General -> "
"Tool dia. %s" % str(e))
return
if type(self.options["cnctooldia"]) == float:
tools_list = [self.options["cnctooldia"]]
else:
try:
temp_tools = self.options["cnctooldia"].split(",")
tools_list = [
float(eval(dia)) for dia in temp_tools if dia != ''
]
except Exception as e:
log.error("FlatCAMGeometry.set_ui() -> At least one tool diameter needed. "
"Verify in Edit -> Preferences -> Geometry General -> Tool dia. %s" % str(e))
return
self.tooluid += 1