Explorar el Código

- Gerber Editor: working on aperture selection to show on Aperture Table

Marius Stanciu hace 6 años
padre
commit
fbdcb00eb3
Se han modificado 2 ficheros con 15 adiciones y 1 borrados
  1. 1 0
      README.md
  2. 14 1
      flatcamEditors/FlatCAMGrbEditor.py

+ 1 - 0
README.md

@@ -12,6 +12,7 @@ CAD program, and create G-Code for Isolation routing.
 9.04.2019
 
 - Gerber Editor: added buffer and scale tools
+- Gerber Editor: working on aperture selection to show on Aperture Table
 
 7.04.2019
 

+ 14 - 1
flatcamEditors/FlatCAMGrbEditor.py

@@ -448,7 +448,20 @@ class FCApertureSelect(DrawTool):
                 self.grb_editor_app.selected = []
 
     def click_release(self, point):
-        # self.select_shapes(point)
+        self.grb_editor_app.apertures_table.clearSelection()
+        sel_aperture = set()
+        for storage in self.grb_editor_app.storage_dict:
+            for shape in self.grb_editor_app.storage_dict[storage]['solid_geometry']:
+                if Point(point).within(shape.geo):
+                    sel_aperture.add(storage)
+        try:
+            self.grb_editor_app.apertures_table.itemClicked.disconnect()
+        except:
+            pass
+        for aper in 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)
         return ""
 
     # def select_shapes(self, pos):