controls/DebugVariablePanel/DebugVariableGraphicViewer.py
branchpython3
changeset 3764 d92c1a3dafa7
parent 3752 9f6f46dbe3ae
child 3765 88fe6fc9fd38
equal deleted inserted replaced
3763:369c7569bf94 3764:d92c1a3dafa7
   487         """
   487         """
   488         Export item(s) data to clipboard in CSV format
   488         Export item(s) data to clipboard in CSV format
   489         @param item: Item from which data to export, all items if None
   489         @param item: Item from which data to export, all items if None
   490         (default None)
   490         (default None)
   491         """
   491         """
   492         self.ParentWindow.CopyDataToClipboard(
   492         if item and item.GetData():
   493             [(item, [entry for entry in item.GetData()])
   493             self.ParentWindow.CopyDataToClipboard(
   494              for item in (self.Items
   494                 [(item, [entry for entry in item.GetData()])
   495                           if item is None
   495                  for item in (self.Items
   496                           else [item])])
   496                               if item is None
       
   497                               else [item])])
   497 
   498 
   498     def OnZoomFitButton(self):
   499     def OnZoomFitButton(self):
   499         """
   500         """
   500         Function called when Viewer Zoom Fit button is pressed
   501         Function called when Viewer Zoom Fit button is pressed
   501         """
   502         """
   588             # Extract items tick
   589             # Extract items tick
   589             data = items[0].GetData(start_tick, end_tick)
   590             data = items[0].GetData(start_tick, end_tick)
   590 
   591 
   591             # Search for point that tick is the nearest from mouse X position
   592             # Search for point that tick is the nearest from mouse X position
   592             # and set cursor tick to the tick of this point
   593             # and set cursor tick to the tick of this point
   593             if len(data) > 0:
   594             if data and len(data) > 0:
   594                 cursor_tick = data[numpy.argmin(
   595                 cursor_tick = data[numpy.argmin(
   595                     numpy.abs(data[:, 0] - event.xdata)), 0]
   596                     numpy.abs(data[:, 0] - event.xdata)), 0]
   596 
   597 
   597         # Update cursor tick
   598         # Update cursor tick
   598         if cursor_tick is not None:
   599         if cursor_tick is not None: