diff --git a/appObjects/FlatCAMExcellon.py b/appObjects/FlatCAMExcellon.py index c5bac25c..aca5318e 100644 --- a/appObjects/FlatCAMExcellon.py +++ b/appObjects/FlatCAMExcellon.py @@ -879,9 +879,11 @@ class ExcellonObject(FlatCAMObj, Excellon): for tool in tools: if tooldia > self.tools[tool]["tooldia"]: - mseg = '[ERROR_NOTCL] %s %s: %s' % (_("Milling tool for DRILLS is larger than hole size. Cancelled."), + mseg = '[ERROR_NOTCL] %s %s: %s (tool = %s, hole = %s)' % (_("Milling tool for DRILLS is larger than hole size. Cancelled."), _("Tool"), - str(tool)) + str(tool), + str(tooldia), + str(self.tools[tool]["tooldia"])) self.app.inform.emit(mseg) return False, "Error: Milling tool is larger than hole." @@ -920,7 +922,6 @@ class ExcellonObject(FlatCAMObj, Excellon): geo_obj.solid_geometry.append(drill.buffer(0.0000001).exterior) else: geo_obj.solid_geometry.append(drill.buffer(buffer_value).exterior) - if use_thread: def geo_thread(a_obj): a_obj.app_obj.new_object("geometry", outname, geo_init, plot=plot) diff --git a/appObjects/FlatCAMObj.py b/appObjects/FlatCAMObj.py index ab5d89e0..565f3855 100644 --- a/appObjects/FlatCAMObj.py +++ b/appObjects/FlatCAMObj.py @@ -148,6 +148,11 @@ class FlatCAMObj(QtCore.QObject): if attr == 'options': self.options.update(d[attr]) + elif attr == 'tools': + #FIXME: JSON stringifies all keys however tools datastructure is indexed by integer not by string + if(d[attr] != None): + d[attr] = {int(k):v for k,v in d[attr].items()} + setattr(self, attr, d[attr]) else: try: setattr(self, attr, d[attr]) @@ -780,7 +785,7 @@ class FlatCAMObj(QtCore.QObject): exc_tool, [ _('Diameter'), - '%.*f %s' % (self.decimals, tool_dia, self.app.defaults['units'].lower()) + '%.*f %s' % (self.decimals, float(tool_dia), self.app.defaults['units'].lower()) ], True ) diff --git a/appParsers/ParseDXF.py b/appParsers/ParseDXF.py index 1417d654..e6deeb1e 100644 --- a/appParsers/ParseDXF.py +++ b/appParsers/ParseDXF.py @@ -7,7 +7,9 @@ from shapely.geometry import LineString from shapely.affinity import rotate -from ezdxf.math import Vec3 as ezdxf_vector +#FIXME: No such class as Vec3 in ezdxf.0.15.1, instead there is Vector "ImportError: cannot import name 'Vec3' from 'ezdxf.math" +#from ezdxf.math import Vec3 as ezdxf_vector +from ezdxf.math import Vector as ezdxf_vector from appParsers.ParseFont import * from appParsers.ParseDXF_Spline import *