controls/DebugVariablePanel/DebugVariableGraphicViewer.py
branchpython3
changeset 3773 ab11852616b8
parent 3765 88fe6fc9fd38
child 3793 9958cf865da0
equal deleted inserted replaced
3772:ec2babbd5698 3773:ab11852616b8
   478         """
   478         """
   479         Export item(s) data to clipboard in CSV format
   479         Export item(s) data to clipboard in CSV format
   480         @param item: Item from which data to export, all items if None
   480         @param item: Item from which data to export, all items if None
   481         (default None)
   481         (default None)
   482         """
   482         """
   483         if item and item.GetData():
   483         if item is not None and item.GetData():
   484             self.ParentWindow.CopyDataToClipboard(
   484             self.ParentWindow.CopyDataToClipboard(
   485                 [(item, [entry for entry in item.GetData()])
   485                 [(item, [entry for entry in item.GetData()])
   486                  for item in (self.Items
   486                  for item in (self.Items
   487                               if item is None
   487                               if item is None
   488                               else [item])])
   488                               else [item])])
   580             # Extract items tick
   580             # Extract items tick
   581             data = items[0].GetData(start_tick, end_tick)
   581             data = items[0].GetData(start_tick, end_tick)
   582 
   582 
   583             # Search for point that tick is the nearest from mouse X position
   583             # Search for point that tick is the nearest from mouse X position
   584             # and set cursor tick to the tick of this point
   584             # and set cursor tick to the tick of this point
   585             if data and len(data) > 0:
   585             if data is not None and len(data) > 0:
   586                 cursor_tick = data[numpy.argmin(
   586                 cursor_tick = data[numpy.argmin(
   587                     numpy.abs(data[:, 0] - event.xdata)), 0]
   587                     numpy.abs(data[:, 0] - event.xdata)), 0]
   588 
   588 
   589         # Update cursor tick
   589         # Update cursor tick
   590         if cursor_tick is not None:
   590         if cursor_tick is not None: