- solved bug such that the app is not crashing when some apertures in the Gerber file have no geometry. More than that, now the apertures that have geometry elements are bolded as opposed to the ones without geometry for which the text is unbolded
This commit is contained in:
parent
cd803266a6
commit
93f9a2f052
|
@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
|
|
||||||
- added project name to the window title
|
- added project name to the window title
|
||||||
- fulfilled request: When saving a CNC file, if the file name is changed in the OS window, the new name does appear in the “Selected” (in name) and “Project” tabs (in cnc_job)
|
- fulfilled request: When saving a CNC file, if the file name is changed in the OS window, the new name does appear in the “Selected” (in name) and “Project” tabs (in cnc_job)
|
||||||
|
- solved bug such that the app is not crashing when some apertures in the Gerber file have no geometry. More than that, now the apertures that have geometry elements are bolded as opposed to the ones without geometry for which the text is unbolded
|
||||||
|
|
||||||
31.07.2019
|
31.07.2019
|
||||||
|
|
||||||
|
|
|
@ -112,6 +112,8 @@ class Properties(FlatCAMTool):
|
||||||
|
|
||||||
def addItems(self, obj):
|
def addItems(self, obj):
|
||||||
parent = self.treeWidget.invisibleRootItem()
|
parent = self.treeWidget.invisibleRootItem()
|
||||||
|
apertures = ''
|
||||||
|
tools = ''
|
||||||
|
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
|
@ -131,11 +133,8 @@ class Properties(FlatCAMTool):
|
||||||
self.addChild(obj_type, ['Object Type:', ('%s' % (obj.kind.capitalize()))], True)
|
self.addChild(obj_type, ['Object Type:', ('%s' % (obj.kind.capitalize()))], True)
|
||||||
try:
|
try:
|
||||||
self.addChild(obj_type,
|
self.addChild(obj_type,
|
||||||
['Geo Type:',
|
['Geo Type:', ('%s' % ({False: "Single-Geo", True: "Multi-Geo"}[obj.multigeo]))],
|
||||||
('%s' % ({False: "Single-Geo", True: "Multi-Geo"}[obj.multigeo]))
|
True)
|
||||||
],
|
|
||||||
True
|
|
||||||
)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("Properties.addItems() --> %s" % str(e))
|
log.debug("Properties.addItems() --> %s" % str(e))
|
||||||
|
|
||||||
|
@ -179,26 +178,31 @@ class Properties(FlatCAMTool):
|
||||||
self.addChild(options, [str(option), str(obj.options[option])], True)
|
self.addChild(options, [str(option), str(obj.options[option])], True)
|
||||||
|
|
||||||
if obj.kind.lower() == 'gerber':
|
if obj.kind.lower() == 'gerber':
|
||||||
temp_ap = {}
|
temp_ap = dict()
|
||||||
for ap in obj.apertures:
|
for ap in obj.apertures:
|
||||||
temp_ap.clear()
|
temp_ap.clear()
|
||||||
temp_ap = deepcopy(obj.apertures[ap])
|
temp_ap = deepcopy(obj.apertures[ap])
|
||||||
temp_ap.pop('geometry', None)
|
temp_ap.pop('geometry', None)
|
||||||
if obj.apertures[ap]['geometry']:
|
|
||||||
solid_nr = 0
|
|
||||||
follow_nr = 0
|
|
||||||
clear_nr = 0
|
|
||||||
|
|
||||||
for el in obj.apertures[ap]['geometry']:
|
solid_nr = 0
|
||||||
if 'solid' in el:
|
follow_nr = 0
|
||||||
solid_nr += 1
|
clear_nr = 0
|
||||||
if 'follow' in el:
|
|
||||||
follow_nr += 1
|
if 'geometry' in obj.apertures[ap]:
|
||||||
if 'clear' in el:
|
if obj.apertures[ap]['geometry']:
|
||||||
clear_nr += 1
|
font.setBold(True)
|
||||||
temp_ap['Solid_Geo'] = '%s Polygons' % str(solid_nr)
|
for el in obj.apertures[ap]['geometry']:
|
||||||
temp_ap['Follow_Geo'] = '%s LineStrings' % str(follow_nr)
|
if 'solid' in el:
|
||||||
temp_ap['Clear_Geo'] = '%s Polygons' % str(clear_nr)
|
solid_nr += 1
|
||||||
|
if 'follow' in el:
|
||||||
|
follow_nr += 1
|
||||||
|
if 'clear' in el:
|
||||||
|
clear_nr += 1
|
||||||
|
else:
|
||||||
|
font.setBold(False)
|
||||||
|
temp_ap['Solid_Geo'] = '%s Polygons' % str(solid_nr)
|
||||||
|
temp_ap['Follow_Geo'] = '%s LineStrings' % str(follow_nr)
|
||||||
|
temp_ap['Clear_Geo'] = '%s Polygons' % str(clear_nr)
|
||||||
|
|
||||||
apid = self.addParent(apertures, str(ap), expanded=False, color=QtGui.QColor("#000000"), font=font)
|
apid = self.addParent(apertures, str(ap), expanded=False, color=QtGui.QColor("#000000"), font=font)
|
||||||
for key in temp_ap:
|
for key in temp_ap:
|
||||||
|
|
Loading…
Reference in New Issue