- fixed Gerber Editor to work in legacy graphic engine

- fixed NCC tool to work in egacy graphic engine
This commit is contained in:
Marius Stanciu
2019-09-22 02:03:19 +03:00
committed by Marius
parent 63b261685d
commit e8109d2007
4 changed files with 134 additions and 70 deletions

View File

@@ -23,7 +23,8 @@ CAD program, and create G-Code for Isolation routing.
- fixed moving geometry in Tool Measurement in legacy graphic engine - fixed moving geometry in Tool Measurement in legacy graphic engine
- fixed Geometry Editor to work in legacy graphic engine - fixed Geometry Editor to work in legacy graphic engine
- fixed Excellon Editor to work in legacy graphic engine - fixed Excellon Editor to work in legacy graphic engine
- fixed Gerber Editor to work in legacy graphic engine
- fixed NCC tool to work in egacy graphic engine
20.09.2019 20.09.2019

View File

@@ -4150,15 +4150,23 @@ class FlatCAMGrbEditor(QtCore.QObject):
:param event: Event object dispatched by VisPy :param event: Event object dispatched by VisPy
:return: None :return: None
""" """
if self.app.is_legacy is False:
event_pos = event.pos
event_is_dragging = event.is_dragging
right_button = 2
else:
event_pos = (event.xdata, event.ydata)
event_is_dragging = self.app.plotcanvas.is_dragging
right_button = 3
self.pos = self.canvas.translate_coords(event.pos) self.pos = self.canvas.translate_coords(event_pos)
if self.app.grid_status() == True: if self.app.grid_status() == True:
self.pos = self.app.geo_editor.snap(self.pos[0], self.pos[1]) self.pos = self.app.geo_editor.snap(self.pos[0], self.pos[1])
else: else:
self.pos = (self.pos[0], self.pos[1]) self.pos = (self.pos[0], self.pos[1])
if event.button is 1: if event.button == 1:
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: " self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (0, 0)) "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (0, 0))
@@ -4209,8 +4217,16 @@ class FlatCAMGrbEditor(QtCore.QObject):
def on_grb_click_release(self, event): def on_grb_click_release(self, event):
self.modifiers = QtWidgets.QApplication.keyboardModifiers() self.modifiers = QtWidgets.QApplication.keyboardModifiers()
if self.app.is_legacy is False:
event_pos = event.pos
event_is_dragging = event.is_dragging
right_button = 2
else:
event_pos = (event.xdata, event.ydata)
event_is_dragging = self.app.plotcanvas.is_dragging
right_button = 3
pos_canvas = self.canvas.translate_coords(event.pos) pos_canvas = self.canvas.translate_coords(event_pos)
if self.app.grid_status() == True: if self.app.grid_status() == True:
pos = self.app.geo_editor.snap(pos_canvas[0], pos_canvas[1]) pos = self.app.geo_editor.snap(pos_canvas[0], pos_canvas[1])
else: else:
@@ -4219,7 +4235,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
# if the released mouse button was RMB then test if it was a panning motion or not, if not it was a context # if the released mouse button was RMB then test if it was a panning motion or not, if not it was a context
# canvas menu # canvas menu
try: try:
if event.button == 2: # right click if event.button == right_button: # right click
if self.app.ui.popMenu.mouse_is_panning is False: if self.app.ui.popMenu.mouse_is_panning is False:
if self.in_action is False: if self.in_action is False:
try: try:
@@ -4342,8 +4358,16 @@ class FlatCAMGrbEditor(QtCore.QObject):
:param event: Event object dispatched by VisPy SceneCavas :param event: Event object dispatched by VisPy SceneCavas
:return: None :return: None
""" """
if self.app.is_legacy is False:
event_pos = event.pos
event_is_dragging = event.is_dragging
right_button = 2
else:
event_pos = (event.xdata, event.ydata)
event_is_dragging = self.app.plotcanvas.is_dragging
right_button = 3
pos_canvas = self.canvas.translate_coords(event.pos) pos_canvas = self.canvas.translate_coords(event_pos)
event.xdata, event.ydata = pos_canvas[0], pos_canvas[1] event.xdata, event.ydata = pos_canvas[0], pos_canvas[1]
self.x = event.xdata self.x = event.xdata
@@ -4352,7 +4376,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.app.ui.popMenu.mouse_is_panning = False self.app.ui.popMenu.mouse_is_panning = False
# if the RMB is clicked and mouse is moving over plot then 'panning_action' is True # if the RMB is clicked and mouse is moving over plot then 'panning_action' is True
if event.button == 2 and event.is_dragging == 1: if event.button == right_button and event_is_dragging == 1:
self.app.ui.popMenu.mouse_is_panning = True self.app.ui.popMenu.mouse_is_panning = True
return return
@@ -4368,8 +4392,9 @@ class FlatCAMGrbEditor(QtCore.QObject):
# # ## Snap coordinates # # ## Snap coordinates
if self.app.grid_status() == True: if self.app.grid_status() == True:
x, y = self.app.geo_editor.snap(x, y) x, y = self.app.geo_editor.snap(x, y)
# Update cursor if self.app.is_legacy is False:
self.app.app_cursor.set_data(np.asarray([(x, y)]), symbol='++', edge_color='black', size=20) # Update cursor
self.app.app_cursor.set_data(np.asarray([(x, y)]), symbol='++', edge_color='black', size=20)
self.snap_x = x self.snap_x = x
self.snap_y = y self.snap_y = y
@@ -4396,7 +4421,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.draw_utility_geometry(geo=geo) self.draw_utility_geometry(geo=geo)
# # ## Selection area on canvas section # ## # # ## Selection area on canvas section # ##
if event.is_dragging == 1 and event.button == 1: if event_is_dragging == 1 and event.button == 1:
# I make an exception for FCRegion and FCTrack because clicking and dragging while making regions can # I make an exception for FCRegion and FCTrack because clicking and dragging while making regions can
# create strange issues like missing a point in a track/region # create strange issues like missing a point in a track/region
if isinstance(self.active_tool, FCRegion) or isinstance(self.active_tool, FCTrack): if isinstance(self.active_tool, FCRegion) or isinstance(self.active_tool, FCTrack):
@@ -4456,11 +4481,11 @@ class FlatCAMGrbEditor(QtCore.QObject):
if elem in self.selected: if elem in self.selected:
self.plot_shape(geometry=geometric_data, self.plot_shape(geometry=geometric_data,
color=self.app.defaults['global_sel_draw_color'], color=self.app.defaults['global_sel_draw_color'] + 'FF',
linewidth=2) linewidth=2)
else: else:
self.plot_shape(geometry=geometric_data, self.plot_shape(geometry=geometric_data,
color=self.app.defaults['global_draw_color']) color=self.app.defaults['global_draw_color'] + 'FF')
if self.utility: if self.utility:
for elem in self.utility: for elem in self.utility:
@@ -4470,7 +4495,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.shapes.redraw() self.shapes.redraw()
def plot_shape(self, geometry=None, color='black', linewidth=1): def plot_shape(self, geometry=None, color='#000000FF', linewidth=1):
""" """
Plots a geometric object or list of objects without rendering. Plotted objects Plots a geometric object or list of objects without rendering. Plotted objects
are returned as a list. This allows for efficient/animated rendering. are returned as a list. This allows for efficient/animated rendering.
@@ -4486,10 +4511,12 @@ class FlatCAMGrbEditor(QtCore.QObject):
try: try:
self.shapes.add(shape=geometry.geo, color=color, face_color=color, layer=0, tolerance=self.tolerance) self.shapes.add(shape=geometry.geo, color=color, face_color=color, layer=0, tolerance=self.tolerance)
except AttributeError: except AttributeError as e:
if type(geometry) == Point: if type(geometry) == Point:
return return
self.shapes.add(shape=geometry, color=color, face_color=color+'AF', layer=0, tolerance=self.tolerance) if len(color) == 9:
color = color[:7] + 'AF'
self.shapes.add(shape=geometry, color=color, face_color=color, layer=0, tolerance=self.tolerance)
def start_delayed_plot(self, check_period): def start_delayed_plot(self, check_period):
""" """

