- in Isolation Plugin fixed the issue with clicking the header not toggling all tools rows
- in Isolation Plugin fixed an issue in the reset_fields() method
This commit is contained in:
@@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
8.01.2021
|
||||||
|
|
||||||
|
- in Isolation Plugin fixed the issue with clicking the header not toggling all tools rows
|
||||||
|
- in Isolation Plugin fixed an issue in the reset_fields() method
|
||||||
|
|
||||||
6.01.2022
|
6.01.2022
|
||||||
|
|
||||||
- modified the 'laser-lines' method in the Paint Plugin such that the rounded part of a painted trace is painted too in the case that the trace width is much higher than the clearing tool diameter
|
- modified the 'laser-lines' method in the Paint Plugin such that the rounded part of a painted trace is painted too in the case that the trace width is much higher than the clearing tool diameter
|
||||||
|
|||||||
@@ -877,7 +877,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
self.update_ui()
|
self.update_ui()
|
||||||
|
|
||||||
def update_ui(self):
|
def update_ui(self):
|
||||||
self.blockSignals(True)
|
self.ui_disconnect()
|
||||||
|
|
||||||
sel_rows = set()
|
sel_rows = set()
|
||||||
table_items = self.ui.tools_table.selectedItems()
|
table_items = self.ui.tools_table.selectedItems()
|
||||||
@@ -891,7 +891,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
self.ui.tool_data_label.setText(
|
self.ui.tool_data_label.setText(
|
||||||
"<b>%s: <font color='#0000FF'>%s</font></b>" % (_('Parameters for'), _("No Tool Selected"))
|
"<b>%s: <font color='#0000FF'>%s</font></b>" % (_('Parameters for'), _("No Tool Selected"))
|
||||||
)
|
)
|
||||||
self.blockSignals(False)
|
self.ui_connect()
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
self.ui.generate_iso_button.setDisabled(False)
|
self.ui.generate_iso_button.setDisabled(False)
|
||||||
@@ -903,9 +903,11 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
if item is not None:
|
if item is not None:
|
||||||
tooluid = int(item.text())
|
tooluid = int(item.text())
|
||||||
else:
|
else:
|
||||||
|
self.ui_connect()
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error("Tool missing. Add a tool in the Tool Table. %s" % str(e))
|
log.error("Tool missing. Add a tool in the Tool Table. %s" % str(e))
|
||||||
|
self.ui_connect()
|
||||||
return
|
return
|
||||||
|
|
||||||
# update the QLabel that shows for which Tool we have the parameters in the UI form
|
# update the QLabel that shows for which Tool we have the parameters in the UI form
|
||||||
@@ -928,7 +930,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
"<b>%s: <font color='#0000FF'>%s</font></b>" % (_('Parameters for'), _("Multiple Tools"))
|
"<b>%s: <font color='#0000FF'>%s</font></b>" % (_('Parameters for'), _("Multiple Tools"))
|
||||||
)
|
)
|
||||||
|
|
||||||
self.blockSignals(False)
|
self.ui_connect()
|
||||||
|
|
||||||
def storage_to_form(self, dict_storage):
|
def storage_to_form(self, dict_storage):
|
||||||
for form_key in self.form_fields:
|
for form_key in self.form_fields:
|
||||||
@@ -1323,7 +1325,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
||||||
|
|
||||||
def on_tool_add(self, custom_dia=None):
|
def on_tool_add(self, custom_dia=None):
|
||||||
self.blockSignals(True)
|
|
||||||
self.ui_disconnect()
|
self.ui_disconnect()
|
||||||
|
|
||||||
filename = self.app.tools_database_path()
|
filename = self.app.tools_database_path()
|
||||||
@@ -1344,7 +1345,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
self.build_ui()
|
self.build_ui()
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Please enter a tool diameter with non-zero value, "
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Please enter a tool diameter with non-zero value, "
|
||||||
"in Float format."))
|
"in Float format."))
|
||||||
self.blockSignals(False)
|
|
||||||
self.ui_connect()
|
self.ui_connect()
|
||||||
return
|
return
|
||||||
truncated_tooldia = self.app.dec_format(tool_dia, self.decimals)
|
truncated_tooldia = self.app.dec_format(tool_dia, self.decimals)
|
||||||
@@ -1362,8 +1362,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
except IOError:
|
except IOError:
|
||||||
self.app.log.error("Could not load tools DB file.")
|
self.app.log.error("Could not load tools DB file.")
|
||||||
self.app.inform.emit('[ERROR] %s' % _("Could not load Tools DB file."))
|
self.app.inform.emit('[ERROR] %s' % _("Could not load Tools DB file."))
|
||||||
self.blockSignals(False)
|
|
||||||
self.ui_connect()
|
|
||||||
self.on_tool_default_add(dia=tool_dia)
|
self.on_tool_default_add(dia=tool_dia)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1374,8 +1372,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
e = sys.exc_info()[0]
|
e = sys.exc_info()[0]
|
||||||
self.app.log.error(str(e))
|
self.app.log.error(str(e))
|
||||||
self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
|
self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
|
||||||
self.blockSignals(False)
|
|
||||||
self.ui_connect()
|
|
||||||
self.on_tool_default_add(dia=tool_dia)
|
self.on_tool_default_add(dia=tool_dia)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1419,15 +1415,12 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
if tool_found == 0:
|
if tool_found == 0:
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Tool not in Tools Database. Adding a default tool."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Tool not in Tools Database. Adding a default tool."))
|
||||||
self.on_tool_default_add(dia=tool_dia)
|
self.on_tool_default_add(dia=tool_dia)
|
||||||
self.blockSignals(False)
|
|
||||||
self.ui_connect()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if tool_found > 1:
|
if tool_found > 1:
|
||||||
self.app.inform.emit(
|
self.app.inform.emit(
|
||||||
'[WARNING_NOTCL] %s' % _("Cancelled.\n"
|
'[WARNING_NOTCL] %s' % _("Cancelled.\n"
|
||||||
"Multiple tools for one tool diameter found in Tools Database."))
|
"Multiple tools for one tool diameter found in Tools Database."))
|
||||||
self.blockSignals(False)
|
|
||||||
self.ui_connect()
|
self.ui_connect()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1445,8 +1438,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
'solid_geometry': []
|
'solid_geometry': []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
self.blockSignals(False)
|
|
||||||
self.ui_connect()
|
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
# select the tool just added
|
# select the tool just added
|
||||||
@@ -1461,7 +1452,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
self.app.inform.emit('[success] %s' % _("New tool added to Tool Table from Tools Database."))
|
self.app.inform.emit('[success] %s' % _("New tool added to Tool Table from Tools Database."))
|
||||||
|
|
||||||
def on_tool_default_add(self, dia=None, muted=None):
|
def on_tool_default_add(self, dia=None, muted=None):
|
||||||
self.blockSignals(True)
|
self.ui_disconnect()
|
||||||
|
|
||||||
tool_dia = dia if dia is not None else self.ui.new_tooldia_entry.get_value()
|
tool_dia = dia if dia is not None else self.ui.new_tooldia_entry.get_value()
|
||||||
|
|
||||||
@@ -1469,7 +1460,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
self.build_ui()
|
self.build_ui()
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Please enter a tool diameter with non-zero value, "
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Please enter a tool diameter with non-zero value, "
|
||||||
"in Float format."))
|
"in Float format."))
|
||||||
self.blockSignals(False)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# construct a list of all 'tooluid' in the self.iso_tools
|
# construct a list of all 'tooluid' in the self.iso_tools
|
||||||
@@ -1495,7 +1485,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
})
|
})
|
||||||
# print("after", self.iso_tools)
|
# print("after", self.iso_tools)
|
||||||
|
|
||||||
self.blockSignals(False)
|
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
# select the tool just added
|
# select the tool just added
|
||||||
@@ -1511,7 +1500,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
self.app.inform.emit('[success] %s' % _("Default tool added to Tool Table."))
|
self.app.inform.emit('[success] %s' % _("Default tool added to Tool Table."))
|
||||||
|
|
||||||
def on_tool_edit(self, item):
|
def on_tool_edit(self, item):
|
||||||
self.blockSignals(True)
|
self.ui_disconnect()
|
||||||
|
|
||||||
edited_row = item.row()
|
edited_row = item.row()
|
||||||
editeduid = int(self.ui.tools_table.item(edited_row, 3).text())
|
editeduid = int(self.ui.tools_table.item(edited_row, 3).text())
|
||||||
@@ -1525,17 +1514,21 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
new_tool_dia = float(self.ui.tools_table.item(edited_row, 1).text().replace(',', '.'))
|
new_tool_dia = float(self.ui.tools_table.item(edited_row, 1).text().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number."))
|
||||||
self.blockSignals(False)
|
self.ui_connect()
|
||||||
return
|
return
|
||||||
|
|
||||||
for v in self.iso_tools.values():
|
for v in self.iso_tools.values():
|
||||||
tool_dias = [float('%.*f' % (self.decimals, v[tool_v])) for tool_v in v.keys() if tool_v == 'tooldia']
|
tool_dias = [self.app.dec_format(v[tool_v], self.decimals) for tool_v in v.keys() if tool_v == 'tooldia']
|
||||||
|
|
||||||
# identify the tool that was edited and get it's tooluid
|
# identify the tool that was edited and get it's tooluid
|
||||||
if new_tool_dia not in tool_dias:
|
if new_tool_dia not in tool_dias:
|
||||||
|
try:
|
||||||
self.iso_tools[editeduid]['tooldia'] = deepcopy(float('%.*f' % (self.decimals, new_tool_dia)))
|
self.iso_tools[editeduid]['tooldia'] = deepcopy(float('%.*f' % (self.decimals, new_tool_dia)))
|
||||||
|
except Exception as err:
|
||||||
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Failed."))
|
||||||
|
self.app.log.error("Failed due: %s" % str(err))
|
||||||
|
|
||||||
self.app.inform.emit('[success] %s' % _("Tool from Tool Table was edited."))
|
self.app.inform.emit('[success] %s' % _("Tool from Tool Table was edited."))
|
||||||
self.blockSignals(False)
|
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1548,7 +1541,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
break
|
break
|
||||||
|
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. New diameter value is already in the Tool Table."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. New diameter value is already in the Tool Table."))
|
||||||
self.blockSignals(False)
|
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
def on_tool_delete(self, rows_to_delete=None, all_tools=None):
|
def on_tool_delete(self, rows_to_delete=None, all_tools=None):
|
||||||
@@ -1559,13 +1551,12 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
:param all_tools: delete all tools in the tool table
|
:param all_tools: delete all tools in the tool table
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
self.blockSignals(True)
|
self.ui_disconnect()
|
||||||
|
|
||||||
deleted_tools_list = []
|
deleted_tools_list = []
|
||||||
|
|
||||||
if all_tools:
|
if all_tools:
|
||||||
self.iso_tools.clear()
|
self.iso_tools.clear()
|
||||||
self.blockSignals(False)
|
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1581,7 +1572,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
for t in deleted_tools_list:
|
for t in deleted_tools_list:
|
||||||
self.iso_tools.pop(t, None)
|
self.iso_tools.pop(t, None)
|
||||||
|
|
||||||
self.blockSignals(False)
|
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1599,13 +1589,12 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Delete failed. Select a tool to delete."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Delete failed. Select a tool to delete."))
|
||||||
self.blockSignals(False)
|
self.ui_connect()
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(str(e))
|
log.error(str(e))
|
||||||
|
|
||||||
self.app.inform.emit('[success] %s' % _("Tool(s) deleted from Tool Table."))
|
self.app.inform.emit('[success] %s' % _("Tool(s) deleted from Tool Table."))
|
||||||
self.blockSignals(False)
|
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
def on_generate_buffer(self):
|
def on_generate_buffer(self):
|
||||||
@@ -2965,7 +2954,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
|
|
||||||
self.app.inform.emit('[success] %s' % _("New tool added to Tool Table."))
|
self.app.inform.emit('[success] %s' % _("New tool added to Tool Table."))
|
||||||
|
|
||||||
self.ui_connect()
|
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
# select the tool just added
|
# select the tool just added
|
||||||
@@ -2999,7 +2987,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
self.app.tools_db_tab.ui.cancel_tool_from_db.show()
|
self.app.tools_db_tab.ui.cancel_tool_from_db.show()
|
||||||
|
|
||||||
def reset_fields(self):
|
def reset_fields(self):
|
||||||
self.object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
self.ui.object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def poly2rings(poly):
|
def poly2rings(poly):
|
||||||
|
|||||||
Reference in New Issue
Block a user