plotWidget.rst 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. .. This is a autogemerated documentation from python docstrings. It was generated using DStrings2Doc.
  2. .. module:: plotWidget
  3. .. _plotWidget:
  4. Module plotWidget
  5. =================
  6. This Module implements the Plot Windows used in KCG
  7. .. py:class:: Enum()
  8. Simple Enum Class (as this is not supported by clean python)
  9. .. py:method:: __init__(self, *args)
  10. .. py:class:: CustomGradientEditorItem(pg.GradientEditorItem)
  11. A Gradient Editor Item to insert a perception linear gradient
  12. .. py:method:: __init__(self, **kwargs)
  13. .. py:method:: addGrad(self, name, grad_dic)
  14. Add a gradient to the list of gradients in the gui
  15. :param name: the name of the gradient
  16. :param grad_dic: the dictionary containing the gradient data
  17. .. py:method:: restoreState(self, state)
  18. Reimplemented of pyqtgraph.GradientEditorItem.restoreState to work with our custom perception linear gradient.
  19. :param state: the state to restore to
  20. .. py:method:: loadPreset(self, name)
  21. Reimplemented of pyqtgraph.GradientEditorItem.loadPreset to work with our custom perception linear gradient.
  22. :param name: the name of the preset to load
  23. .. py:method:: tickMoved(self, tick, pos)
  24. Reimplemented of pyqtgraph.GradientEditorItem.tickMoved to work with our custom perception linear gradient,
  25. which has a lot of steps which would create a lot of ticks in the gradient legend. This removes all but 2
  26. ticks and aligns all the internal ticks accordingly.
  27. :param tick: the tick to move
  28. :param pos: the position to move to
  29. .. py:class:: SpectrogramColorLegendItem(pg.GraphicsWidget)
  30. The Item used as Legend for Heatmap and FFT Plot
  31. .. py:method:: __init__(self, img=None)
  32. Initialise the Legend
  33. :param img: (ImageItem) the image item this is the legend for
  34. .. py:method:: gradient_changed(self)
  35. Proxy function for the gradient_cnahged event of the GradientEditorItem
  36. .. py:method:: set_image(self, img)
  37. Set the Image this is the legend for (only needed if not already done upon initialisation)
  38. :param img: (ImageItem) The image item to use
  39. .. py:method:: update_axis(self)
  40. Update the axis of this legend
  41. .. py:method:: reset_gradient(self)
  42. Reset the gradient to the preset "spectrum"
  43. .. py:method:: image_changed(self, reset_gradient=True)
  44. Call this to adjust the legend when the image has changed
  45. :param reset_gradient: (bool) whether to reset the gradient or not
  46. .. py:method:: getLookupTable(self, nPts, alpha=None)
  47. Get the look up table of the imageitem
  48. :param nPts: (int) number of points the lookup table is defined on
  49. :param alpha: ??
  50. .. py:method:: resizeEvent(self, event)
  51. Handle resizing of the window
  52. .. py:class:: SubPlotWidget(pg.GraphicsLayoutWidget)
  53. The Widget actually containing the plots and images
  54. .. py:method:: __init__(self, dType=FILE)
  55. .. py:method:: _enableCustomAutoRange(self, data)
  56. Enable custom auto range in this plot
  57. :param data: the data to autorange
  58. .. py:method:: _disableCustomAutoRange(self)
  59. Disable the custom autorange and reset it to default
  60. .. py:method:: plot(self, data, xvalueborders=None, yvalueborders=None, autorange=True)
  61. Plot Data. The plot type depends on the type property
  62. :param data: (dataset.DataSet) data to plot
  63. :param xvalueborders: (touple) the borders for the xvalues
  64. :param yvalueborders: (touple) the borders for the yvalues
  65. :param autorange: (bool) whether to perform a autorange or not
  66. .. py:method:: labelAxes(self)
  67. Add Labels to the axis depending on the self.plotType property.
  68. .. py:method:: changeType(self, type)
  69. Change the plot Type
  70. :param type: (int) the new type
  71. .. py:class:: PlotWidget(kcgw.KCGWidgets)
  72. The container Class holding various buttons and controls and the actual plots as SubPlotWidgets instance
  73. .. py:method:: __init__(self, board_id, parent=None, name=None, unique_id=None, type=None, datatype=None, prefix=None, fName=None, data=None)
  74. Initialise the Plot Widgt
  75. :param parent: (QWidget) the parent widget
  76. :param name: (str) name of this widget
  77. :param unique_id: (int) unique id of this widget
  78. :param type: (int) type of this widget
  79. :param datatype: (int) datatype (LIVE or FILE)
  80. :param prefix: (str) prefix for text in the listview in LeftBar
  81. :param fName: (str) the filename (this is only used if datatype is FILE)
  82. :param data: (dataset.DataSet) the data to be plotted
  83. .. py:method:: initUI(self)
  84. Initialise the UI
  85. .. py:method:: change_adc(self)
  86. Change the adc for which data is plotted
  87. .. py:method:: change_adc_compare(self, who)
  88. Change the adcs displayed in a compare plot
  89. .. py:method:: disable_buttons(self, b_bool)
  90. Disable the buttons on this widget
  91. This is not used at the moment
  92. :param b_bool: (bool) disable(False) or enable(True)
  93. .. py:method:: changePlotType(self, type)
  94. Change the plot type to the given type.
  95. :param type: the new type
  96. .. py:method:: plot(self, type=None)
  97. Wrapper function to call the correct plot function depending on type
  98. :param type: (int) the plot type
  99. .. py:method:: plot_live(self, type=None, data=None)
  100. Function to call when livedata is to be plotted
  101. :param type: (int) plot type
  102. :param data: (dataset.DataSet) data to plot
  103. .. py:method:: do_plot(self, type, autorange=True)
  104. Actually perform a plot (this calls SubPlotWidget.plot)
  105. :param type: (int) plot type
  106. :param autorange: (bool) whether to perform a autorange upon plot
  107. .. py:method:: change_identifier_text(self)
  108. Change the text that identifies the plot in the left bar
  109. .. py:method:: closeEvent(self, event)
  110. Event Handler to handle the event of closing this window
  111. :param event: QEvent