View File

@@ -388,6 +388,8 @@ class PlotCanvasLegacy(QtCore.QObject):
:return: None :return: None
""" """
factor = 1 / factor
xmin, xmax = self.axes.get_xlim() xmin, xmax = self.axes.get_xlim()
ymin, ymax = self.axes.get_ylim() ymin, ymax = self.axes.get_ylim()
width = xmax - xmin width = xmax - xmin
@@ -465,9 +467,9 @@ class PlotCanvasLegacy(QtCore.QObject):
if self.key is None: if self.key is None:
if event.button == 'up': if event.button == 'up':
self.zoom(1.5, self.mouse)
else:
self.zoom(1 / 1.5, self.mouse) self.zoom(1 / 1.5, self.mouse)
else:
self.zoom(1.5, self.mouse)
return return
if self.key == 'shift': if self.key == 'shift':
@@ -699,6 +701,7 @@ class ShapeCollectionLegacy():
self._face_color = None self._face_color = None
self._visible = True self._visible = True
self._update = False self._update = False
self._alpha = None
self._obj = None self._obj = None
self._gcode_parsed = None self._gcode_parsed = None
@@ -715,10 +718,10 @@ class ShapeCollectionLegacy():
def add(self, shape=None, color=None, face_color=None, alpha=None, visible=True, def add(self, shape=None, color=None, face_color=None, alpha=None, visible=True,
update=False, layer=1, tolerance=0.01, obj=None, gcode_parsed=None, tool_tolerance=None, tooldia=None): update=False, layer=1, tolerance=0.01, obj=None, gcode_parsed=None, tool_tolerance=None, tooldia=None):
self._color = color[:-2] if color is not None else None self._color = color[:-2] if color is not None else None
self._face_color = face_color[:-2] if face_color is not None else None self._face_color = face_color[:-2] if face_color is not None else None
self._alpha = int(face_color[-2:], 16) / 255 if face_color is not None else 0.75 self._alpha = int(face_color[-2:], 16) / 255 if face_color is not None else 0.75
if alpha is not None: if alpha is not None:
self._alpha = alpha self._alpha = alpha
@@ -774,38 +777,39 @@ class ShapeCollectionLegacy():
def redraw(self): def redraw(self):
path_num = 0 path_num = 0
local_shapes = deepcopy(self._shapes)
try: try:
obj_type = self.obj.kind obj_type = self.obj.kind
except AttributeError: except AttributeError:
obj_type = 'utility' obj_type = 'utility'
if self._visible: if self._visible:
for element in self._shapes: for element in local_shapes:
if obj_type == 'excellon': if obj_type == 'excellon':
# Plot excellon (All polygons?) # Plot excellon (All polygons?)
if self.obj.options["solid"] and isinstance(self._shapes[element]['shape'], Polygon): if self.obj.options["solid"] and isinstance(local_shapes[element]['shape'], Polygon):
patch = PolygonPatch(self._shapes[element]['shape'], patch = PolygonPatch(local_shapes[element]['shape'],
facecolor="#C40000", facecolor="#C40000",
edgecolor="#750000", edgecolor="#750000",
alpha=self._shapes[element]['alpha'], alpha=local_shapes[element]['alpha'],
zorder=3) zorder=3)
self.axes.add_patch(patch) self.axes.add_patch(patch)
else: else:
x, y = self._shapes[element]['shape'].exterior.coords.xy x, y = local_shapes[element]['shape'].exterior.coords.xy
self.axes.plot(x, y, 'r-') self.axes.plot(x, y, 'r-')
for ints in self._shapes[element]['shape'].interiors: for ints in local_shapes[element]['shape'].interiors:
x, y = ints.coords.xy x, y = ints.coords.xy
self.axes.plot(x, y, 'o-') self.axes.plot(x, y, 'o-')
elif obj_type== 'geometry': elif obj_type== 'geometry':
if type(self._shapes[element]['shape']) == Polygon: if type(local_shapes[element]['shape']) == Polygon:
x, y = self._shapes[element]['shape'].exterior.coords.xy x, y = local_shapes[element]['shape'].exterior.coords.xy
self.axes.plot(x, y, self._shapes[element]['color'], linestyle='-') self.axes.plot(x, y, local_shapes[element]['color'], linestyle='-')
for ints in self._shapes[element]['shape'].interiors: for ints in local_shapes[element]['shape'].interiors:
x, y = ints.coords.xy x, y = ints.coords.xy
self.axes.plot(x, y, self._shapes[element]['color'], linestyle='-') self.axes.plot(x, y, local_shapes[element]['color'], linestyle='-')
elif type(element) == LineString or type(element) == LinearRing: elif type(element) == LineString or type(element) == LinearRing:
x, y = element.coords.xy x, y = element.coords.xy
self.axes.plot(x, y, self._shapes[element]['color'], marker='-') self.axes.plot(x, y, local_shapes[element]['color'], marker='-')
return return
elif obj_type == 'gerber': elif obj_type == 'gerber':
if self.obj.options["multicolored"]: if self.obj.options["multicolored"]:
@@ -815,67 +819,66 @@ class ShapeCollectionLegacy():
if self.obj.options["solid"]: if self.obj.options["solid"]:
try: try:
patch = PolygonPatch(self._shapes[element]['shape'], patch = PolygonPatch(local_shapes[element]['shape'],
facecolor=self._shapes[element]['face_color'], facecolor=local_shapes[element]['face_color'],
edgecolor=self._shapes[element]['color'], edgecolor=local_shapes[element]['color'],
alpha=self._shapes[element]['alpha'], alpha=local_shapes[element]['alpha'],
zorder=2) zorder=2)
self.axes.add_patch(patch) self.axes.add_patch(patch)
except AssertionError: except AssertionError:
FlatCAMApp.App.log.warning("A geometry component was not a polygon:") FlatCAMApp.App.log.warning("A geometry component was not a polygon:")
FlatCAMApp.App.log.warning(str(element)) FlatCAMApp.App.log.warning(str(element))
else: else:
x, y = self._shapes[element]['shape'].exterior.xy x, y = local_shapes[element]['shape'].exterior.xy
self.axes.plot(x, y, linespec) self.axes.plot(x, y, linespec)
for ints in self._shapes[element]['shape'].interiors: for ints in local_shapes[element]['shape'].interiors:
x, y = ints.coords.xy x, y = ints.coords.xy
self.axes.plot(x, y, linespec) self.axes.plot(x, y, linespec)
elif obj_type == 'cncjob': elif obj_type == 'cncjob':
if self._shapes[element]['face_color'] is None: if local_shapes[element]['face_color'] is None:
linespec = '--' linespec = '--'
linecolor = self._shapes[element]['color'] linecolor = local_shapes[element]['color']
# if geo['kind'][0] == 'C': # if geo['kind'][0] == 'C':
# linespec = 'k-' # linespec = 'k-'
x, y = self._shapes[element]['shape'].coords.xy x, y = local_shapes[element]['shape'].coords.xy
self.axes.plot(x, y, linespec, color=linecolor) self.axes.plot(x, y, linespec, color=linecolor)
else: else:
path_num += 1 path_num += 1
if isinstance(self._shapes[element]['shape'], Polygon): if isinstance(local_shapes[element]['shape'], Polygon):
self.axes.annotate(str(path_num), xy=self._shapes[element]['shape'].exterior.coords[0], self.axes.annotate(str(path_num), xy=local_shapes[element]['shape'].exterior.coords[0],
xycoords='data', fontsize=20) xycoords='data', fontsize=20)
else: else:
self.axes.annotate(str(path_num), xy=self._shapes[element]['shape'].coords[0], self.axes.annotate(str(path_num), xy=local_shapes[element]['shape'].coords[0],
xycoords='data', fontsize=20) xycoords='data', fontsize=20)
patch = PolygonPatch(self._shapes[element]['shape'], patch = PolygonPatch(local_shapes[element]['shape'],
facecolor=self._shapes[element]['face_color'], facecolor=local_shapes[element]['face_color'],
edgecolor=self._shapes[element]['color'], edgecolor=local_shapes[element]['color'],
alpha=self._shapes[element]['alpha'], zorder=2) alpha=local_shapes[element]['alpha'], zorder=2)
self.axes.add_patch(patch) self.axes.add_patch(patch)
elif obj_type == 'utility': elif obj_type == 'utility':
# not a FlatCAM object, must be utility # not a FlatCAM object, must be utility
if self._shapes[element]['face_color']: if local_shapes[element]['face_color']:
try: try:
patch = PolygonPatch(self._shapes[element]['shape'], patch = PolygonPatch(local_shapes[element]['shape'],
facecolor=self._shapes[element]['face_color'], facecolor=local_shapes[element]['face_color'],
edgecolor=self._shapes[element]['color'], edgecolor=local_shapes[element]['color'],
alpha=self._shapes[element]['alpha'], alpha=local_shapes[element]['alpha'],
zorder=2) zorder=2)
self.axes.add_patch(patch) self.axes.add_patch(patch)
except AssertionError: except Exception as e:
FlatCAMApp.App.log.warning("A geometry component was not a polygon:") log.debug("ShapeCollectionLegacy.redraw() --> %s" % str(e))
FlatCAMApp.App.log.warning(str(element))
else: else:
if isinstance(self._shapes[element]['shape'], Polygon): if isinstance(local_shapes[element]['shape'], Polygon):
x, y = self._shapes[element]['shape'].exterior.xy x, y = local_shapes[element]['shape'].exterior.xy
self.axes.plot(x, y, self._shapes[element]['color'], linestyle='-') self.axes.plot(x, y, local_shapes[element]['color'], linestyle='-')
for ints in self._shapes[element]['shape'].interiors: for ints in local_shapes[element]['shape'].interiors:
x, y = ints.coords.xy x, y = ints.coords.xy
self.axes.plot(x, y, self._shapes[element]['color'], linestyle='-') self.axes.plot(x, y, local_shapes[element]['color'], linestyle='-')
else: else:
x, y = self._shapes[element]['shape'].coords.xy x, y = local_shapes[element]['shape'].coords.xy
self.axes.plot(x, y, self._shapes[element]['color'], linestyle='-') self.axes.plot(x, y, local_shapes[element]['color'], linestyle='-')
self.app.plotcanvas.auto_adjust_axes() self.app.plotcanvas.auto_adjust_axes()

