pymodaq 3.6.12__py3-none-any.whl → 4.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 (233) hide show
  1. pymodaq/__init__.py +13 -6
  2. pymodaq/control_modules/__init__.py +0 -7
  3. pymodaq/control_modules/daq_move.py +965 -2
  4. pymodaq/control_modules/daq_move_ui.py +319 -0
  5. pymodaq/control_modules/daq_viewer.py +1573 -3
  6. pymodaq/control_modules/daq_viewer_ui.py +393 -0
  7. pymodaq/control_modules/mocks.py +51 -0
  8. pymodaq/control_modules/move_utility_classes.py +709 -8
  9. pymodaq/control_modules/utils.py +256 -0
  10. pymodaq/control_modules/viewer_utility_classes.py +663 -6
  11. pymodaq/daq_utils.py +89 -0
  12. pymodaq/dashboard.py +91 -72
  13. pymodaq/examples/custom_app.py +12 -11
  14. pymodaq/examples/custom_viewer.py +10 -10
  15. pymodaq/examples/function_plotter.py +16 -13
  16. pymodaq/examples/nonlinearscanner.py +8 -6
  17. pymodaq/examples/parameter_ex.py +7 -7
  18. pymodaq/examples/preset_MockCamera.xml +1 -0
  19. pymodaq/extensions/__init__.py +16 -0
  20. pymodaq/extensions/console.py +76 -0
  21. pymodaq/{daq_logger.py → extensions/daq_logger.py} +115 -65
  22. pymodaq/extensions/daq_scan.py +1339 -0
  23. pymodaq/extensions/daq_scan_ui.py +240 -0
  24. pymodaq/extensions/h5browser.py +23 -0
  25. pymodaq/{pid → extensions/pid}/__init__.py +4 -2
  26. pymodaq/{pid → extensions/pid}/daq_move_PID.py +2 -2
  27. pymodaq/{pid → extensions/pid}/pid_controller.py +48 -36
  28. pymodaq/{pid → extensions/pid}/utils.py +52 -6
  29. pymodaq/extensions/utils.py +40 -0
  30. pymodaq/post_treatment/__init__.py +6 -0
  31. pymodaq/{daq_analysis → post_treatment/daq_analysis}/daq_analysis_main.py +17 -17
  32. pymodaq/{daq_measurement → post_treatment/daq_measurement}/daq_measurement_main.py +8 -14
  33. pymodaq/post_treatment/load_and_plot.py +219 -0
  34. pymodaq/post_treatment/process_to_scalar.py +263 -0
  35. pymodaq/resources/QtDesigner_Ressources/Icon_Library/run_all.png +0 -0
  36. pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop_all.png +0 -0
  37. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.bat +1 -1
  38. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.qrc +1 -0
  39. pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +109784 -109173
  40. pymodaq/resources/QtDesigner_Ressources/icons.svg +142 -0
  41. pymodaq/resources/VERSION +1 -1
  42. pymodaq/resources/config_template.toml +32 -13
  43. pymodaq/resources/preset_default.xml +1 -1
  44. pymodaq/{daq_utils → utils}/Tuto innosetup/script_full_setup.iss +1 -1
  45. pymodaq/utils/__init__.py +0 -29
  46. pymodaq/utils/abstract/__init__.py +48 -0
  47. pymodaq/{daq_utils → utils}/abstract/logger.py +7 -3
  48. pymodaq/utils/array_manipulation.py +379 -8
  49. pymodaq/{daq_utils → utils}/calibration_camera.py +6 -6
  50. pymodaq/{daq_utils → utils}/chrono_timer.py +1 -1
  51. pymodaq/utils/config.py +448 -0
  52. pymodaq/utils/conftests.py +5 -0
  53. pymodaq/utils/daq_utils.py +828 -8
  54. pymodaq/utils/data.py +1873 -7
  55. pymodaq/{daq_utils → utils}/db/db_logger/db_logger.py +86 -47
  56. pymodaq/{daq_utils → utils}/db/db_logger/db_logger_models.py +31 -10
  57. pymodaq/{daq_utils → utils}/enums.py +12 -7
  58. pymodaq/utils/exceptions.py +37 -0
  59. pymodaq/utils/factory.py +82 -0
  60. pymodaq/{daq_utils → utils}/gui_utils/__init__.py +1 -1
  61. pymodaq/utils/gui_utils/custom_app.py +129 -0
  62. pymodaq/utils/gui_utils/file_io.py +66 -0
  63. pymodaq/{daq_utils → utils}/gui_utils/layout.py +2 -2
  64. pymodaq/{daq_utils → utils}/gui_utils/utils.py +13 -3
  65. pymodaq/{daq_utils → utils}/gui_utils/widgets/__init__.py +2 -2
  66. pymodaq/utils/gui_utils/widgets/label.py +24 -0
  67. pymodaq/{daq_utils → utils}/gui_utils/widgets/lcd.py +12 -7
  68. pymodaq/{daq_utils → utils}/gui_utils/widgets/push.py +66 -2
  69. pymodaq/{daq_utils → utils}/gui_utils/widgets/qled.py +6 -4
  70. pymodaq/utils/gui_utils/widgets/spinbox.py +24 -0
  71. pymodaq/{daq_utils → utils}/gui_utils/widgets/table.py +2 -2
  72. pymodaq/utils/h5modules/__init__.py +1 -0
  73. pymodaq/{daq_utils/h5backend.py → utils/h5modules/backends.py} +200 -112
  74. pymodaq/utils/h5modules/browsing.py +683 -0
  75. pymodaq/utils/h5modules/data_saving.py +839 -0
  76. pymodaq/utils/h5modules/h5logging.py +110 -0
  77. pymodaq/utils/h5modules/module_saving.py +350 -0
  78. pymodaq/utils/h5modules/saving.py +914 -0
  79. pymodaq/utils/h5modules/utils.py +85 -0
  80. pymodaq/utils/logger.py +64 -6
  81. pymodaq/utils/managers/action_manager.py +460 -0
  82. pymodaq/{daq_utils → utils}/managers/batchscan_manager.py +144 -112
  83. pymodaq/{daq_utils → utils}/managers/modules_manager.py +188 -114
  84. pymodaq/{daq_utils → utils}/managers/overshoot_manager.py +3 -3
  85. pymodaq/utils/managers/parameter_manager.py +110 -0
  86. pymodaq/{daq_utils → utils}/managers/preset_manager.py +17 -13
  87. pymodaq/{daq_utils → utils}/managers/preset_manager_utils.py +8 -7
  88. pymodaq/{daq_utils → utils}/managers/remote_manager.py +7 -6
  89. pymodaq/{daq_utils → utils}/managers/roi_manager.py +148 -57
  90. pymodaq/utils/math_utils.py +546 -10
  91. pymodaq/{daq_utils → utils}/messenger.py +5 -1
  92. pymodaq/utils/parameter/__init__.py +2 -15
  93. pymodaq/{daq_utils → utils}/parameter/ioxml.py +12 -6
  94. pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/__init__.py +1 -3
  95. pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/filedir.py +1 -1
  96. pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/itemselect.py +3 -0
  97. pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/led.py +1 -1
  98. pymodaq/utils/parameter/pymodaq_ptypes/pixmap.py +161 -0
  99. pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/slide.py +1 -1
  100. pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/table.py +1 -1
  101. pymodaq/utils/parameter/utils.py +206 -11
  102. pymodaq/utils/plotting/data_viewers/__init__.py +6 -0
  103. pymodaq/utils/plotting/data_viewers/viewer.py +393 -0
  104. pymodaq/utils/plotting/data_viewers/viewer0D.py +251 -0
  105. pymodaq/utils/plotting/data_viewers/viewer1D.py +574 -0
  106. pymodaq/{daq_utils → utils}/plotting/data_viewers/viewer1Dbasic.py +8 -3
  107. pymodaq/{daq_utils → utils}/plotting/data_viewers/viewer2D.py +292 -357
  108. pymodaq/{daq_utils → utils}/plotting/data_viewers/viewer2D_basic.py +58 -75
  109. pymodaq/utils/plotting/data_viewers/viewerND.py +738 -0
  110. pymodaq/{daq_utils → utils}/plotting/gant_chart.py +2 -2
  111. pymodaq/{daq_utils → utils}/plotting/items/axis_scaled.py +4 -2
  112. pymodaq/{daq_utils → utils}/plotting/items/image.py +8 -6
  113. pymodaq/utils/plotting/navigator.py +355 -0
  114. pymodaq/utils/plotting/scan_selector.py +480 -0
  115. pymodaq/utils/plotting/utils/axes_viewer.py +88 -0
  116. pymodaq/utils/plotting/utils/filter.py +538 -0
  117. pymodaq/utils/plotting/utils/lineout.py +224 -0
  118. pymodaq/{daq_utils → utils}/plotting/utils/plot_utils.py +196 -84
  119. pymodaq/{daq_utils → utils}/plotting/utils/signalND.py +21 -13
  120. pymodaq/utils/plotting/widgets.py +76 -0
  121. pymodaq/utils/scanner/__init__.py +10 -0
  122. pymodaq/utils/scanner/scan_factory.py +204 -0
  123. pymodaq/utils/scanner/scanner.py +271 -0
  124. pymodaq/utils/scanner/scanners/_1d_scanners.py +117 -0
  125. pymodaq/utils/scanner/scanners/_2d_scanners.py +293 -0
  126. pymodaq/utils/scanner/scanners/sequential.py +192 -0
  127. pymodaq/utils/scanner/scanners/tabular.py +294 -0
  128. pymodaq/utils/scanner/utils.py +83 -0
  129. pymodaq/utils/slicing.py +47 -0
  130. pymodaq/utils/svg/__init__.py +6 -0
  131. pymodaq/utils/svg/svg_renderer.py +20 -0
  132. pymodaq/utils/svg/svg_view.py +35 -0
  133. pymodaq/utils/svg/svg_viewer2D.py +51 -0
  134. pymodaq/{daq_utils → utils}/tcp_server_client.py +36 -37
  135. pymodaq/{daq_utils → utils}/tree_layout/tree_layout_main.py +50 -35
  136. pymodaq/utils/units.py +216 -0
  137. pymodaq-4.0.1.dist-info/METADATA +159 -0
  138. {pymodaq-3.6.12.dist-info → pymodaq-4.0.1.dist-info}/RECORD +167 -170
  139. {pymodaq-3.6.12.dist-info → pymodaq-4.0.1.dist-info}/WHEEL +1 -2
  140. pymodaq-4.0.1.dist-info/entry_points.txt +8 -0
  141. pymodaq/daq_move/daq_move_gui.py +0 -279
  142. pymodaq/daq_move/daq_move_gui.ui +0 -534
  143. pymodaq/daq_move/daq_move_main.py +0 -1042
  144. pymodaq/daq_move/process_from_QtDesigner_DAQ_Move_GUI.bat +0 -2
  145. pymodaq/daq_move/utility_classes.py +0 -671
  146. pymodaq/daq_scan.py +0 -2160
  147. pymodaq/daq_utils/array_manipulation.py +0 -386
  148. pymodaq/daq_utils/config.py +0 -273
  149. pymodaq/daq_utils/conftests.py +0 -7
  150. pymodaq/daq_utils/custom_parameter_tree.py +0 -9
  151. pymodaq/daq_utils/daq_enums.py +0 -133
  152. pymodaq/daq_utils/daq_utils.py +0 -1402
  153. pymodaq/daq_utils/exceptions.py +0 -71
  154. pymodaq/daq_utils/gui_utils/custom_app.py +0 -103
  155. pymodaq/daq_utils/gui_utils/file_io.py +0 -75
  156. pymodaq/daq_utils/gui_utils/widgets/spinbox.py +0 -9
  157. pymodaq/daq_utils/h5exporter_hyperspy.py +0 -115
  158. pymodaq/daq_utils/h5exporters.py +0 -242
  159. pymodaq/daq_utils/h5modules.py +0 -1559
  160. pymodaq/daq_utils/h5utils.py +0 -241
  161. pymodaq/daq_utils/managers/action_manager.py +0 -236
  162. pymodaq/daq_utils/managers/parameter_manager.py +0 -57
  163. pymodaq/daq_utils/math_utils.py +0 -705
  164. pymodaq/daq_utils/parameter/__init__.py +0 -1
  165. pymodaq/daq_utils/parameter/oldpymodaq_ptypes.py +0 -1626
  166. pymodaq/daq_utils/parameter/pymodaq_ptypes/pixmap.py +0 -85
  167. pymodaq/daq_utils/parameter/utils.py +0 -136
  168. pymodaq/daq_utils/plotting/data_viewers/__init__.py +0 -0
  169. pymodaq/daq_utils/plotting/data_viewers/process_from_QtDesigner_0DViewer_GUI.bat +0 -2
  170. pymodaq/daq_utils/plotting/data_viewers/viewer0D.py +0 -204
  171. pymodaq/daq_utils/plotting/data_viewers/viewer0D_GUI.py +0 -89
  172. pymodaq/daq_utils/plotting/data_viewers/viewer0D_GUI.ui +0 -131
  173. pymodaq/daq_utils/plotting/data_viewers/viewer1D.py +0 -781
  174. pymodaq/daq_utils/plotting/data_viewers/viewerND.py +0 -894
  175. pymodaq/daq_utils/plotting/data_viewers/viewerbase.py +0 -64
  176. pymodaq/daq_utils/plotting/items/__init__.py +0 -0
  177. pymodaq/daq_utils/plotting/navigator.py +0 -500
  178. pymodaq/daq_utils/plotting/scan_selector.py +0 -289
  179. pymodaq/daq_utils/plotting/utils/__init__.py +0 -0
  180. pymodaq/daq_utils/plotting/utils/filter.py +0 -236
  181. pymodaq/daq_utils/plotting/viewer0D/__init__.py +0 -0
  182. pymodaq/daq_utils/plotting/viewer0D/viewer0D_main.py +0 -4
  183. pymodaq/daq_utils/plotting/viewer1D/__init__.py +0 -0
  184. pymodaq/daq_utils/plotting/viewer1D/viewer1D_main.py +0 -4
  185. pymodaq/daq_utils/plotting/viewer1D/viewer1Dbasic.py +0 -4
  186. pymodaq/daq_utils/plotting/viewer2D/viewer_2D_basic.py +0 -4
  187. pymodaq/daq_utils/plotting/viewer2D/viewer_2D_main.py +0 -4
  188. pymodaq/daq_utils/plotting/viewerND/__init__.py +0 -0
  189. pymodaq/daq_utils/plotting/viewerND/viewerND_main.py +0 -4
  190. pymodaq/daq_utils/scanner.py +0 -1289
  191. pymodaq/daq_utils/tree_layout/__init__.py +0 -0
  192. pymodaq/daq_viewer/__init__.py +0 -0
  193. pymodaq/daq_viewer/daq_gui_settings.py +0 -237
  194. pymodaq/daq_viewer/daq_gui_settings.ui +0 -441
  195. pymodaq/daq_viewer/daq_viewer_main.py +0 -2225
  196. pymodaq/daq_viewer/process_from_QtDesigner_DAQ_GUI_settings.bat +0 -2
  197. pymodaq/daq_viewer/utility_classes.py +0 -673
  198. pymodaq/examples/logger_image/__init__.py +0 -0
  199. pymodaq/examples/logger_image/logger_displayer.py +0 -121
  200. pymodaq/examples/logger_image/setup.svg +0 -3119
  201. pymodaq/examples/logger_image/setup_svg.py +0 -114
  202. pymodaq/h5browser.py +0 -39
  203. pymodaq/utils/scanner.py +0 -15
  204. pymodaq-3.6.12.dist-info/METADATA +0 -39
  205. pymodaq-3.6.12.dist-info/entry_points.txt +0 -8
  206. pymodaq-3.6.12.dist-info/top_level.txt +0 -1
  207. /pymodaq/{daq_analysis → post_treatment/daq_analysis}/__init__.py +0 -0
  208. /pymodaq/{daq_measurement → post_treatment/daq_measurement}/__init__.py +0 -0
  209. /pymodaq/{daq_measurement → post_treatment/daq_measurement}/daq_measurement_GUI.py +0 -0
  210. /pymodaq/{daq_measurement → post_treatment/daq_measurement}/daq_measurement_GUI.ui +0 -0
  211. /pymodaq/{daq_measurement → post_treatment/daq_measurement}/process_from_QtDesigner_DAQ_Measurement_GUI.bat +0 -0
  212. /pymodaq/{daq_utils → utils}/Tuto innosetup/Tuto innosetup.odt +0 -0
  213. /pymodaq/{daq_utils → utils}/Tuto innosetup/Tuto innosetup.pdf +0 -0
  214. /pymodaq/{daq_move → utils/db}/__init__.py +0 -0
  215. /pymodaq/{daq_utils → utils/db/db_logger}/__init__.py +0 -0
  216. /pymodaq/{daq_utils → utils}/gui_utils/dock.py +0 -0
  217. /pymodaq/{daq_utils → utils}/gui_utils/list_picker.py +0 -0
  218. /pymodaq/{daq_utils/abstract → utils/managers}/__init__.py +0 -0
  219. /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/bool.py +0 -0
  220. /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/date.py +0 -0
  221. /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/list.py +0 -0
  222. /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/numeric.py +0 -0
  223. /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/tableview.py +0 -0
  224. /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/text.py +0 -0
  225. /pymodaq/{daq_utils/db → utils/plotting}/__init__.py +0 -0
  226. /pymodaq/{daq_utils → utils}/plotting/image_viewer.py +0 -0
  227. /pymodaq/{daq_utils/db/db_logger → utils/plotting/items}/__init__.py +0 -0
  228. /pymodaq/{daq_utils → utils}/plotting/items/crosshair.py +0 -0
  229. /pymodaq/{daq_utils/managers → utils/plotting/utils}/__init__.py +0 -0
  230. /pymodaq/{daq_utils → utils}/qvariant.py +0 -0
  231. /pymodaq/{daq_utils/plotting/viewer2D → utils/scanner/scanners}/__init__.py +0 -0
  232. /pymodaq/{daq_utils/plotting → utils/tree_layout}/__init__.py +0 -0
  233. {pymodaq-3.6.12.dist-info → pymodaq-4.0.1.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1 @@
1
+ <Preset type="group" title="Preset" visible="1" removable="0" readonly="0"><filename type="str" title="Filename:" visible="1" removable="0" readonly="0">preset_MockCamera</filename><use_pid type="bool" title="Use PID as actuator:" visible="1" removable="0" readonly="0">0</use_pid><pid_models type="list" title="PID models:" visible="0" removable="0" readonly="0" values="[]" limits="[]">str('')</pid_models><model_settings type="group" title="Model Settings:" visible="0" removable="0" readonly="0" /><Moves type="groupmove" title="Moves:" visible="1" removable="0" readonly="0" addList="['Mock', 'MockCamera', 'MockTau', 'TCPServer', 'PID']"><move00 type="group" title="Actuator 00" visible="1" removable="1" readonly="0"><name type="str" title="Name:" visible="1" removable="0" readonly="0">Xaxis</name><init type="bool" title="Init?:" visible="1" removable="0" readonly="0">1</init><params type="group" title="Settings:" visible="1" removable="0" readonly="0"><main_settings type="group" title="Main Settings:" visible="1" removable="0" readonly="0"><move_type type="str" title="Actuator type:" visible="1" removable="0" readonly="1">MockCamera</move_type><module_name type="str" title="Actuator name:" visible="1" removable="0" readonly="1">Xaxis</module_name><controller_ID type="int" title="Controller ID:" visible="1" removable="0" readonly="0">4524</controller_ID><refresh_timeout type="int" title="Refresh value (ms):" visible="1" removable="0" readonly="0">500</refresh_timeout><tcpip type="group" title="TCP/IP options:" visible="1" removable="0" readonly="0"><connect_server type="bool_push" title="Connect to server:" visible="1" removable="0" readonly="0">0</connect_server><tcp_connected type="led" title="Connected?:" visible="1" removable="0" readonly="0">0</tcp_connected><ip_address type="str" title="IP address:" visible="1" removable="0" readonly="0">10.47.0.39</ip_address><port type="int" title="Port:" visible="1" removable="0" readonly="0">6341</port></tcpip></main_settings><move_settings type="group" title="Actuator Settings:" visible="1" removable="0" readonly="0"><multiaxes type="group" title="MultiAxes:" visible="1" removable="0" readonly="0"><ismultiaxes type="bool" title="is Multiaxes:" visible="1" removable="0" readonly="0">1</ismultiaxes><multi_status type="list" title="Status:" visible="1" removable="0" readonly="0" values="['Master', 'Slave']" limits="['Master', 'Slave']" show_pb="1">str('Slave')</multi_status><axis type="list" title="Axis:" visible="1" removable="0" readonly="0" values="['X', 'Y', 'Theta']" limits="['X', 'Y', 'Theta']" show_pb="1">str('X')</axis></multiaxes><units type="str" title="Units:" visible="1" removable="0" readonly="1" /><epsilon type="float" title="Epsilon:" visible="1" removable="0" readonly="0">1.0</epsilon><timeout type="int" title="Timeout (s):" visible="1" removable="0" readonly="0">20</timeout><bounds type="group" title="Bounds:" visible="1" removable="0" readonly="0"><is_bounds type="bool" title="Set Bounds:" visible="1" removable="0" readonly="0">0</is_bounds><min_bound type="float" title="Min:" visible="1" removable="0" readonly="0">0.0</min_bound><max_bound type="float" title="Max:" visible="1" removable="0" readonly="0">1.0</max_bound></bounds><scaling type="group" title="Scaling:" visible="1" removable="0" readonly="0"><use_scaling type="bool" title="Use scaling:" visible="1" removable="0" readonly="0">0</use_scaling><scaling type="float" title="Scaling factor:" visible="1" removable="0" readonly="0">1.0</scaling><offset type="float" title="Offset factor:" visible="1" removable="0" readonly="0">0.0</offset></scaling></move_settings></params></move00><move01 type="group" title="Actuator 01" visible="1" removable="1" readonly="0"><name type="str" title="Name:" visible="1" removable="0" readonly="0">Yaxis</name><init type="bool" title="Init?:" visible="1" removable="0" readonly="0">1</init><params type="group" title="Settings:" visible="1" removable="0" readonly="0"><main_settings type="group" title="Main Settings:" visible="1" removable="0" readonly="0"><move_type type="str" title="Actuator type:" visible="1" removable="0" readonly="1">MockCamera</move_type><module_name type="str" title="Actuator name:" visible="1" removable="0" readonly="1">Yaxis</module_name><controller_ID type="int" title="Controller ID:" visible="1" removable="0" readonly="0">4524</controller_ID><refresh_timeout type="int" title="Refresh value (ms):" visible="1" removable="0" readonly="0">500</refresh_timeout><tcpip type="group" title="TCP/IP options:" visible="1" removable="0" readonly="0"><connect_server type="bool_push" title="Connect to server:" visible="1" removable="0" readonly="0">0</connect_server><tcp_connected type="led" title="Connected?:" visible="1" removable="0" readonly="0">0</tcp_connected><ip_address type="str" title="IP address:" visible="1" removable="0" readonly="0">10.47.0.39</ip_address><port type="int" title="Port:" visible="1" removable="0" readonly="0">6341</port></tcpip></main_settings><move_settings type="group" title="Actuator Settings:" visible="1" removable="0" readonly="0"><multiaxes type="group" title="MultiAxes:" visible="1" removable="0" readonly="0"><ismultiaxes type="bool" title="is Multiaxes:" visible="1" removable="0" readonly="0">1</ismultiaxes><multi_status type="list" title="Status:" visible="1" removable="0" readonly="0" values="['Master', 'Slave']" limits="['Master', 'Slave']" show_pb="1">str('Slave')</multi_status><axis type="list" title="Axis:" visible="1" removable="0" readonly="0" values="['X', 'Y', 'Theta']" limits="['X', 'Y', 'Theta']" show_pb="1">str('Y')</axis></multiaxes><units type="str" title="Units:" visible="1" removable="0" readonly="1" /><epsilon type="float" title="Epsilon:" visible="1" removable="0" readonly="0">1.0</epsilon><timeout type="int" title="Timeout (s):" visible="1" removable="0" readonly="0">20</timeout><bounds type="group" title="Bounds:" visible="1" removable="0" readonly="0"><is_bounds type="bool" title="Set Bounds:" visible="1" removable="0" readonly="0">0</is_bounds><min_bound type="float" title="Min:" visible="1" removable="0" readonly="0">0.0</min_bound><max_bound type="float" title="Max:" visible="1" removable="0" readonly="0">1.0</max_bound></bounds><scaling type="group" title="Scaling:" visible="1" removable="0" readonly="0"><use_scaling type="bool" title="Use scaling:" visible="1" removable="0" readonly="0">0</use_scaling><scaling type="float" title="Scaling factor:" visible="1" removable="0" readonly="0">1.0</scaling><offset type="float" title="Offset factor:" visible="1" removable="0" readonly="0">0.0</offset></scaling></move_settings></params></move01><move02 type="group" title="Actuator 02" visible="1" removable="1" readonly="0"><name type="str" title="Name:" visible="1" removable="0" readonly="0">Theta</name><init type="bool" title="Init?:" visible="1" removable="0" readonly="0">1</init><params type="group" title="Settings:" visible="1" removable="0" readonly="0"><main_settings type="group" title="Main Settings:" visible="1" removable="0" readonly="0"><move_type type="str" title="Actuator type:" visible="1" removable="0" readonly="1">MockCamera</move_type><module_name type="str" title="Actuator name:" visible="1" removable="0" readonly="1">Theta</module_name><controller_ID type="int" title="Controller ID:" visible="1" removable="0" readonly="0">4524</controller_ID><refresh_timeout type="int" title="Refresh value (ms):" visible="1" removable="0" readonly="0">500</refresh_timeout><tcpip type="group" title="TCP/IP options:" visible="1" removable="0" readonly="0"><connect_server type="bool_push" title="Connect to server:" visible="1" removable="0" readonly="0">0</connect_server><tcp_connected type="led" title="Connected?:" visible="1" removable="0" readonly="0">0</tcp_connected><ip_address type="str" title="IP address:" visible="1" removable="0" readonly="0">10.47.0.39</ip_address><port type="int" title="Port:" visible="1" removable="0" readonly="0">6341</port></tcpip></main_settings><move_settings type="group" title="Actuator Settings:" visible="1" removable="0" readonly="0"><multiaxes type="group" title="MultiAxes:" visible="1" removable="0" readonly="0"><ismultiaxes type="bool" title="is Multiaxes:" visible="1" removable="0" readonly="0">1</ismultiaxes><multi_status type="list" title="Status:" visible="1" removable="0" readonly="0" values="['Master', 'Slave']" limits="['Master', 'Slave']" show_pb="1">str('Slave')</multi_status><axis type="list" title="Axis:" visible="1" removable="0" readonly="0" values="['X', 'Y', 'Theta']" limits="['X', 'Y', 'Theta']" show_pb="1">str('Theta')</axis></multiaxes><units type="str" title="Units:" visible="1" removable="0" readonly="1" /><epsilon type="float" title="Epsilon:" visible="1" removable="0" readonly="0">1.0</epsilon><timeout type="int" title="Timeout (s):" visible="1" removable="0" readonly="0">20</timeout><bounds type="group" title="Bounds:" visible="1" removable="0" readonly="0"><is_bounds type="bool" title="Set Bounds:" visible="1" removable="0" readonly="0">0</is_bounds><min_bound type="float" title="Min:" visible="1" removable="0" readonly="0">0.0</min_bound><max_bound type="float" title="Max:" visible="1" removable="0" readonly="0">1.0</max_bound></bounds><scaling type="group" title="Scaling:" visible="1" removable="0" readonly="0"><use_scaling type="bool" title="Use scaling:" visible="1" removable="0" readonly="0">0</use_scaling><scaling type="float" title="Scaling factor:" visible="1" removable="0" readonly="0">1.0</scaling><offset type="float" title="Offset factor:" visible="1" removable="0" readonly="0">0.0</offset></scaling></move_settings></params></move02></Moves><Detectors type="groupdet" title="Detectors:" visible="1" removable="0" readonly="0" addList="['DAQ0D/Mock', 'DAQ0D/TCPServer', 'DAQ1D/Mock', 'DAQ1D/Mock_spectro', 'DAQ1D/TCPServer', 'DAQ2D/Mock', 'DAQ2D/MockCamera', 'DAQ2D/TCPServer', 'DAQND/Mock']"><det00 type="group" title="Det 00" visible="1" removable="1" readonly="0"><name type="str" title="Name:" visible="1" removable="0" readonly="0">Camera</name><init type="bool" title="Init?:" visible="1" removable="0" readonly="0">1</init><params type="group" title="Settings:" visible="1" removable="0" readonly="0"><main_settings type="group" title="Main Settings:" visible="1" removable="0" readonly="0"><DAQ_type type="list" title="DAQ type:" visible="1" removable="0" readonly="1" values="['DAQ0D', 'DAQ1D', 'DAQ2D', 'DAQND']" limits="['DAQ0D', 'DAQ1D', 'DAQ2D', 'DAQND']" show_pb="1">str('DAQ2D')</DAQ_type><detector_type type="str" title="Detector type:" visible="1" removable="0" readonly="1">MockCamera</detector_type><module_name type="str" title="Detector Name:" visible="1" removable="0" readonly="1">Camera</module_name><Nviewers type="int" title="Nviewers:" visible="1" removable="0" readonly="1">1</Nviewers><controller_ID type="int" title="Controller ID:" visible="1" removable="0" readonly="0">4524</controller_ID><show_data type="bool" title="Show data and process:" visible="1" removable="0" readonly="0">1</show_data><refresh_time type="float" title="Refresh time (ms):" visible="1" removable="0" readonly="0">50.0</refresh_time><Naverage type="int" title="Naverage" visible="1" removable="0" readonly="0">1</Naverage><show_averaging type="bool" title="Show averaging:" visible="1" removable="0" readonly="0">0</show_averaging><live_averaging type="bool" title="Live averaging:" visible="1" removable="0" readonly="0">0</live_averaging><N_live_averaging type="int" title="N Live aver.:" visible="0" removable="0" readonly="0">0</N_live_averaging><wait_time type="int" title="Wait time (ms):" visible="1" removable="0" readonly="0">0</wait_time><continuous_saving_opt type="bool" title="Continuous saving:" visible="1" removable="0" readonly="0">0</continuous_saving_opt><tcpip type="group" title="TCP/IP options:" visible="1" removable="0" readonly="0"><connect_server type="bool_push" title="Connect to server:" visible="1" removable="0" readonly="0">0</connect_server><tcp_connected type="led" title="Connected?:" visible="1" removable="0" readonly="0">0</tcp_connected><ip_address type="str" title="IP address:" visible="1" removable="0" readonly="0">10.47.0.39</ip_address><port type="int" title="Port:" visible="1" removable="0" readonly="0">6341</port></tcpip><overshoot type="group" title="Overshoot options:" visible="1" removable="0" readonly="0"><stop_overshoot type="bool" title="Overshoot:" visible="1" removable="0" readonly="0">0</stop_overshoot><overshoot_value type="float" title="Overshoot value:" visible="1" removable="0" readonly="0">0.0</overshoot_value></overshoot><axes type="group" title="Axis options:" visible="1" removable="0" readonly="0"><use_calib type="list" title="Use calibration?:" visible="1" removable="0" readonly="0" values="['None']" limits="['None']" show_pb="1">str('None')</use_calib><xaxis type="group" title="X axis:" visible="1" removable="0" readonly="0"><xlabel type="str" title="Label:" visible="1" removable="0" readonly="0">x axis</xlabel><xunits type="str" title="Units:" visible="1" removable="0" readonly="0">pxls</xunits><xoffset type="float" title="Offset:" visible="1" removable="0" readonly="0">0.0</xoffset><xscaling type="float" title="Scaling" visible="1" removable="0" readonly="0">1.0</xscaling></xaxis><yaxis type="group" title="Y axis:" visible="1" removable="0" readonly="0"><ylabel type="str" title="Label:" visible="1" removable="0" readonly="0">y axis</ylabel><yunits type="str" title="Units:" visible="1" removable="0" readonly="0">pxls</yunits><yoffset type="float" title="Offset:" visible="1" removable="0" readonly="0">0.0</yoffset><yscaling type="float" title="Scaling" visible="1" removable="0" readonly="0">1.0</yscaling></yaxis></axes></main_settings><detector_settings type="group" title="Detector Settings" visible="1" removable="0" readonly="0"><controller_status type="list" title="Controller Status:" visible="1" removable="0" readonly="0" values="['Master', 'Slave']" limits="['Master', 'Slave']" show_pb="1">str('Master')</controller_status><wait_time type="int" title="Wait time (ms)" visible="1" removable="0" readonly="0">50</wait_time><Nimagescolor type="int" title="Nimages colors:" visible="1" removable="0" readonly="0">1</Nimagescolor><Nimagespannel type="int" title="Nimages pannels:" visible="1" removable="0" readonly="0">1</Nimagespannel><use_roi_select type="bool" title="Use ROISelect" visible="1" removable="0" readonly="0">0</use_roi_select><threshold type="int" title="Threshold" visible="1" removable="0" readonly="0">1</threshold><current_values type="group" title="Values" visible="1" removable="0" readonly="0"><X type="float" title="X" visible="1" removable="0" readonly="0">0.0</X><Y type="float" title="Y" visible="1" removable="0" readonly="0">0.0</Y><Theta type="float" title="Theta" visible="1" removable="0" readonly="0">0.0</Theta></current_values><cam_settings type="group" title="Cam. Prop.:" visible="1" removable="0" readonly="0"><Nx type="int" title="Nx" visible="1" removable="0" readonly="0">100</Nx><Ny type="int" title="Ny" visible="1" removable="0" readonly="0">200</Ny><amp type="int" title="Amp" visible="1" removable="0" readonly="0">20</amp><x0 type="slide" title="x0" visible="1" removable="0" readonly="0">50</x0><y0 type="float" title="y0" visible="1" removable="0" readonly="0">100.0</y0><dx type="float" title="dx" visible="1" removable="0" readonly="0">20.0</dx><dy type="float" title="dy" visible="1" removable="0" readonly="0">40.0</dy><n type="int" title="n" visible="1" removable="0" readonly="0">1</n><amp_noise type="float" title="amp_noise" visible="1" removable="0" readonly="0">2.0</amp_noise></cam_settings></detector_settings></params></det00></Detectors></Preset>
@@ -0,0 +1,16 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Created the 25/10/2022
4
+
5
+ @author: Sebastien Weber
6
+ """
7
+ from .utils import get_extensions
8
+ from .pid.utils import get_models
9
+
10
+ from .console import QtConsole
11
+ from .daq_scan import DAQScan
12
+ from .daq_logger import DAQ_Logger
13
+ from .pid.pid_controller import DAQ_PID
14
+ from .h5browser import H5Browser
15
+
16
+
@@ -0,0 +1,76 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Created the 25/10/2022
4
+
5
+ @author: Sebastien Weber
6
+ """
7
+ from qtpy import QtWidgets
8
+ from qtconsole.rich_jupyter_widget import RichJupyterWidget
9
+ from qtconsole.inprocess import QtInProcessKernelManager
10
+ from pymodaq.utils import config as configmod
11
+ from pymodaq.utils.daq_utils import get_version
12
+
13
+
14
+ config = configmod.Config()
15
+ BANNER = f'PyMoDAQ v{get_version()}\n' \
16
+ 'Main objects available for interaction:\n'\
17
+ '* dashboard: Main Dashboard Object\n'\
18
+ '* mods: ModuleManager of the dashboard\'s Control Modules\n'\
19
+ '* np: numpy module\n\n'\
20
+ 'For inline plotting use: %matplotlib\n\n'
21
+
22
+
23
+ class QtConsole(RichJupyterWidget):
24
+ """Live IPython console widget.
25
+ .. image:: img/IPythonWidget.png
26
+ :param custom_banner: Custom welcome message to be printed at the top of
27
+ the console.
28
+ """
29
+
30
+ def __init__(self, parent=None, custom_banner=None, *args, **kwargs):
31
+ if parent is not None:
32
+ kwargs["parent"] = parent
33
+ super().__init__(*args, **kwargs)
34
+ if custom_banner is not None:
35
+ self.banner = custom_banner
36
+ self.kernel_manager = kernel_manager = QtInProcessKernelManager()
37
+ kernel_manager.start_kernel()
38
+
39
+ self.kernel_client = kernel_client = self._kernel_manager.client()
40
+ kernel_client.start_channels()
41
+
42
+ def stop():
43
+ kernel_client.stop_channels()
44
+ kernel_manager.shutdown_kernel()
45
+ self.exit_requested.connect(stop)
46
+
47
+ def push_variables(self, variable_dict):
48
+ """ Given a dictionary containing name / value pairs, push those
49
+ variables to the IPython console widget.
50
+ :param variable_dict: Dictionary of variables to be pushed to the
51
+ console's interactive namespace (```{variable_name: object, …}```)
52
+ """
53
+ self.kernel_manager.kernel.shell.push(variable_dict)
54
+
55
+
56
+ def main(init_qt=True):
57
+ import sys
58
+
59
+ if init_qt: # used for the test suite
60
+ app = QtWidgets.QApplication(sys.argv)
61
+ if config('style', 'darkstyle'):
62
+ import qdarkstyle
63
+ app.setStyleSheet(qdarkstyle.load_stylesheet(qdarkstyle.DarkPalette))
64
+
65
+ prog = QtConsole(style_sheet=config('style', 'syntax_highlighting'),
66
+ syntax_style=config('style', 'syntax_highlighting'),
67
+ custom_banner=BANNER,
68
+ )
69
+ prog.show()
70
+ if init_qt:
71
+ sys.exit(app.exec_())
72
+ return prog
73
+
74
+
75
+ if __name__ == '__main__':
76
+ main()
@@ -3,29 +3,32 @@
3
3
 
4
4
  """Automated scanning module functionalities for PyMoDAQ
5
5
 
6
- Contains all objects related to the DAQ_Scan module, to do automated scans, saving data...
6
+ Contains all objects related to the DAQScan module, to do automated scans, saving data...
7
7
  """
8
8
 
9
9
  import sys
10
10
  from collections import OrderedDict
11
+ import datetime
11
12
 
12
- from pymodaq.daq_utils.gui_utils.custom_app import CustomApp
13
- from pymodaq.daq_utils.gui_utils.dock import Dock
14
- from pymodaq.daq_utils.config import Config, get_set_preset_path
15
- import pymodaq.daq_utils.parameter.ioxml
16
13
 
14
+ from pymodaq.utils.logger import set_logger, get_module_name
15
+ from pymodaq.utils.gui_utils.custom_app import CustomApp
16
+ from pymodaq.utils.gui_utils.dock import Dock
17
+ from pymodaq.utils.config import Config, get_set_preset_path
18
+ import pymodaq.utils.parameter.ioxml
19
+ import numpy as np
17
20
  from qtpy import QtWidgets
18
21
  from qtpy.QtCore import QObject, Slot, QThread, Signal, Qt
19
-
20
- from pymodaq.daq_utils.gui_utils.widgets import QLED
21
- from pymodaq.daq_utils import daq_utils as utils
22
- from pymodaq.daq_utils.h5modules import H5Logger
22
+ from pymodaq.utils import data as data_mod
23
+ from pymodaq.utils.gui_utils.widgets import QLED
24
+ from pymodaq.utils import daq_utils as utils
25
+ from pymodaq.utils.h5modules.h5logging import H5Logger
23
26
 
24
27
  config = Config()
25
- logger = utils.set_logger(utils.get_module_name(__file__))
28
+ logger = set_logger(get_module_name(__file__))
26
29
  try:
27
30
  import sqlalchemy
28
- from pymodaq.daq_utils.db.db_logger.db_logger import DataBaseLogger
31
+ from pymodaq.utils.db.db_logger.db_logger import DataBaseLogger
29
32
  is_sql = True
30
33
  except Exception as e:
31
34
  is_sql = False
@@ -58,6 +61,8 @@ class DAQ_Logger(CustomApp):
58
61
  """
59
62
 
60
63
  super().__init__(dockarea, dashboard)
64
+
65
+
61
66
  self.wait_time = 1000
62
67
 
63
68
  self.logger_thread = None
@@ -81,11 +86,15 @@ class DAQ_Logger(CustomApp):
81
86
  log_type_combo.currentTextChanged.connect(self.set_log_type)
82
87
  self._actions['log_type'] = self.toolbar.addWidget(log_type_combo)
83
88
  self.toolbar.addSeparator()
84
- self.add_action('grab_all', 'Grab All', 'run_all', "Grab all selected detectors",
85
- checkable=True, toolbar=self.toolbar)
89
+ self.add_action('grab_all', 'Grab All', 'run_all', "Grab all selected detectors's data and actuators's value",
90
+ checkable=False, toolbar=self.toolbar)
91
+ self.add_action('stop_all', 'Stop All', 'stop_all', "Stop all selected detectors and actuators",
92
+ checkable=False, toolbar=self.toolbar)
86
93
  self.add_action('infos', 'Log infos', 'information2', "Show log file",
87
94
  checkable=False, toolbar=self.toolbar)
88
95
 
96
+ self.set_action_enabled('start', False)
97
+ self.set_action_enabled('stop', False)
89
98
 
90
99
  logger.debug('actions set')
91
100
 
@@ -96,8 +105,6 @@ class DAQ_Logger(CustomApp):
96
105
  self.docks['detectors'].addWidget(splitter)
97
106
  splitter.addWidget(self.settings_tree)
98
107
  splitter.addWidget(self.modules_manager.settings_tree)
99
- self.modules_manager.settings.child('modules', 'actuators').hide()
100
- self.modules_manager.settings.child('actuators_positions').hide()
101
108
  self.dockarea.addDock(self.docks['detectors'])
102
109
 
103
110
  self.docks['logger_settings'] = Dock("Logger Settings")
@@ -124,6 +131,7 @@ class DAQ_Logger(CustomApp):
124
131
  self._actions['start'].connect_to(self.start_logging)
125
132
  self._actions['stop'].connect_to(self.stop_logging)
126
133
  self._actions['grab_all'].connect_to(self.start_all)
134
+ self._actions['stop_all'].connect_to(self.stop_all)
127
135
 
128
136
  self._actions['infos'].connect_to(self.dashboard.show_log)
129
137
 
@@ -135,7 +143,10 @@ class DAQ_Logger(CustomApp):
135
143
 
136
144
  def value_changed(self, param):
137
145
  if param.name() == 'log_type':
138
- self.set_logger(param.value())
146
+ if param.value() != 'None':
147
+ self.set_action_enabled('start', True)
148
+ self.set_action_enabled('stop', True)
149
+ self.set_logger(param.value())
139
150
 
140
151
  def set_logger(self, logger_interface):
141
152
  if self.logger is not None:
@@ -175,28 +186,31 @@ class DAQ_Logger(CustomApp):
175
186
  --------
176
187
  daq_utils.set_current_scan_path
177
188
  """
178
- self.do_continuous_save = True
179
- self.logger.settings.child(('N_saved')).show()
180
- self.logger.settings.child(('N_saved')).setValue(0)
181
-
182
- settings_str = b'<All_settings>'
183
- settings_str += pymodaq.daq_utils.parameter.ioxml.parameter_to_xml_string(self.dashboard.settings)
184
- settings_str += pymodaq.daq_utils.parameter.ioxml.parameter_to_xml_string(
185
- self.dashboard.preset_manager.preset_params)
186
- if self.dashboard.settings.child('loaded_files', 'overshoot_file').value() != '':
187
- settings_str += pymodaq.daq_utils.parameter.ioxml.parameter_to_xml_string(
188
- self.dashboard.overshoot_manager.overshoot_params)
189
- if self.dashboard.settings.child('loaded_files', 'roi_file').value() != '':
190
- settings_str += pymodaq.daq_utils.parameter.ioxml.parameter_to_xml_string(
191
- self.dashboard.roi_saver.roi_presets)
192
- settings_str += pymodaq.daq_utils.parameter.ioxml.parameter_to_xml_string(self.settings)
193
- settings_str += pymodaq.daq_utils.parameter.ioxml.parameter_to_xml_string(self.logger.settings)
194
- settings_str += b'</All_settings>'
195
-
196
- if not self.logger.init_logger(settings_str):
189
+ if self.logger is not None:
190
+ self.do_continuous_save = True
191
+ self.logger.settings.child('N_saved').show()
192
+ self.logger.settings.child('N_saved').setValue(0)
193
+
194
+ settings_str = b'<All_settings>'
195
+ settings_str += pymodaq.utils.parameter.ioxml.parameter_to_xml_string(self.dashboard.settings)
196
+ settings_str += pymodaq.utils.parameter.ioxml.parameter_to_xml_string(
197
+ self.dashboard.preset_manager.preset_params)
198
+ if self.dashboard.settings.child('loaded_files', 'overshoot_file').value() != '':
199
+ settings_str += pymodaq.utils.parameter.ioxml.parameter_to_xml_string(
200
+ self.dashboard.overshoot_manager.overshoot_params)
201
+ if self.dashboard.settings.child('loaded_files', 'roi_file').value() != '':
202
+ settings_str += pymodaq.utils.parameter.ioxml.parameter_to_xml_string(
203
+ self.dashboard.roi_saver.roi_presets)
204
+ settings_str += pymodaq.utils.parameter.ioxml.parameter_to_xml_string(self.settings)
205
+ settings_str += pymodaq.utils.parameter.ioxml.parameter_to_xml_string(self.logger.settings)
206
+ settings_str += b'</All_settings>'
207
+
208
+ if not self.logger.init_logger(settings_str):
209
+ return False
210
+ logger.addHandler(self.logger.get_handler())
211
+ return True
212
+ else:
197
213
  return False
198
- logger.addHandler(self.logger.get_handler())
199
- return True
200
214
 
201
215
  def set_logging(self):
202
216
  """
@@ -204,25 +218,29 @@ class DAQ_Logger(CustomApp):
204
218
  """
205
219
  status = self.set_continuous_save()
206
220
  if status:
207
- det_modules_log = self.modules_manager.detectors_all
208
- if det_modules_log != []:
221
+ modules_log = self.modules_manager.detectors_all + self.modules_manager.actuators_all
222
+ if modules_log != []:
209
223
  # check if the modules are initialized
210
- for module in det_modules_log:
224
+ for module in modules_log:
211
225
  if not module.initialized_state:
212
226
  logger.error(f'module {module.title} is not initialized')
213
227
  return False
214
228
 
215
229
  # create the detectors in the chosen logger
216
- for det in det_modules_log:
230
+ for mod in modules_log:
217
231
  settings_str = b'<All_settings>'
218
- settings_str += pymodaq.daq_utils.parameter.ioxml.parameter_to_xml_string(det.settings)
219
- for viewer in det.ui.viewers:
220
- if hasattr(viewer, 'roi_manager'):
221
- settings_str += pymodaq.daq_utils.parameter.ioxml.parameter_to_xml_string(
222
- viewer.roi_manager.settings)
223
- settings_str += b'</All_settings>'
232
+ settings_str += pymodaq.utils.parameter.ioxml.parameter_to_xml_string(mod.settings)
224
233
 
225
- self.logger.add_detector(det.title, settings_str)
234
+ if mod.module_type == 'DAQ_Viewer':
235
+ for viewer in mod.ui.viewers:
236
+ if hasattr(viewer, 'roi_manager'):
237
+ settings_str += pymodaq.utils.parameter.ioxml.parameter_to_xml_string(
238
+ viewer.roi_manager.settings)
239
+ settings_str += b'</All_settings>'
240
+ if mod.module_type == 'DAQ_Viewer':
241
+ self.logger.add_detector(mod.title, settings_str)
242
+ elif mod.module_type == 'DAQ_Move':
243
+ self.logger.add_actuator(mod.title, settings_str)
226
244
 
227
245
  self._actions['start'].setEnabled(True)
228
246
  self._actions['stop'].setEnabled(True)
@@ -240,9 +258,16 @@ class DAQ_Logger(CustomApp):
240
258
  return False
241
259
 
242
260
  def start_all(self):
243
- preset_items_det = self.modules_manager.detectors
244
- for det in preset_items_det:
245
- det.ui.grab_pb.click()
261
+ for det in self.modules_manager.detectors:
262
+ det.grab()
263
+ for act in self.modules_manager.actuators:
264
+ act.grab()
265
+
266
+ def stop_all(self):
267
+ for det in self.modules_manager.detectors:
268
+ det.stop_grab()
269
+ for act in self.modules_manager.actuators:
270
+ act.stop_grab()
246
271
 
247
272
  def set_log_type(self, log_type):
248
273
  self.settings.child('log_type').setValue(log_type)
@@ -347,12 +372,9 @@ class DAQ_Logger(CustomApp):
347
372
 
348
373
  class DAQ_Logging(QObject):
349
374
  """
350
- =========================== ========================================
351
- **Attributes** **Type**
352
-
353
- =========================== ========================================
354
375
 
355
376
  """
377
+
356
378
  scan_data_tmp = Signal(OrderedDict)
357
379
  status_sig = Signal(list)
358
380
 
@@ -374,7 +396,7 @@ class DAQ_Logging(QObject):
374
396
  self.ind_log = 0
375
397
  self.modules_manager = modules_manager
376
398
  self.modules_manager.detectors_changed.connect(self.update_connect_detectors)
377
-
399
+ self.modules_manager.actuators_changed.connect(self.update_connect_actuators)
378
400
  self.data_logger = logger
379
401
 
380
402
  @Slot(list)
@@ -402,23 +424,48 @@ class DAQ_Logging(QObject):
402
424
  self.stop_scan_flag = True
403
425
  self.stop_logging()
404
426
 
405
- def do_save_continuous(self, datas):
427
+ def do_save_continuous(self, data):
406
428
  """
407
429
 
408
430
  """
409
431
  try:
410
- self.data_logger.add_datas(datas)
432
+ self.data_logger.add_data(data)
411
433
  except Exception as e:
412
434
  logger.exception(str(e))
413
435
 
414
- def connect_detectors(self, status=True):
436
+ def format_actuators_data(self, act_name, act_value):
437
+ acq_time = datetime.datetime.now().timestamp()
438
+ data = OrderedDict(name=act_name, acq_time_s=acq_time, control_module='DAQ_Move',
439
+ data0D=OrderedDict(data=data_mod.DataToExport(name=act_name, dim='Data0D', source='raw',
440
+ data=np.array([act_value]))))
441
+ self.do_save_continuous(data)
442
+
443
+ def connect_actuators(self, connect=True):
444
+ """Connect actuators to DAQ_Logging do_save_continuous method
445
+
446
+ Parameters
447
+ ----------
448
+ connect: bool
449
+ If True make the connection else disconnect
415
450
  """
416
- Connect detectors to DAQ_Logging do_save_continuous method
451
+ self.modules_manager.connect_actuators(connect=connect, slot=self.format_actuators_data, signal='current_value')
452
+
453
+ def update_connect_actuators(self):
454
+ try:
455
+ self.connect_actuators(False)
456
+ except:
457
+ pass
458
+ self.connect_actuators()
459
+
460
+ def connect_detectors(self, connect=True):
461
+ """Connect detectors to DAQ_Logging do_save_continuous method
462
+
417
463
  Parameters
418
464
  ----------
419
- status: (bool) If True make the connection else disconnect
465
+ connect: bool
466
+ If True make the connection else disconnect
420
467
  """
421
- self.modules_manager.connect_detectors(connect=status, slot=self.do_save_continuous)
468
+ self.modules_manager.connect_detectors(connect=connect, slot=self.do_save_continuous)
422
469
 
423
470
  def update_connect_detectors(self):
424
471
  try:
@@ -429,18 +476,21 @@ class DAQ_Logging(QObject):
429
476
 
430
477
  def stop_logging(self):
431
478
  try:
432
- self.connect_detectors(False)
479
+ self.connect_detectors(connect=False)
480
+ self.connect_actuators(connect=False)
433
481
  except Exception as e:
434
482
  logger.exception(str(e))
435
483
 
436
484
  if self.stop_logging_flag:
437
485
  status = 'Data Acquisition has been stopped by user'
438
486
  self.status_sig.emit(["Update_Status", status])
439
- self.data_logger.stop_logger()
487
+ if self.data_logger is not None:
488
+ self.data_logger.stop_logger()
440
489
 
441
490
  def start_logging(self):
442
491
  try:
443
492
  self.connect_detectors()
493
+ self.connect_actuators()
444
494
  self.stop_logging_flag = False
445
495
  self.status_sig.emit(["Update_Status", "Acquisition has started"])
446
496
 
@@ -451,7 +501,7 @@ class DAQ_Logging(QObject):
451
501
  def main():
452
502
  from pymodaq.dashboard import DashBoard
453
503
  from pathlib import Path
454
- from pymodaq.daq_utils.gui_utils.dock import DockArea
504
+ from pymodaq.utils.gui_utils.dock import DockArea
455
505
 
456
506
  config = Config()
457
507
  app = QtWidgets.QApplication(sys.argv)