pymodaq 4.4.7__py3-none-any.whl → 5.0.1__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 (415) hide show
  1. pymodaq/__init__.py +57 -91
  2. pymodaq/control_modules/daq_move.py +64 -46
  3. pymodaq/control_modules/daq_move_ui.py +34 -12
  4. pymodaq/control_modules/daq_viewer.py +55 -30
  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 +51 -43
  8. pymodaq/control_modules/utils.py +43 -20
  9. pymodaq/control_modules/viewer_utility_classes.py +54 -18
  10. pymodaq/daq_utils/daq_utils.py +6 -0
  11. pymodaq/dashboard.py +639 -323
  12. pymodaq/examples/function_plotter.py +13 -12
  13. pymodaq/examples/tcp_client.py +1 -1
  14. pymodaq/extensions/__init__.py +1 -1
  15. pymodaq/extensions/bayesian/bayesian_optimisation.py +44 -32
  16. pymodaq/extensions/bayesian/utils.py +10 -10
  17. pymodaq/extensions/console.py +7 -6
  18. pymodaq/extensions/daq_logger/__init__.py +1 -0
  19. pymodaq/extensions/{daq_logger.py → daq_logger/daq_logger.py} +30 -30
  20. pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger.py +16 -15
  21. pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger_models.py +2 -0
  22. pymodaq/{utils/h5modules → extensions/daq_logger}/h5logging.py +7 -8
  23. pymodaq/extensions/daq_scan.py +42 -34
  24. pymodaq/extensions/daq_scan_ui.py +18 -18
  25. pymodaq/extensions/h5browser.py +2 -3
  26. pymodaq/extensions/pid/__init__.py +4 -2
  27. pymodaq/extensions/pid/daq_move_PID.py +3 -3
  28. pymodaq/extensions/pid/pid_controller.py +59 -50
  29. pymodaq/extensions/pid/utils.py +10 -5
  30. pymodaq/extensions/utils.py +33 -3
  31. pymodaq/post_treatment/load_and_plot.py +10 -7
  32. pymodaq/resources/preset_default.xml +1 -1
  33. pymodaq/updater.py +107 -0
  34. pymodaq/utils/array_manipulation.py +4 -384
  35. pymodaq/utils/calibration_camera.py +12 -9
  36. pymodaq/utils/chrono_timer.py +11 -10
  37. pymodaq/utils/config.py +3 -458
  38. pymodaq/utils/daq_utils.py +9 -715
  39. pymodaq/utils/data.py +17 -2959
  40. pymodaq/utils/enums.py +4 -74
  41. pymodaq/utils/exceptions.py +0 -4
  42. pymodaq/utils/gui_utils/__init__.py +8 -8
  43. pymodaq/utils/gui_utils/loader_utils.py +26 -1
  44. pymodaq/utils/gui_utils/utils.py +8 -162
  45. pymodaq/utils/gui_utils/widgets/lcd.py +6 -109
  46. pymodaq/utils/h5modules/__init__.py +0 -4
  47. pymodaq/utils/h5modules/module_saving.py +9 -8
  48. pymodaq/utils/leco/__init__.py +2 -2
  49. pymodaq/utils/leco/daq_move_LECODirector.py +3 -6
  50. pymodaq/utils/leco/daq_xDviewer_LECODirector.py +5 -5
  51. pymodaq/utils/leco/director_utils.py +2 -2
  52. pymodaq/utils/leco/leco_director.py +3 -3
  53. pymodaq/utils/leco/pymodaq_listener.py +4 -3
  54. pymodaq/utils/leco/utils.py +11 -9
  55. pymodaq/utils/logger.py +4 -76
  56. pymodaq/utils/managers/batchscan_manager.py +16 -19
  57. pymodaq/utils/managers/modules_manager.py +30 -17
  58. pymodaq/utils/managers/overshoot_manager.py +48 -6
  59. pymodaq/utils/managers/preset_manager.py +39 -59
  60. pymodaq/utils/managers/preset_manager_utils.py +28 -22
  61. pymodaq/utils/managers/remote_manager.py +12 -10
  62. pymodaq/utils/math_utils.py +4 -582
  63. pymodaq/utils/messenger.py +4 -64
  64. pymodaq/utils/parameter/__init__.py +6 -9
  65. pymodaq/utils/parameter/utils.py +4 -328
  66. pymodaq/utils/scanner/scan_config.py +1 -1
  67. pymodaq/utils/scanner/scan_factory.py +16 -12
  68. pymodaq/utils/{plotting → scanner}/scan_selector.py +19 -20
  69. pymodaq/utils/scanner/scanner.py +10 -8
  70. pymodaq/utils/scanner/scanners/_1d_scanners.py +8 -5
  71. pymodaq/utils/scanner/scanners/_2d_scanners.py +5 -5
  72. pymodaq/utils/scanner/scanners/sequential.py +8 -8
  73. pymodaq/utils/scanner/scanners/tabular.py +9 -9
  74. pymodaq/utils/scanner/utils.py +6 -4
  75. pymodaq/utils/svg/svg_viewer2D.py +3 -4
  76. pymodaq/utils/tcp_ip/mysocket.py +4 -110
  77. pymodaq/utils/tcp_ip/serializer.py +4 -801
  78. pymodaq/utils/tcp_ip/tcp_server_client.py +15 -13
  79. pymodaq-5.0.1.dist-info/METADATA +242 -0
  80. pymodaq-5.0.1.dist-info/RECORD +122 -0
  81. {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/WHEEL +1 -1
  82. {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/entry_points.txt +1 -0
  83. pymodaq/examples/custom_app.py +0 -258
  84. pymodaq/examples/custom_viewer.py +0 -112
  85. pymodaq/examples/parameter_ex.py +0 -138
  86. pymodaq/examples/preset_MockCamera.xml +0 -1
  87. pymodaq/post_treatment/daq_measurement/daq_measurement_GUI.py +0 -142
  88. pymodaq/post_treatment/daq_measurement/daq_measurement_GUI.ui +0 -232
  89. pymodaq/post_treatment/daq_measurement/daq_measurement_main.py +0 -391
  90. pymodaq/post_treatment/daq_measurement/process_from_QtDesigner_DAQ_Measurement_GUI.bat +0 -2
  91. pymodaq/post_treatment/process_to_scalar.py +0 -263
  92. pymodaq/resources/QtDesigner_Ressources/Icon_Library/1d.png +0 -0
  93. pymodaq/resources/QtDesigner_Ressources/Icon_Library/2d.png +0 -0
  94. pymodaq/resources/QtDesigner_Ressources/Icon_Library/3d.png +0 -0
  95. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add2.png +0 -0
  96. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add_Step.png +0 -0
  97. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve.png +0 -0
  98. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve_All.png +0 -0
  99. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Browse_Dir_Path.png +0 -0
  100. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Calculator.png +0 -0
  101. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnGroup.png +0 -0
  102. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnNum.png +0 -0
  103. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnText.png +0 -0
  104. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnTime.png +0 -0
  105. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnWave.png +0 -0
  106. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Close3.png +0 -0
  107. pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll.png +0 -0
  108. pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll_32.png +0 -0
  109. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ColorPicker.png +0 -0
  110. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Contract.png +0 -0
  111. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Create.png +0 -0
  112. pymodaq/resources/QtDesigner_Ressources/Icon_Library/DeleteLayer.png +0 -0
  113. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditOpen.png +0 -0
  114. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditRedo.png +0 -0
  115. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditUndo.png +0 -0
  116. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Ellipse.png +0 -0
  117. pymodaq/resources/QtDesigner_Ressources/Icon_Library/EllipseFilled.png +0 -0
  118. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error.png +0 -0
  119. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ErrorMessage.png +0 -0
  120. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error_16.png +0 -0
  121. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Exit.png +0 -0
  122. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Expand.png +0 -0
  123. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll.png +0 -0
  124. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll_32.png +0 -0
  125. pymodaq/resources/QtDesigner_Ressources/Icon_Library/FFT.png +0 -0
  126. pymodaq/resources/QtDesigner_Ressources/Icon_Library/HLM.ico +0 -0
  127. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help.png +0 -0
  128. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help_32.png +0 -0
  129. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Histogram.png +0 -0
  130. pymodaq/resources/QtDesigner_Ressources/Icon_Library/LUT_LookUpTable.png +0 -0
  131. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass.png +0 -0
  132. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass_24.png +0 -0
  133. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Marker.png +0 -0
  134. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Math.png +0 -0
  135. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MeasurementStudio_32.png +0 -0
  136. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Move.png +0 -0
  137. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveDown.png +0 -0
  138. pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveUp.png +0 -0
  139. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Multiply.png +0 -0
  140. pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewFile.png +0 -0
  141. pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewLayer.png +0 -0
  142. pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_File.png +0 -0
  143. pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_Folder.png +0 -0
  144. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open.png +0 -0
  145. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_1D.png +0 -0
  146. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_2D.png +0 -0
  147. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File.png +0 -0
  148. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File_32.png +0 -0
  149. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_sim.png +0 -0
  150. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Options.png +0 -0
  151. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope.png +0 -0
  152. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope_16.png +0 -0
  153. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Pass.png +0 -0
  154. pymodaq/resources/QtDesigner_Ressources/Icon_Library/RGB.png +0 -0
  155. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rectangle.png +0 -0
  156. pymodaq/resources/QtDesigner_Ressources/Icon_Library/RectangleFilled.png +0 -0
  157. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Redo.png +0 -0
  158. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh.png +0 -0
  159. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh2.png +0 -0
  160. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh_32.png +0 -0
  161. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Region.png +0 -0
  162. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rendezvous.png +0 -0
  163. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SELECT.png +0 -0
  164. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save.png +0 -0
  165. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll.png +0 -0
  166. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll_32.png +0 -0
  167. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs.png +0 -0
  168. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs_32.png +0 -0
  169. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_24.png +0 -0
  170. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_32.png +0 -0
  171. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Search.png +0 -0
  172. pymodaq/resources/QtDesigner_Ressources/Icon_Library/SelectPolygon.png +0 -0
  173. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Select_24.png +0 -0
  174. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Settings.png +0 -0
  175. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snap&Save.png +0 -0
  176. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot.png +0 -0
  177. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2.png +0 -0
  178. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_16.png +0 -0
  179. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_32.png +0 -0
  180. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Spreadsheet.png +0 -0
  181. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics.png +0 -0
  182. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics2.png +0 -0
  183. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Status.png +0 -0
  184. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Subtract.png +0 -0
  185. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Vision.png +0 -0
  186. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Volts.png +0 -0
  187. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Wait2.png +0 -0
  188. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_1_1.png +0 -0
  189. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_in.png +0 -0
  190. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_out.png +0 -0
  191. pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_to_Selection.png +0 -0
  192. pymodaq/resources/QtDesigner_Ressources/Icon_Library/abort.png +0 -0
  193. pymodaq/resources/QtDesigner_Ressources/Icon_Library/advanced2.png +0 -0
  194. pymodaq/resources/QtDesigner_Ressources/Icon_Library/algo.png +0 -0
  195. pymodaq/resources/QtDesigner_Ressources/Icon_Library/autoscale.png +0 -0
  196. pymodaq/resources/QtDesigner_Ressources/Icon_Library/b_icon.png +0 -0
  197. pymodaq/resources/QtDesigner_Ressources/Icon_Library/back.png +0 -0
  198. pymodaq/resources/QtDesigner_Ressources/Icon_Library/bg_icon.png +0 -0
  199. pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera.png +0 -0
  200. pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera_snap.png +0 -0
  201. pymodaq/resources/QtDesigner_Ressources/Icon_Library/cartesian.png +0 -0
  202. pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear2.png +0 -0
  203. pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear_ROI.png +0 -0
  204. pymodaq/resources/QtDesigner_Ressources/Icon_Library/close2.png +0 -0
  205. pymodaq/resources/QtDesigner_Ressources/Icon_Library/cluster2.png +0 -0
  206. pymodaq/resources/QtDesigner_Ressources/Icon_Library/color.png +0 -0
  207. pymodaq/resources/QtDesigner_Ressources/Icon_Library/color2.png +0 -0
  208. pymodaq/resources/QtDesigner_Ressources/Icon_Library/continuous.png +0 -0
  209. pymodaq/resources/QtDesigner_Ressources/Icon_Library/data.png +0 -0
  210. pymodaq/resources/QtDesigner_Ressources/Icon_Library/delay.png +0 -0
  211. pymodaq/resources/QtDesigner_Ressources/Icon_Library/download.png +0 -0
  212. pymodaq/resources/QtDesigner_Ressources/Icon_Library/download2.png +0 -0
  213. pymodaq/resources/QtDesigner_Ressources/Icon_Library/error2.png +0 -0
  214. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ethernet.png +0 -0
  215. pymodaq/resources/QtDesigner_Ressources/Icon_Library/exit2.png +0 -0
  216. pymodaq/resources/QtDesigner_Ressources/Icon_Library/fan.png +0 -0
  217. pymodaq/resources/QtDesigner_Ressources/Icon_Library/filter2.png +0 -0
  218. pymodaq/resources/QtDesigner_Ressources/Icon_Library/g_icon.png +0 -0
  219. pymodaq/resources/QtDesigner_Ressources/Icon_Library/gear2.png +0 -0
  220. pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to.png +0 -0
  221. pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_1.png +0 -0
  222. pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_2.png +0 -0
  223. pymodaq/resources/QtDesigner_Ressources/Icon_Library/grab.png +0 -0
  224. pymodaq/resources/QtDesigner_Ressources/Icon_Library/graph.png +0 -0
  225. pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2.png +0 -0
  226. pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2_32.png +0 -0
  227. pymodaq/resources/QtDesigner_Ressources/Icon_Library/green_light.png +0 -0
  228. pymodaq/resources/QtDesigner_Ressources/Icon_Library/grey_icon.png +0 -0
  229. pymodaq/resources/QtDesigner_Ressources/Icon_Library/greyscale.png +0 -0
  230. pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1.png +0 -0
  231. pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1_32.png +0 -0
  232. pymodaq/resources/QtDesigner_Ressources/Icon_Library/home2.png +0 -0
  233. pymodaq/resources/QtDesigner_Ressources/Icon_Library/information2.png +0 -0
  234. pymodaq/resources/QtDesigner_Ressources/Icon_Library/ini.png +0 -0
  235. pymodaq/resources/QtDesigner_Ressources/Icon_Library/input.png +0 -0
  236. pymodaq/resources/QtDesigner_Ressources/Icon_Library/integrator.png +0 -0
  237. pymodaq/resources/QtDesigner_Ressources/Icon_Library/joystick.png +0 -0
  238. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green.png +0 -0
  239. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green_16.png +0 -0
  240. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red.png +0 -0
  241. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red_16.png +0 -0
  242. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow.png +0 -0
  243. pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow_16.png +0 -0
  244. pymodaq/resources/QtDesigner_Ressources/Icon_Library/limiter.png +0 -0
  245. pymodaq/resources/QtDesigner_Ressources/Icon_Library/load_ROI.png +0 -0
  246. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meshPlot.png +0 -0
  247. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter.png +0 -0
  248. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter2.png +0 -0
  249. pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter_32.png +0 -0
  250. pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_contour.png +0 -0
  251. pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_straight_line.png +0 -0
  252. pymodaq/resources/QtDesigner_Ressources/Icon_Library/movie.png +0 -0
  253. pymodaq/resources/QtDesigner_Ressources/Icon_Library/multi_point.png +0 -0
  254. pymodaq/resources/QtDesigner_Ressources/Icon_Library/multiplexer.png +0 -0
  255. pymodaq/resources/QtDesigner_Ressources/Icon_Library/new.png +0 -0
  256. pymodaq/resources/QtDesigner_Ressources/Icon_Library/openArrow.png +0 -0
  257. pymodaq/resources/QtDesigner_Ressources/Icon_Library/openTree.png +0 -0
  258. pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope2.png +0 -0
  259. pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope3.png +0 -0
  260. pymodaq/resources/QtDesigner_Ressources/Icon_Library/overlay.png +0 -0
  261. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2.png +0 -0
  262. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2_16.png +0 -0
  263. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass_32.png +0 -0
  264. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pause.png +0 -0
  265. pymodaq/resources/QtDesigner_Ressources/Icon_Library/permute.png +0 -0
  266. pymodaq/resources/QtDesigner_Ressources/Icon_Library/phase.png +0 -0
  267. pymodaq/resources/QtDesigner_Ressources/Icon_Library/play.png +0 -0
  268. pymodaq/resources/QtDesigner_Ressources/Icon_Library/polar.png +0 -0
  269. pymodaq/resources/QtDesigner_Ressources/Icon_Library/pole_zero.png +0 -0
  270. pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerMeter.png +0 -0
  271. pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch.png +0 -0
  272. pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch_16.png +0 -0
  273. pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2.png +0 -0
  274. pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2_32.png +0 -0
  275. pymodaq/resources/QtDesigner_Ressources/Icon_Library/properties.png +0 -0
  276. pymodaq/resources/QtDesigner_Ressources/Icon_Library/r_icon.png +0 -0
  277. pymodaq/resources/QtDesigner_Ressources/Icon_Library/radiocontrolbutton.png +0 -0
  278. pymodaq/resources/QtDesigner_Ressources/Icon_Library/random.png +0 -0
  279. pymodaq/resources/QtDesigner_Ressources/Icon_Library/read2.png +0 -0
  280. pymodaq/resources/QtDesigner_Ressources/Icon_Library/red_light.png +0 -0
  281. pymodaq/resources/QtDesigner_Ressources/Icon_Library/remove.png +0 -0
  282. pymodaq/resources/QtDesigner_Ressources/Icon_Library/reset.png +0 -0
  283. pymodaq/resources/QtDesigner_Ressources/Icon_Library/rgb_icon.png +0 -0
  284. pymodaq/resources/QtDesigner_Ressources/Icon_Library/robot.png +0 -0
  285. pymodaq/resources/QtDesigner_Ressources/Icon_Library/rotation2.png +0 -0
  286. pymodaq/resources/QtDesigner_Ressources/Icon_Library/run2.png +0 -0
  287. pymodaq/resources/QtDesigner_Ressources/Icon_Library/run_all.png +0 -0
  288. pymodaq/resources/QtDesigner_Ressources/Icon_Library/saturation.png +0 -0
  289. pymodaq/resources/QtDesigner_Ressources/Icon_Library/saveTree.png +0 -0
  290. pymodaq/resources/QtDesigner_Ressources/Icon_Library/save_ROI.png +0 -0
  291. pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_horizontally.png +0 -0
  292. pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_vertically.png +0 -0
  293. pymodaq/resources/QtDesigner_Ressources/Icon_Library/search2.png +0 -0
  294. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select2.png +0 -0
  295. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all.png +0 -0
  296. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all2.png +0 -0
  297. pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_none.png +0 -0
  298. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence.png +0 -0
  299. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence2.png +0 -0
  300. pymodaq/resources/QtDesigner_Ressources/Icon_Library/snap.png +0 -0
  301. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sort_ascend.png +0 -0
  302. pymodaq/resources/QtDesigner_Ressources/Icon_Library/spectrumAnalyzer.png +0 -0
  303. pymodaq/resources/QtDesigner_Ressources/Icon_Library/start.png +0 -0
  304. pymodaq/resources/QtDesigner_Ressources/Icon_Library/status_cancelled.png +0 -0
  305. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop.png +0 -0
  306. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop2.png +0 -0
  307. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop3.png +0 -0
  308. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop_all.png +0 -0
  309. pymodaq/resources/QtDesigner_Ressources/Icon_Library/sum.png +0 -0
  310. pymodaq/resources/QtDesigner_Ressources/Icon_Library/surfacePlot.png +0 -0
  311. pymodaq/resources/QtDesigner_Ressources/Icon_Library/target.png +0 -0
  312. pymodaq/resources/QtDesigner_Ressources/Icon_Library/tree.png +0 -0
  313. pymodaq/resources/QtDesigner_Ressources/Icon_Library/updateTree.png +0 -0
  314. pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility2.png +0 -0
  315. pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility_small.png +0 -0
  316. pymodaq/resources/QtDesigner_Ressources/Icon_Library/vector.png +0 -0
  317. pymodaq/resources/QtDesigner_Ressources/Icon_Library/verify.png +0 -0
  318. pymodaq/resources/QtDesigner_Ressources/Icon_Library/video.png +0 -0
  319. pymodaq/resources/QtDesigner_Ressources/Icon_Library/wait.png +0 -0
  320. pymodaq/resources/QtDesigner_Ressources/Icon_Library/waterfallPlot.png +0 -0
  321. pymodaq/resources/QtDesigner_Ressources/Icon_Library/watershed.png +0 -0
  322. pymodaq/resources/QtDesigner_Ressources/Icon_Library/yellow_light.png +0 -0
  323. pymodaq/resources/QtDesigner_Ressources/Icon_Library/zip_file.png +0 -0
  324. pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomAuto.png +0 -0
  325. pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomReset.png +0 -0
  326. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.bat +0 -2
  327. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.qrc +0 -238
  328. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +0 -127453
  329. pymodaq/resources/QtDesigner_Ressources/__init__.py +0 -0
  330. pymodaq/resources/QtDesigner_Ressources/credit.rst +0 -7
  331. pymodaq/resources/QtDesigner_Ressources/icons.svg +0 -142
  332. pymodaq/resources/VERSION +0 -2
  333. pymodaq/resources/config_template.toml +0 -96
  334. pymodaq/resources/triangulation_data.npy +0 -0
  335. pymodaq/utils/abstract/__init__.py +0 -48
  336. pymodaq/utils/db/__init__.py +0 -0
  337. pymodaq/utils/db/db_logger/__init__.py +0 -0
  338. pymodaq/utils/factory.py +0 -82
  339. pymodaq/utils/gui_utils/custom_app.py +0 -133
  340. pymodaq/utils/gui_utils/dock.py +0 -107
  341. pymodaq/utils/gui_utils/file_io.py +0 -94
  342. pymodaq/utils/gui_utils/layout.py +0 -34
  343. pymodaq/utils/gui_utils/list_picker.py +0 -38
  344. pymodaq/utils/gui_utils/widgets/__init__.py +0 -5
  345. pymodaq/utils/gui_utils/widgets/label.py +0 -24
  346. pymodaq/utils/gui_utils/widgets/push.py +0 -149
  347. pymodaq/utils/gui_utils/widgets/qled.py +0 -62
  348. pymodaq/utils/gui_utils/widgets/spinbox.py +0 -24
  349. pymodaq/utils/gui_utils/widgets/table.py +0 -263
  350. pymodaq/utils/gui_utils/widgets/tree_layout.py +0 -188
  351. pymodaq/utils/gui_utils/widgets/tree_toml.py +0 -110
  352. pymodaq/utils/h5modules/backends.py +0 -1022
  353. pymodaq/utils/h5modules/browsing.py +0 -627
  354. pymodaq/utils/h5modules/data_saving.py +0 -1107
  355. pymodaq/utils/h5modules/exporter.py +0 -119
  356. pymodaq/utils/h5modules/exporters/__init__.py +0 -0
  357. pymodaq/utils/h5modules/exporters/base.py +0 -111
  358. pymodaq/utils/h5modules/exporters/flimj.py +0 -63
  359. pymodaq/utils/h5modules/exporters/hyperspy.py +0 -143
  360. pymodaq/utils/h5modules/saving.py +0 -866
  361. pymodaq/utils/h5modules/utils.py +0 -115
  362. pymodaq/utils/managers/action_manager.py +0 -489
  363. pymodaq/utils/managers/parameter_manager.py +0 -279
  364. pymodaq/utils/managers/roi_manager.py +0 -740
  365. pymodaq/utils/parameter/ioxml.py +0 -545
  366. pymodaq/utils/parameter/pymodaq_ptypes/__init__.py +0 -38
  367. pymodaq/utils/parameter/pymodaq_ptypes/bool.py +0 -31
  368. pymodaq/utils/parameter/pymodaq_ptypes/date.py +0 -126
  369. pymodaq/utils/parameter/pymodaq_ptypes/filedir.py +0 -143
  370. pymodaq/utils/parameter/pymodaq_ptypes/itemselect.py +0 -265
  371. pymodaq/utils/parameter/pymodaq_ptypes/led.py +0 -44
  372. pymodaq/utils/parameter/pymodaq_ptypes/list.py +0 -150
  373. pymodaq/utils/parameter/pymodaq_ptypes/numeric.py +0 -18
  374. pymodaq/utils/parameter/pymodaq_ptypes/pixmap.py +0 -175
  375. pymodaq/utils/parameter/pymodaq_ptypes/slide.py +0 -166
  376. pymodaq/utils/parameter/pymodaq_ptypes/table.py +0 -135
  377. pymodaq/utils/parameter/pymodaq_ptypes/tableview.py +0 -149
  378. pymodaq/utils/parameter/pymodaq_ptypes/text.py +0 -142
  379. pymodaq/utils/plotting/__init__.py +0 -0
  380. pymodaq/utils/plotting/data_viewers/__init__.py +0 -10
  381. pymodaq/utils/plotting/data_viewers/base.py +0 -286
  382. pymodaq/utils/plotting/data_viewers/viewer.py +0 -275
  383. pymodaq/utils/plotting/data_viewers/viewer0D.py +0 -298
  384. pymodaq/utils/plotting/data_viewers/viewer1D.py +0 -826
  385. pymodaq/utils/plotting/data_viewers/viewer1Dbasic.py +0 -231
  386. pymodaq/utils/plotting/data_viewers/viewer2D.py +0 -1118
  387. pymodaq/utils/plotting/data_viewers/viewer2D_basic.py +0 -146
  388. pymodaq/utils/plotting/data_viewers/viewerND.py +0 -800
  389. pymodaq/utils/plotting/gant_chart.py +0 -123
  390. pymodaq/utils/plotting/image_viewer.py +0 -97
  391. pymodaq/utils/plotting/items/__init__.py +0 -0
  392. pymodaq/utils/plotting/items/axis_scaled.py +0 -93
  393. pymodaq/utils/plotting/items/crosshair.py +0 -94
  394. pymodaq/utils/plotting/items/image.py +0 -388
  395. pymodaq/utils/plotting/navigator.py +0 -353
  396. pymodaq/utils/plotting/plotter/plotter.py +0 -94
  397. pymodaq/utils/plotting/plotter/plotters/__init__.py +0 -0
  398. pymodaq/utils/plotting/plotter/plotters/matplotlib_plotters.py +0 -134
  399. pymodaq/utils/plotting/plotter/plotters/qt_plotters.py +0 -78
  400. pymodaq/utils/plotting/utils/__init__.py +0 -0
  401. pymodaq/utils/plotting/utils/axes_viewer.py +0 -88
  402. pymodaq/utils/plotting/utils/filter.py +0 -585
  403. pymodaq/utils/plotting/utils/lineout.py +0 -226
  404. pymodaq/utils/plotting/utils/plot_utils.py +0 -579
  405. pymodaq/utils/plotting/utils/signalND.py +0 -1347
  406. pymodaq/utils/plotting/widgets.py +0 -76
  407. pymodaq/utils/qvariant.py +0 -12
  408. pymodaq/utils/slicing.py +0 -63
  409. pymodaq/utils/units.py +0 -216
  410. pymodaq-4.4.7.dist-info/METADATA +0 -163
  411. pymodaq-4.4.7.dist-info/RECORD +0 -446
  412. /pymodaq/{post_treatment/daq_analysis → daq_utils}/__init__.py +0 -0
  413. /pymodaq/{utils/abstract/logger.py → extensions/daq_logger/abstract.py} +0 -0
  414. /pymodaq/{post_treatment/daq_measurement → extensions/daq_logger/db}/__init__.py +0 -0
  415. {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/licenses/LICENSE +0 -0
pymodaq/utils/logger.py CHANGED
@@ -1,78 +1,6 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- Created the 27/10/2022
1
+ from pymodaq_utils.logger import set_logger, get_module_name, get_set_config_dir, get_base_logger
4
2
 
5
- @author: Sebastien Weber
6
- """
7
- import logging
8
- import warnings
9
- from logging.handlers import TimedRotatingFileHandler
10
- from pathlib import Path
3
+ from pymodaq_utils.warnings import deprecation_msg
11
4
 
12
- from pymodaq.utils.config import get_set_config_dir, Config
13
-
14
- config = Config()
15
-
16
-
17
- def set_logger(logger_name, add_handler=False, base_logger=False, add_to_console=False, log_level=None,
18
- logger_base_name='pymodaq') -> logging.Logger:
19
- """defines a logger of a given name and eventually add an handler to it
20
-
21
- Parameters
22
- ----------
23
- logger_name: (str) the name of the logger (usually it is the module name as returned by get_module_name
24
- add_handler (bool) if True adds a TimedRotatingFileHandler to the logger instance (should be True if logger set from
25
- main app
26
- base_logger: (bool) specify if this is the parent logger (usually where one defines the handler)
27
-
28
- Returns
29
- -------
30
- logger: (logging.Logger) logger instance
31
- See Also
32
- --------
33
- get_module_name, logging.handlers.TimedRotatingFileHandler
34
- """
35
- if not base_logger:
36
- logger_name = f'{logger_base_name}.{logger_name}'
37
-
38
- logger = logging.getLogger(logger_name)
39
- log_path = get_set_config_dir('log', user=True)
40
- if log_level is None:
41
- log_level = config('general', 'debug_level')
42
- logger.setLevel(log_level)
43
- if add_handler:
44
- log_file_path = log_path.joinpath(f'{logger_base_name}.log')
45
- if not log_file_path.is_file():
46
- log_file_path.touch(mode=0o777)
47
- handler = TimedRotatingFileHandler(log_file_path, when='midnight')
48
- formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
49
- handler.setFormatter(formatter)
50
- logger.addHandler(handler)
51
-
52
- logging.captureWarnings(True)
53
- # only catch DeprecationWarning in DEBUG level
54
- if log_level == 'DEBUG':
55
- warnings.filterwarnings('default', category=DeprecationWarning)
56
- else:
57
- warnings.filterwarnings('ignore', category=DeprecationWarning)
58
- warnings_logger = logging.getLogger("py.warnings")
59
- warnings_logger.addHandler(handler)
60
-
61
- if add_to_console:
62
- console_handler = logging.StreamHandler()
63
- formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
64
- console_handler.setFormatter(formatter)
65
- logger.addHandler(console_handler)
66
- return logger
67
-
68
-
69
- def get_base_logger(logger: logging.Logger) -> logging.Logger:
70
- while logger.name != 'pymodaq':
71
- logger = logger.parent
72
- return logger
73
-
74
-
75
- def get_module_name(module__file__path):
76
- """from the full path of a module extract its name"""
77
- path = Path(module__file__path)
78
- return path.stem
5
+ deprecation_msg('Importing logger stuff from pymodaq is deprecated in pymodaq>5.0.0,'
6
+ 'please use the pymodaq_utils package')
@@ -1,29 +1,26 @@
1
+ from collections import OrderedDict
2
+ from pathlib import Path
3
+ import sys
1
4
  from typing import List
2
5
 
3
- import pymodaq.utils.config
4
- import pymodaq.utils.gui_utils.dock
5
- import pymodaq.utils.gui_utils.file_io
6
- import pymodaq.utils.messenger
7
6
  from qtpy import QtWidgets, QtCore
8
- import sys
9
- import os
10
7
 
11
- from pymodaq.utils.managers.parameter_manager import ParameterManager
8
+ from pymodaq_utils.logger import set_logger, get_module_name
9
+ from pymodaq_utils import config as config_mod
10
+
11
+ from pymodaq_gui.managers.parameter_manager import ParameterManager
12
+ from pymodaq_gui.utils import Dock, file_io, DockArea
13
+ from pymodaq_gui.parameter import ioxml
14
+ from pymodaq_gui.messenger import messagebox
15
+
12
16
  from pymodaq.utils.managers.modules_manager import ModulesManager
13
- from pymodaq.utils.gui_utils import Dock
14
- from pymodaq.utils.logger import set_logger, get_module_name
15
- from pymodaq.utils import config as config_mod
16
- from pymodaq.utils.parameter import ioxml
17
17
  from pymodaq.utils.scanner import Scanner
18
18
  from pymodaq.utils.scanner.scan_factory import ScannerBase
19
- from pymodaq.utils.scanner.utils import ScanType #, adaptive_losses
20
- from pathlib import Path
21
- from collections import OrderedDict
22
- from pymodaq.utils.messenger import messagebox
19
+ from pymodaq.utils.config import get_set_batch_path
23
20
 
24
21
  logger = set_logger(get_module_name(__file__))
25
22
 
26
- batch_path = config_mod.get_set_batch_path()
23
+ batch_path = get_set_batch_path()
27
24
 
28
25
  params = [
29
26
  {'title': 'Actuators/Detectors Selection', 'name': 'modules', 'type': 'group', 'children': [
@@ -92,7 +89,7 @@ class BatchManager(ParameterManager):
92
89
 
93
90
  """
94
91
  if filename is None or filename is False:
95
- filename = pymodaq.utils.gui_utils.file_io.select_file(start_path=self.batch_path, save=False, ext='xml')
92
+ filename = file_io.select_file(start_path=self.batch_path, save=False, ext='xml')
96
93
  if filename == '':
97
94
  return
98
95
 
@@ -301,7 +298,7 @@ class BatchScanner(QtCore.QObject):
301
298
 
302
299
  def load_file(self, filepath=None):
303
300
  if filepath is None:
304
- path = pymodaq.utils.gui_utils.file_io.select_file(start_path=batch_path, save=False, ext='xml')
301
+ path = file_io.select_file(start_path=batch_path, save=False, ext='xml')
305
302
  if path != '':
306
303
  filepath = path
307
304
  else:
@@ -319,7 +316,7 @@ def main_batch_scanner():
319
316
  from pymodaq.control_modules.mocks import MockDAQMove, MockDAQViewer
320
317
  app = QtWidgets.QApplication(sys.argv)
321
318
  win = QtWidgets.QMainWindow()
322
- area = pymodaq.utils.gui_utils.dock.DockArea()
319
+ area = DockArea()
323
320
  win.setCentralWidget(area)
324
321
 
325
322
  # prog = BatchManager(msgbox=False, actuators=['Xaxis', 'Yaxis'], detectors=['Det0D', 'Det1D'])
@@ -5,12 +5,16 @@ from qtpy.QtCore import QObject, Signal, Slot, QThread
5
5
  from qtpy import QtWidgets
6
6
  import time
7
7
 
8
- from pymodaq.utils.logger import set_logger, get_module_name, get_module_name
9
- from pymodaq.utils import daq_utils as utils
10
- from pymodaq.utils.config import Config
11
- from pymodaq.utils.data import DataToExport, DataFromPlugins, DataActuator
12
- from pyqtgraph.parametertree import Parameter, ParameterTree
13
- from pymodaq.utils.managers.parameter_manager import ParameterManager
8
+ from pymodaq_utils.logger import set_logger, get_module_name
9
+ from pymodaq_utils import utils
10
+ from pymodaq_utils.config import Config
11
+
12
+ from pymodaq_data.data import DataToExport
13
+
14
+ from pymodaq_gui.managers.parameter_manager import ParameterManager
15
+ from pymodaq_gui.utils import Dock
16
+
17
+ from pymodaq.utils.data import DataActuator
14
18
 
15
19
 
16
20
  if TYPE_CHECKING:
@@ -35,6 +39,7 @@ class ModulesManager(QObject, ParameterManager):
35
39
  selected_actuators: list of DAQ_Move
36
40
  sublist of actuators
37
41
  """
42
+ settings_name = 'ModulesManagerSettings'
38
43
  detectors_changed = Signal(list)
39
44
  actuators_changed = Signal(list)
40
45
  det_done_signal = Signal(DataToExport) # dte here contains DataWithAxes
@@ -113,7 +118,7 @@ class ModulesManager(QObject, ParameterManager):
113
118
  modules = [modules]
114
119
  return [mod.title for mod in modules]
115
120
 
116
- def get_mods_from_names(self, names, mod='det'):
121
+ def get_mods_from_names(self, names, mod='det') -> List[Union['DAQ_Move', 'DAQ_Viewer']]:
117
122
  """Getter of a list of given modules from their name (title)
118
123
 
119
124
  Parameters
@@ -168,9 +173,14 @@ class ModulesManager(QObject, ParameterManager):
168
173
 
169
174
  @property
170
175
  def detectors_all(self):
171
- """Get the list of all detectors"""
176
+ """Get/Set the list of all detectors"""
172
177
  return self._detectors
173
178
 
179
+ @detectors_all.setter
180
+ def detectors_all(self, detectors: List['DAQ_Viewer']):
181
+ self._detectors = detectors
182
+
183
+
174
184
  @property
175
185
  def actuators(self) -> List['DAQ_Move']:
176
186
  """Get the list of selected actuators"""
@@ -181,6 +191,10 @@ class ModulesManager(QObject, ParameterManager):
181
191
  """Get the list of all actuators"""
182
192
  return self._actuators
183
193
 
194
+ @actuators_all.setter
195
+ def actuators_all(self, actuators: List['DAQ_Move']):
196
+ self._actuators = actuators
197
+
184
198
  @property
185
199
  def modules(self):
186
200
  """Get the list of all detectors and actuators"""
@@ -240,11 +254,11 @@ class ModulesManager(QObject, ParameterManager):
240
254
  elif param.name() == 'actuators':
241
255
  self.actuators_changed.emit(param.value()['selected'])
242
256
 
243
- def get_det_data_list(self):
257
+ def get_det_data_list(self) -> DataToExport:
244
258
  """Do a snap of selected detectors, to get the list of all the data and processed data"""
245
259
 
246
260
  self.connect_detectors()
247
- datas: DataToExport = self.grab_datas()
261
+ datas: DataToExport = self.grab_data()
248
262
 
249
263
  data_list0D = datas.get_full_names('data0D')
250
264
  data_list1D = datas.get_full_names('data1D')
@@ -261,6 +275,7 @@ class ModulesManager(QObject, ParameterManager):
261
275
  dict(all_items=data_listND, selected=[]))
262
276
 
263
277
  self.connect_detectors(False)
278
+ return datas
264
279
 
265
280
  def get_selected_probed_data(self, dim='0D'):
266
281
  """Get the name of selected data names of a given dimensionality
@@ -272,7 +287,7 @@ class ModulesManager(QObject, ParameterManager):
272
287
  """
273
288
  return self.settings.child('data_dimensions', f'det_data_list{dim.upper()}').value()['selected']
274
289
 
275
- def grab_datas(self, **kwargs):
290
+ def grab_data(self, **kwargs):
276
291
  """Do a single grab of connected and selected detectors"""
277
292
  self.det_done_datas = DataToExport(name=__class__.__name__, control_module='DAQ_Viewer')
278
293
  self._received_data = 0
@@ -296,6 +311,10 @@ class ModulesManager(QObject, ParameterManager):
296
311
  self.det_done_signal.emit(self.det_done_datas)
297
312
  return self.det_done_datas
298
313
 
314
+ def grab_datas(self, **kwargs):
315
+ """ For back compatibility but use self.grab_data"""
316
+ return self.grab_data(**kwargs)
317
+
299
318
  def connect_actuators(self, connect=True, slot=None, signal='move_done'):
300
319
  """Connect the selected actuators signal to a given or default slot
301
320
 
@@ -478,11 +497,6 @@ class ModulesManager(QObject, ParameterManager):
478
497
  self.det_done_flag = True
479
498
  self.settings.child('det_done').setValue(self.det_done_flag)
480
499
 
481
- # if data.name not in list(self.det_done_datas.keys()):
482
- # self.det_done_datas[data['name']] = data
483
- # if len(self.det_done_datas.items()) == len(self.detectors):
484
- # self.det_done_flag = True
485
-
486
500
 
487
501
  if __name__ == '__main__':
488
502
  import sys
@@ -490,7 +504,6 @@ if __name__ == '__main__':
490
504
  app = QtWidgets.QApplication(sys.argv)
491
505
  from qtpy.QtCore import QThread
492
506
  from pymodaq.utils.gui_utils import DockArea
493
- from pyqtgraph.dockarea import Dock
494
507
  from pymodaq.control_modules.daq_viewer import DAQ_Viewer
495
508
  from pymodaq.control_modules.daq_move import DAQ_Move
496
509
 
@@ -2,11 +2,9 @@ from qtpy import QtWidgets
2
2
  import sys
3
3
  import os
4
4
 
5
- from pymodaq.utils.parameter import ioxml
6
- from pymodaq.utils.parameter import ParameterTree, Parameter
7
- from pyqtgraph.parametertree.Parameter import registerParameterType
8
- from pyqtgraph.parametertree.parameterTypes.basetypes import GroupParameter
9
- from pymodaq.utils.gui_utils import select_file
5
+ from pymodaq_gui.parameter import ioxml, Parameter, ParameterTree
6
+ from pymodaq_gui.parameter.pymodaq_ptypes import registerParameterType, GroupParameter
7
+ from pymodaq_gui.utils import select_file
10
8
 
11
9
  # check if overshoot_configurations directory exists on the drive
12
10
  from pymodaq.utils.config import get_set_overshoot_path
@@ -120,6 +118,8 @@ class OvershootManager:
120
118
  self.det_modules = det_modules
121
119
  self.actuators_modules = actuators_modules
122
120
 
121
+ self._activated = False
122
+
123
123
  if msgbox:
124
124
  msgBox = QtWidgets.QMessageBox()
125
125
  msgBox.setText("Overshoot Manager?")
@@ -140,12 +140,21 @@ class OvershootManager:
140
140
  else: # cancel
141
141
  pass
142
142
 
143
+ @property
144
+ def activated(self) -> bool:
145
+ return self._activated
146
+
147
+ @activated.setter
148
+ def activated(self, status: bool):
149
+ self._activated = status
150
+
143
151
  def set_file_overshoot(self, filename, show=True):
144
152
  """
145
153
 
146
154
  """
147
155
  children = ioxml.XML_file_to_parameter(filename)
148
- self.overshoot_params = Parameter.create(title='Overshoot', name='Overshoot', type='group', children=children)
156
+ self.overshoot_params = Parameter.create(title='Overshoot', name='Overshoot', type='group',
157
+ children=children)
149
158
  if show:
150
159
  self.show_overshoot()
151
160
 
@@ -191,6 +200,39 @@ class OvershootManager:
191
200
  ioxml.parameter_to_xml_file(
192
201
  self.overshoot_params, os.path.join(overshoot_path, self.overshoot_params.child('filename').value()))
193
202
 
203
+ def activate_overshoot(self, det_modules, act_modules, status: bool):
204
+ det_titles = [det.title for det in det_modules]
205
+ move_titles = [move.title for move in act_modules]
206
+
207
+ if self.overshoot_params is not None:
208
+ for det_param in self.overshoot_params.child(
209
+ 'Detectors').children():
210
+ if det_param['trig_overshoot']:
211
+ det_index = det_titles.index(det_param.opts['title'])
212
+ det_module = det_modules[det_index]
213
+ det_module.settings.child(
214
+ 'main_settings', 'overshoot', 'stop_overshoot').setValue(status)
215
+ det_module.settings.child(
216
+ 'main_settings', 'overshoot', 'overshoot_value').setValue(
217
+ det_param['overshoot_value'])
218
+ for move_param in det_param.child('params').children():
219
+ if move_param['move_overshoot']:
220
+ move_index = move_titles.index(move_param.opts['title'])
221
+ move_module = act_modules[move_index]
222
+ if status:
223
+ det_module.overshoot_signal.connect(
224
+ self.create_overshoot_fun(
225
+ move_module, move_param['position']))
226
+ else:
227
+ try:
228
+ det_module.overshoot_signal.disconnect()
229
+ except Exception as e:
230
+ pass
231
+
232
+ @staticmethod
233
+ def create_overshoot_fun(move_module, position):
234
+ return lambda: move_module.move_abs(position)
235
+
194
236
 
195
237
  if __name__ == '__main__':
196
238
  app = QtWidgets.QApplication(sys.argv)
@@ -1,26 +1,27 @@
1
- from pymodaq.extensions import get_models
2
- import pymodaq.utils.config
3
- from pymodaq.utils.logger import set_logger, get_module_name, get_module_name
4
- from pymodaq.utils.gui_utils.file_io import select_file
5
- from qtpy import QtWidgets
6
- import sys
7
1
  import os
8
- from pymodaq.utils.parameter import ParameterTree, Parameter
9
- from pymodaq.utils.parameter import ioxml
10
- from pymodaq.utils.messenger import dialog as dialogbox
11
- from pymodaq.utils import daq_utils as utils
12
2
  from pathlib import Path
3
+ import sys
4
+
5
+ from qtpy import QtWidgets
6
+
7
+ import pymodaq_utils.config as config_mod
8
+ from pymodaq_utils.logger import set_logger, get_module_name
9
+
10
+ from pymodaq_gui.utils.file_io import select_file
11
+ from pymodaq_gui.parameter import ParameterTree, Parameter
12
+ from pymodaq_gui.parameter import ioxml
13
+ from pymodaq_gui.messenger import dialog as dialogbox
14
+ from pymodaq.utils import config as config_mod_pymodaq
15
+ from pymodaq.extensions import get_models
16
+
13
17
  import pymodaq.utils.managers.preset_manager_utils # to register move and det types
14
18
 
15
19
  logger = set_logger(get_module_name(__file__))
16
20
 
17
21
  # check if preset_mode directory exists on the drive
18
- pid_path = pymodaq.utils.config.get_set_pid_path()
19
- preset_path = pymodaq.utils.config.get_set_preset_path()
20
- overshoot_path = pymodaq.utils.config.get_set_overshoot_path()
21
- layout_path = pymodaq.utils.config.get_set_layout_path()
22
-
23
- pid_models = [mod['name'] for mod in get_models()]
22
+ preset_path = config_mod_pymodaq.get_set_preset_path()
23
+ overshoot_path = config_mod_pymodaq.get_set_overshoot_path()
24
+ layout_path = config_mod_pymodaq.get_set_layout_path()
24
25
 
25
26
 
26
27
  class PresetManager:
@@ -34,8 +35,8 @@ class PresetManager:
34
35
  self.extra_params = extra_params
35
36
  self.param_options = param_options
36
37
  self.preset_path = path
37
- self.preset_params = None
38
- self.pid_type = False
38
+ self.preset_params: Parameter = None
39
+
39
40
  if msgbox:
40
41
  msgBox = QtWidgets.QMessageBox()
41
42
  msgBox.setText("Preset Manager?")
@@ -56,33 +57,28 @@ class PresetManager:
56
57
  else: # cancel
57
58
  pass
58
59
 
60
+ @property
61
+ def filename(self) -> str:
62
+ try:
63
+ return self.preset_params['filename']
64
+ except:
65
+ return None
66
+
59
67
  def set_file_preset(self, filename, show=True):
60
68
  """
61
69
 
62
70
  """
63
71
  status = False
64
- self.pid_type = False
65
72
  children = ioxml.XML_file_to_parameter(filename)
66
73
  self.preset_params = Parameter.create(title='Preset', name='Preset', type='group', children=children)
67
74
  if show:
68
75
  status = self.show_preset()
69
76
  return status
70
77
 
71
- def get_set_pid_model_params(self, model_file):
72
- self.preset_params.child('model_settings').clearChildren()
73
- model = get_models(model_file)
74
- if model is not None:
75
- params = model['class'].params
76
- self.preset_params.child('model_settings').addChildren(params)
77
78
 
78
79
  def set_new_preset(self):
79
- self.pid_type = False
80
80
  param = [
81
81
  {'title': 'Filename:', 'name': 'filename', 'type': 'str', 'value': 'preset_default'},
82
- {'title': 'Use PID as actuator:', 'name': 'use_pid', 'type': 'bool', 'value': False},
83
- # {'title': 'Saving options:', 'name': 'saving_options', 'type': 'group', 'children': H5Saver.params},
84
- {'title': 'PID models:', 'name': 'pid_models', 'type': 'list', 'visible': False,
85
- 'limits': pid_models},
86
82
  {'title': 'Model Settings:', 'name': 'model_settings', 'type': 'group', 'visible': False, 'children': []},
87
83
  ]
88
84
  params_move = [
@@ -98,9 +94,6 @@ class PresetManager:
98
94
  except Exception as e:
99
95
  logger.exception(str(e))
100
96
 
101
- if len(pid_models) != 0:
102
- self.get_set_pid_model_params(pid_models[0])
103
-
104
97
  self.preset_params.sigTreeStateChanged.connect(self.parameter_tree_changed)
105
98
 
106
99
  status = self.show_preset()
@@ -125,12 +118,6 @@ class PresetManager:
125
118
  data[0].child('params', 'main_settings', 'module_name').setValue(data[0].child('name').value())
126
119
 
127
120
  elif change == 'value':
128
-
129
- if param.name() == 'use_pid':
130
- self.preset_params.child('pid_models').show(param.value())
131
- self.preset_params.child('model_settings').show(param.value())
132
- if param.name() == 'pid_models' and param.value() != '':
133
- self.get_set_pid_model_params(param.value())
134
121
  if param.name() == 'name':
135
122
  param.parent().child('params', 'main_settings', 'module_name').setValue(param.value())
136
123
 
@@ -144,8 +131,8 @@ class PresetManager:
144
131
  dialog = QtWidgets.QDialog()
145
132
  vlayout = QtWidgets.QVBoxLayout()
146
133
  tree = ParameterTree()
147
- tree.setMinimumWidth(400)
148
- tree.setMinimumHeight(500)
134
+ # tree.setMinimumWidth(400)
135
+ # tree.setMinimumHeight(500)
149
136
  tree.setParameters(self.preset_params, showTop=False)
150
137
 
151
138
  vlayout.addWidget(tree)
@@ -161,20 +148,18 @@ class PresetManager:
161
148
  dialog.setWindowTitle('Fill in information about this manager')
162
149
  res = dialog.exec()
163
150
 
164
- if self.pid_type:
165
- path = pid_path
166
- else:
167
- path = self.preset_path
151
+ path = self.preset_path
152
+ file= None
168
153
 
169
154
  if res == dialog.Accepted:
170
155
  # save managers parameters in a xml file
171
156
  # start = os.path.split(os.path.split(os.path.realpath(__file__))[0])[0]
172
157
  # start = os.path.join("..",'daq_scan')
173
- filename_without_extension = self.preset_params.child('filename').value()
158
+ filename_without_extension = self.filename
174
159
 
175
160
  try:
176
161
  ioxml.parameter_to_xml_file(self.preset_params,
177
- os.path.join(path, filename_without_extension),
162
+ path.joinpath(filename_without_extension),
178
163
  overwrite=False)
179
164
  except FileExistsError as currenterror:
180
165
  # logger.warning(str(currenterror)+"File " + filename_without_extension + ".xml exists")
@@ -183,24 +168,19 @@ class PresetManager:
183
168
  message="File exist do you want to overwrite it ?")
184
169
  if user_agreed:
185
170
  ioxml.parameter_to_xml_file(self.preset_params,
186
- os.path.join(path, filename_without_extension))
171
+ path.joinpath(filename_without_extension))
187
172
  logger.warning(f"File {filename_without_extension}.xml overwriten at user request")
188
173
  else:
189
174
  logger.warning(f"File {filename_without_extension}.xml wasn't saved at user request")
190
175
  # emit status signal to dashboard to write : did not save ?
191
176
  pass
192
177
 
193
- if not self.pid_type:
194
- # check if overshoot configuration and layout configuration with same name exists => delete them if yes
195
- file = os.path.splitext(self.preset_params.child('filename').value())[0]
196
- file = os.path.join(overshoot_path, file + '.xml')
197
- if os.path.isfile(file):
198
- os.remove(file)
199
-
200
- file = os.path.splitext(self.preset_params.child('filename').value())[0]
201
- file = os.path.join(layout_path, file + '.dock')
202
- if os.path.isfile(file):
203
- os.remove(file)
178
+ # check if overshoot configuration and layout configuration with same name exists => delete them if yes
179
+ over_shoot_file = overshoot_path.joinpath(self.filename + '.xml')
180
+ over_shoot_file.unlink(missing_ok=True)
181
+
182
+ layout_file = layout_path.joinpath(self.filename + '.dock')
183
+ layout_file.unlink(missing_ok=True)
204
184
 
205
185
  return res == dialog.Accepted
206
186
 
@@ -1,19 +1,22 @@
1
1
  import random
2
2
 
3
- from pymodaq.utils.logger import set_logger, get_module_name
4
- from pymodaq.utils import daq_utils as utils
3
+ from pymodaq_utils.logger import set_logger, get_module_name
4
+ from pymodaq_utils import utils
5
+
6
+ from pymodaq_gui.parameter.pymodaq_ptypes import registerParameterType, GroupParameter
7
+ from pymodaq_gui.parameter.utils import get_param_dict_from_name
8
+
5
9
  from pymodaq.control_modules.move_utility_classes import params as daq_move_params
6
10
  from pymodaq.control_modules.viewer_utility_classes import params as daq_viewer_params
11
+ from pymodaq.utils.daq_utils import get_plugins
7
12
 
8
- from pyqtgraph.parametertree.Parameter import registerParameterType
9
- from pyqtgraph.parametertree.parameterTypes.basetypes import GroupParameter
10
13
  logger = set_logger(get_module_name(__file__))
11
14
 
12
- DAQ_Move_Stage_type = utils.get_plugins('daq_move')
13
- DAQ_0DViewer_Det_types = utils.get_plugins('daq_0Dviewer')
14
- DAQ_1DViewer_Det_types = utils.get_plugins('daq_1Dviewer')
15
- DAQ_2DViewer_Det_types = utils.get_plugins('daq_2Dviewer')
16
- DAQ_NDViewer_Det_types = utils.get_plugins('daq_NDviewer')
15
+ DAQ_Move_Stage_type = get_plugins('daq_move')
16
+ DAQ_0DViewer_Det_types = get_plugins('daq_0Dviewer')
17
+ DAQ_1DViewer_Det_types = get_plugins('daq_1Dviewer')
18
+ DAQ_2DViewer_Det_types = get_plugins('daq_2Dviewer')
19
+ DAQ_NDViewer_Det_types = get_plugins('daq_NDviewer')
17
20
 
18
21
 
19
22
  def iterative_show_pb(params):
@@ -74,20 +77,23 @@ class PresetScalableGroupMove(GroupParameter):
74
77
  for main_child in params:
75
78
  if main_child['name'] == 'move_settings':
76
79
  main_child['children'] = params_hardware
80
+ controller_dict = get_param_dict_from_name(params_hardware, 'controller_ID')
81
+ controller_dict['value'] = random.randint(0, 9999)
82
+
77
83
  elif main_child['name'] == 'main_settings':
78
- for child in main_child['children']:
79
- if child['name'] == 'move_type':
80
- child['value'] = typ
81
- if child['name'] == 'controller_ID':
82
- child['value'] = random.randint(0, 9999)
84
+ typ_dict = get_param_dict_from_name(main_child['children'], 'move_type')
85
+ typ_dict['value'] = typ
83
86
 
84
- child = {'title': 'Actuator {:02.0f}'.format(newindex), 'name': f'{name_prefix}{newindex:02.0f}',
87
+ child = {'title': 'Actuator {:02.0f}'.format(newindex),
88
+ 'name': f'{name_prefix}{newindex:02.0f}',
85
89
  'type': 'group',
86
- 'removable': True, 'children': [
87
- {'title': 'Name:', 'name': 'name', 'type': 'str', 'value': 'Move {:02.0f}'.format(newindex)},
88
- {'title': 'Init?:', 'name': 'init', 'type': 'bool', 'value': True},
89
- {'title': 'Settings:', 'name': 'params', 'type': 'group', 'children': params
90
- }], 'removable': True, 'renamable': False}
90
+ 'removable': True, 'renamable': False,
91
+ 'children': [
92
+ {'title': 'Name:', 'name': 'name', 'type': 'str',
93
+ 'value': 'Move {:02.0f}'.format(newindex)},
94
+ {'title': 'Init?:', 'name': 'init', 'type': 'bool', 'value': True},
95
+ {'title': 'Settings:', 'name': 'params', 'type': 'group', 'children': params},
96
+ ]}
91
97
 
92
98
  self.addChild(child)
93
99
 
@@ -153,8 +159,6 @@ class PresetScalableGroupDet(GroupParameter):
153
159
  child['value'] = typ[6:]
154
160
  if child['name'] == 'controller_status':
155
161
  child['visible'] = True
156
- if child['name'] == 'controller_ID':
157
- child['value'] = random.randint(0, 9999)
158
162
 
159
163
  if '0D' in typ:
160
164
  parent_module = utils.find_dict_in_list_from_key_val(DAQ_0DViewer_Det_types, 'name', typ[6:])
@@ -184,6 +188,8 @@ class PresetScalableGroupDet(GroupParameter):
184
188
  main_child['children'].remove(child)
185
189
 
186
190
  main_child['children'].extend(params_hardware)
191
+ controller_dict = get_param_dict_from_name(main_child['children'], 'controller_ID')
192
+ controller_dict['value'] = random.randint(0, 9999)
187
193
 
188
194
  child = {'title': 'Det {:02.0f}'.format(newindex), 'name': f'{name_prefix}{newindex:02.0f}',
189
195
  'type': 'group', 'children': [