- improvements in the Punch Gerber Tool aperture markings

- improved the Geometry Object functionality in regards of Tools DB, deleting a tool and adding a tool
- when using the 'T' shortcut key with Properties Tab in focus and populated with the properties of a Geometry Object made the popped up spinner to have the value autoselected
This commit is contained in:
Marius Stanciu
2020-10-30 04:09:23 +02:00
committed by Marius
parent 21f5090372
commit 084643eb95
5 changed files with 45 additions and 11 deletions

View File

@@ -1015,7 +1015,7 @@ class GeometryObject(FlatCAMObj, Geometry):
self.ui_connect()
def on_tool_add(self, dia=None, new_geo=None):
def on_tool_add(self, clicked_state, dia=None, new_geo=None):
log.debug("GeometryObject.on_add_tool()")
self.ui_disconnect()
@@ -1023,6 +1023,7 @@ class GeometryObject(FlatCAMObj, Geometry):
filename = self.app.tools_database_path()
tool_dia = dia if dia is not None else self.ui.addtool_entry.get_value()
# construct a list of all 'tooluid' in the self.iso_tools
tool_uid_list = [int(tooluid_key) for tooluid_key in self.tools]
@@ -1147,6 +1148,10 @@ class GeometryObject(FlatCAMObj, Geometry):
# update the UI form
self.update_ui()
# if there is at least one tool left in the Tools Table, enable the parameters GUI
if self.ui.geo_tools_table.rowCount() != 0:
self.ui.geo_param_frame.setDisabled(False)
self.app.inform.emit('[success] %s' % _("New tool added to Tool Table from Tools Database."))
def on_tool_default_add(self, dia=None, new_geo=None, muted=None):
@@ -1397,7 +1402,11 @@ class GeometryObject(FlatCAMObj, Geometry):
self.ui_connect()
self.builduiSig.emit()
def on_tool_delete(self, all_tools=None):
def on_tool_delete(self, clicked_signal, all_tools=None):
"""
It's important to keep the not clicked_signal parameter otherwise the signal will go to the all_tools
parameter and I might get all the tool deleted
"""
self.ui_disconnect()
if all_tools is None:

View File

@@ -995,9 +995,8 @@ class GerberObject(FlatCAMObj, Gerber):
else:
visibility = kwargs['visible']
with self.app.proc_container.new(_("Plotting Apertures")):
def job_thread(app_obj):
def job_thread(app_obj):
with self.app.proc_container.new(_("Plotting Apertures")):
try:
if aperture_to_plot_mark in self.apertures:
for elem in app_obj.apertures[aperture_to_plot_mark]['geometry']:
@@ -1022,10 +1021,10 @@ class GerberObject(FlatCAMObj, Gerber):
except Exception as e:
log.debug("GerberObject.plot_aperture() --> %s" % str(e))
if run_thread:
self.app.worker_task.emit({'fcn': job_thread, 'params': [self]})
else:
job_thread(self)
if run_thread:
self.app.worker_task.emit({'fcn': job_thread, 'params': [self]})
else:
job_thread(self)
def clear_plot_apertures(self, aperture='all'):
"""