pymodaq 4.2.3__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 +33 -16
  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 +166 -118
  11. pymodaq/examples/custom_app.py +13 -16
  12. pymodaq/examples/custom_viewer.py +7 -7
  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 -664
  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.3.dist-info → pymodaq-5.0.0.dist-info}/METADATA +5 -3
  76. pymodaq-5.0.0.dist-info/RECORD +123 -0
  77. {pymodaq-4.2.3.dist-info → pymodaq-5.0.0.dist-info}/WHEEL +1 -1
  78. pymodaq/post_treatment/process_to_scalar.py +0 -263
  79. pymodaq/resources/QtDesigner_Ressources/Icon_Library/1d.png +0 -0
  80. pymodaq/resources/QtDesigner_Ressources/Icon_Library/2d.png +0 -0
  81. pymodaq/resources/QtDesigner_Ressources/Icon_Library/3d.png +0 -0
  82. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add2.png +0 -0
  83. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add_Step.png +0 -0
  84. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve.png +0 -0
  85. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve_All.png +0 -0
  86. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Browse_Dir_Path.png +0 -0
  87. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Calculator.png +0 -0
  88. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnGroup.png +0 -0
  89. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnNum.png +0 -0
  90. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnText.png +0 -0
  91. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnTime.png +0 -0
  92. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnWave.png +0 -0
  93. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Close3.png +0 -0
  94. pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll.png +0 -0
  95. pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll_32.png +0 -0
  96. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ColorPicker.png +0 -0
  97. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Contract.png +0 -0
  98. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Create.png +0 -0
  99. pymodaq/resources/QtDesigner_Ressources/Icon_Library/DeleteLayer.png +0 -0
  100. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditOpen.png +0 -0
  101. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditRedo.png +0 -0
  102. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditUndo.png +0 -0
  103. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Ellipse.png +0 -0
  104. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EllipseFilled.png +0 -0
  105. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error.png +0 -0
  106. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ErrorMessage.png +0 -0
  107. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error_16.png +0 -0
  108. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Exit.png +0 -0
  109. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Expand.png +0 -0
  110. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll.png +0 -0
  111. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll_32.png +0 -0
  112. pymodaq/resources/QtDesigner_Ressources/Icon_Library/FFT.png +0 -0
  113. pymodaq/resources/QtDesigner_Ressources/Icon_Library/HLM.ico +0 -0
  114. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help.png +0 -0
  115. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help_32.png +0 -0
  116. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Histogram.png +0 -0
  117. pymodaq/resources/QtDesigner_Ressources/Icon_Library/LUT_LookUpTable.png +0 -0
  118. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass.png +0 -0
  119. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass_24.png +0 -0
  120. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Marker.png +0 -0
  121. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Math.png +0 -0
  122. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MeasurementStudio_32.png +0 -0
  123. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Move.png +0 -0
  124. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveDown.png +0 -0
  125. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveUp.png +0 -0
  126. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Multiply.png +0 -0
  127. pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewFile.png +0 -0
  128. pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewLayer.png +0 -0
  129. pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_File.png +0 -0
  130. pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_Folder.png +0 -0
  131. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open.png +0 -0
  132. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_1D.png +0 -0
  133. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_2D.png +0 -0
  134. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File.png +0 -0
  135. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File_32.png +0 -0
  136. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_sim.png +0 -0
  137. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Options.png +0 -0
  138. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope.png +0 -0
  139. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope_16.png +0 -0
  140. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Pass.png +0 -0
  141. pymodaq/resources/QtDesigner_Ressources/Icon_Library/RGB.png +0 -0
  142. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rectangle.png +0 -0
  143. pymodaq/resources/QtDesigner_Ressources/Icon_Library/RectangleFilled.png +0 -0
  144. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Redo.png +0 -0
  145. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh.png +0 -0
  146. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh2.png +0 -0
  147. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh_32.png +0 -0
  148. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Region.png +0 -0
  149. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rendezvous.png +0 -0
  150. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SELECT.png +0 -0
  151. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save.png +0 -0
  152. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll.png +0 -0
  153. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll_32.png +0 -0
  154. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs.png +0 -0
  155. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs_32.png +0 -0
  156. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_24.png +0 -0
  157. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_32.png +0 -0
  158. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Search.png +0 -0
  159. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SelectPolygon.png +0 -0
  160. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Select_24.png +0 -0
  161. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Settings.png +0 -0
  162. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snap&Save.png +0 -0
  163. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot.png +0 -0
  164. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2.png +0 -0
  165. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_16.png +0 -0
  166. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_32.png +0 -0
  167. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Spreadsheet.png +0 -0
  168. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics.png +0 -0
  169. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics2.png +0 -0
  170. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Status.png +0 -0
  171. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Subtract.png +0 -0
  172. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Vision.png +0 -0
  173. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Volts.png +0 -0
  174. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Wait2.png +0 -0
  175. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_1_1.png +0 -0
  176. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_in.png +0 -0
  177. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_out.png +0 -0
  178. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_to_Selection.png +0 -0
  179. pymodaq/resources/QtDesigner_Ressources/Icon_Library/abort.png +0 -0
  180. pymodaq/resources/QtDesigner_Ressources/Icon_Library/advanced2.png +0 -0
  181. pymodaq/resources/QtDesigner_Ressources/Icon_Library/autoscale.png +0 -0
  182. pymodaq/resources/QtDesigner_Ressources/Icon_Library/b_icon.png +0 -0
  183. pymodaq/resources/QtDesigner_Ressources/Icon_Library/back.png +0 -0
  184. pymodaq/resources/QtDesigner_Ressources/Icon_Library/bg_icon.png +0 -0
  185. pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera.png +0 -0
  186. pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera_snap.png +0 -0
  187. pymodaq/resources/QtDesigner_Ressources/Icon_Library/cartesian.png +0 -0
  188. pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear2.png +0 -0
  189. pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear_ROI.png +0 -0
  190. pymodaq/resources/QtDesigner_Ressources/Icon_Library/close2.png +0 -0
  191. pymodaq/resources/QtDesigner_Ressources/Icon_Library/cluster2.png +0 -0
  192. pymodaq/resources/QtDesigner_Ressources/Icon_Library/color.png +0 -0
  193. pymodaq/resources/QtDesigner_Ressources/Icon_Library/color2.png +0 -0
  194. pymodaq/resources/QtDesigner_Ressources/Icon_Library/continuous.png +0 -0
  195. pymodaq/resources/QtDesigner_Ressources/Icon_Library/data.png +0 -0
  196. pymodaq/resources/QtDesigner_Ressources/Icon_Library/delay.png +0 -0
  197. pymodaq/resources/QtDesigner_Ressources/Icon_Library/download.png +0 -0
  198. pymodaq/resources/QtDesigner_Ressources/Icon_Library/download2.png +0 -0
  199. pymodaq/resources/QtDesigner_Ressources/Icon_Library/error2.png +0 -0
  200. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ethernet.png +0 -0
  201. pymodaq/resources/QtDesigner_Ressources/Icon_Library/exit2.png +0 -0
  202. pymodaq/resources/QtDesigner_Ressources/Icon_Library/fan.png +0 -0
  203. pymodaq/resources/QtDesigner_Ressources/Icon_Library/filter2.png +0 -0
  204. pymodaq/resources/QtDesigner_Ressources/Icon_Library/g_icon.png +0 -0
  205. pymodaq/resources/QtDesigner_Ressources/Icon_Library/gear2.png +0 -0
  206. pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to.png +0 -0
  207. pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_1.png +0 -0
  208. pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_2.png +0 -0
  209. pymodaq/resources/QtDesigner_Ressources/Icon_Library/grab.png +0 -0
  210. pymodaq/resources/QtDesigner_Ressources/Icon_Library/graph.png +0 -0
  211. pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2.png +0 -0
  212. pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2_32.png +0 -0
  213. pymodaq/resources/QtDesigner_Ressources/Icon_Library/green_light.png +0 -0
  214. pymodaq/resources/QtDesigner_Ressources/Icon_Library/grey_icon.png +0 -0
  215. pymodaq/resources/QtDesigner_Ressources/Icon_Library/greyscale.png +0 -0
  216. pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1.png +0 -0
  217. pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1_32.png +0 -0
  218. pymodaq/resources/QtDesigner_Ressources/Icon_Library/home2.png +0 -0
  219. pymodaq/resources/QtDesigner_Ressources/Icon_Library/information2.png +0 -0
  220. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ini.png +0 -0
  221. pymodaq/resources/QtDesigner_Ressources/Icon_Library/integrator.png +0 -0
  222. pymodaq/resources/QtDesigner_Ressources/Icon_Library/joystick.png +0 -0
  223. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green.png +0 -0
  224. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green_16.png +0 -0
  225. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red.png +0 -0
  226. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red_16.png +0 -0
  227. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow.png +0 -0
  228. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow_16.png +0 -0
  229. pymodaq/resources/QtDesigner_Ressources/Icon_Library/limiter.png +0 -0
  230. pymodaq/resources/QtDesigner_Ressources/Icon_Library/load_ROI.png +0 -0
  231. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meshPlot.png +0 -0
  232. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter.png +0 -0
  233. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter2.png +0 -0
  234. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter_32.png +0 -0
  235. pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_contour.png +0 -0
  236. pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_straight_line.png +0 -0
  237. pymodaq/resources/QtDesigner_Ressources/Icon_Library/movie.png +0 -0
  238. pymodaq/resources/QtDesigner_Ressources/Icon_Library/multi_point.png +0 -0
  239. pymodaq/resources/QtDesigner_Ressources/Icon_Library/multiplexer.png +0 -0
  240. pymodaq/resources/QtDesigner_Ressources/Icon_Library/new.png +0 -0
  241. pymodaq/resources/QtDesigner_Ressources/Icon_Library/openArrow.png +0 -0
  242. pymodaq/resources/QtDesigner_Ressources/Icon_Library/openTree.png +0 -0
  243. pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope2.png +0 -0
  244. pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope3.png +0 -0
  245. pymodaq/resources/QtDesigner_Ressources/Icon_Library/overlay.png +0 -0
  246. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2.png +0 -0
  247. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2_16.png +0 -0
  248. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass_32.png +0 -0
  249. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pause.png +0 -0
  250. pymodaq/resources/QtDesigner_Ressources/Icon_Library/permute.png +0 -0
  251. pymodaq/resources/QtDesigner_Ressources/Icon_Library/phase.png +0 -0
  252. pymodaq/resources/QtDesigner_Ressources/Icon_Library/play.png +0 -0
  253. pymodaq/resources/QtDesigner_Ressources/Icon_Library/polar.png +0 -0
  254. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pole_zero.png +0 -0
  255. pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerMeter.png +0 -0
  256. pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch.png +0 -0
  257. pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch_16.png +0 -0
  258. pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2.png +0 -0
  259. pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2_32.png +0 -0
  260. pymodaq/resources/QtDesigner_Ressources/Icon_Library/properties.png +0 -0
  261. pymodaq/resources/QtDesigner_Ressources/Icon_Library/r_icon.png +0 -0
  262. pymodaq/resources/QtDesigner_Ressources/Icon_Library/radiocontrolbutton.png +0 -0
  263. pymodaq/resources/QtDesigner_Ressources/Icon_Library/read2.png +0 -0
  264. pymodaq/resources/QtDesigner_Ressources/Icon_Library/red_light.png +0 -0
  265. pymodaq/resources/QtDesigner_Ressources/Icon_Library/remove.png +0 -0
  266. pymodaq/resources/QtDesigner_Ressources/Icon_Library/reset.png +0 -0
  267. pymodaq/resources/QtDesigner_Ressources/Icon_Library/rgb_icon.png +0 -0
  268. pymodaq/resources/QtDesigner_Ressources/Icon_Library/robot.png +0 -0
  269. pymodaq/resources/QtDesigner_Ressources/Icon_Library/rotation2.png +0 -0
  270. pymodaq/resources/QtDesigner_Ressources/Icon_Library/run2.png +0 -0
  271. pymodaq/resources/QtDesigner_Ressources/Icon_Library/run_all.png +0 -0
  272. pymodaq/resources/QtDesigner_Ressources/Icon_Library/saturation.png +0 -0
  273. pymodaq/resources/QtDesigner_Ressources/Icon_Library/saveTree.png +0 -0
  274. pymodaq/resources/QtDesigner_Ressources/Icon_Library/save_ROI.png +0 -0
  275. pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_horizontally.png +0 -0
  276. pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_vertically.png +0 -0
  277. pymodaq/resources/QtDesigner_Ressources/Icon_Library/search2.png +0 -0
  278. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select2.png +0 -0
  279. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all.png +0 -0
  280. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all2.png +0 -0
  281. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_none.png +0 -0
  282. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence.png +0 -0
  283. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence2.png +0 -0
  284. pymodaq/resources/QtDesigner_Ressources/Icon_Library/snap.png +0 -0
  285. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sort_ascend.png +0 -0
  286. pymodaq/resources/QtDesigner_Ressources/Icon_Library/spectrumAnalyzer.png +0 -0
  287. pymodaq/resources/QtDesigner_Ressources/Icon_Library/start.png +0 -0
  288. pymodaq/resources/QtDesigner_Ressources/Icon_Library/status_cancelled.png +0 -0
  289. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop.png +0 -0
  290. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop2.png +0 -0
  291. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop3.png +0 -0
  292. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop_all.png +0 -0
  293. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sum.png +0 -0
  294. pymodaq/resources/QtDesigner_Ressources/Icon_Library/surfacePlot.png +0 -0
  295. pymodaq/resources/QtDesigner_Ressources/Icon_Library/tree.png +0 -0
  296. pymodaq/resources/QtDesigner_Ressources/Icon_Library/updateTree.png +0 -0
  297. pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility2.png +0 -0
  298. pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility_small.png +0 -0
  299. pymodaq/resources/QtDesigner_Ressources/Icon_Library/vector.png +0 -0
  300. pymodaq/resources/QtDesigner_Ressources/Icon_Library/verify.png +0 -0
  301. pymodaq/resources/QtDesigner_Ressources/Icon_Library/video.png +0 -0
  302. pymodaq/resources/QtDesigner_Ressources/Icon_Library/wait.png +0 -0
  303. pymodaq/resources/QtDesigner_Ressources/Icon_Library/waterfallPlot.png +0 -0
  304. pymodaq/resources/QtDesigner_Ressources/Icon_Library/watershed.png +0 -0
  305. pymodaq/resources/QtDesigner_Ressources/Icon_Library/yellow_light.png +0 -0
  306. pymodaq/resources/QtDesigner_Ressources/Icon_Library/zip_file.png +0 -0
  307. pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomAuto.png +0 -0
  308. pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomReset.png +0 -0
  309. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.bat +0 -2
  310. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.qrc +0 -234
  311. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +0 -127150
  312. pymodaq/resources/QtDesigner_Ressources/icons.svg +0 -142
  313. pymodaq/resources/VERSION +0 -1
  314. pymodaq/resources/config_template.toml +0 -90
  315. pymodaq/resources/triangulation_data.npy +0 -0
  316. pymodaq/utils/abstract/__init__.py +0 -48
  317. pymodaq/utils/db/__init__.py +0 -0
  318. pymodaq/utils/db/db_logger/__init__.py +0 -0
  319. pymodaq/utils/enums.py +0 -76
  320. pymodaq/utils/factory.py +0 -82
  321. pymodaq/utils/gui_utils/custom_app.py +0 -133
  322. pymodaq/utils/gui_utils/dock.py +0 -107
  323. pymodaq/utils/gui_utils/file_io.py +0 -93
  324. pymodaq/utils/gui_utils/layout.py +0 -34
  325. pymodaq/utils/gui_utils/list_picker.py +0 -38
  326. pymodaq/utils/gui_utils/widgets/__init__.py +0 -5
  327. pymodaq/utils/gui_utils/widgets/label.py +0 -24
  328. pymodaq/utils/gui_utils/widgets/lcd.py +0 -111
  329. pymodaq/utils/gui_utils/widgets/push.py +0 -149
  330. pymodaq/utils/gui_utils/widgets/qled.py +0 -62
  331. pymodaq/utils/gui_utils/widgets/spinbox.py +0 -24
  332. pymodaq/utils/gui_utils/widgets/table.py +0 -263
  333. pymodaq/utils/gui_utils/widgets/tree_layout.py +0 -188
  334. pymodaq/utils/gui_utils/widgets/tree_toml.py +0 -102
  335. pymodaq/utils/h5modules/backends.py +0 -1022
  336. pymodaq/utils/h5modules/browsing.py +0 -625
  337. pymodaq/utils/h5modules/data_saving.py +0 -1101
  338. pymodaq/utils/h5modules/exporter.py +0 -119
  339. pymodaq/utils/h5modules/exporters/__init__.py +0 -0
  340. pymodaq/utils/h5modules/exporters/base.py +0 -111
  341. pymodaq/utils/h5modules/exporters/flimj.py +0 -63
  342. pymodaq/utils/h5modules/exporters/hyperspy.py +0 -143
  343. pymodaq/utils/h5modules/saving.py +0 -866
  344. pymodaq/utils/h5modules/utils.py +0 -115
  345. pymodaq/utils/managers/action_manager.py +0 -489
  346. pymodaq/utils/managers/parameter_manager.py +0 -282
  347. pymodaq/utils/managers/roi_manager.py +0 -726
  348. pymodaq/utils/messenger.py +0 -66
  349. pymodaq/utils/parameter/ioxml.py +0 -542
  350. pymodaq/utils/parameter/pymodaq_ptypes/__init__.py +0 -38
  351. pymodaq/utils/parameter/pymodaq_ptypes/bool.py +0 -31
  352. pymodaq/utils/parameter/pymodaq_ptypes/date.py +0 -126
  353. pymodaq/utils/parameter/pymodaq_ptypes/filedir.py +0 -143
  354. pymodaq/utils/parameter/pymodaq_ptypes/itemselect.py +0 -265
  355. pymodaq/utils/parameter/pymodaq_ptypes/led.py +0 -44
  356. pymodaq/utils/parameter/pymodaq_ptypes/list.py +0 -150
  357. pymodaq/utils/parameter/pymodaq_ptypes/numeric.py +0 -18
  358. pymodaq/utils/parameter/pymodaq_ptypes/pixmap.py +0 -175
  359. pymodaq/utils/parameter/pymodaq_ptypes/slide.py +0 -145
  360. pymodaq/utils/parameter/pymodaq_ptypes/table.py +0 -135
  361. pymodaq/utils/parameter/pymodaq_ptypes/tableview.py +0 -149
  362. pymodaq/utils/parameter/pymodaq_ptypes/text.py +0 -142
  363. pymodaq/utils/plotting/__init__.py +0 -0
  364. pymodaq/utils/plotting/data_viewers/__init__.py +0 -10
  365. pymodaq/utils/plotting/data_viewers/base.py +0 -286
  366. pymodaq/utils/plotting/data_viewers/viewer.py +0 -274
  367. pymodaq/utils/plotting/data_viewers/viewer0D.py +0 -298
  368. pymodaq/utils/plotting/data_viewers/viewer1D.py +0 -820
  369. pymodaq/utils/plotting/data_viewers/viewer1Dbasic.py +0 -231
  370. pymodaq/utils/plotting/data_viewers/viewer2D.py +0 -1118
  371. pymodaq/utils/plotting/data_viewers/viewer2D_basic.py +0 -146
  372. pymodaq/utils/plotting/data_viewers/viewerND.py +0 -800
  373. pymodaq/utils/plotting/gant_chart.py +0 -123
  374. pymodaq/utils/plotting/image_viewer.py +0 -97
  375. pymodaq/utils/plotting/items/__init__.py +0 -0
  376. pymodaq/utils/plotting/items/axis_scaled.py +0 -93
  377. pymodaq/utils/plotting/items/crosshair.py +0 -94
  378. pymodaq/utils/plotting/items/image.py +0 -388
  379. pymodaq/utils/plotting/navigator.py +0 -353
  380. pymodaq/utils/plotting/plotter/plotter.py +0 -94
  381. pymodaq/utils/plotting/plotter/plotters/__init__.py +0 -0
  382. pymodaq/utils/plotting/plotter/plotters/matplotlib_plotters.py +0 -134
  383. pymodaq/utils/plotting/plotter/plotters/qt_plotters.py +0 -78
  384. pymodaq/utils/plotting/utils/__init__.py +0 -0
  385. pymodaq/utils/plotting/utils/axes_viewer.py +0 -88
  386. pymodaq/utils/plotting/utils/filter.py +0 -585
  387. pymodaq/utils/plotting/utils/lineout.py +0 -226
  388. pymodaq/utils/plotting/utils/plot_utils.py +0 -579
  389. pymodaq/utils/plotting/utils/signalND.py +0 -1347
  390. pymodaq/utils/plotting/widgets.py +0 -76
  391. pymodaq/utils/qvariant.py +0 -12
  392. pymodaq/utils/slicing.py +0 -63
  393. pymodaq/utils/units.py +0 -216
  394. pymodaq-4.2.3.dist-info/RECORD +0 -438
  395. /pymodaq/{post_treatment/daq_analysis → extensions/daq_logger}/__init__.py +0 -0
  396. /pymodaq/{utils/abstract/logger.py → extensions/daq_logger/abstract.py} +0 -0
  397. /pymodaq/{resources/QtDesigner_Ressources → extensions/daq_logger/db}/__init__.py +0 -0
  398. {pymodaq-4.2.3.dist-info → pymodaq-5.0.0.dist-info}/entry_points.txt +0 -0
  399. {pymodaq-4.2.3.dist-info → pymodaq-5.0.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,150 +0,0 @@
1
- from qtpy import QtWidgets, QtGui, QtCore
2
- from pyqtgraph.parametertree.parameterTypes.list import ListParameter, ListParameterItem
3
- from pyqtgraph.parametertree.Parameter import ParameterItem
4
-
5
-
6
- class Combo_pb(QtWidgets.QWidget):
7
-
8
- def __init__(self, items=[]):
9
- super(Combo_pb, self).__init__()
10
- self.items = items
11
- self.initUI()
12
- self.count = self.combo.count
13
-
14
- def initUI(self):
15
- """
16
- Init the User Interface.
17
- """
18
- self.hor_layout = QtWidgets.QHBoxLayout()
19
- self.combo = QtWidgets.QComboBox()
20
- self.combo.addItems(self.items)
21
- self.add_pb = QtWidgets.QPushButton()
22
- self.add_pb.setText("")
23
- icon3 = QtGui.QIcon()
24
- icon3.addPixmap(QtGui.QPixmap(":/icons/Icon_Library/Add2.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
25
- self.add_pb.setIcon(icon3)
26
- self.hor_layout.addWidget(self.combo)
27
- self.hor_layout.addWidget(self.add_pb)
28
- self.hor_layout.setSpacing(0)
29
- self.hor_layout.setContentsMargins(0, 0, 0, 0)
30
- self.add_pb.setMaximumWidth(25)
31
- self.setLayout(self.hor_layout)
32
- self.currentText = self.combo.currentText
33
- self.setCurrentIndex = self.combo.setCurrentIndex
34
- self.clear = self.combo.clear
35
- self.addItem = self.combo.addItem
36
- self.findText = self.combo.findText
37
-
38
-
39
- class ListParameterItem(ListParameterItem):
40
- """
41
- WidgetParameterItem subclass providing comboBox that lets the user select from a list of options.
42
-
43
- """
44
-
45
- def __init__(self, param, depth):
46
- super().__init__(param, depth)
47
-
48
- def makeWidget(self):
49
- """
50
- Make a widget from self parameter options, connected to the buttonClicked function.
51
-
52
- Returns
53
- -------
54
- w:widget
55
- the initialized widget
56
-
57
- See Also
58
- --------
59
- buttonClicked, limitsChanged,
60
- """
61
- opts = self.param.opts
62
- t = opts['type']
63
- w = Combo_pb()
64
- w.add_pb.clicked.connect(self.buttonClicked)
65
- w.setMaximumHeight(20) # # set to match height of spin box and line edit
66
- if 'show_pb' in opts:
67
- w.add_pb.setVisible(opts['show_pb'])
68
- else:
69
- w.add_pb.setVisible(False)
70
- w.sigChanged = w.combo.currentIndexChanged
71
- w.value = self.value
72
- w.setValue = self.setValue
73
- self.widget = w # # needs to be set before limits are changed
74
- self.limitsChanged(self.param, self.param.opts['limits'])
75
- if len(self.forward) > 0:
76
- self.setValue(self.param.value())
77
- return w
78
-
79
- def buttonClicked(self):
80
- """
81
- |
82
- | Append the self limits attributes an added parameter with string value.
83
- | Update parameter and call the limitschanged method to map the added parameter.
84
-
85
- See Also
86
- --------
87
- limitsChanged,
88
- """
89
- if isinstance(self.param.opts['limits'], list):
90
- text, ok = QtWidgets.QInputDialog.getText(None, "Enter a value to add to the parameter",
91
- "String value:", QtWidgets.QLineEdit.Normal)
92
- if ok and not (text == ""):
93
- self.param.opts['limits'].append(text)
94
- self.limitsChanged(self.param, self.param.opts['limits'])
95
- self.param.setValue(text)
96
- elif isinstance(self.param.opts['limits'], dict):
97
- text, ok = QtWidgets.QInputDialog.getText(None, "Enter a text to add to the parameter",
98
- "String value:", QtWidgets.QLineEdit.Normal)
99
- if ok and not (text == ""):
100
-
101
- value, ok = QtWidgets.QInputDialog.getInt(None, "Enter an integer value to add to the parameter",
102
- "integer value:", QtWidgets.QLineEdit.Normal)
103
- if ok:
104
- self.param.opts['limits'].update({text: value})
105
- self.limitsChanged(self.param, self.param.opts['limits'])
106
- self.param.setValue(text)
107
-
108
- def optsChanged(self, param, opts):
109
- """
110
- Called when any options are changed that are not name, value, default, or limits.
111
-
112
- =============== ================================== =======================================
113
- **Parameters** **Type** **Description**
114
- *param* instance of pyqtgraph parameter The parameter to be checked
115
- *opts* string list The option dictionnary to be checked
116
- =============== ================================== =======================================
117
-
118
- See Also
119
- --------
120
- optsChanged
121
- """
122
- super().optsChanged(param, opts)
123
- if 'show_pb' in opts:
124
- self.widget.add_pb.setVisible(opts['show_pb'])
125
- if 'enabled' in opts:
126
- self.widget.setEnabled(opts['enabled'])
127
-
128
-
129
- class ListParameter(ListParameter):
130
- """
131
- =============== =======================================
132
- **Attributes** **Type**
133
- *itemClass* instance of ListParameterItem_custom
134
- *sigActivated* instance of pyqt Signal
135
- =============== =======================================
136
- """
137
- itemClass = ListParameterItem
138
- sigActivated = QtCore.Signal(object)
139
-
140
- def __init__(self, **opts):
141
- super().__init__(**opts)
142
-
143
- def activate(self):
144
- """
145
- Emit the Activated signal.
146
- """
147
- self.sigActivated.emit(self)
148
- self.emitStateChanged('activated', None)
149
-
150
-
@@ -1,18 +0,0 @@
1
- from pyqtgraph.parametertree.parameterTypes.basetypes import SimpleParameter
2
- from pyqtgraph.parametertree.parameterTypes.numeric import NumericParameterItem
3
-
4
-
5
- class NumericParameter(SimpleParameter):
6
- itemClass = NumericParameterItem
7
-
8
- def __init__(self, **opts):
9
- super().__init__(**opts)
10
-
11
- def setLimits(self, limits):
12
- curVal = self.value()
13
- if curVal > limits[1]:
14
- self.setValue(limits[1])
15
- elif curVal < limits[0]:
16
- self.setValue(limits[0])
17
- super().setLimits(limits)
18
- return limits
@@ -1,175 +0,0 @@
1
- import numpy as np
2
- from qtpy import QtWidgets, QtGui
3
- from qtpy.QtCore import QByteArray, QObject
4
- from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem, SimpleParameter
5
- from qtpy import QtWidgets, QtGui
6
- from qtpy.QtCore import QByteArray
7
- from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem
8
-
9
-
10
- class PixmapCheckData:
11
- def __init__(self, data: np.ndarray, path: str = '', checked: bool = False, info: str = ''):
12
- if data is not None:
13
- data = data / np.max(data) * 255
14
- data = data.astype(np.uint8)
15
- self.data = data[:, :]
16
- else:
17
- self.data = []
18
- self.path = path
19
- self.checked = checked
20
- self.info = info
21
-
22
- def __eq__(self, other):
23
- if other is None:
24
- return False
25
- else:
26
- status = np.all(np.isclose(self.data, other.data))
27
- status = status and self.checked == other.checked
28
- status = status and self.path == other.path
29
- return status
30
-
31
-
32
- class PixmapCheckWidget(QtWidgets.QWidget):
33
- """ value of this parameter is a PixmapCheckData
34
-
35
- See Also
36
- --------
37
- PixmapCheckedData
38
- """
39
-
40
- def __init__(self):
41
-
42
- super().__init__()
43
- self._data: PixmapCheckData = None
44
- self.checkbox: QtWidgets.QCheckBox = None
45
- self.label: QtWidgets.QLabel = None
46
- self.info_label: QtWidgets.QLabel = None
47
- self.initUI()
48
-
49
- def initUI(self):
50
- """
51
- Init the User Interface.
52
- """
53
- self.setLayout(QtWidgets.QHBoxLayout())
54
- self.layout().setContentsMargins(0, 0, 0, 0)
55
- self.label = QtWidgets.QLabel()
56
- self.label.setMaximumWidth(100)
57
- self.label.setMinimumHeight(50)
58
- self.label.setMaximumHeight(50)
59
- self.layout().addWidget(self.label)
60
-
61
- ver_widget = QtWidgets.QWidget()
62
- ver_widget.setLayout(QtWidgets.QVBoxLayout())
63
- self.checkbox = QtWidgets.QCheckBox('Show/Hide')
64
- self.info_label = QtWidgets.QLabel()
65
- # self.info.setReadOnly(True)
66
- self.checkbox.setChecked(False)
67
- ver_widget.layout().addWidget(self.info_label)
68
- ver_widget.layout().addWidget(self.checkbox)
69
- ver_widget.layout().setSpacing(0)
70
- ver_widget.layout().setContentsMargins(0, 0, 0, 0)
71
- self.layout().addWidget(ver_widget)
72
-
73
- def setValue(self, data: PixmapCheckData):
74
-
75
-
76
- im = QtGui.QImage(data.data, *data.data.shape, QtGui.QImage.Format_Indexed8)
77
- a = QtGui.QPixmap.fromImage(im)
78
-
79
- self.label.setPixmap(a)
80
- self.checkbox.setChecked(data.checked)
81
- self.info_label.setText(data.info)
82
- self._data = data
83
-
84
- def value(self):
85
- return PixmapCheckData(data=self._data.data if self._data is not None else None,
86
- checked=self.checkbox.isChecked(),
87
- info=self._data.info if self._data is not None else '',
88
- path=self._data.path if self._data is not None else '')
89
-
90
-
91
- class PixmapParameterItem(WidgetParameterItem):
92
- """Registered parameter type which displays a QPixmap in a QLabel"""
93
-
94
- def makeWidget(self):
95
- w = QtWidgets.QLabel()
96
- w.sigChanged = None
97
- w.value = w.pixmap
98
- w.setValue = w.setPixmap
99
- return w
100
-
101
-
102
- class PixmapCheckParameterItem(WidgetParameterItem):
103
- """Registered parameter type which displays a PixmapCheckWidget custom widget"""
104
-
105
- def makeWidget(self):
106
- w = PixmapCheckWidget()
107
- w.sigChanged = w.checkbox.clicked
108
- w.value = w.value
109
- w.setValue = w.setValue
110
- self.hideWidget = False
111
- return w
112
-
113
-
114
- class PixmapCheckParameter(SimpleParameter):
115
- itemClass = PixmapCheckParameterItem
116
-
117
- def __init__(self, **kwargs):
118
- super().__init__(**kwargs)
119
-
120
-
121
- class PixmapParameter(SimpleParameter):
122
- itemClass = PixmapParameterItem
123
-
124
- def __init__(self, **kwargs):
125
- super().__init__(**kwargs)
126
-
127
-
128
- def main_widget():
129
- import sys
130
- app = QtWidgets.QApplication(sys.argv)
131
- prog = PixmapCheckWidget()
132
- prog.show()
133
- data = np.arange(128 * 256).reshape((256, 128))
134
- data = data / np.max(data) * 255
135
- data = data.astype(np.uint8)
136
- prog.setValue(PixmapCheckData(data=data,
137
- checked=True,
138
- info='this is an info'))
139
-
140
- def print_toggled(status):
141
- print(f"toggled: {status}")
142
-
143
- prog.checkbox.toggled.connect(print_toggled)
144
-
145
- sys.exit(app.exec_())
146
-
147
-
148
- def main_parameter():
149
- from pymodaq.utils.managers.parameter_manager import ParameterManager
150
- data = np.arange(128 * 256).reshape((256, 128))
151
- data = data / np.max(data) * 255
152
- data = data.astype(np.uint8)
153
-
154
- class PixmapParameter(ParameterManager):
155
- params = {'title': 'Overlays', 'name': 'overlays', 'type': 'group', 'children': [
156
- {'name': f'Overlay{0:03.0f}', 'type': 'pixmap_check',
157
- 'value': PixmapCheckData(data=data, checked=False,
158
- info=f'This is an info')},
159
- {'name': 'other', 'type': 'bool_push', 'value': True},
160
- {'name': 'otherp', 'type': 'led_push', 'value': True},
161
- ]},
162
-
163
- def value_changed(self, param):
164
- print(f'Value changed for {param}: {param.value()}')
165
-
166
- import sys
167
- app = QtWidgets.QApplication(sys.argv)
168
- prog = PixmapParameter()
169
- prog.settings_tree.show()
170
-
171
- sys.exit(app.exec_())
172
-
173
-
174
- if __name__ == '__main__':
175
- main_parameter()
@@ -1,145 +0,0 @@
1
- from qtpy import QtWidgets, QtCore
2
- from pyqtgraph.widgets.SpinBox import SpinBox
3
- from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem, SimpleParameter
4
- from pymodaq.utils.parameter.utils import scroll_log, scroll_linear
5
- import numpy as np
6
-
7
-
8
- class SliderSpinBox(QtWidgets.QWidget):
9
-
10
- def __init__(self, *args, subtype='lin', **kwargs):
11
-
12
- super().__init__()
13
- self.subtype = subtype
14
- self.initUI(*args, **kwargs)
15
-
16
- self.valueChanged = self.spinbox.valueChanged # (value) for compatibility with QSpinBox
17
- self.sigValueChanged = self.spinbox.sigValueChanged # (self)
18
- self.sigValueChanging = self.spinbox.sigValueChanging # (self, value) sent immediately; no delay.
19
- self.sigChanged = self.spinbox.sigValueChanged
20
-
21
- @property
22
- def opts(self):
23
- return self.spinbox.opts
24
-
25
- @opts.setter
26
- def opts(self, **opts):
27
- self.setOpts(**opts)
28
-
29
- def setOpts(self, **opts):
30
- self.spinbox.setOpts(**opts)
31
- if 'visible' in opts:
32
- self.slider.setVisible(opts['visible'])
33
-
34
- def insert_widget(self ,widget, row=0):
35
- self.vlayout.insertWidget(row, widget)
36
-
37
- def initUI(self, *args, **kwargs):
38
- """
39
- Init the User Interface.
40
- """
41
- self.vlayout = QtWidgets.QVBoxLayout()
42
- self.slider = QtWidgets.QSlider(QtCore.Qt.Horizontal)
43
- self.slider.setMinimumWidth(50)
44
- self.slider.setMinimum(0)
45
- self.slider.setMaximum(100)
46
- if 'value' in kwargs:
47
- value = kwargs.pop('value')
48
- else:
49
- if 'bounds' in kwargs:
50
- value = kwargs['bounds'][0]
51
- else:
52
- value = 1
53
- self.spinbox = SpinBox(parent=None, value=value, **kwargs)
54
-
55
- self.vlayout.addWidget(self.slider)
56
- self.vlayout.addWidget(self.spinbox)
57
- self.vlayout.setSpacing(0)
58
- self.vlayout.setContentsMargins(0, 0, 0, 0)
59
- self.setLayout(self.vlayout)
60
-
61
- self.slider.valueChanged.connect(self.update_spinbox)
62
- self.spinbox.valueChanged.connect(self.update_slide)
63
-
64
- def update_spinbox(self, val):
65
- """
66
- val is a percentage [0-100] used in order to set the spinbox value between its min and max
67
- """
68
- min_val = float(self.opts['bounds'][0])
69
- max_val = float(self.opts['bounds'][1])
70
- if self.subtype == 'log':
71
- val_out = scroll_log(val, min_val, max_val)
72
- else:
73
- val_out = scroll_linear(val, min_val, max_val)
74
- try:
75
- self.slider.valueChanged.disconnect(self.update_spinbox)
76
- self.spinbox.valueChanged.disconnect(self.update_slide)
77
- except Exception:
78
- pass
79
- self.spinbox.setValue(val_out)
80
-
81
- self.slider.valueChanged.connect(self.update_spinbox)
82
- self.spinbox.valueChanged.connect(self.update_slide)
83
-
84
- def update_slide(self, val):
85
- """
86
- val is the spinbox value between its min and max
87
- """
88
- min_val = float(self.opts['bounds'][0])
89
- max_val = float(self.opts['bounds'][1])
90
-
91
- try:
92
- self.slider.valueChanged.disconnect(self.update_spinbox)
93
- self.spinbox.valueChanged.disconnect(self.update_slide)
94
- except Exception:
95
- pass
96
- if self.subtype == 'linear':
97
- value = int((val - min_val) / (max_val - min_val) * 100)
98
- else:
99
- value = int((np.log10(val) - np.log10(min_val)) / (np.log10(max_val) - np.log10(min_val)) * 100)
100
- self.slider.setValue(value)
101
- self.slider.valueChanged.connect(self.update_spinbox)
102
- self.spinbox.valueChanged.connect(self.update_slide)
103
-
104
- def setValue(self, val):
105
- self.spinbox.setValue(val)
106
-
107
- def value(self):
108
- return self.spinbox.value()
109
-
110
-
111
- class SliderParameterItem(WidgetParameterItem):
112
- """Registered parameter type which displays a QLineEdit"""
113
-
114
- def makeWidget(self):
115
- opts = self.param.opts
116
- defs = {
117
- 'value': 0, 'min': None, 'max': None,
118
- 'step': 1.0, 'dec': False,
119
- 'siPrefix': False, 'suffix': '', 'decimals': 12,
120
- 'int': False
121
- }
122
- if 'subtype' not in opts:
123
- opts['subtype'] = 'linear'
124
- defs['bounds'] = [0., self.param.value()] # max value set to default value when no max given
125
- if 'limits' not in opts:
126
- if 'min' in opts:
127
- defs['bounds'][0] = opts['min']
128
- if 'max' in opts:
129
- defs['bounds'][1] = opts['max']
130
- else:
131
- defs['bounds'] = opts['limits']
132
-
133
- if 'int' in opts:
134
- defs['int'] = opts['int']
135
-
136
- w = SliderSpinBox(subtype=opts['subtype'], bounds=defs['bounds'], value=defs['value'], int=defs['int'])
137
- self.setSizeHint(1, QtCore.QSize(50, 50))
138
- return w
139
-
140
-
141
- class SliderParameter(SimpleParameter):
142
- itemClass = SliderParameterItem
143
-
144
- def __init__(self, **kwargs):
145
- super().__init__(**kwargs)
@@ -1,135 +0,0 @@
1
- from qtpy import QtWidgets, QtCore
2
- from collections import OrderedDict
3
- from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem
4
- from pyqtgraph.parametertree import Parameter
5
-
6
-
7
- class TableWidget(QtWidgets.QTableWidget):
8
- """
9
- ============== ===========================
10
- *Attributes** **Type**
11
- *valuechanged* instance of pyqt Signal
12
- *QtWidgets* instance of QTableWidget
13
- ============== ===========================
14
- """
15
-
16
- valuechanged = QtCore.Signal(OrderedDict)
17
-
18
- def __init__(self):
19
- super().__init__()
20
-
21
- def get_table_value(self):
22
- """
23
- Get the contents of the self coursed table.
24
-
25
- Returns
26
- -------
27
- data : ordered dictionnary
28
- The getted values dictionnary.
29
- """
30
- data = OrderedDict([])
31
- for ind in range(self.rowCount()):
32
- item0 = self.item(ind, 0)
33
- item1 = self.item(ind, 1)
34
- if item0 is not None and item1 is not None:
35
- try:
36
- data[item0.text()] = float(item1.text())
37
- except Exception:
38
- data[item0.text()] = item1.text()
39
- return data
40
-
41
- def set_table_value(self, data_dict):
42
- """
43
- Set the data values dictionnary to the custom table.
44
-
45
- =============== ====================== ================================================
46
- **Parameters** **Type** **Description**
47
- *data_dict* ordered dictionnary the contents to be stored in the custom table
48
- =============== ====================== ================================================
49
- """
50
- try:
51
- self.setRowCount(len(data_dict))
52
- self.setColumnCount(2)
53
- for ind, (key, value) in enumerate(data_dict.items()):
54
- item0 = QtWidgets.QTableWidgetItem(key)
55
- item0.setFlags(item0.flags() ^ QtCore.Qt.ItemIsEditable)
56
- if isinstance(value, float):
57
- item1 = QtWidgets.QTableWidgetItem('{:.3e}'.format(value))
58
- else:
59
- item1 = QtWidgets.QTableWidgetItem(str(value))
60
- item1.setFlags(item1.flags() ^ QtCore.Qt.ItemIsEditable)
61
- self.setItem(ind, 0, item0)
62
- self.setItem(ind, 1, item1)
63
- # self.valuechanged.emit(data_dict)
64
-
65
- except Exception as e:
66
- pass
67
-
68
-
69
- class TableParameterItem(WidgetParameterItem):
70
-
71
- # def treeWidgetChanged(self):
72
- # """
73
- # Check for changement in the Widget tree.
74
- # """
75
- # # # TODO: fix so that superclass method can be called
76
- # # # (WidgetParameter should just natively support this style)
77
- # # WidgetParameterItem.treeWidgetChanged(self)
78
- # self.treeWidget().setFirstItemColumnSpanned(self.subItem, True)
79
- # self.treeWidget().setItemWidget(self.subItem, 0, self.widget)
80
- #
81
- # # for now, these are copied from ParameterItem.treeWidgetChanged
82
- # self.setHidden(not self.param.opts.get('visible', True))
83
- # self.setExpanded(self.param.opts.get('expanded', True))
84
-
85
- def makeWidget(self):
86
- """
87
- Make and initialize an instance of TableWidget.
88
-
89
- Returns
90
- -------
91
- table : instance of TableWidget.
92
- The initialized table.
93
-
94
- See Also
95
- --------
96
- TableWidget
97
- """
98
- self.asSubItem = True
99
- self.hideWidget = False
100
- opts = self.param.opts
101
- w = TableWidget()
102
- if 'tip' in opts:
103
- w.setToolTip(opts['tip'])
104
- w.setColumnCount(2)
105
- if 'header' in opts:
106
- w.setHorizontalHeaderLabels(self.param.opts['header'])
107
- if 'height' not in opts:
108
- opts['height'] = 200
109
- w.setMaximumHeight(opts['height'])
110
- w.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch)
111
- # self.table.setReadOnly(self.param.opts.get('readonly', False))
112
- w.value = w.get_table_value
113
- w.setValue = w.set_table_value
114
- w.sigChanged = w.itemChanged
115
- return w
116
-
117
-
118
- class TableParameter(Parameter):
119
- """
120
- =============== =================================
121
- **Attributes** **Type**
122
- *itemClass* instance of TableParameterItem
123
- *Parameter* instance of pyqtgraph parameter
124
- =============== =================================
125
- """
126
- itemClass = TableParameterItem
127
- """Editable string; displayed as large text box in the tree."""
128
-
129
- # def __init(self):
130
- # super(TableParameter,self).__init__()
131
-
132
- def setValue(self, value):
133
- self.opts['value'] = value
134
- self.sigValueChanged.emit(self, value)
135
-