- fixed an issue in Tool Isolation used with tools from the Tools Database: the set offset value was not used

- updated the Tools Database to include all the Geometry keys in the every tool from database
- made sure that the Operation Type values ('Iso', 'Rough' and 'Finish') are not translated as this may create issues all over the application
This commit is contained in:
Marius Stanciu 2020-11-03 02:19:01 +02:00 committed by Marius
parent 334e2e1b91
commit 263ec736c3
12 changed files with 61 additions and 30 deletions

View File

@ -7,6 +7,12 @@ CHANGELOG for FlatCAM beta
=================================================
3.11.2020
- fixed an issue in Tool Isolation used with tools from the Tools Database: the set offset value was not used
- updated the Tools Database to include all the Geometry keys in the every tool from database
- made sure that the Operation Type values ('Iso', 'Rough' and 'Finish') are not translated as this may create issues all over the application
2.11.2020
- fixed the Tcl Command AlignDrill

View File

@ -26,7 +26,7 @@ class ToolsDB2UI:
self.decimals = self.app.decimals
self.offset_item_options = ["Path", "In", "Out", "Custom"]
self.type_item_options = [_("Iso"), _("Rough"), _("Finish")]
self.type_item_options = ['Iso', 'Rough', 'Finish']
self.tool_type_item_options = ["C1", "C2", "C3", "C4", "B", "V"]
settings = QtCore.QSettings("Open Source", "FlatCAM")
@ -1417,7 +1417,7 @@ class ToolsDB2(QtWidgets.QWidget):
'tooldia': self.app.defaults["geometry_cnctooldia"]
'offset': 'Path'
'offset_value': 0.0
'type': _('Rough'),
'type': 'Rough',
'tool_type': 'C1'
'data': dict()
}
@ -1907,6 +1907,28 @@ class ToolsDB2(QtWidgets.QWidget):
"toolchangez": float(self.app.defaults["geometry_toolchangez"]),
"startz": self.app.defaults["geometry_startz"],
"endz": float(self.app.defaults["geometry_endz"]),
"endxy": self.app.defaults["geometry_endxy"],
"search_time": int(self.app.defaults["geometry_search_time"]),
"z_pdepth": float(self.app.defaults["geometry_z_pdepth"]),
"f_plunge": float(self.app.defaults["geometry_f_plunge"]),
"spindledir": self.app.defaults["geometry_spindledir"],
"optimization_type": self.app.defaults["geometry_optimization_type"],
"feedrate_probe": self.app.defaults["geometry_feedrate_probe"],
"segx": self.app.defaults["geometry_segx"],
"segy": self.app.defaults["geometry_segy"],
"area_exclusion": self.app.defaults["geometry_area_exclusion"],
"area_shape": self.app.defaults["geometry_area_shape"],
"area_strategy": self.app.defaults["geometry_area_strategy"],
"area_overz": self.app.defaults["geometry_area_overz"],
"polish": self.app.defaults["geometry_polish"],
"polish_dia": self.app.defaults["geometry_polish_dia"],
"polish_pressure": self.app.defaults["geometry_polish_pressure"],
"polish_travelz": self.app.defaults["geometry_polish_travelz"],
"polish_margin": self.app.defaults["geometry_polish_margin"],
"polish_overlap": self.app.defaults["geometry_polish_overlap"],
"polish_method": self.app.defaults["geometry_polish_method"],
# NCC
"tools_ncc_operation": self.app.defaults["tools_ncc_operation"],
@ -2642,7 +2664,7 @@ class ToolsDB2(QtWidgets.QWidget):
# 'tooldia': self.app.defaults["geometry_cnctooldia"]
# 'offset': 'Path'
# 'offset_value': 0.0
# 'type': _('Rough'),
# 'type': 'Rough',
# 'tool_type': 'C1'
# 'data': dict()
# }

View File

@ -256,7 +256,7 @@ class AppObject(QtCore.QObject):
'tooldia': float(app.defaults["geometry_cnctooldia"]),
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'type': 'Rough',
'tool_type': 'C1',
'data': deepcopy(default_data),
'solid_geometry': []

View File

