Просмотр исходного кода

- in NCC Tool now the Area adding is continuous until RMB is clicked (no key modifier is needed anymore)

Marius Stanciu 6 лет назад
Родитель
Сommit
50aacf21c2
2 измененных файлов с 35 добавлено и 32 удалено
  1. 1 0
      README.md
  2. 34 32
      flatcamTools/ToolNonCopperClear.py

+ 1 - 0
README.md

@@ -15,6 +15,7 @@ CAD program, and create G-Code for Isolation routing.
 - in NCC tool added possibility to choose between the type of tools to be used and when V-shape is used then the tool diameter is calculated from the desired depth of cut and from the V-tip parameters
 - small changes in NCC tool regarding the usage of the V-shape tool
 - fixed the isolation distance in NCC Tool for the tools with iso_op type
+- in NCC Tool now the Area adding is continuous until RMB is clicked (no key modifier is needed anymore)
 
 2.09.2019
 

+ 34 - 32
flatcamTools/ToolNonCopperClear.py

@@ -1147,7 +1147,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
                         if self.app.grid_status() == True:
                             self.cursor_pos = self.app.geo_editor.snap(self.cursor_pos[0], self.cursor_pos[1])
                     else:
-                        self.app.inform.emit(_("Zone added. Right click to finish."))
+                        self.app.inform.emit(_("Zone added. Click to start adding next zone or right click to finish."))
                         self.app.delete_selection_shape()
 
                         curr_pos = self.app.plotcanvas.translate_coords(event.pos)
@@ -1161,38 +1161,40 @@ class NonCopperClear(FlatCAMTool, Gerber):
                         pt3 = (x1, y1)
                         pt4 = (x0, y1)
                         self.sel_rect.append(Polygon([pt1, pt2, pt3, pt4]))
+                        self.first_click = False
+                        return
 
-                        modifiers = QtWidgets.QApplication.keyboardModifiers()
-
-                        if modifiers == QtCore.Qt.ShiftModifier:
-                            mod_key = 'Shift'
-                        elif modifiers == QtCore.Qt.ControlModifier:
-                            mod_key = 'Control'
-                        else:
-                            mod_key = None
-
-                        if mod_key == self.app.defaults["global_mselect_key"]:
-                            self.first_click = False
-                            return
-
-                        self.sel_rect = cascaded_union(self.sel_rect)
-                        self.clear_copper(ncc_obj=self.ncc_obj,
-                                          sel_obj=self.bound_obj,
-                                          ncctooldia=ncc_dia_list,
-                                          isotooldia=iso_dia_list,
-                                          has_offset=has_offset,
-                                          outname=o_name,
-                                          overlap=overlap,
-                                          connect=connect,
-                                          contour=contour,
-                                          rest=rest)
-
-                        self.app.plotcanvas.vis_disconnect('mouse_release', on_mouse_release)
-                        self.app.plotcanvas.vis_disconnect('mouse_move', on_mouse_move)
-
-                        self.app.plotcanvas.vis_connect('mouse_press', self.app.on_mouse_click_over_plot)
-                        self.app.plotcanvas.vis_connect('mouse_move', self.app.on_mouse_move_over_plot)
-                        self.app.plotcanvas.vis_connect('mouse_release', self.app.on_mouse_click_release_over_plot)
+                        # modifiers = QtWidgets.QApplication.keyboardModifiers()
+                        #
+                        # if modifiers == QtCore.Qt.ShiftModifier:
+                        #     mod_key = 'Shift'
+                        # elif modifiers == QtCore.Qt.ControlModifier:
+                        #     mod_key = 'Control'
+                        # else:
+                        #     mod_key = None
+                        #
+                        # if mod_key == self.app.defaults["global_mselect_key"]:
+                        #     self.first_click = False
+                        #     return
+                        #
+                        # self.sel_rect = cascaded_union(self.sel_rect)
+                        # self.clear_copper(ncc_obj=self.ncc_obj,
+                        #                   sel_obj=self.bound_obj,
+                        #                   ncctooldia=ncc_dia_list,
+                        #                   isotooldia=iso_dia_list,
+                        #                   has_offset=has_offset,
+                        #                   outname=o_name,
+                        #                   overlap=overlap,
+                        #                   connect=connect,
+                        #                   contour=contour,
+                        #                   rest=rest)
+                        #
+                        # self.app.plotcanvas.vis_disconnect('mouse_release', on_mouse_release)
+                        # self.app.plotcanvas.vis_disconnect('mouse_move', on_mouse_move)
+                        #
+                        # self.app.plotcanvas.vis_connect('mouse_press', self.app.on_mouse_click_over_plot)
+                        # self.app.plotcanvas.vis_connect('mouse_move', self.app.on_mouse_move_over_plot)
+                        # self.app.plotcanvas.vis_connect('mouse_release', self.app.on_mouse_click_release_over_plot)
                 elif event.button == 2 and self.first_click is False and self.mouse_is_dragging is False:
                     self.first_click = False
                     self.app.plotcanvas.vis_disconnect('mouse_release', on_mouse_release)