View File

@@ -474,6 +474,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.cursor_pos = None self.cursor_pos = None
self.mouse_is_dragging = False self.mouse_is_dragging = False
self.mm = None
self.mr = None
# store here solid_geometry when there are tool with isolation job # store here solid_geometry when there are tool with isolation job
self.solid_geometry = [] self.solid_geometry = []
@@ -1145,20 +1147,36 @@ class NonCopperClear(FlatCAMTool, Gerber):
# To be called after clicking on the plot. # To be called after clicking on the plot.
def on_mouse_release(event): def on_mouse_release(event):
if self.app.is_legacy is False:
event_pos = event.pos
event_is_dragging = event.is_dragging
right_button = 2
else:
event_pos = (event.xdata, event.ydata)
event_is_dragging = self.app.plotcanvas.is_dragging
right_button = 3
try:
x = float(event_pos[0])
y = float(event_pos[1])
except TypeError:
return
event_pos = self.app.plotcanvas.translate_coords((x, y))
# do clear area only for left mouse clicks # do clear area only for left mouse clicks
if event.button == 1: if event.button == 1:
if self.first_click is False: if self.first_click is False:
self.first_click = True self.first_click = True
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click the end point of the paint area.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click the end point of the paint area."))
self.cursor_pos = self.app.plotcanvas.translate_coords(event.pos) self.cursor_pos = self.app.plotcanvas.translate_coords(event_pos)
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. Click to start adding next zone or 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)
if self.app.grid_status() == True: if self.app.grid_status() == True:
curr_pos = self.app.geo_editor.snap(curr_pos[0], curr_pos[1]) curr_pos = self.app.geo_editor.snap(curr_pos[0], curr_pos[1])
@@ -1204,7 +1222,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
# self.app.plotcanvas.graph_event_connect('mouse_move', self.app.on_mouse_move_over_plot) # self.app.plotcanvas.graph_event_connect('mouse_move', self.app.on_mouse_move_over_plot)
# self.app.plotcanvas.graph_event_connect('mouse_release', # self.app.plotcanvas.graph_event_connect('mouse_release',
# self.app.on_mouse_click_release_over_plot) # self.app.on_mouse_click_release_over_plot)
elif event.button == 2 and self.mouse_is_dragging == False: elif event.button == right_button and self.mouse_is_dragging == False:
self.first_click = False self.first_click = False
if self.app.is_legacy is False: if self.app.is_legacy is False:
@@ -1225,6 +1243,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
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,
@@ -1238,10 +1257,24 @@ class NonCopperClear(FlatCAMTool, Gerber):
# called on mouse move # called on mouse move
def on_mouse_move(event): def on_mouse_move(event):
curr_pos = self.app.plotcanvas.translate_coords(event.pos) if self.app.is_legacy is False:
event_pos = event.pos
event_is_dragging = event.is_dragging
right_button = 2
else:
event_pos = (event.xdata, event.ydata)
event_is_dragging = self.app.plotcanvas.is_dragging
right_button = 3
try:
x = float(event_pos[0])
y = float(event_pos[1])
except TypeError:
return
curr_pos = self.app.plotcanvas.translate_coords((x, y))
# detect mouse dragging motion # detect mouse dragging motion
if event.is_dragging is True: if event_is_dragging is True:
self.mouse_is_dragging = True self.mouse_is_dragging = True
else: else:
self.mouse_is_dragging = False self.mouse_is_dragging = False
@@ -1250,15 +1283,15 @@ class NonCopperClear(FlatCAMTool, Gerber):
if self.app.grid_status() == True: if self.app.grid_status() == True:
# Update cursor # Update cursor
curr_pos = self.app.geo_editor.snap(curr_pos[0], curr_pos[1]) curr_pos = self.app.geo_editor.snap(curr_pos[0], curr_pos[1])
self.app.app_cursor.set_data(np.asarray([(curr_pos[0], curr_pos[1])]), if self.app.is_legacy is False:
symbol='++', edge_color='black', size=20) self.app.app_cursor.set_data(np.asarray([(curr_pos[0], curr_pos[1])]),
symbol='++', edge_color='black', size=20)
# draw the utility geometry # draw the utility geometry
if self.first_click: if self.first_click:
self.app.delete_selection_shape() self.app.delete_selection_shape()
self.app.draw_moving_selection_shape(old_coords=(self.cursor_pos[0], self.cursor_pos[1]), self.app.draw_moving_selection_shape(old_coords=(self.cursor_pos[0], self.cursor_pos[1]),
coords=(curr_pos[0], curr_pos[1]), coords=(curr_pos[0], curr_pos[1]))
face_alpha=0.0)
if self.app.is_legacy is False: if self.app.is_legacy is False:
self.app.plotcanvas.graph_event_disconnect('mouse_press', self.app.on_mouse_click_over_plot) self.app.plotcanvas.graph_event_disconnect('mouse_press', self.app.on_mouse_click_over_plot)
self.app.plotcanvas.graph_event_disconnect('mouse_move', self.app.on_mouse_move_over_plot) self.app.plotcanvas.graph_event_disconnect('mouse_move', self.app.on_mouse_move_over_plot)