@ -128,7 +128,7 @@ class GeometryObject(FlatCAMObj, Geometry):
self.sel_tools = {}
self.offset_item_options = ["Path", "In", "Out", "Custom"]
self.type_item_options = [_("Iso"), _("Rough"), _("Finish")]
self.type_item_options = ['Iso', 'Rough', 'Finish']
self.tool_type_item_options = ["C1", "C2", "C3", "C4", "B", "V"]
# flag to store if the V-Shape tool is selected in self.ui.geo_tools_table
@ -534,7 +534,7 @@ class GeometryObject(FlatCAMObj, Geometry):
'tooldia': self.app.dec_format(float(toold), self.decimals),
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'type': 'Rough',
'tool_type': self.tool_type,
'data': new_data,
'solid_geometry': self.solid_geometry
@ -1069,7 +1069,7 @@ class GeometryObject(FlatCAMObj, Geometry):
offset = 'Path'
offset_val = 0.0
typ = _("Rough")
typ = 'Rough'
tool_type = 'C1'
# look in database tools
for db_tool, db_tool_val in tools_db_dict.items():
@ -1199,7 +1199,7 @@ class GeometryObject(FlatCAMObj, Geometry):
'tooldia': tooldia,
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'type': 'Rough',
'tool_type': 'C1',
'data': deepcopy(self.default_data),
'solid_geometry': self.solid_geometry
@ -1587,8 +1587,8 @@ class GeometryObject(FlatCAMObj, Geometry):
elif cw_col == 3:
# force toolpath type as 'Iso' if the tool type is V-Shape
if self.ui.geo_tools_table.cellWidget(cw_row, 4).currentText() == 'V':
tooluid_value['type'] = _('Iso')
idx = self.ui.geo_tools_table.cellWidget(cw_row, 3).findText(_('Iso'))
tooluid_value['type'] = 'Iso'
idx = self.ui.geo_tools_table.cellWidget(cw_row, 3).findText('Iso')
self.ui.geo_tools_table.cellWidget(cw_row, 3).setCurrentIndex(idx)
else:
tooluid_value['type'] = cb_txt
@ -1597,7 +1597,7 @@ class GeometryObject(FlatCAMObj, Geometry):
# if the tool_type selected is V-Shape then autoselect the toolpath type as Iso
if cb_txt == 'V':
idx = self.ui.geo_tools_table.cellWidget(cw_row, 3).findText(_('Iso'))
idx = self.ui.geo_tools_table.cellWidget(cw_row, 3).findText('Iso')
self.ui.geo_tools_table.cellWidget(cw_row, 3).setCurrentIndex(idx)
else:
self.ui.cutz_entry.set_value(self.old_cutz)

View File

@ -536,7 +536,7 @@ class GerberObject(FlatCAMObj, Gerber):
'tooldia': dia,
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'type': 'Rough',
'tool_type': tool_type,
'data': default_data,
'solid_geometry': geo_obj.solid_geometry
@ -682,7 +682,7 @@ class GerberObject(FlatCAMObj, Gerber):
'tooldia': dia,
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'type': 'Rough',
'tool_type': tool_type,
'data': default_data,
'solid_geometry': geo_obj.solid_geometry

View File

@ -311,7 +311,7 @@ class CutOut(AppTool):
offset = 'Path'
offset_val = 0.0
typ = _("Rough")
typ = 'Rough'
tool_type = 'V'
# look in database tools
for db_tool, db_tool_val in tools_db_dict.items():
@ -445,7 +445,7 @@ class CutOut(AppTool):
'tooldia': dia,
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'type': 'Rough',
'tool_type': 'C1',
'data': deepcopy(self.default_data),
'solid_geometry': []

View File

