- handled the New project event and the object deletion (when all objects are deleted then the exclusion areas will be deleted too)

This commit is contained in:
Marius Stanciu 2020-05-06 04:11:31 +03:00 committed by Marius
parent 343d4ee534
commit afbe2d974f
3 changed files with 18 additions and 12 deletions

View File

@ -10,16 +10,17 @@ CHANGELOG for FlatCAM beta
6.05.2020
- wip in adding Exclusion areas in Geometry object; each Geometry object has now a storage for shapes (exclusion shapes, should I make them more general?)
- changed the above: too many shapes collections and the performance will go down. Created a class Exclusion areas that holds all the require properties and the Object UI elements will connect to it's methods. This way I can apply this to Excellon object too (who are a special type of Geometry Object)
- changed the above: too many shapes collections and the performance will go down. Created a class ExclusionAreas that holds all the require properties and the Object UI elements will connect to it's methods. This way I can apply this feature to Excellon object too (who is a special type of Geometry Object)
- handled the New project event and the object deletion (when all objects are deleted then the exclusion areas will be deleted too)
5.05.2020
- fixed an issue that made the preprocessors comboxes in Preferences not to load and display the saved value fro the file
- fixed an issue that made the preprocessors combo boxes in Preferences not to load and display the saved value fro the file
- some PEP8 corrections
4.05.2020
- in detachable tabs, Linux loose the reference of the detached tab and on close of the detachable tabs will gave a 'segmantation fault' error. Solved it by not deleting the reference in case of Unix-like systems
- in detachable tabs, Linux loose the reference of the detached tab and on close of the detachable tabs will gave a 'segmentation fault' error. Solved it by not deleting the reference in case of Unix-like systems
- some strings added to translation strings
3.05.2020

View File

@ -5130,11 +5130,6 @@ class App(QtCore.QObject):
obj_active.mark_shapes[el].enabled = False
# obj_active.mark_shapes[el] = None
del el
# if the deleted object is GerberObject then make sure to delete the possible mark shapes
if obj_active.kind == 'geometry':
obj_active.exclusion_shapes.clear(update=True)
obj_active.exclusion_shapes.enabled = False
del obj_active.exclusion_shapes
elif isinstance(obj_active, CNCJobObject):
try:
obj_active.text_col.enabled = False
@ -5152,6 +5147,10 @@ class App(QtCore.QObject):
self.inform.emit('%s...' % _("Object(s) deleted"))
# make sure that the selection shape is deleted, too
self.delete_selection_shape()
# if there are no longer objects delete also the exclusion areas shapes
if not self.collection.get_list():
self.exc_areas.clear_shapes()
else:
self.inform.emit('[ERROR_NOTCL] %s' % _("Failed. No object(s) selected..."))
else:
@ -7419,6 +7418,9 @@ class App(QtCore.QObject):
except AttributeError:
pass
# delete the exclusion areas
self.exc_areas.clear_shapes()
# tcl needs to be reinitialized, otherwise old shell variables etc remains
self.shell.init_tcl()

View File

@ -472,10 +472,7 @@ class ExclusionAreas:
data=(curr_pos[0], curr_pos[1]))
def on_clear_area_click(self):
self.exclusion_areas_storage.clear()
FlatCAMTool.delete_moving_selection_shape(self)
self.app.delete_selection_shape()
FlatCAMTool.delete_tool_selection_shape(self, shapes_storage=self.exclusion_shapes)
self.clear_shapes()
# restore the default StyleSheet
self.cnc_button.setStyleSheet("")
@ -487,3 +484,9 @@ class ExclusionAreas:
}
""")
self.cnc_button.setToolTip('%s' % _("Generate the CNC Job object."))
def clear_shapes(self):
self.exclusion_areas_storage.clear()
FlatCAMTool.delete_moving_selection_shape(self)
self.app.delete_selection_shape()
FlatCAMTool.delete_tool_selection_shape(self, shapes_storage=self.exclusion_shapes)