|
@@ -146,30 +146,33 @@ class Properties(AppTool):
|
|
|
font = QtGui.QFont()
|
|
font = QtGui.QFont()
|
|
|
font.setBold(True)
|
|
font.setBold(True)
|
|
|
|
|
|
|
|
|
|
+ p_color = QtGui.QColor("#000000") if self.app.defaults['global_gray_icons'] is False \
|
|
|
|
|
+ else QtGui.QColor("#FFFFFF")
|
|
|
|
|
+
|
|
|
# main Items categories
|
|
# main Items categories
|
|
|
- obj_type = self.treeWidget.addParent(parent, _('TYPE'), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
- obj_name = self.treeWidget.addParent(parent, _('NAME'), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ obj_type = self.treeWidget.addParent(parent, _('TYPE'), expanded=True, color=p_color, font=font)
|
|
|
|
|
+ obj_name = self.treeWidget.addParent(parent, _('NAME'), expanded=True, color=p_color, font=font)
|
|
|
dims = self.treeWidget.addParent(
|
|
dims = self.treeWidget.addParent(
|
|
|
- parent, _('Dimensions'), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
- units = self.treeWidget.addParent(parent, _('Units'), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
- options = self.treeWidget.addParent(parent, _('Options'), color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ parent, _('Dimensions'), expanded=True, color=p_color, font=font)
|
|
|
|
|
+ units = self.treeWidget.addParent(parent, _('Units'), expanded=True, color=p_color, font=font)
|
|
|
|
|
+ options = self.treeWidget.addParent(parent, _('Options'), color=p_color, font=font)
|
|
|
|
|
|
|
|
if obj.kind.lower() == 'gerber':
|
|
if obj.kind.lower() == 'gerber':
|
|
|
apertures = self.treeWidget.addParent(
|
|
apertures = self.treeWidget.addParent(
|
|
|
- parent, _('Apertures'), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ parent, _('Apertures'), expanded=True, color=p_color, font=font)
|
|
|
else:
|
|
else:
|
|
|
tools = self.treeWidget.addParent(
|
|
tools = self.treeWidget.addParent(
|
|
|
- parent, _('Tools'), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ parent, _('Tools'), expanded=True, color=p_color, font=font)
|
|
|
|
|
|
|
|
if obj.kind.lower() == 'excellon':
|
|
if obj.kind.lower() == 'excellon':
|
|
|
drills = self.treeWidget.addParent(
|
|
drills = self.treeWidget.addParent(
|
|
|
- parent, _('Drills'), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ parent, _('Drills'), expanded=True, color=p_color, font=font)
|
|
|
slots = self.treeWidget.addParent(
|
|
slots = self.treeWidget.addParent(
|
|
|
- parent, _('Slots'), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ parent, _('Slots'), expanded=True, color=p_color, font=font)
|
|
|
|
|
|
|
|
if obj.kind.lower() == 'cncjob':
|
|
if obj.kind.lower() == 'cncjob':
|
|
|
others = self.treeWidget.addParent(
|
|
others = self.treeWidget.addParent(
|
|
|
- parent, _('Others'), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ parent, _('Others'), expanded=True, color=p_color, font=font)
|
|
|
|
|
|
|
|
separator = self.treeWidget.addParent(parent, '')
|
|
separator = self.treeWidget.addParent(parent, '')
|
|
|
|
|
|
|
@@ -193,7 +196,7 @@ class Properties(AppTool):
|
|
|
self.treeWidget.addChild(obj_name, [obj.options['name']])
|
|
self.treeWidget.addChild(obj_name, [obj.options['name']])
|
|
|
|
|
|
|
|
def job_thread(obj_prop):
|
|
def job_thread(obj_prop):
|
|
|
- proc = self.app.proc_container.new(_("Calculating dimensions ... Please wait."))
|
|
|
|
|
|
|
+ self.app.proc_container.new(_("Calculating dimensions ... Please wait."))
|
|
|
|
|
|
|
|
length = 0.0
|
|
length = 0.0
|
|
|
width = 0.0
|
|
width = 0.0
|
|
@@ -382,7 +385,7 @@ class Properties(AppTool):
|
|
|
temp_ap['Clear_Geo'] = '%s Polygons' % str(clear_nr)
|
|
temp_ap['Clear_Geo'] = '%s Polygons' % str(clear_nr)
|
|
|
|
|
|
|
|
apid = self.treeWidget.addParent(
|
|
apid = self.treeWidget.addParent(
|
|
|
- apertures, str(ap), expanded=False, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ apertures, str(ap), expanded=False, color=p_color, font=font)
|
|
|
for key in temp_ap:
|
|
for key in temp_ap:
|
|
|
self.treeWidget.addChild(apid, [str(key), str(temp_ap[key])], True)
|
|
self.treeWidget.addChild(apid, [str(key), str(temp_ap[key])], True)
|
|
|
elif obj.kind.lower() == 'excellon':
|
|
elif obj.kind.lower() == 'excellon':
|
|
@@ -391,7 +394,7 @@ class Properties(AppTool):
|
|
|
|
|
|
|
|
for tool, value in obj.tools.items():
|
|
for tool, value in obj.tools.items():
|
|
|
toolid = self.treeWidget.addParent(
|
|
toolid = self.treeWidget.addParent(
|
|
|
- tools, str(tool), expanded=False, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ tools, str(tool), expanded=False, color=p_color, font=font)
|
|
|
|
|
|
|
|
drill_cnt = 0 # variable to store the nr of drills per tool
|
|
drill_cnt = 0 # variable to store the nr of drills per tool
|
|
|
slot_cnt = 0 # variable to store the nr of slots per tool
|
|
slot_cnt = 0 # variable to store the nr of slots per tool
|
|
@@ -424,7 +427,7 @@ class Properties(AppTool):
|
|
|
elif obj.kind.lower() == 'geometry':
|
|
elif obj.kind.lower() == 'geometry':
|
|
|
for tool, value in obj.tools.items():
|
|
for tool, value in obj.tools.items():
|
|
|
geo_tool = self.treeWidget.addParent(
|
|
geo_tool = self.treeWidget.addParent(
|
|
|
- tools, str(tool), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ tools, str(tool), expanded=True, color=p_color, font=font)
|
|
|
for k, v in value.items():
|
|
for k, v in value.items():
|
|
|
if k == 'solid_geometry':
|
|
if k == 'solid_geometry':
|
|
|
# printed_value = _('Present') if v else _('None')
|
|
# printed_value = _('Present') if v else _('None')
|
|
@@ -435,7 +438,7 @@ class Properties(AppTool):
|
|
|
self.treeWidget.addChild(geo_tool, [str(k), printed_value], True)
|
|
self.treeWidget.addChild(geo_tool, [str(k), printed_value], True)
|
|
|
elif k == 'data':
|
|
elif k == 'data':
|
|
|
tool_data = self.treeWidget.addParent(
|
|
tool_data = self.treeWidget.addParent(
|
|
|
- geo_tool, str(k).capitalize(), color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ geo_tool, str(k).capitalize(), color=p_color, font=font)
|
|
|
for data_k, data_v in v.items():
|
|
for data_k, data_v in v.items():
|
|
|
self.treeWidget.addChild(tool_data, [str(data_k), str(data_v)], True)
|
|
self.treeWidget.addChild(tool_data, [str(data_k), str(data_v)], True)
|
|
|
else:
|
|
else:
|
|
@@ -444,7 +447,7 @@ class Properties(AppTool):
|
|
|
# for cncjob objects made from gerber or geometry
|
|
# for cncjob objects made from gerber or geometry
|
|
|
for tool, value in obj.cnc_tools.items():
|
|
for tool, value in obj.cnc_tools.items():
|
|
|
geo_tool = self.treeWidget.addParent(
|
|
geo_tool = self.treeWidget.addParent(
|
|
|
- tools, str(tool), expanded=True, color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
|
|
+ tools, str(tool), expanded=True, color=p_color, font=font)
|
|
|
for k, v in value.items():
|
|
for k, v in value.items():
|
|
|
if k == 'solid_geometry':
|
|
if k == 'solid_geometry':
|
|
|
printed_value = _('Present') if v else _('None')
|
|
printed_value = _('Present') if v else _('None')
|
|
@@ -456,17 +459,20 @@ class Properties(AppTool):
|
|
|
printed_value = _('Present') if v else _('None')
|
|
printed_value = _('Present') if v else _('None')
|
|
|
self.treeWidget.addChild(geo_tool, [_("GCode Geometry"), printed_value], True)
|
|
self.treeWidget.addChild(geo_tool, [_("GCode Geometry"), printed_value], True)
|
|
|
elif k == 'data':
|
|
elif k == 'data':
|
|
|
- tool_data = self.treeWidget.addParent(
|
|
|
|
|
- geo_tool, _("Data"), color=QtGui.QColor("#000000"), font=font)
|
|
|
|
|
- for data_k, data_v in v.items():
|
|
|
|
|
- self.treeWidget.addChild(tool_data, [str(data_k).capitalize(), str(data_v)], True)
|
|
|
|
|
|
|
+ pass
|
|
|
else:
|
|
else:
|
|
|
self.treeWidget.addChild(geo_tool, [str(k), str(v)], True)
|
|
self.treeWidget.addChild(geo_tool, [str(k), str(v)], True)
|
|
|
|
|
|
|
|
|
|
+ v = value['data']
|
|
|
|
|
+ tool_data = self.treeWidget.addParent(
|
|
|
|
|
+ geo_tool, _("Tool Data"), color=p_color, font=font)
|
|
|
|
|
+ for data_k, data_v in v.items():
|
|
|
|
|
+ self.treeWidget.addChild(tool_data, [str(data_k).capitalize(), str(data_v)], True)
|
|
|
|
|
+
|
|
|
# for cncjob objects made from excellon
|
|
# for cncjob objects made from excellon
|
|
|
for tool_dia, value in obj.exc_cnc_tools.items():
|
|
for tool_dia, value in obj.exc_cnc_tools.items():
|
|
|
exc_tool = self.treeWidget.addParent(
|
|
exc_tool = self.treeWidget.addParent(
|
|
|
- tools, str(value['tool']), expanded=False, color=QtGui.QColor("#000000"), font=font
|
|
|
|
|
|
|
+ tools, str(value['tool']), expanded=False, color=p_color, font=font
|
|
|
)
|
|
)
|
|
|
self.treeWidget.addChild(
|
|
self.treeWidget.addChild(
|
|
|
exc_tool,
|
|
exc_tool,
|
|
@@ -484,6 +490,12 @@ class Properties(AppTool):
|
|
|
self.treeWidget.addChild(exc_tool, [_("Drills number"), str(v)], True)
|
|
self.treeWidget.addChild(exc_tool, [_("Drills number"), str(v)], True)
|
|
|
elif k == 'nr_slots':
|
|
elif k == 'nr_slots':
|
|
|
self.treeWidget.addChild(exc_tool, [_("Slots number"), str(v)], True)
|
|
self.treeWidget.addChild(exc_tool, [_("Slots number"), str(v)], True)
|
|
|
|
|
+ elif k == 'gcode':
|
|
|
|
|
+ printed_value = _('Present') if v != '' else _('None')
|
|
|
|
|
+ self.treeWidget.addChild(exc_tool, [_("GCode Text"), printed_value], True)
|
|
|
|
|
+ elif k == 'gcode_parsed':
|
|
|
|
|
+ printed_value = _('Present') if v else _('None')
|
|
|
|
|
+ self.treeWidget.addChild(exc_tool, [_("GCode Geometry"), printed_value], True)
|
|
|
else:
|
|
else:
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
@@ -493,7 +505,7 @@ class Properties(AppTool):
|
|
|
_("Depth of Cut"),
|
|
_("Depth of Cut"),
|
|
|
'%.*f %s' % (
|
|
'%.*f %s' % (
|
|
|
self.decimals,
|
|
self.decimals,
|
|
|
- (obj.z_cut - abs(obj.tool_offset[tool_dia])),
|
|
|
|
|
|
|
+ (obj.z_cut - abs(value['data']['tools_drill_offset'])),
|
|
|
self.app.defaults['units'].lower()
|
|
self.app.defaults['units'].lower()
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
@@ -524,6 +536,12 @@ class Properties(AppTool):
|
|
|
True
|
|
True
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+ v = value['data']
|
|
|
|
|
+ tool_data = self.treeWidget.addParent(
|
|
|
|
|
+ exc_tool, _("Tool Data"), color=p_color, font=font)
|
|
|
|
|
+ for data_k, data_v in v.items():
|
|
|
|
|
+ self.treeWidget.addChild(tool_data, [str(data_k).capitalize(), str(data_v)], True)
|
|
|
|
|
+
|
|
|
r_time = obj.routing_time
|
|
r_time = obj.routing_time
|
|
|
if r_time > 1:
|
|
if r_time > 1:
|
|
|
units_lbl = 'min'
|
|
units_lbl = 'min'
|