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

This commit is contained in:
Marius Stanciu
2019-09-03 02:17:31 +03:00
committed by Marius
parent a1d874b705
commit 50aacf21c2
2 changed files with 35 additions and 32 deletions

View File

@@ -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 - 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 - 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 - 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 2.09.2019

View File

@@ -1147,7 +1147,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
if self.app.grid_status() == True: if self.app.grid_status() == True:
self.cursor_pos = self.app.geo_editor.snap(self.cursor_pos[0], self.cursor_pos[1]) self.cursor_pos = self.app.geo_editor.snap(self.cursor_pos[0], self.cursor_pos[1])
else: 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() self.app.delete_selection_shape()
curr_pos = self.app.plotcanvas.translate_coords(event.pos) curr_pos = self.app.plotcanvas.translate_coords(event.pos)
@@ -1161,38 +1161,40 @@ class NonCopperClear(FlatCAMTool, Gerber):
pt3 = (x1, y1) pt3 = (x1, y1)
pt4 = (x0, y1) pt4 = (x0, y1)
self.sel_rect.append(Polygon([pt1, pt2, pt3, pt4])) self.sel_rect.append(Polygon([pt1, pt2, pt3, pt4]))
self.first_click = False
return
modifiers = QtWidgets.QApplication.keyboardModifiers() # modifiers = QtWidgets.QApplication.keyboardModifiers()
#
if modifiers == QtCore.Qt.ShiftModifier: # if modifiers == QtCore.Qt.ShiftModifier:
mod_key = 'Shift' # mod_key = 'Shift'
elif modifiers == QtCore.Qt.ControlModifier: # elif modifiers == QtCore.Qt.ControlModifier:
mod_key = 'Control' # mod_key = 'Control'
else: # else:
mod_key = None # mod_key = None
#
if mod_key == self.app.defaults["global_mselect_key"]: # if mod_key == self.app.defaults["global_mselect_key"]:
self.first_click = False # self.first_click = False
return # return
#
self.sel_rect = cascaded_union(self.sel_rect) # self.sel_rect = cascaded_union(self.sel_rect)
self.clear_copper(ncc_obj=self.ncc_obj, # self.clear_copper(ncc_obj=self.ncc_obj,
sel_obj=self.bound_obj, # sel_obj=self.bound_obj,
ncctooldia=ncc_dia_list, # ncctooldia=ncc_dia_list,
isotooldia=iso_dia_list, # isotooldia=iso_dia_list,
has_offset=has_offset, # has_offset=has_offset,
outname=o_name, # outname=o_name,
overlap=overlap, # overlap=overlap,
connect=connect, # connect=connect,
contour=contour, # contour=contour,
rest=rest) # rest=rest)
#
self.app.plotcanvas.vis_disconnect('mouse_release', on_mouse_release) # self.app.plotcanvas.vis_disconnect('mouse_release', on_mouse_release)
self.app.plotcanvas.vis_disconnect('mouse_move', on_mouse_move) # 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_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_move', self.app.on_mouse_move_over_plot)
self.app.plotcanvas.vis_connect('mouse_release', self.app.on_mouse_click_release_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: elif event.button == 2 and self.first_click is False and self.mouse_is_dragging is False:
self.first_click = False self.first_click = False
self.app.plotcanvas.vis_disconnect('mouse_release', on_mouse_release) self.app.plotcanvas.vis_disconnect('mouse_release', on_mouse_release)