groupedelements.rst 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. .. This is a autogemerated documentation from python docstrings. It was generated using DStrings2Doc.
  2. .. module:: groupedelements
  3. .. _groupedelements:
  4. Module groupedelements
  5. ======================
  6. Module to easily group elements of a gui
  7. .. py:class:: GroupWarning(Warning)
  8. General Warning Class for GroupedObjects
  9. .. py:class:: GroupedObjects
  10. This class enables grouping of objects to easily access them as groups throughout the gui.
  11. .. py:method:: __init__(self)
  12. Initialise this object
  13. .. py:method:: setFlags(self, flagDict)
  14. Set Flags that define the behaviour of GroupedObjects in various events.
  15. :param flagDict: Dictionary containing the Flags.
  16. Possible Flags are: (They are to be of type bool)
  17. * warn: If an element is deleted and the corresponding entry is encountered by setEnabled, a
  18. Warning is raised if warn is True
  19. * autoremove: If an element is deleted and the corresponding entry is encountered by setEnabled,
  20. the Element will be removed from GroupedObjects if autoremove is True
  21. * exception_on_deleted: If an element is deleted and the corresponding entry is encountered by
  22. setEnabled an Exception will be raised if exception_on_deleted is True
  23. * notify_deletion: If this is set to True a notification will be printed to STDOUT whenever an
  24. autoremove is performed (see above)
  25. .. py:method:: createEmptyGroup(self, group)
  26. Create an empty group
  27. :param group: (str) the name of the group
  28. .. py:method:: addItem(self, group, item)
  29. Add a item or items to a group and thus register with the GroupedObjects object
  30. :param group: (list or str) List of groups or single group where the item is to be added
  31. :param item: (single item or list) What item/s
  32. .. py:method:: setChecked(self, group, state)
  33. Set the state of all the checkboxes in the group
  34. :param group: What group
  35. :param state: True for checked, False for unchecked
  36. .. py:method:: setEnabled(self, group, state, exclude=None)
  37. Set the state of all the items in the group
  38. :param group: What group
  39. :param state: True for enabled, False for disabled
  40. :param exclude: Exclude this item
  41. .. py:method:: addMenuItem(self, group, item)
  42. Deprecated. Use addItem.
  43. .. py:method:: addButton(self, group, item)
  44. Deprecated. Use addItem.
  45. .. py:method:: addCheckbox(self, group, item)
  46. Deprecated. Use addItem.
  47. .. py:method:: removeItem(self, group, item)
  48. Remove an element from a gropu
  49. :param group: (list or str) list of groups or groupname
  50. :param item: (list or item) list of items or item to remove
  51. .. py:method:: removeGroup(self, group)
  52. Remove a group from GroupedObjects. If the group is not registered, a warning will be raised.
  53. :param group: (str) the group to remove
  54. .. py:method:: emptyGroup(self, group)
  55. Unregister all elements from group. (This will delete the group and recreate it.
  56. :param group: (str) the group to clean out.
  57. .. py:method:: getElements(self, group)
  58. Get the elements of a group as list.
  59. :param group: (str) the gorup you want the elements of
  60. :return: (list) Elements in group
  61. .. py:method:: isEnabled(self, group)
  62. Check if a group is enabled.
  63. :param group: (str) the gorup to check.
  64. :return: (bool) State of group
  65. .. py:class:: LivePlotWindows()
  66. Container class to hold open LivePlotWindows.
  67. Added LivePlotWindows will automatically be plotted to on the event of new data.
  68. .. py:method:: __init__(self)
  69. .. py:method:: addWindow(self, board_id, window)
  70. Register a Window.
  71. :param window: (PlotWidget) The window to be added.
  72. .. py:method:: getWindows(self, board_id)
  73. Get the list of registered plot windows.
  74. :return: (list) List of plotWindows
  75. .. py:method:: hasWindows(self, board_id)
  76. Check if Windows are registered.
  77. :return: (bool) True if there are windows and False if not.
  78. .. py:method:: removeWindow(self, board_id, window)
  79. Remove a window from open plot windows
  80. :param window: the window to remove