- 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

@@ -70,15 +70,15 @@ class TclCommandMillSlots(TclCommandSignaled):
name = args['name']
if 'outname' not in args:
args['outname'] = name + "_mill_slots"
try:
obj = self.app.collection.get_by_name(str(name))
except Exception:
obj = None
self.raise_tcl_error("Could not retrieve object: %s" % name)
if 'outname' not in args:
args['outname'] = name + "_mill_slots"
if not obj.slots:
self.raise_tcl_error("The Excellon object has no slots: %s" % name)
@@ -91,10 +91,8 @@ class TclCommandMillSlots(TclCommandSignaled):
req_tools = set()
for tool in obj.tools:
for req_dia in diameters:
obj_dia_form = float('%.2f' % float(obj.tools[tool]["C"])) if units == 'MM' else \
float('%.4f' % float(obj.tools[tool]["C"]))
req_dia_form = float('%.2f' % float(req_dia)) if units == 'MM' else \
float('%.4f' % float(req_dia))
obj_dia_form = float('%.*f' % (obj.decimals, float(obj.tools[tool]["C"])))
req_dia_form = float('%.*f' % (obj.decimals, float(req_dia)))
if 'diatol' in args:
tolerance = args['diatol'] / 100