@ -1213,7 +1213,7 @@ class ToolDrilling(AppTool, Excellon):
# if the sender is in the column with index 2 then we update the tool_type key
if cw_col == 2:
tt = cw.currentText()
typ = 'Iso' if tt == 'V' else _("Rough")
typ = 'Iso' if tt == 'V' else 'Rough'
self.excellon_tools[current_uid].update({
'type': typ,

View File

@ -900,7 +900,7 @@ class ToolIsolation(AppTool, Gerber):
# if the sender is in the column with index 2 then we update the tool_type key
if cw_col == 2:
tt = cw.currentText()
typ = 'Iso' if tt == 'V' else _("Rough")
typ = 'Iso' if tt == 'V' else 'Rough'
self.iso_tools[currenuid].update({
'type': typ,
@ -1095,7 +1095,7 @@ class ToolIsolation(AppTool, Gerber):
offset = 'Path'
offset_val = 0.0
typ = _("Rough")
typ = 'Rough'
tool_type = 'V'
# look in database tools
for db_tool, db_tool_val in tools_db_dict.items():
@ -1626,7 +1626,7 @@ class ToolIsolation(AppTool, Gerber):
'tooldia': float(tool_dia),
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'type': 'Rough',
'tool_type': tool_type,
'data': tool_data,
'solid_geometry': geo_obj.solid_geometry
@ -1788,7 +1788,7 @@ class ToolIsolation(AppTool, Gerber):
'tooldia': float(tool_dia),
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'type': 'Rough',
'tool_type': tool_type,
'data': tool_data,
'solid_geometry': deepcopy(new_solid_geo)
@ -1905,7 +1905,10 @@ class ToolIsolation(AppTool, Gerber):
for tool in sorted_tools:
tool_dia = tools_storage[tool]['tooldia']
tool_has_offset = tools_storage[tool]['offset']
tool_offset_value = tools_storage[tool]['offset_value']
tool_type = tools_storage[tool]['tool_type']
tool_cut_type = tools_storage[tool]['type']
tool_data = tools_storage[tool]['data']
to_follow = tool_data['tools_iso_follow']
@ -1979,9 +1982,9 @@ class ToolIsolation(AppTool, Gerber):
tools_storage.update({
tool: {
'tooldia': float(tool_dia),
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'offset': tool_has_offset,
'offset_value': tool_offset_value,
'type': tool_cut_type,
'tool_type': tool_type,
'data': tool_data,
'solid_geometry': deepcopy(new_solid_geo)

View File

@ -980,7 +980,7 @@ class ToolMilling(AppTool, Excellon):
# if the sender is in the column with index 2 then we update the tool_type key
if cw_col == 2:
tt = cw.currentText()
typ = 'Iso' if tt == 'V' else _("Rough")
typ = 'Iso' if tt == 'V' else 'Rough'
self.iso_tools[current_uid].update({
'type': typ,

View File

@ -837,7 +837,7 @@ class NonCopperClear(AppTool, Gerber):
# if the sender is in the column with index 2 then we update the tool_type key
if cw_col == 2:
tt = cw.currentText()
typ = 'Iso' if tt == 'V' else _("Rough")
typ = 'Iso' if tt == 'V' else 'Rough'
self.ncc_tools[current_uid].update({
'type': typ,
@ -1043,7 +1043,7 @@ class NonCopperClear(AppTool, Gerber):
offset = 'Path'
offset_val = 0.0
typ = _("Rough")
typ = 'Rough'
tool_type = 'V'
# look in database tools
for db_tool, db_tool_val in tools_db_dict.items():

View File

@ -412,7 +412,7 @@ class ToolPaint(AppTool, Gerber):
# if the sender is in the column with index 2 then we update the tool_type key
if cw_col == 2:
tt = cw.currentText()
typ = 'Iso' if tt == 'V' else _("Rough")
typ = 'Iso' if tt == 'V' else 'Rough'
self.paint_tools[current_uid].update({
'type': typ,
@ -730,7 +730,7 @@ class ToolPaint(AppTool, Gerber):
offset = 'Path'
offset_val = 0.0
typ = _("Rough")
typ = 'Rough'
tool_type = 'V'
# look in database tools
for db_tool, db_tool_val in tools_db_dict.items():

View File

@ -1228,7 +1228,7 @@ class Geometry(object):
'tooldia': tooldia,
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'type': 'Rough',
'tool_type': 'C1',
'data': deepcopy(new_data),
'solid_geometry': self.solid_geometry
@ -1289,7 +1289,7 @@ class Geometry(object):
'tooldia': tooldia,
'offset': 'Path',
'offset_value': 0.0,
'type': _('Rough'),
'type': 'Rough',
'tool_type': 'C1',
'data': deepcopy(new_data),
'solid_geometry': self.solid_geometry