- application wide change: introduced the precision parameters in Edit -> Preferences who will control how many decimals to use in the app parameters

This commit is contained in:
Marius Stanciu
2019-12-05 15:18:54 +02:00
parent 19b5f732b5
commit 0d0f872244
53 changed files with 481 additions and 445 deletions

View File

@@ -89,6 +89,17 @@ class TclCommandCopperClear(TclCommand):
name = args['name']
# Get source object.
try:
obj = self.app.collection.get_by_name(str(name))
except Exception as e:
log.debug("TclCommandCopperClear.execute() --> %s" % str(e))
self.raise_tcl_error("%s: %s" % (_("Could not retrieve object"), name))
return "Could not retrieve object: %s" % name
if obj is None:
return "Object not found: %s" % name
if 'tooldia' in args:
tooldia = str(args['tooldia'])
else:
@@ -181,7 +192,7 @@ class TclCommandCopperClear(TclCommand):
tooluid += 1
ncc_tools.update({
int(tooluid): {
'tooldia': float('%.4f' % tool),
'tooldia': float('%.*f' % (obj.decimals, tool)),
'offset': 'Path',
'offset_value': 0.0,
'type': 'Iso',
@@ -204,17 +215,6 @@ class TclCommandCopperClear(TclCommand):
else:
outname = name + "_ncc_rm"
# Get source object.
try:
obj = self.app.collection.get_by_name(str(name))
except Exception as e:
log.debug("TclCommandCopperClear.execute() --> %s" % str(e))
self.raise_tcl_error("%s: %s" % (_("Could not retrieve object"), name))
return "Could not retrieve object: %s" % name
if obj is None:
return "Object not found: %s" % name
# Non-Copper clear all polygons in the non-copper clear object
if 'all' in args and args['all'] == 1:
self.app.ncclear_tool.clear_copper(ncc_obj=obj,