- fixed bug in Gerber Editor in which the units conversion wasn't calculated correct
- fixed bug in Gerber Editor in which the QThread that is started on object edit was not stopped at clean up stage - fixed bug in Gerber Editor that kept all the apertures (including the geometry) of a previously edited object that was not saved after edit
This commit is contained in:
@@ -2837,7 +2837,7 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
# start with GRID toolbar activated
|
||||
if self.app.ui.grid_snap_btn.isChecked() is False:
|
||||
self.app.ui.grid_snap_btn.trigger()
|
||||
self.app.on_grid_snap_triggered(state=True)
|
||||
self.app.ui.on_grid_snap_triggered(state=True)
|
||||
|
||||
self.app.ui.popmenu_disable.setVisible(False)
|
||||
self.app.ui.cmenu_newmenu.menuAction().setVisible(False)
|
||||
|
||||
@@ -4100,7 +4100,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
# start with GRID toolbar activated
|
||||
if self.app.ui.grid_snap_btn.isChecked() is False:
|
||||
self.app.ui.grid_snap_btn.trigger()
|
||||
self.app.on_grid_snap_triggered(state=True)
|
||||
self.app.ui.on_grid_snap_triggered(state=True)
|
||||
|
||||
def on_buffer_tool(self):
|
||||
buff_tool = BufferSelectionTool(self.app, self)
|
||||
|
||||
@@ -3703,7 +3703,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
# start with GRID toolbar activated
|
||||
if self.app.ui.grid_snap_btn.isChecked() is False:
|
||||
self.app.ui.grid_snap_btn.trigger()
|
||||
self.app.on_grid_snap_triggered(state=True)
|
||||
self.app.ui.on_grid_snap_triggered(state=True)
|
||||
|
||||
# adjust the visibility of some of the canvas context menu
|
||||
self.app.ui.popmenu_edit.setVisible(False)
|
||||
@@ -3723,6 +3723,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
except Exception as e:
|
||||
log.debug("FlatCAMGrbEditor.deactivate_grb_editor() --> %s" % str(e))
|
||||
|
||||
self.clear()
|
||||
|
||||
# adjust the status of the menu entries related to the editor
|
||||
self.app.ui.menueditedit.setDisabled(False)
|
||||
self.app.ui.menueditok.setDisabled(True)
|
||||
@@ -3731,7 +3733,6 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
self.app.ui.popmenu_save.setVisible(False)
|
||||
|
||||
self.disconnect_canvas_event_handlers()
|
||||
self.clear()
|
||||
self.app.ui.grb_edit_toolbar.setDisabled(True)
|
||||
|
||||
settings = QSettings("Open Source", "FlatCAM")
|
||||
@@ -3939,8 +3940,12 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
pass
|
||||
|
||||
def clear(self):
|
||||
self.thread.quit()
|
||||
|
||||
self.active_tool = None
|
||||
self.selected = []
|
||||
self.storage_dict.clear()
|
||||
self.results.clear()
|
||||
|
||||
self.shapes.clear(update=True)
|
||||
self.tool_shape.clear(update=True)
|
||||
@@ -3970,7 +3975,16 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
|
||||
file_units = self.gerber_obj.units if self.gerber_obj.units else 'IN'
|
||||
app_units = self.app.defaults['units']
|
||||
self.conversion_factor = 25.4 if file_units == 'IN' else (1 / 25.4) if file_units != app_units else 1
|
||||
# self.conversion_factor = 25.4 if file_units == 'IN' else (1 / 25.4) if file_units != app_units else 1
|
||||
|
||||
if file_units == app_units:
|
||||
self.conversion_factor = 1
|
||||
else:
|
||||
if file_units == 'IN':
|
||||
self.conversion_factor = 25.4
|
||||
else:
|
||||
self.conversion_factor = 0.0393700787401575
|
||||
|
||||
|
||||
# Hide original geometry
|
||||
orig_grb_obj.visible = False
|
||||
@@ -4230,8 +4244,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
else:
|
||||
new_grb_name = self.edited_obj_name + "_edit"
|
||||
|
||||
self.app.worker_task.emit({'fcn': self.new_edited_gerber,
|
||||
'params': [new_grb_name, self.storage_dict]})
|
||||
self.app.worker_task.emit({'fcn': self.new_edited_gerber, 'params': [new_grb_name, self.storage_dict]})
|
||||
|
||||
@staticmethod
|
||||
def update_options(obj):
|
||||
|
||||
Reference in New Issue
Block a user