- fixed a GUI glitch in the Excellon tool table
- added units to some of the parameters in the Properties Tool
This commit is contained in:
parent
2ca509ca04
commit
e15c6da086
|
@ -2499,10 +2499,10 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
|
||||||
horizontal_header.setDefaultSectionSize(70)
|
horizontal_header.setDefaultSectionSize(70)
|
||||||
horizontal_header.setSectionResizeMode(0, QtWidgets.QHeaderView.Fixed)
|
horizontal_header.setSectionResizeMode(0, QtWidgets.QHeaderView.Fixed)
|
||||||
horizontal_header.resizeSection(0, 20)
|
horizontal_header.resizeSection(0, 20)
|
||||||
horizontal_header.setSectionResizeMode(1, QtWidgets.QHeaderView.Stretch)
|
horizontal_header.setSectionResizeMode(1, QtWidgets.QHeaderView.ResizeToContents)
|
||||||
horizontal_header.setSectionResizeMode(2, QtWidgets.QHeaderView.ResizeToContents)
|
horizontal_header.setSectionResizeMode(2, QtWidgets.QHeaderView.ResizeToContents)
|
||||||
horizontal_header.setSectionResizeMode(3, QtWidgets.QHeaderView.ResizeToContents)
|
horizontal_header.setSectionResizeMode(3, QtWidgets.QHeaderView.ResizeToContents)
|
||||||
horizontal_header.setSectionResizeMode(4, QtWidgets.QHeaderView.ResizeToContents)
|
horizontal_header.setSectionResizeMode(4, QtWidgets.QHeaderView.Stretch)
|
||||||
horizontal_header.setSectionResizeMode(5, QtWidgets.QHeaderView.Fixed)
|
horizontal_header.setSectionResizeMode(5, QtWidgets.QHeaderView.Fixed)
|
||||||
horizontal_header.resizeSection(5, 17)
|
horizontal_header.resizeSection(5, 17)
|
||||||
self.ui.tools_table.setColumnWidth(5, 17)
|
self.ui.tools_table.setColumnWidth(5, 17)
|
||||||
|
|
|
@ -18,6 +18,8 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
- few bugs solved regarding the newly created empty objects
|
- few bugs solved regarding the newly created empty objects
|
||||||
- changed everywhere the name "postprocessor" with "preprocessor"
|
- changed everywhere the name "postprocessor" with "preprocessor"
|
||||||
- updated the preprocessor files in the toolchange section in order to avoid a graphical representation of travel lines glitch
|
- updated the preprocessor files in the toolchange section in order to avoid a graphical representation of travel lines glitch
|
||||||
|
- fixed a GUI glitch in the Excellon tool table
|
||||||
|
- added units to some of the parameters in the Properties Tool
|
||||||
|
|
||||||
5.12.2019
|
5.12.2019
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ def dxfpoint2shapely(point):
|
||||||
geo = Point(point.dxf.location).buffer(0.01)
|
geo = Point(point.dxf.location).buffer(0.01)
|
||||||
return geo
|
return geo
|
||||||
|
|
||||||
|
|
||||||
def dxfline2shapely(line):
|
def dxfline2shapely(line):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -39,6 +40,7 @@ def dxfline2shapely(line):
|
||||||
|
|
||||||
return geo
|
return geo
|
||||||
|
|
||||||
|
|
||||||
def dxfcircle2shapely(circle, n_points=100):
|
def dxfcircle2shapely(circle, n_points=100):
|
||||||
|
|
||||||
ocs = circle.ocs()
|
ocs = circle.ocs()
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
# ########################################################## ##
|
||||||
|
# FlatCAM: 2D Post-processing for Manufacturing #
|
||||||
|
# http://flatcam.org #
|
||||||
|
# Author: Juan Pablo Caram (c) #
|
||||||
|
# Date: 2/5/2014 #
|
||||||
|
# MIT Licence #
|
||||||
|
# ########################################################## ##
|
||||||
|
|
||||||
from camlib import Geometry
|
from camlib import Geometry
|
||||||
import FlatCAMApp
|
import FlatCAMApp
|
||||||
|
|
|
@ -166,7 +166,7 @@ class Properties(FlatCAMTool):
|
||||||
|
|
||||||
separator = self.addParent(parent, '')
|
separator = self.addParent(parent, '')
|
||||||
|
|
||||||
self.addChild(obj_type, ['%s:' % _('Object Type'), ('%s' % (obj.kind.capitalize()))], True)
|
self.addChild(obj_type, ['%s:' % _('Object Type'), ('%s' % (obj.kind.upper()))], True, font=font, font_items=1)
|
||||||
try:
|
try:
|
||||||
self.addChild(obj_type,
|
self.addChild(obj_type,
|
||||||
['%s:' % _('Geo Type'),
|
['%s:' % _('Geo Type'),
|
||||||
|
@ -318,7 +318,7 @@ class Properties(FlatCAMTool):
|
||||||
self.app.worker_task.emit({'fcn': job_thread, 'params': [obj]})
|
self.app.worker_task.emit({'fcn': job_thread, 'params': [obj]})
|
||||||
|
|
||||||
# Units items
|
# Units items
|
||||||
f_unit = {'in': _('Inch'), 'mm': _('MM')}[str(self.app.defaults['units'].lower())]
|
f_unit = {'in': _('Inch'), 'mm': _('Metric')}[str(self.app.defaults['units'].lower())]
|
||||||
self.addChild(units, ['FlatCAM units:', f_unit], True)
|
self.addChild(units, ['FlatCAM units:', f_unit], True)
|
||||||
|
|
||||||
o_unit = {
|
o_unit = {
|
||||||
|
@ -390,7 +390,14 @@ class Properties(FlatCAMTool):
|
||||||
|
|
||||||
tot_slot_cnt += slot_cnt
|
tot_slot_cnt += slot_cnt
|
||||||
|
|
||||||
self.addChild(toolid, [_('Diameter'), str(value['C'])], True)
|
self.addChild(
|
||||||
|
toolid,
|
||||||
|
[
|
||||||
|
_('Diameter'),
|
||||||
|
'%.*f %s' % (self.decimals, value['C'], self.app.defaults['units'].lower())
|
||||||
|
],
|
||||||
|
True
|
||||||
|
)
|
||||||
self.addChild(toolid, [_('Drills number'), str(drill_cnt)], True)
|
self.addChild(toolid, [_('Drills number'), str(drill_cnt)], True)
|
||||||
self.addChild(toolid, [_('Slots number'), str(slot_cnt)], True)
|
self.addChild(toolid, [_('Slots number'), str(slot_cnt)], True)
|
||||||
|
|
||||||
|
@ -436,7 +443,14 @@ class Properties(FlatCAMTool):
|
||||||
exc_tool = self.addParent(
|
exc_tool = self.addParent(
|
||||||
tools, str(value['tool']), expanded=False, color=QtGui.QColor("#000000"), font=font
|
tools, str(value['tool']), expanded=False, color=QtGui.QColor("#000000"), font=font
|
||||||
)
|
)
|
||||||
self.addChild(exc_tool, [_('Diameter'), str(tool_dia)], True)
|
self.addChild(
|
||||||
|
exc_tool,
|
||||||
|
[
|
||||||
|
_('Diameter'),
|
||||||
|
'%.*f %s' % (self.decimals, tool_dia, self.app.defaults['units'].lower())
|
||||||
|
],
|
||||||
|
True
|
||||||
|
)
|
||||||
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')
|
||||||
|
@ -448,9 +462,42 @@ class Properties(FlatCAMTool):
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.addChild(exc_tool, [_("Depth of Cut"), str(obj.z_cut - obj.tool_offset[tool_dia])], True)
|
self.addChild(
|
||||||
self.addChild(exc_tool, [_("Clearance Height"), str(obj.z_move)], True)
|
exc_tool,
|
||||||
self.addChild(exc_tool, [_("Feedrate"), str(obj.feedrate)], True)
|
[
|
||||||
|
_("Depth of Cut"),
|
||||||
|
'%.*f %s' % (
|
||||||
|
self.decimals,
|
||||||
|
(obj.z_cut - obj.tool_offset[tool_dia]),
|
||||||
|
self.app.defaults['units'].lower()
|
||||||
|
)
|
||||||
|
],
|
||||||
|
True
|
||||||
|
)
|
||||||
|
self.addChild(
|
||||||
|
exc_tool,
|
||||||
|
[
|
||||||
|
_("Clearance Height"),
|
||||||
|
'%.*f %s' % (
|
||||||
|
self.decimals,
|
||||||
|
obj.z_move,
|
||||||
|
self.app.defaults['units'].lower()
|
||||||
|
)
|
||||||
|
],
|
||||||
|
True
|
||||||
|
)
|
||||||
|
self.addChild(
|
||||||
|
exc_tool,
|
||||||
|
[
|
||||||
|
_("Feedrate"),
|
||||||
|
'%.*f %s/min' % (
|
||||||
|
self.decimals,
|
||||||
|
obj.feedrate,
|
||||||
|
self.app.defaults['units'].lower()
|
||||||
|
)
|
||||||
|
],
|
||||||
|
True
|
||||||
|
)
|
||||||
|
|
||||||
r_time = obj.routing_time
|
r_time = obj.routing_time
|
||||||
if r_time > 1:
|
if r_time > 1:
|
||||||
|
@ -462,15 +509,15 @@ class Properties(FlatCAMTool):
|
||||||
self.addChild(
|
self.addChild(
|
||||||
others,
|
others,
|
||||||
[
|
[
|
||||||
'%s (%s):' % (_('Routing time'), units_lbl),
|
'%s:' % _('Routing time'),
|
||||||
'%.*f' % (self.decimals, r_time)],
|
'%.*f %s' % (self.decimals, r_time, units_lbl)],
|
||||||
True
|
True
|
||||||
)
|
)
|
||||||
self.addChild(
|
self.addChild(
|
||||||
others,
|
others,
|
||||||
[
|
[
|
||||||
'%s (%s):' % (_('Travelled distance'), f_unit),
|
'%s:' % _('Travelled distance'),
|
||||||
'%.*f' % (self.decimals, obj.travel_distance)
|
'%.*f %s' % (self.decimals, obj.travel_distance, self.app.defaults['units'].lower())
|
||||||
],
|
],
|
||||||
True
|
True
|
||||||
)
|
)
|
||||||
|
@ -488,11 +535,17 @@ class Properties(FlatCAMTool):
|
||||||
item.setFont(0, font)
|
item.setFont(0, font)
|
||||||
return item
|
return item
|
||||||
|
|
||||||
def addChild(self, parent, title, column1=None):
|
def addChild(self, parent, title, column1=None, font=None, font_items=None):
|
||||||
item = QtWidgets.QTreeWidgetItem(parent)
|
item = QtWidgets.QTreeWidgetItem(parent)
|
||||||
item.setText(0, str(title[0]))
|
item.setText(0, str(title[0]))
|
||||||
if column1 is not None:
|
if column1 is not None:
|
||||||
item.setText(1, str(title[1]))
|
item.setText(1, str(title[1]))
|
||||||
|
if font and font_items:
|
||||||
|
try:
|
||||||
|
for fi in font_items:
|
||||||
|
item.setFont(fi, font)
|
||||||
|
except TypeError:
|
||||||
|
item.setFont(font_items, font)
|
||||||
|
|
||||||
def show_area_chull(self, area, length, width, chull_area, copper_area, location):
|
def show_area_chull(self, area, length, width, chull_area, copper_area, location):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue