- fixed aperture move in Gerber Editor

- fixed drills/slots move in Excellon Editor
- RELEASE 8.96
This commit is contained in:
Marius Stanciu 2019-08-24 00:16:23 +03:00 committed by Marius
parent 4ca15b486b
commit f9b5689008
4 changed files with 31 additions and 29 deletions

View File

@ -23,6 +23,9 @@ CAD program, and create G-Code for Isolation routing.
- some changes in GUI tooltips
- modified the way key modifiers are detected in Gerber Editor Selection class and in Excellon Editor Selection class
- updated the translations
- fixed aperture move in Gerber Editor
- fixed drills/slots move in Excellon Editor
- RELEASE 8.96
22.08.2019

View File

@ -1251,6 +1251,9 @@ class FCDrillSelect(DrawTool):
self.storage = self.exc_editor_app.storage_dict
# self.selected = self.exc_editor_app.selected
# here we store the selected tools
self.sel_tools = set()
# here we store all shapes that were selected so we can search for the nearest to our click location
self.sel_storage = FlatCAMExcEditor.make_storage()
@ -1333,14 +1336,13 @@ class FCDrillSelect(DrawTool):
except (TypeError, AttributeError):
pass
sel_tools = set()
self.exc_editor_app.tools_table_exc.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
for shape_s in self.exc_editor_app.selected:
for storage in self.exc_editor_app.storage_dict:
if shape_s in self.exc_editor_app.storage_dict[storage].get_objects():
sel_tools.add(storage)
self.sel_tools.add(storage)
for storage in sel_tools:
for storage in self.sel_tools:
for k, v in self.draw_app.tool2tooldia.items():
if v == storage:
self.exc_editor_app.tools_table_exc.selectRow(int(k) - 1)

View File

@ -2360,10 +2360,6 @@ class FCSelect(DrawTool):
def click_release(self, point):
self.select_shapes(point)
return ""
def select_shapes(self, pos):
# list where we store the overlapped shapes under our mouse left click position
over_shape_list = []
@ -2383,7 +2379,7 @@ class FCSelect(DrawTool):
# 3rd method of click selection -> inconvenient
try:
_, closest_shape = self.storage.nearest(pos)
_, closest_shape = self.storage.nearest(point)
except StopIteration:
return ""
@ -2402,30 +2398,28 @@ class FCSelect(DrawTool):
obj_to_add = over_shape_list[int(FlatCAMGeoEditor.draw_shape_idx)]
key_modifier = QtWidgets.QApplication.keyboardModifiers()
if self.draw_app.app.defaults["global_mselect_key"] == 'Control':
# if CONTROL key is pressed then we add to the selected list the current shape but if it's already
if key_modifier == QtCore.Qt.ShiftModifier:
mod_key = 'Shift'
elif key_modifier == QtCore.Qt.ControlModifier:
mod_key = 'Control'
else:
mod_key = None
if mod_key == self.draw_app.app.defaults["global_mselect_key"]:
# if modifier key is pressed then we add to the selected list the current shape but if it's already
# in the selected list, we removed it. Therefore first click selects, second deselects.
if key_modifier == Qt.ControlModifier:
if obj_to_add in self.draw_app.selected:
self.draw_app.selected.remove(obj_to_add)
else:
self.draw_app.selected.append(obj_to_add)
if obj_to_add in self.draw_app.selected:
self.draw_app.selected.remove(obj_to_add)
else:
self.draw_app.selected = []
self.draw_app.selected.append(obj_to_add)
else:
if key_modifier == Qt.ShiftModifier:
if obj_to_add in self.draw_app.selected:
self.draw_app.selected.remove(obj_to_add)
else:
self.draw_app.selected.append(obj_to_add)
else:
self.draw_app.selected = []
self.draw_app.selected.append(obj_to_add)
self.draw_app.selected = []
self.draw_app.selected.append(obj_to_add)
except Exception as e:
log.error("[ERROR] Something went bad. %s" % str(e))
raise
return ""
class FCMove(FCShapeTool):

View File

@ -2195,6 +2195,9 @@ class FCApertureSelect(DrawTool):
# bending modes using in FCRegion and FCTrack
self.draw_app.bend_mode = 1
# here store the selected apertures
self.sel_aperture = set()
try:
self.grb_editor_app.apertures_table.clearSelection()
except Exception as e:
@ -2229,7 +2232,6 @@ class FCApertureSelect(DrawTool):
def click_release(self, point):
self.grb_editor_app.apertures_table.clearSelection()
sel_aperture = set()
key_modifier = QtWidgets.QApplication.keyboardModifiers()
if key_modifier == QtCore.Qt.ShiftModifier:
@ -2248,13 +2250,14 @@ class FCApertureSelect(DrawTool):
if mod_key == self.grb_editor_app.app.defaults["global_mselect_key"]:
if geo_el in self.draw_app.selected:
self.draw_app.selected.remove(geo_el)
self.sel_aperture.remove(storage)
else:
# add the object to the selected shapes
self.draw_app.selected.append(geo_el)
sel_aperture.add(storage)
self.sel_aperture.add(storage)
else:
self.draw_app.selected.append(geo_el)
sel_aperture.add(storage)
self.sel_aperture.add(storage)
except KeyError:
pass
@ -2265,7 +2268,7 @@ class FCApertureSelect(DrawTool):
log.debug("FlatCAMGrbEditor.FCApertureSelect.click_release() --> %s" % str(e))
self.grb_editor_app.apertures_table.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
for aper in sel_aperture:
for aper in self.sel_aperture:
for row in range(self.grb_editor_app.apertures_table.rowCount()):
if str(aper) == self.grb_editor_app.apertures_table.item(row, 1).text():
self.grb_editor_app.apertures_table.selectRow(row)