pymodaq 4.2.4__py3-none-any.whl → 5.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pymodaq might be problematic. Click here for more details.

Files changed (399) hide show
  1. pymodaq/__init__.py +30 -23
  2. pymodaq/control_modules/daq_move.py +27 -14
  3. pymodaq/control_modules/daq_move_ui.py +28 -12
  4. pymodaq/control_modules/daq_viewer.py +38 -28
  5. pymodaq/control_modules/daq_viewer_ui.py +6 -6
  6. pymodaq/control_modules/mocks.py +1 -1
  7. pymodaq/control_modules/move_utility_classes.py +19 -10
  8. pymodaq/control_modules/utils.py +18 -12
  9. pymodaq/control_modules/viewer_utility_classes.py +13 -4
  10. pymodaq/dashboard.py +164 -115
  11. pymodaq/examples/custom_app.py +13 -16
  12. pymodaq/examples/custom_viewer.py +6 -6
  13. pymodaq/examples/function_plotter.py +13 -12
  14. pymodaq/examples/parameter_ex.py +50 -25
  15. pymodaq/examples/tcp_client.py +1 -1
  16. pymodaq/extensions/__init__.py +1 -1
  17. pymodaq/extensions/bayesian/bayesian_optimisation.py +15 -12
  18. pymodaq/extensions/bayesian/utils.py +10 -10
  19. pymodaq/extensions/console.py +10 -13
  20. pymodaq/extensions/{daq_logger.py → daq_logger/daq_logger.py} +36 -56
  21. pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger.py +16 -15
  22. pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger_models.py +2 -0
  23. pymodaq/{utils/h5modules → extensions/daq_logger}/h5logging.py +7 -8
  24. pymodaq/extensions/daq_scan.py +153 -247
  25. pymodaq/extensions/daq_scan_ui.py +11 -9
  26. pymodaq/extensions/h5browser.py +8 -8
  27. pymodaq/extensions/pid/__init__.py +6 -3
  28. pymodaq/extensions/pid/daq_move_PID.py +4 -2
  29. pymodaq/extensions/pid/pid_controller.py +15 -12
  30. pymodaq/extensions/pid/utils.py +10 -5
  31. pymodaq/extensions/utils.py +5 -3
  32. pymodaq/post_treatment/load_and_plot.py +10 -7
  33. pymodaq/resources/preset_default.xml +1 -1
  34. pymodaq/utils/array_manipulation.py +4 -384
  35. pymodaq/utils/calibration_camera.py +12 -9
  36. pymodaq/utils/chrono_timer.py +7 -5
  37. pymodaq/utils/config.py +3 -450
  38. pymodaq/utils/daq_utils.py +6 -708
  39. pymodaq/utils/data.py +9 -2774
  40. pymodaq/utils/exceptions.py +0 -4
  41. pymodaq/utils/gui_utils/__init__.py +8 -8
  42. pymodaq/utils/gui_utils/loader_utils.py +38 -0
  43. pymodaq/utils/gui_utils/utils.py +6 -138
  44. pymodaq/utils/h5modules/__init__.py +0 -4
  45. pymodaq/utils/h5modules/module_saving.py +15 -8
  46. pymodaq/utils/leco/__init__.py +2 -2
  47. pymodaq/utils/leco/daq_move_LECODirector.py +2 -2
  48. pymodaq/utils/leco/daq_xDviewer_LECODirector.py +2 -2
  49. pymodaq/utils/leco/director_utils.py +2 -2
  50. pymodaq/utils/leco/leco_director.py +3 -3
  51. pymodaq/utils/leco/pymodaq_listener.py +2 -2
  52. pymodaq/utils/leco/utils.py +1 -1
  53. pymodaq/utils/logger.py +4 -76
  54. pymodaq/utils/managers/batchscan_manager.py +16 -19
  55. pymodaq/utils/managers/modules_manager.py +10 -7
  56. pymodaq/utils/managers/overshoot_manager.py +3 -5
  57. pymodaq/utils/managers/preset_manager.py +37 -15
  58. pymodaq/utils/managers/preset_manager_utils.py +11 -9
  59. pymodaq/utils/managers/remote_manager.py +12 -10
  60. pymodaq/utils/math_utils.py +4 -572
  61. pymodaq/utils/parameter/__init__.py +4 -11
  62. pymodaq/utils/parameter/utils.py +4 -299
  63. pymodaq/utils/scanner/scan_config.py +1 -1
  64. pymodaq/utils/scanner/scan_factory.py +16 -12
  65. pymodaq/utils/{plotting → scanner}/scan_selector.py +19 -20
  66. pymodaq/utils/scanner/scanner.py +10 -8
  67. pymodaq/utils/scanner/scanners/_1d_scanners.py +8 -5
  68. pymodaq/utils/scanner/scanners/_2d_scanners.py +5 -5
  69. pymodaq/utils/scanner/scanners/sequential.py +8 -8
  70. pymodaq/utils/scanner/scanners/tabular.py +9 -9
  71. pymodaq/utils/scanner/utils.py +6 -4
  72. pymodaq/utils/svg/svg_viewer2D.py +3 -4
  73. pymodaq/utils/tcp_ip/serializer.py +64 -16
  74. pymodaq/utils/tcp_ip/tcp_server_client.py +10 -8
  75. {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/METADATA +5 -3
  76. pymodaq-5.0.0.dist-info/RECORD +123 -0
  77. pymodaq/post_treatment/process_to_scalar.py +0 -263
  78. pymodaq/resources/QtDesigner_Ressources/Icon_Library/1d.png +0 -0
  79. pymodaq/resources/QtDesigner_Ressources/Icon_Library/2d.png +0 -0
  80. pymodaq/resources/QtDesigner_Ressources/Icon_Library/3d.png +0 -0
  81. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add2.png +0 -0
  82. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add_Step.png +0 -0
  83. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve.png +0 -0
  84. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve_All.png +0 -0
  85. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Browse_Dir_Path.png +0 -0
  86. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Calculator.png +0 -0
  87. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnGroup.png +0 -0
  88. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnNum.png +0 -0
  89. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnText.png +0 -0
  90. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnTime.png +0 -0
  91. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnWave.png +0 -0
  92. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Close3.png +0 -0
  93. pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll.png +0 -0
  94. pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll_32.png +0 -0
  95. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ColorPicker.png +0 -0
  96. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Contract.png +0 -0
  97. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Create.png +0 -0
  98. pymodaq/resources/QtDesigner_Ressources/Icon_Library/DeleteLayer.png +0 -0
  99. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditOpen.png +0 -0
  100. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditRedo.png +0 -0
  101. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditUndo.png +0 -0
  102. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Ellipse.png +0 -0
  103. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EllipseFilled.png +0 -0
  104. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error.png +0 -0
  105. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ErrorMessage.png +0 -0
  106. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error_16.png +0 -0
  107. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Exit.png +0 -0
  108. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Expand.png +0 -0
  109. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll.png +0 -0
  110. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll_32.png +0 -0
  111. pymodaq/resources/QtDesigner_Ressources/Icon_Library/FFT.png +0 -0
  112. pymodaq/resources/QtDesigner_Ressources/Icon_Library/HLM.ico +0 -0
  113. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help.png +0 -0
  114. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help_32.png +0 -0
  115. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Histogram.png +0 -0
  116. pymodaq/resources/QtDesigner_Ressources/Icon_Library/LUT_LookUpTable.png +0 -0
  117. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass.png +0 -0
  118. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass_24.png +0 -0
  119. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Marker.png +0 -0
  120. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Math.png +0 -0
  121. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MeasurementStudio_32.png +0 -0
  122. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Move.png +0 -0
  123. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveDown.png +0 -0
  124. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveUp.png +0 -0
  125. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Multiply.png +0 -0
  126. pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewFile.png +0 -0
  127. pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewLayer.png +0 -0
  128. pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_File.png +0 -0
  129. pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_Folder.png +0 -0
  130. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open.png +0 -0
  131. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_1D.png +0 -0
  132. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_2D.png +0 -0
  133. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File.png +0 -0
  134. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File_32.png +0 -0
  135. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_sim.png +0 -0
  136. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Options.png +0 -0
  137. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope.png +0 -0
  138. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope_16.png +0 -0
  139. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Pass.png +0 -0
  140. pymodaq/resources/QtDesigner_Ressources/Icon_Library/RGB.png +0 -0
  141. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rectangle.png +0 -0
  142. pymodaq/resources/QtDesigner_Ressources/Icon_Library/RectangleFilled.png +0 -0
  143. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Redo.png +0 -0
  144. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh.png +0 -0
  145. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh2.png +0 -0
  146. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh_32.png +0 -0
  147. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Region.png +0 -0
  148. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rendezvous.png +0 -0
  149. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SELECT.png +0 -0
  150. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save.png +0 -0
  151. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll.png +0 -0
  152. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll_32.png +0 -0
  153. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs.png +0 -0
  154. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs_32.png +0 -0
  155. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_24.png +0 -0
  156. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_32.png +0 -0
  157. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Search.png +0 -0
  158. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SelectPolygon.png +0 -0
  159. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Select_24.png +0 -0
  160. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Settings.png +0 -0
  161. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snap&Save.png +0 -0
  162. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot.png +0 -0
  163. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2.png +0 -0
  164. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_16.png +0 -0
  165. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_32.png +0 -0
  166. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Spreadsheet.png +0 -0
  167. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics.png +0 -0
  168. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics2.png +0 -0
  169. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Status.png +0 -0
  170. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Subtract.png +0 -0
  171. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Vision.png +0 -0
  172. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Volts.png +0 -0
  173. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Wait2.png +0 -0
  174. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_1_1.png +0 -0
  175. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_in.png +0 -0
  176. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_out.png +0 -0
  177. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_to_Selection.png +0 -0
  178. pymodaq/resources/QtDesigner_Ressources/Icon_Library/abort.png +0 -0
  179. pymodaq/resources/QtDesigner_Ressources/Icon_Library/advanced2.png +0 -0
  180. pymodaq/resources/QtDesigner_Ressources/Icon_Library/autoscale.png +0 -0
  181. pymodaq/resources/QtDesigner_Ressources/Icon_Library/b_icon.png +0 -0
  182. pymodaq/resources/QtDesigner_Ressources/Icon_Library/back.png +0 -0
  183. pymodaq/resources/QtDesigner_Ressources/Icon_Library/bg_icon.png +0 -0
  184. pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera.png +0 -0
  185. pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera_snap.png +0 -0
  186. pymodaq/resources/QtDesigner_Ressources/Icon_Library/cartesian.png +0 -0
  187. pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear2.png +0 -0
  188. pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear_ROI.png +0 -0
  189. pymodaq/resources/QtDesigner_Ressources/Icon_Library/close2.png +0 -0
  190. pymodaq/resources/QtDesigner_Ressources/Icon_Library/cluster2.png +0 -0
  191. pymodaq/resources/QtDesigner_Ressources/Icon_Library/color.png +0 -0
  192. pymodaq/resources/QtDesigner_Ressources/Icon_Library/color2.png +0 -0
  193. pymodaq/resources/QtDesigner_Ressources/Icon_Library/continuous.png +0 -0
  194. pymodaq/resources/QtDesigner_Ressources/Icon_Library/data.png +0 -0
  195. pymodaq/resources/QtDesigner_Ressources/Icon_Library/delay.png +0 -0
  196. pymodaq/resources/QtDesigner_Ressources/Icon_Library/download.png +0 -0
  197. pymodaq/resources/QtDesigner_Ressources/Icon_Library/download2.png +0 -0
  198. pymodaq/resources/QtDesigner_Ressources/Icon_Library/error2.png +0 -0
  199. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ethernet.png +0 -0
  200. pymodaq/resources/QtDesigner_Ressources/Icon_Library/exit2.png +0 -0
  201. pymodaq/resources/QtDesigner_Ressources/Icon_Library/fan.png +0 -0
  202. pymodaq/resources/QtDesigner_Ressources/Icon_Library/filter2.png +0 -0
  203. pymodaq/resources/QtDesigner_Ressources/Icon_Library/g_icon.png +0 -0
  204. pymodaq/resources/QtDesigner_Ressources/Icon_Library/gear2.png +0 -0
  205. pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to.png +0 -0
  206. pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_1.png +0 -0
  207. pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_2.png +0 -0
  208. pymodaq/resources/QtDesigner_Ressources/Icon_Library/grab.png +0 -0
  209. pymodaq/resources/QtDesigner_Ressources/Icon_Library/graph.png +0 -0
  210. pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2.png +0 -0
  211. pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2_32.png +0 -0
  212. pymodaq/resources/QtDesigner_Ressources/Icon_Library/green_light.png +0 -0
  213. pymodaq/resources/QtDesigner_Ressources/Icon_Library/grey_icon.png +0 -0
  214. pymodaq/resources/QtDesigner_Ressources/Icon_Library/greyscale.png +0 -0
  215. pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1.png +0 -0
  216. pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1_32.png +0 -0
  217. pymodaq/resources/QtDesigner_Ressources/Icon_Library/home2.png +0 -0
  218. pymodaq/resources/QtDesigner_Ressources/Icon_Library/information2.png +0 -0
  219. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ini.png +0 -0
  220. pymodaq/resources/QtDesigner_Ressources/Icon_Library/integrator.png +0 -0
  221. pymodaq/resources/QtDesigner_Ressources/Icon_Library/joystick.png +0 -0
  222. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green.png +0 -0
  223. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green_16.png +0 -0
  224. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red.png +0 -0
  225. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red_16.png +0 -0
  226. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow.png +0 -0
  227. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow_16.png +0 -0
  228. pymodaq/resources/QtDesigner_Ressources/Icon_Library/limiter.png +0 -0
  229. pymodaq/resources/QtDesigner_Ressources/Icon_Library/load_ROI.png +0 -0
  230. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meshPlot.png +0 -0
  231. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter.png +0 -0
  232. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter2.png +0 -0
  233. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter_32.png +0 -0
  234. pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_contour.png +0 -0
  235. pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_straight_line.png +0 -0
  236. pymodaq/resources/QtDesigner_Ressources/Icon_Library/movie.png +0 -0
  237. pymodaq/resources/QtDesigner_Ressources/Icon_Library/multi_point.png +0 -0
  238. pymodaq/resources/QtDesigner_Ressources/Icon_Library/multiplexer.png +0 -0
  239. pymodaq/resources/QtDesigner_Ressources/Icon_Library/new.png +0 -0
  240. pymodaq/resources/QtDesigner_Ressources/Icon_Library/openArrow.png +0 -0
  241. pymodaq/resources/QtDesigner_Ressources/Icon_Library/openTree.png +0 -0
  242. pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope2.png +0 -0
  243. pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope3.png +0 -0
  244. pymodaq/resources/QtDesigner_Ressources/Icon_Library/overlay.png +0 -0
  245. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2.png +0 -0
  246. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2_16.png +0 -0
  247. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass_32.png +0 -0
  248. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pause.png +0 -0
  249. pymodaq/resources/QtDesigner_Ressources/Icon_Library/permute.png +0 -0
  250. pymodaq/resources/QtDesigner_Ressources/Icon_Library/phase.png +0 -0
  251. pymodaq/resources/QtDesigner_Ressources/Icon_Library/play.png +0 -0
  252. pymodaq/resources/QtDesigner_Ressources/Icon_Library/polar.png +0 -0
  253. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pole_zero.png +0 -0
  254. pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerMeter.png +0 -0
  255. pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch.png +0 -0
  256. pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch_16.png +0 -0
  257. pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2.png +0 -0
  258. pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2_32.png +0 -0
  259. pymodaq/resources/QtDesigner_Ressources/Icon_Library/properties.png +0 -0
  260. pymodaq/resources/QtDesigner_Ressources/Icon_Library/r_icon.png +0 -0
  261. pymodaq/resources/QtDesigner_Ressources/Icon_Library/radiocontrolbutton.png +0 -0
  262. pymodaq/resources/QtDesigner_Ressources/Icon_Library/read2.png +0 -0
  263. pymodaq/resources/QtDesigner_Ressources/Icon_Library/red_light.png +0 -0
  264. pymodaq/resources/QtDesigner_Ressources/Icon_Library/remove.png +0 -0
  265. pymodaq/resources/QtDesigner_Ressources/Icon_Library/reset.png +0 -0
  266. pymodaq/resources/QtDesigner_Ressources/Icon_Library/rgb_icon.png +0 -0
  267. pymodaq/resources/QtDesigner_Ressources/Icon_Library/robot.png +0 -0
  268. pymodaq/resources/QtDesigner_Ressources/Icon_Library/rotation2.png +0 -0
  269. pymodaq/resources/QtDesigner_Ressources/Icon_Library/run2.png +0 -0
  270. pymodaq/resources/QtDesigner_Ressources/Icon_Library/run_all.png +0 -0
  271. pymodaq/resources/QtDesigner_Ressources/Icon_Library/saturation.png +0 -0
  272. pymodaq/resources/QtDesigner_Ressources/Icon_Library/saveTree.png +0 -0
  273. pymodaq/resources/QtDesigner_Ressources/Icon_Library/save_ROI.png +0 -0
  274. pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_horizontally.png +0 -0
  275. pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_vertically.png +0 -0
  276. pymodaq/resources/QtDesigner_Ressources/Icon_Library/search2.png +0 -0
  277. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select2.png +0 -0
  278. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all.png +0 -0
  279. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all2.png +0 -0
  280. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_none.png +0 -0
  281. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence.png +0 -0
  282. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence2.png +0 -0
  283. pymodaq/resources/QtDesigner_Ressources/Icon_Library/snap.png +0 -0
  284. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sort_ascend.png +0 -0
  285. pymodaq/resources/QtDesigner_Ressources/Icon_Library/spectrumAnalyzer.png +0 -0
  286. pymodaq/resources/QtDesigner_Ressources/Icon_Library/start.png +0 -0
  287. pymodaq/resources/QtDesigner_Ressources/Icon_Library/status_cancelled.png +0 -0
  288. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop.png +0 -0
  289. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop2.png +0 -0
  290. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop3.png +0 -0
  291. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop_all.png +0 -0
  292. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sum.png +0 -0
  293. pymodaq/resources/QtDesigner_Ressources/Icon_Library/surfacePlot.png +0 -0
  294. pymodaq/resources/QtDesigner_Ressources/Icon_Library/tree.png +0 -0
  295. pymodaq/resources/QtDesigner_Ressources/Icon_Library/updateTree.png +0 -0
  296. pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility2.png +0 -0
  297. pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility_small.png +0 -0
  298. pymodaq/resources/QtDesigner_Ressources/Icon_Library/vector.png +0 -0
  299. pymodaq/resources/QtDesigner_Ressources/Icon_Library/verify.png +0 -0
  300. pymodaq/resources/QtDesigner_Ressources/Icon_Library/video.png +0 -0
  301. pymodaq/resources/QtDesigner_Ressources/Icon_Library/wait.png +0 -0
  302. pymodaq/resources/QtDesigner_Ressources/Icon_Library/waterfallPlot.png +0 -0
  303. pymodaq/resources/QtDesigner_Ressources/Icon_Library/watershed.png +0 -0
  304. pymodaq/resources/QtDesigner_Ressources/Icon_Library/yellow_light.png +0 -0
  305. pymodaq/resources/QtDesigner_Ressources/Icon_Library/zip_file.png +0 -0
  306. pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomAuto.png +0 -0
  307. pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomReset.png +0 -0
  308. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.bat +0 -2
  309. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.qrc +0 -234
  310. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +0 -127150
  311. pymodaq/resources/QtDesigner_Ressources/icons.svg +0 -142
  312. pymodaq/resources/VERSION +0 -1
  313. pymodaq/resources/config_template.toml +0 -94
  314. pymodaq/resources/triangulation_data.npy +0 -0
  315. pymodaq/utils/abstract/__init__.py +0 -48
  316. pymodaq/utils/db/__init__.py +0 -0
  317. pymodaq/utils/db/db_logger/__init__.py +0 -0
  318. pymodaq/utils/enums.py +0 -76
  319. pymodaq/utils/factory.py +0 -82
  320. pymodaq/utils/gui_utils/custom_app.py +0 -133
  321. pymodaq/utils/gui_utils/dock.py +0 -107
  322. pymodaq/utils/gui_utils/file_io.py +0 -93
  323. pymodaq/utils/gui_utils/layout.py +0 -34
  324. pymodaq/utils/gui_utils/list_picker.py +0 -38
  325. pymodaq/utils/gui_utils/widgets/__init__.py +0 -5
  326. pymodaq/utils/gui_utils/widgets/label.py +0 -24
  327. pymodaq/utils/gui_utils/widgets/lcd.py +0 -111
  328. pymodaq/utils/gui_utils/widgets/push.py +0 -149
  329. pymodaq/utils/gui_utils/widgets/qled.py +0 -62
  330. pymodaq/utils/gui_utils/widgets/spinbox.py +0 -24
  331. pymodaq/utils/gui_utils/widgets/table.py +0 -263
  332. pymodaq/utils/gui_utils/widgets/tree_layout.py +0 -188
  333. pymodaq/utils/gui_utils/widgets/tree_toml.py +0 -102
  334. pymodaq/utils/h5modules/backends.py +0 -1022
  335. pymodaq/utils/h5modules/browsing.py +0 -625
  336. pymodaq/utils/h5modules/data_saving.py +0 -1105
  337. pymodaq/utils/h5modules/exporter.py +0 -119
  338. pymodaq/utils/h5modules/exporters/__init__.py +0 -0
  339. pymodaq/utils/h5modules/exporters/base.py +0 -111
  340. pymodaq/utils/h5modules/exporters/flimj.py +0 -63
  341. pymodaq/utils/h5modules/exporters/hyperspy.py +0 -143
  342. pymodaq/utils/h5modules/saving.py +0 -866
  343. pymodaq/utils/h5modules/utils.py +0 -115
  344. pymodaq/utils/managers/action_manager.py +0 -489
  345. pymodaq/utils/managers/parameter_manager.py +0 -282
  346. pymodaq/utils/managers/roi_manager.py +0 -726
  347. pymodaq/utils/messenger.py +0 -66
  348. pymodaq/utils/parameter/ioxml.py +0 -542
  349. pymodaq/utils/parameter/pymodaq_ptypes/__init__.py +0 -38
  350. pymodaq/utils/parameter/pymodaq_ptypes/bool.py +0 -31
  351. pymodaq/utils/parameter/pymodaq_ptypes/date.py +0 -126
  352. pymodaq/utils/parameter/pymodaq_ptypes/filedir.py +0 -143
  353. pymodaq/utils/parameter/pymodaq_ptypes/itemselect.py +0 -265
  354. pymodaq/utils/parameter/pymodaq_ptypes/led.py +0 -44
  355. pymodaq/utils/parameter/pymodaq_ptypes/list.py +0 -150
  356. pymodaq/utils/parameter/pymodaq_ptypes/numeric.py +0 -18
  357. pymodaq/utils/parameter/pymodaq_ptypes/pixmap.py +0 -175
  358. pymodaq/utils/parameter/pymodaq_ptypes/slide.py +0 -145
  359. pymodaq/utils/parameter/pymodaq_ptypes/table.py +0 -135
  360. pymodaq/utils/parameter/pymodaq_ptypes/tableview.py +0 -149
  361. pymodaq/utils/parameter/pymodaq_ptypes/text.py +0 -142
  362. pymodaq/utils/plotting/__init__.py +0 -0
  363. pymodaq/utils/plotting/data_viewers/__init__.py +0 -10
  364. pymodaq/utils/plotting/data_viewers/base.py +0 -286
  365. pymodaq/utils/plotting/data_viewers/viewer.py +0 -274
  366. pymodaq/utils/plotting/data_viewers/viewer0D.py +0 -298
  367. pymodaq/utils/plotting/data_viewers/viewer1D.py +0 -826
  368. pymodaq/utils/plotting/data_viewers/viewer1Dbasic.py +0 -231
  369. pymodaq/utils/plotting/data_viewers/viewer2D.py +0 -1118
  370. pymodaq/utils/plotting/data_viewers/viewer2D_basic.py +0 -146
  371. pymodaq/utils/plotting/data_viewers/viewerND.py +0 -800
  372. pymodaq/utils/plotting/gant_chart.py +0 -123
  373. pymodaq/utils/plotting/image_viewer.py +0 -97
  374. pymodaq/utils/plotting/items/__init__.py +0 -0
  375. pymodaq/utils/plotting/items/axis_scaled.py +0 -93
  376. pymodaq/utils/plotting/items/crosshair.py +0 -94
  377. pymodaq/utils/plotting/items/image.py +0 -388
  378. pymodaq/utils/plotting/navigator.py +0 -353
  379. pymodaq/utils/plotting/plotter/plotter.py +0 -94
  380. pymodaq/utils/plotting/plotter/plotters/__init__.py +0 -0
  381. pymodaq/utils/plotting/plotter/plotters/matplotlib_plotters.py +0 -134
  382. pymodaq/utils/plotting/plotter/plotters/qt_plotters.py +0 -78
  383. pymodaq/utils/plotting/utils/__init__.py +0 -0
  384. pymodaq/utils/plotting/utils/axes_viewer.py +0 -88
  385. pymodaq/utils/plotting/utils/filter.py +0 -585
  386. pymodaq/utils/plotting/utils/lineout.py +0 -226
  387. pymodaq/utils/plotting/utils/plot_utils.py +0 -579
  388. pymodaq/utils/plotting/utils/signalND.py +0 -1347
  389. pymodaq/utils/plotting/widgets.py +0 -76
  390. pymodaq/utils/qvariant.py +0 -12
  391. pymodaq/utils/slicing.py +0 -63
  392. pymodaq/utils/units.py +0 -216
  393. pymodaq-4.2.4.dist-info/RECORD +0 -438
  394. /pymodaq/{post_treatment/daq_analysis → extensions/daq_logger}/__init__.py +0 -0
  395. /pymodaq/{utils/abstract/logger.py → extensions/daq_logger/abstract.py} +0 -0
  396. /pymodaq/{resources/QtDesigner_Ressources → extensions/daq_logger/db}/__init__.py +0 -0
  397. {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/WHEEL +0 -0
  398. {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/entry_points.txt +0 -0
  399. {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,149 +0,0 @@
1
- from qtpy import QtWidgets, QtCore
2
- from collections import OrderedDict
3
- from pyqtgraph.parametertree.Parameter import ParameterItem
4
- from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem
5
- from pyqtgraph.parametertree import Parameter
6
- from pyqtgraph.widgets import ColorButton
7
-
8
-
9
- class TableViewCustom(QtWidgets.QTableView):
10
- """
11
- ============== ===========================
12
- *Attributes** **Type**
13
- *valuechanged* instance of pyqt Signal
14
- *QtWidgets* instance of QTableWidget
15
- ============== ===========================
16
- """
17
-
18
- valueChanged = QtCore.Signal(list)
19
- add_data_signal = QtCore.Signal(int)
20
- remove_row_signal = QtCore.Signal(int)
21
- load_data_signal = QtCore.Signal()
22
- save_data_signal = QtCore.Signal()
23
-
24
- def __init__(self, menu=False):
25
- super().__init__()
26
- self.setmenu(menu)
27
-
28
- def setmenu(self, status):
29
- if status:
30
- self.menu = QtWidgets.QMenu()
31
- self.menu.addAction('Add new', self.add)
32
- self.menu.addAction('Remove selected row', self.remove)
33
- self.menu.addAction('Clear all', self.clear)
34
- self.menu.addSeparator()
35
- self.menu.addAction('Load as txt', lambda: self.load_data_signal.emit())
36
- self.menu.addAction('Save as txt', lambda: self.save_data_signal.emit())
37
- else:
38
- self.menu = None
39
-
40
- def clear(self):
41
- self.model().clear()
42
-
43
- def add(self):
44
- self.add_data_signal.emit(self.currentIndex().row())
45
-
46
- def remove(self):
47
- self.remove_row_signal.emit(self.currentIndex().row())
48
-
49
- def data_has_changed(self, topleft, bottomright, roles):
50
- self.valueChanged.emit([topleft, bottomright, roles])
51
-
52
- def get_table_value(self):
53
- """
54
-
55
- """
56
- return self.model()
57
-
58
- def set_table_value(self, data_model):
59
- """
60
-
61
- """
62
- try:
63
- self.setModel(data_model)
64
- self.model().dataChanged.connect(self.data_has_changed)
65
- except Exception as e:
66
- pass
67
-
68
- def contextMenuEvent(self, event):
69
- if self.menu is not None:
70
- self.menu.exec(event.globalPos())
71
-
72
-
73
- class TableViewParameterItem(WidgetParameterItem):
74
- def makeWidget(self):
75
- """
76
- Make and initialize an instance of Table_custom.
77
-
78
- Returns
79
- -------
80
- table : instance of Table_custom.
81
- The initialized table.
82
-
83
- See Also
84
- --------
85
- Table_custom
86
- """
87
- self.asSubItem = True
88
- self.hideWidget = False
89
- menu = False
90
- opts = self.param.opts
91
- if 'menu' in opts:
92
- menu = opts['menu']
93
- w = TableViewCustom(menu=menu)
94
-
95
- if 'tip' in opts:
96
- w.setToolTip(opts['tip'])
97
- w.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch)
98
- #w.setMaximumHeight(200)
99
- # self.table.setReadOnly(self.param.opts.get('readonly', False))
100
- w.value = w.get_table_value
101
- w.setValue = w.set_table_value
102
- w.sigChanged = w.valueChanged
103
- return w
104
-
105
- def optsChanged(self, param, opts):
106
- """
107
- | Called when any options are changed that are not name, value, default, or limits.
108
- |
109
- | If widget is a SpinBox, pass options straight through.
110
- | So that only the display label is shown when visible option is toggled.
111
-
112
- =============== ================================== ==============================
113
- **Parameters** **Type** **Description**
114
- *param* instance of pyqtgraph parameter the parameter to check
115
- *opts* string list the associated options list
116
- =============== ================================== ==============================
117
-
118
- See Also
119
- --------
120
- optsChanged
121
- """
122
- # print "opts changed:", opts
123
- ParameterItem.optsChanged(self, param, opts)
124
-
125
- if 'delegate' in opts:
126
- styledItemDelegate = QtWidgets.QStyledItemDelegate()
127
- styledItemDelegate.setItemEditorFactory(opts['delegate']())
128
- self.widget.setItemDelegate(styledItemDelegate)
129
-
130
- if 'menu' in opts:
131
- self.widget.setmenu(opts['menu'])
132
-
133
-
134
- class TableViewParameter(Parameter):
135
- """
136
- =============== =================================
137
- **Attributes** **Type**
138
- *itemClass* instance of TableParameterItem
139
- *Parameter* instance of pyqtgraph parameter
140
- =============== =================================
141
- """
142
- itemClass = TableViewParameterItem
143
-
144
- def setValue(self, value):
145
- self.opts['value'] = value
146
- self.sigValueChanged.emit(self, value)
147
-
148
-
149
-
@@ -1,142 +0,0 @@
1
- import os
2
- from pathlib import Path
3
- from qtpy import QtWidgets, QtCore, QtGui
4
- from pyqtgraph.parametertree.Parameter import ParameterItem
5
- from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem
6
- from pyqtgraph.parametertree import Parameter
7
-
8
-
9
- class PlainTextWidget(QtWidgets.QWidget):
10
- """
11
- ================ ========================
12
- **Attributes** **Type**
13
- *value_changed* instance of pyqt Signal
14
- ================ ========================
15
-
16
- See Also
17
- --------
18
- initUI, emitsignal
19
- """
20
- value_changed = QtCore.Signal(str)
21
-
22
- def __init__(self):
23
-
24
- super().__init__()
25
-
26
- self.initUI()
27
- self.text_edit.textChanged.connect(self.emitsignal)
28
-
29
- def emitsignal(self):
30
- """
31
- Emit the value changed signal from the text_edit attribute.
32
- """
33
- text = self.text_edit.toPlainText()
34
- self.value_changed.emit(text)
35
-
36
- def set_value(self, txt):
37
- """
38
- Set the value of the text_edit attribute.
39
-
40
- =============== =========== ================================
41
- **Parameters** **Type** **Description**
42
- *txt* string the string value to be setted
43
- =============== =========== ================================
44
- """
45
- self.text_edit.setPlainText(txt)
46
-
47
- def get_value(self):
48
- """
49
- Get the value of the text_edit attribute.
50
-
51
- Returns
52
- -------
53
- string
54
- The string value of text_edit.
55
- """
56
- return self.text_edit.toPlainText()
57
-
58
- def initUI(self):
59
- """
60
- Init the User Interface.
61
- """
62
-
63
- self.hor_layout = QtWidgets.QHBoxLayout()
64
- self.text_edit = QtWidgets.QPlainTextEdit()
65
- self.text_edit.setReadOnly(True)
66
- self.text_edit.setMaximumHeight(50)
67
-
68
- self.add_pb = QtWidgets.QPushButton()
69
- self.add_pb.setText("")
70
- icon3 = QtGui.QIcon()
71
- icon3.addPixmap(QtGui.QPixmap(":/icons/Icon_Library/Add2.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
72
- self.add_pb.setIcon(icon3)
73
- self.hor_layout.addWidget(self.text_edit)
74
-
75
- verlayout = QtWidgets.QVBoxLayout()
76
- verlayout.addWidget(self.add_pb)
77
- verlayout.addStretch()
78
- self.hor_layout.addLayout(verlayout)
79
- self.hor_layout.setSpacing(0)
80
- self.setLayout(self.hor_layout)
81
-
82
-
83
- class PlainTextParameterItem(WidgetParameterItem):
84
-
85
- def __init__(self, param, depth):
86
- super().__init__(param, depth)
87
- self.hideWidget = False
88
- self.subItem = QtWidgets.QTreeWidgetItem()
89
- self.addChild(self.subItem)
90
-
91
- def treeWidgetChanged(self):
92
- # # TODO: fix so that superclass method can be called
93
- # # (WidgetParameter should just natively support this style)
94
- # WidgetParameterItem.treeWidgetChanged(self)
95
- if self.treeWidget() is not None:
96
- self.treeWidget().setFirstItemColumnSpanned(self.subItem, True)
97
- self.treeWidget().setItemWidget(self.subItem, 0, self.w)
98
-
99
- # for now, these are copied from ParameterItem.treeWidgetChanged
100
- self.setHidden(not self.param.opts.get('visible', True))
101
- self.setExpanded(self.param.opts.get('expanded', True))
102
-
103
- def makeWidget(self):
104
- """
105
- Make and initialize an instance of Plain_text_pb object from parameter options dictionnary (using 'readonly' key).
106
-
107
- Returns
108
- -------
109
- Plain_text_pb object
110
- The initialized object.
111
-
112
- See Also
113
- --------
114
- Plain_text_pb, buttonClicked
115
- """
116
- self.w = PlainTextWidget()
117
- self.w.text_edit.setReadOnly(self.param.opts.get('readonly', False))
118
- self.w.value = self.w.get_value
119
- self.w.setValue = self.w.set_value
120
- self.w.sigChanged = self.w.value_changed
121
- self.w.add_pb.clicked.connect(self.buttonClicked)
122
- return self.w
123
-
124
- def buttonClicked(self):
125
- text, ok = QtWidgets.QInputDialog.getText(None, "Enter a value to add to the parameter",
126
- "String value:", QtWidgets.QLineEdit.Normal)
127
- if ok and not (text == ""):
128
- self.param.setValue(self.param.value() + '\n' + text)
129
-
130
-
131
- class PlainTextPbParameter(Parameter):
132
- """Editable string; displayed as large text box in the tree."""
133
- itemClass = PlainTextParameterItem
134
- sigActivated = QtCore.Signal(object)
135
-
136
- def activate(self):
137
- """
138
- Send the Activated signal.
139
- """
140
- self.sigActivated.emit(self)
141
- self.emitStateChanged('activated', None)
142
-
File without changes
@@ -1,10 +0,0 @@
1
- from .base import ViewersEnum
2
-
3
- from .viewer0D import Viewer0D
4
- from .viewer1D import Viewer1D
5
- from .viewer2D import Viewer2D
6
- from .viewerND import ViewerND
7
- from .viewer import ViewerDispatcher
8
-
9
-
10
- DATA_TYPES = ['Data0D', 'Data1D', 'Data2D', 'DataND']
@@ -1,286 +0,0 @@
1
-
2
- from typing import Union, TYPE_CHECKING, Iterable
3
-
4
- from pymodaq.utils.enums import BaseEnum
5
- from pyqtgraph.graphicsItems import InfiniteLine, ROI
6
- from qtpy import QtWidgets
7
- from qtpy.QtCore import QObject, Signal, QRectF
8
-
9
- from pymodaq.utils.data import DataToExport, DataWithAxes, DataDim, DataDistribution
10
- from pymodaq.utils.exceptions import ViewerError
11
- from pymodaq.utils.plotting.utils.plot_utils import RoiInfo
12
-
13
- if TYPE_CHECKING:
14
- from pymodaq.utils.plotting.data_viewers.viewer0D import Viewer0D
15
- from pymodaq.utils.plotting.data_viewers.viewer1D import Viewer1D
16
- from pymodaq.utils.plotting.data_viewers.viewer2D import Viewer2D
17
- from pymodaq.utils.plotting.data_viewers.viewerND import ViewerND
18
-
19
-
20
- class ViewersEnum(BaseEnum):
21
- """enum relating a given viewer with data type"""
22
- Viewer0D = 'Data0D'
23
- Viewer1D = 'Data1D'
24
- Viewer2D = 'Data2D'
25
- ViewerND = 'DataND'
26
- ViewerSequential = 'DataSequential'
27
-
28
- def get_dim(self):
29
- return self.value.split('Data')[1].split('D')[0]
30
-
31
- def increase_dim(self, ndim: int):
32
- dim = self.get_dim()
33
- if dim != 'N':
34
- dim_as_int = int(dim) + ndim
35
- if dim_as_int > 2:
36
- dim = 'N'
37
- else:
38
- dim = str(dim_as_int)
39
- else:
40
- dim = 'N'
41
- return ViewersEnum[f'Viewer{dim}D']
42
-
43
- @classmethod
44
- def from_n_axes(cls, n_axes: int):
45
- if n_axes == 0:
46
- return ViewersEnum['Viewer0D']
47
- elif n_axes == 1:
48
- return ViewersEnum['Viewer1D']
49
- elif n_axes == 2:
50
- return ViewersEnum['Viewer2D']
51
- elif n_axes > 2:
52
- return ViewersEnum['ViewerND']
53
-
54
- @staticmethod
55
- def get_viewers_enum_from_metadata(dim: DataDim,
56
- distribution: DataDistribution,
57
- n_nav_axes: int,
58
- n_sig_indexes: int,
59
- shape_len: int,
60
- size: int) -> 'ViewersEnum':
61
- if dim.name == 'Data0D':
62
- viewer = 'Viewer0D'
63
- elif dim.name == 'Data1D':
64
- viewer = 'Viewer1D'
65
- elif dim.name == 'Data2D':
66
- viewer = 'Viewer2D'
67
- else:
68
- if distribution.name == 'uniform':
69
- if shape_len < 3:
70
- if shape_len == 1 and size == 1:
71
- viewer = 'Viewer0D'
72
- elif shape_len == 1 and size > 1:
73
- viewer = 'Viewer1D'
74
- elif shape_len == 2:
75
- viewer = 'Viewer2D'
76
- else:
77
- viewer = 'ViewerND'
78
- else:
79
- viewer = 'ViewerND'
80
- else:
81
- if n_sig_indexes == 0:
82
- if n_nav_axes == 1:
83
- viewer = 'Viewer1D'
84
- elif n_nav_axes == 2:
85
- viewer = 'Viewer2D'
86
- else:
87
- viewer = 'ViewerND'
88
- else:
89
- viewer = 'ViewerND'
90
- return ViewersEnum[viewer]
91
-
92
- @staticmethod
93
- def get_viewers_enum_from_data(dwa: DataWithAxes) -> 'ViewersEnum':
94
- if dwa.dim.name == 'Data0D':
95
- viewer = 'Viewer0D'
96
- elif dwa.dim.name == 'Data1D':
97
- viewer = 'Viewer1D'
98
- elif dwa.dim.name == 'Data2D':
99
- viewer = 'Viewer2D'
100
- else:
101
- if dwa.distribution.name == 'uniform':
102
- if len(dwa.shape) < 3:
103
- dwa.nav_indexes = ()
104
- if len(dwa.shape) == 1 and dwa.size == 1:
105
- viewer = 'Viewer0D'
106
- elif len(dwa.shape) == 1 and dwa.size > 1:
107
- viewer = 'Viewer1D'
108
- elif len(dwa.shape) == 2:
109
- viewer = 'Viewer2D'
110
- else:
111
- viewer = 'ViewerND'
112
- else:
113
- viewer = 'ViewerND'
114
- else:
115
- if len(dwa.sig_indexes) == 0:
116
- if len(dwa.get_nav_axes()) == 1:
117
- viewer = 'Viewer1D'
118
- elif len(dwa.get_nav_axes()) == 2:
119
- viewer = 'Viewer2D'
120
- else:
121
- viewer = 'ViewerND'
122
- else:
123
- viewer = 'ViewerND'
124
- return ViewersEnum[viewer]
125
-
126
-
127
- class ViewerBase(QObject):
128
- """Base Class for data viewers implementing all common functionalities
129
-
130
- Parameters
131
- ----------
132
- parent: QtWidgets.QWidget
133
- title: str
134
-
135
- Attributes
136
- ----------
137
- view: QObject
138
- Ui interface of the viewer
139
-
140
- data_to_export_signal: Signal[DataToExport]
141
- ROI_changed: Signal
142
- crosshair_dragged: Signal[float, float]
143
- crosshair_clicked: Signal[bool]
144
- sig_double_clicked: Signal[float, float]
145
- status_signal: Signal[str]
146
- """
147
- data_to_export_signal = Signal(DataToExport)
148
- _data_to_show_signal = Signal(DataWithAxes)
149
-
150
- ROI_changed = Signal()
151
- crosshair_dragged = Signal(float, float) # Crosshair position in units of scaled top/right axes
152
- status_signal = Signal(str)
153
- crosshair_clicked = Signal(bool)
154
- sig_double_clicked = Signal(float, float)
155
- ROI_select_signal = Signal(QRectF) # deprecated: use roi_select_signal
156
- roi_select_signal = Signal(RoiInfo)
157
-
158
- def __init__(self, parent: QtWidgets.QWidget = None, title=''):
159
- super().__init__()
160
- self.title = title if title != '' else self.__class__.__name__
161
-
162
- self._raw_data = None
163
- self.data_to_export: DataToExport = DataToExport(name=self.title)
164
- self.view: Union[Viewer0D, Viewer1D, Viewer2D, ViewerND] = None
165
-
166
- if parent is None:
167
- parent = QtWidgets.QWidget()
168
- parent.show()
169
- self.parent = parent
170
-
171
- self._display_temporary = False
172
-
173
- @property
174
- def has_action(self):
175
- """Convenience method"""
176
- if hasattr(self.view, 'has_action'):
177
- return self.view.has_action
178
-
179
- @property
180
- def is_action_checked(self):
181
- """Convenience method"""
182
- if hasattr(self.view, 'is_action_checked'):
183
- return self.view.is_action_checked
184
-
185
- @property
186
- def is_action_visible(self):
187
- """Convenience method"""
188
- if hasattr(self.view, 'is_action_visible'):
189
- return self.view.is_action_visible
190
-
191
- @property
192
- def set_action_checked(self):
193
- """Convenience method"""
194
- if hasattr(self.view, 'set_action_checked'):
195
- return self.view.set_action_checked
196
-
197
- @property
198
- def set_action_visible(self):
199
- """Convenience method"""
200
- if hasattr(self.view, 'set_action_visible'):
201
- return self.view.set_action_visible
202
-
203
- @property
204
- def get_action(self):
205
- """Convenience method"""
206
- if hasattr(self.view, 'get_action'):
207
- return self.view.get_action
208
-
209
- @property
210
- def toolbar(self):
211
- """Convenience property"""
212
- if hasattr(self.view, 'toolbar'):
213
- return self.view.toolbar
214
-
215
- @property
216
- def viewer_type(self):
217
- """str: the viewer data type see DATA_TYPES"""
218
- return ViewersEnum[self.__class__.__name__].value
219
-
220
- def show_data(self, data: DataWithAxes, **kwargs):
221
- """Entrypoint to display data into the viewer
222
-
223
- Parameters
224
- ----------
225
- data: data_mod.DataFromPlugins
226
- """
227
- if len(data.shape) > 4:
228
- raise ViewerError(f'Ndarray of dim: {len(data.shape)} cannot be plotted using a {self.viewer_type}')
229
-
230
- self.data_to_export = DataToExport(name=self.title)
231
- self._raw_data = data
232
-
233
- self._display_temporary = False
234
-
235
- self._show_data(data, **kwargs)
236
-
237
- def show_data_temp(self, data: DataWithAxes, **kwargs):
238
- """Entrypoint to display temporary data into the viewer
239
-
240
- No processed data signal is emitted from the viewer
241
-
242
- Parameters
243
- ----------
244
- data: data_mod.DataFromPlugins
245
- """
246
- self._display_temporary = True
247
- self.show_data(data, **kwargs)
248
-
249
- def _show_data(self, data: DataWithAxes, *args, **kwargs):
250
- """Specific viewers should implement it"""
251
- raise NotImplementedError
252
-
253
- def add_attributes_from_view(self):
254
- """Convenience function to add attributes from the view to self"""
255
- for attribute in self.convenience_attributes:
256
- if hasattr(self.view, attribute):
257
- setattr(self, attribute, getattr(self.view, attribute))
258
-
259
- def trigger_action(self, action_name: str):
260
- """Convenience function to trigger programmatically one of the action of the related view"""
261
- if self.has_action(action_name):
262
- self.get_action(action_name).trigger()
263
-
264
- def activate_roi(self, activate=True):
265
- """Activate the Roi manager using the corresponding action"""
266
- raise NotImplementedError
267
-
268
- def setVisible(self, show=True):
269
- """convenience method to show or hide the paretn widget"""
270
- self.parent.setVisible(show)
271
-
272
- @property
273
- def roi_target(self) -> Union[InfiniteLine.InfiniteLine, ROI.ROI]:
274
- """To be implemented if necessary (Viewer1D and above)"""
275
- return None
276
-
277
- def move_roi_target(self, pos: Iterable[float] = None, **kwargs):
278
- """move a specific read only ROI at the given position on the viewer"""
279
- ...
280
-
281
- def show_roi_target(self, show=True):
282
- """Show/Hide a specific read only ROI"""
283
- if self.roi_target is not None:
284
- self.roi_target.setVisible(show)
285
-
286
-